From 8e67345ea58498a22cbb072ea33192da32c24346 Mon Sep 17 00:00:00 2001 From: jbaptistetrb Date: Tue, 25 Feb 2020 13:23:06 +0100 Subject: [PATCH 0001/1252] resource/aws_ecs_service: fix ecs service force new if service discovery changed (#4373) (#4874) --- aws/resource_aws_ecs_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 1f8ab812de1..b7791fbd680 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -350,20 +350,24 @@ func resourceAwsEcsService() *schema.Resource { Schema: map[string]*schema.Schema{ "container_name": { Type: schema.TypeString, + ForceNew: true, Optional: true, }, "container_port": { Type: schema.TypeInt, + ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), }, "port": { Type: schema.TypeInt, + ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), }, "registry_arn": { Type: schema.TypeString, + ForceNew: true, Required: true, ValidateFunc: validateArn, }, From b9e8c07fbea7f5bb4a39d6c452ab4047e865096a Mon Sep 17 00:00:00 2001 From: kromol Date: Thu, 17 Dec 2020 14:23:07 +0100 Subject: [PATCH 0002/1252] Fix validation for CloudWatch event bus name Now validation matches the pattern described in [AWS docs][1]. Slash in names allows to create event buses associated with partner event sources (where names might contain slashes), since both names should match. [1]: https://docs.aws.amazon.com/eventbridge/latest/APIReference --- aws/validators.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/validators.go b/aws/validators.go index 526eb613492..97b3953089f 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -2479,7 +2479,7 @@ var validateCloudWatchEventCustomEventBusName = validation.All( var validateCloudWatchEventBusName = validation.All( validation.StringLenBetween(1, 256), - validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9._\-]+$`), ""), + validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9._\-/]+$`), ""), ) var validateServiceDiscoveryNamespaceName = validation.All( From 6fbbd8ba8a94e86a3a696c3d4c6eb26d1c85e4d6 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Wed, 20 Jan 2021 09:20:23 +0900 Subject: [PATCH 0003/1252] Add owner_id to resource_aws_ami --- aws/resource_aws_ami.go | 5 +++++ aws/resource_aws_ami_copy.go | 4 ++++ aws/resource_aws_ami_from_instance.go | 4 ++++ aws/resource_aws_ami_test.go | 5 +++++ website/docs/r/ami.html.markdown | 1 + 5 files changed, 19 insertions(+) diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 1fe711e8fd3..f83c06b9088 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -190,6 +190,10 @@ func resourceAwsAmi() *schema.Resource { Required: true, ForceNew: true, }, + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Optional: true, @@ -376,6 +380,7 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { d.Set("image_location", image.ImageLocation) d.Set("architecture", image.Architecture) d.Set("kernel_id", image.KernelId) + d.Set("owner_id", image.OwnerId) d.Set("ramdisk_id", image.RamdiskId) d.Set("root_device_name", image.RootDeviceName) d.Set("root_snapshot_id", amiRootSnapshotId(image)) diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index 07e0e92ebec..a4b9fe9da9a 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -155,6 +155,10 @@ func resourceAwsAmiCopy() *schema.Resource { Required: true, ForceNew: true, }, + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index 9cdadc90815..3f309795018 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -142,6 +142,10 @@ func resourceAwsAmiFromInstance() *schema.Resource { Required: true, ForceNew: true, }, + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_ami_test.go b/aws/resource_aws_ami_test.go index 730c052688d..a4f87aaf7b7 100644 --- a/aws/resource_aws_ami_test.go +++ b/aws/resource_aws_ami_test.go @@ -47,6 +47,7 @@ func TestAccAWSAMI_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "ephemeral_block_device.#", "0"), resource.TestCheckResourceAttr(resourceName, "kernel_id", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "ramdisk_id", ""), resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), resource.TestCheckResourceAttrPair(resourceName, "root_snapshot_id", snapshotResourceName, "id"), @@ -102,6 +103,7 @@ func TestAccAWSAMI_description(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "ephemeral_block_device.#", "0"), resource.TestCheckResourceAttr(resourceName, "kernel_id", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "ramdisk_id", ""), resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), resource.TestCheckResourceAttrPair(resourceName, "root_snapshot_id", snapshotResourceName, "id"), @@ -140,6 +142,7 @@ func TestAccAWSAMI_description(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "ephemeral_block_device.#", "0"), resource.TestCheckResourceAttr(resourceName, "kernel_id", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "ramdisk_id", ""), resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), resource.TestCheckResourceAttrPair(resourceName, "root_snapshot_id", snapshotResourceName, "id"), @@ -214,6 +217,7 @@ func TestAccAWSAMI_EphemeralBlockDevices(t *testing.T) { }), resource.TestCheckResourceAttr(resourceName, "kernel_id", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "ramdisk_id", ""), resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), resource.TestCheckResourceAttrPair(resourceName, "root_snapshot_id", snapshotResourceName, "id"), @@ -276,6 +280,7 @@ func TestAccAWSAMI_Gp3BlockDevice(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "ephemeral_block_device.#", "0"), resource.TestCheckResourceAttr(resourceName, "kernel_id", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "ramdisk_id", ""), resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), resource.TestCheckResourceAttrPair(resourceName, "root_snapshot_id", snapshotResourceName, "id"), diff --git a/website/docs/r/ami.html.markdown b/website/docs/r/ami.html.markdown index 10bb0d6d634..9bdbe3fc188 100644 --- a/website/docs/r/ami.html.markdown +++ b/website/docs/r/ami.html.markdown @@ -110,6 +110,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN of the AMI. * `id` - The ID of the created AMI. +* `owner_id` - The AWS account ID of the image owner. * `root_snapshot_id` - The Snapshot ID for the root volume (for EBS-backed AMIs) ## Import From 1995cb733156b112f6c0eacb2844e8e7255d5191 Mon Sep 17 00:00:00 2001 From: Gauthier Wallet Date: Tue, 9 Feb 2021 17:56:21 -0800 Subject: [PATCH 0004/1252] Update waiter.go --- aws/internal/service/sagemaker/waiter/waiter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/internal/service/sagemaker/waiter/waiter.go b/aws/internal/service/sagemaker/waiter/waiter.go index e1e03df43b4..8ba7012aa13 100644 --- a/aws/internal/service/sagemaker/waiter/waiter.go +++ b/aws/internal/service/sagemaker/waiter/waiter.go @@ -8,7 +8,7 @@ import ( ) const ( - NotebookInstanceInServiceTimeout = 10 * time.Minute + NotebookInstanceInServiceTimeout = 60 * time.Minute NotebookInstanceStoppedTimeout = 10 * time.Minute NotebookInstanceDeletedTimeout = 10 * time.Minute ImageCreatedTimeout = 10 * time.Minute From 512cbf723ef449c762a81fc8a1e1bc1adca6ce3d Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sun, 19 Jul 2020 23:40:43 +0300 Subject: [PATCH 0005/1252] fix setting id some refactor to tests and resource added disappears test remove hardcoded region from tests --- ...rce_aws_config_configuration_aggregator.go | 45 +++---- ...ws_config_configuration_aggregator_test.go | 110 ++++++++++++------ 2 files changed, 100 insertions(+), 55 deletions(-) diff --git a/aws/resource_aws_config_configuration_aggregator.go b/aws/resource_aws_config_configuration_aggregator.go index 71afa91648f..6ae318e814a 100644 --- a/aws/resource_aws_config_configuration_aggregator.go +++ b/aws/resource_aws_config_configuration_aggregator.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "log" - "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/configservice" @@ -115,35 +114,34 @@ func resourceAwsConfigConfigurationAggregator() *schema.Resource { func resourceAwsConfigConfigurationAggregatorPut(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).configconn - name := d.Get("name").(string) - req := &configservice.PutConfigurationAggregatorInput{ - ConfigurationAggregatorName: aws.String(name), + ConfigurationAggregatorName: aws.String(d.Get("name").(string)), Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ConfigserviceTags(), } - account_aggregation_sources := d.Get("account_aggregation_source").([]interface{}) - if len(account_aggregation_sources) > 0 { - req.AccountAggregationSources = expandConfigAccountAggregationSources(account_aggregation_sources) + if v, ok := d.GetOk("account_aggregation_source"); ok && len(v.([]interface{})) > 0 { + req.AccountAggregationSources = expandConfigAccountAggregationSources(v.([]interface{})) } - organization_aggregation_sources := d.Get("organization_aggregation_source").([]interface{}) - if len(organization_aggregation_sources) > 0 { - req.OrganizationAggregationSource = expandConfigOrganizationAggregationSource(organization_aggregation_sources[0].(map[string]interface{})) + if v, ok := d.GetOk("organization_aggregation_source"); ok && len(v.([]interface{})) > 0 { + req.OrganizationAggregationSource = expandConfigOrganizationAggregationSource(v.([]interface{})[0].(map[string]interface{})) } - _, err := conn.PutConfigurationAggregator(req) + log.Printf("[DEBUG] Putting Config Configuration Aggregator: %#v", req) + resp, err := conn.PutConfigurationAggregator(req) if err != nil { - return fmt.Errorf("Error creating aggregator: %s", err) + return fmt.Errorf("error creating aggregator: %w", err) } - d.SetId(strings.ToLower(name)) + configAgg := resp.ConfigurationAggregator + d.SetId(aws.StringValue(configAgg.ConfigurationAggregatorName)) if !d.IsNewResource() && d.HasChange("tags") { o, n := d.GetChange("tags") - if err := keyvaluetags.ConfigserviceUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { - return fmt.Errorf("error updating Config Configuration Aggregator (%s) tags: %s", d.Get("arn").(string), err) + arn := aws.StringValue(configAgg.ConfigurationAggregatorArn) + if err := keyvaluetags.ConfigserviceUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Config Configuration Aggregator (%s) tags: %w", arn, err) } } @@ -175,7 +173,8 @@ func resourceAwsConfigConfigurationAggregatorRead(d *schema.ResourceData, meta i } aggregator := res.ConfigurationAggregators[0] - d.Set("arn", aggregator.ConfigurationAggregatorArn) + arn := aws.StringValue(aggregator.ConfigurationAggregatorArn) + d.Set("arn", arn) d.Set("name", aggregator.ConfigurationAggregatorName) if err := d.Set("account_aggregation_source", flattenConfigAccountAggregationSources(aggregator.AccountAggregationSources)); err != nil { @@ -186,14 +185,14 @@ func resourceAwsConfigConfigurationAggregatorRead(d *schema.ResourceData, meta i return fmt.Errorf("error setting organization_aggregation_source: %s", err) } - tags, err := keyvaluetags.ConfigserviceListTags(conn, d.Get("arn").(string)) + tags, err := keyvaluetags.ConfigserviceListTags(conn, arn) if err != nil { - return fmt.Errorf("error listing tags for Config Configuration Aggregator (%s): %s", d.Get("arn").(string), err) + return fmt.Errorf("error listing tags for Config Configuration Aggregator (%s): %w", arn, err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) } return nil @@ -206,10 +205,14 @@ func resourceAwsConfigConfigurationAggregatorDelete(d *schema.ResourceData, meta ConfigurationAggregatorName: aws.String(d.Id()), } _, err := conn.DeleteConfigurationAggregator(req) + + if isAWSErr(err, configservice.ErrCodeNoSuchConfigurationAggregatorException, "") { + return nil + } + if err != nil { - return err + return fmt.Errorf("error deleting Config Configuration Aggregator (%s): %w", d.Id(), err) } - d.SetId("") return nil } diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index db238e97c15..c20a4e80e1b 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -49,7 +50,8 @@ func testSweepConfigConfigurationAggregators(region string) error { }) if err != nil { - return fmt.Errorf("Error deleting config configuration aggregator %s: %s", *agg.ConfigurationAggregatorName, err) + return fmt.Errorf("error deleting config configuration aggregator %s: %w", + aws.StringValue(agg.ConfigurationAggregatorName), err) } } @@ -59,7 +61,7 @@ func testSweepConfigConfigurationAggregators(region string) error { func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { var ca configservice.ConfigurationAggregator rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_config_configuration_aggregator.example" + resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -72,11 +74,13 @@ func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { testAccCheckAWSConfigConfigurationAggregatorExists(resourceName, &ca), testAccCheckAWSConfigConfigurationAggregatorName(resourceName, rName, &ca), resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "config", regexp.MustCompile(`config-aggregator/config-aggregator-.+`)), resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.#", "1"), resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.0.account_ids.#", "1"), testAccCheckResourceAttrAccountID(resourceName, "account_aggregation_source.0.account_ids.0"), resource.TestCheckResourceAttr(resourceName, "account_aggregation_source.0.regions.#", "1"), resource.TestCheckResourceAttrPair(resourceName, "account_aggregation_source.0.regions.0", "data.aws_region.current", "name"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -91,7 +95,7 @@ func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { func TestAccAWSConfigConfigurationAggregator_organization(t *testing.T) { var ca configservice.ConfigurationAggregator rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_config_configuration_aggregator.example" + resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, @@ -120,7 +124,7 @@ func TestAccAWSConfigConfigurationAggregator_organization(t *testing.T) { func TestAccAWSConfigConfigurationAggregator_switch(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_config_configuration_aggregator.example" + resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, @@ -148,7 +152,7 @@ func TestAccAWSConfigConfigurationAggregator_switch(t *testing.T) { func TestAccAWSConfigConfigurationAggregator_tags(t *testing.T) { var ca configservice.ConfigurationAggregator rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_config_configuration_aggregator.example" + resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -156,25 +160,22 @@ func TestAccAWSConfigConfigurationAggregator_tags(t *testing.T) { CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSConfigConfigurationAggregatorConfig_tags(rName, "foo", "bar", "fizz", "buzz"), + Config: testAccAWSConfigConfigurationAggregatorConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSConfigConfigurationAggregatorExists(resourceName, &ca), testAccCheckAWSConfigConfigurationAggregatorName(resourceName, rName, &ca), - resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar"), - resource.TestCheckResourceAttr(resourceName, "tags.fizz", "buzz"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - Config: testAccAWSConfigConfigurationAggregatorConfig_tags(rName, "foo", "bar2", "fizz2", "buzz2"), + Config: testAccAWSConfigConfigurationAggregatorConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSConfigConfigurationAggregatorExists(resourceName, &ca), testAccCheckAWSConfigConfigurationAggregatorName(resourceName, rName, &ca), - resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), - resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar2"), - resource.TestCheckResourceAttr(resourceName, "tags.fizz2", "buzz2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { @@ -183,12 +184,35 @@ func TestAccAWSConfigConfigurationAggregator_tags(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccAWSConfigConfigurationAggregatorConfig_account(rName), + Config: testAccAWSConfigConfigurationAggregatorConfigTags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSConfigConfigurationAggregatorExists(resourceName, &ca), testAccCheckAWSConfigConfigurationAggregatorName(resourceName, rName, &ca), - resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSConfigConfigurationAggregator_disappears(t *testing.T) { + var ca configservice.ConfigurationAggregator + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_config_configuration_aggregator.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSConfigConfigurationAggregatorConfig_account(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSConfigConfigurationAggregatorExists(resourceName, &ca), + testAccCheckResourceDisappears(testAccProvider, resourceAwsConfigConfigurationAggregator(), resourceName), ), + ExpectNonEmptyPlan: true, }, }, }) @@ -200,8 +224,8 @@ func testAccCheckAWSConfigConfigurationAggregatorName(n, desired string, obj *co if !ok { return fmt.Errorf("Not found: %s", n) } - if rs.Primary.Attributes["name"] != *obj.ConfigurationAggregatorName { - return fmt.Errorf("Expected name: %q, given: %q", desired, *obj.ConfigurationAggregatorName) + if rs.Primary.Attributes["name"] != aws.StringValue(obj.ConfigurationAggregatorName) { + return fmt.Errorf("expected name: %q, given: %q", desired, aws.StringValue(obj.ConfigurationAggregatorName)) } return nil } @@ -250,7 +274,7 @@ func testAccCheckAWSConfigConfigurationAggregatorDestroy(s *terraform.State) err if err == nil { if len(resp.ConfigurationAggregators) != 0 && - *resp.ConfigurationAggregators[0].ConfigurationAggregatorName == rs.Primary.Attributes["name"] { + aws.StringValue(resp.ConfigurationAggregators[0].ConfigurationAggregatorName) == rs.Primary.Attributes["name"] { return fmt.Errorf("config configuration aggregator still exists: %s", rs.Primary.Attributes["name"]) } } @@ -261,19 +285,18 @@ func testAccCheckAWSConfigConfigurationAggregatorDestroy(s *terraform.State) err func testAccAWSConfigConfigurationAggregatorConfig_account(rName string) string { return fmt.Sprintf(` +data "aws_caller_identity" "current" {} + data "aws_region" "current" {} -resource "aws_config_configuration_aggregator" "example" { - name = %q +resource "aws_config_configuration_aggregator" "test" { + name = %[1]q account_aggregation_source { account_ids = [data.aws_caller_identity.current.account_id] regions = [data.aws_region.current.name] } } - -data "aws_caller_identity" "current" { -} `, rName) } @@ -281,14 +304,14 @@ func testAccAWSConfigConfigurationAggregatorConfig_organization(rName string) st return fmt.Sprintf(` resource "aws_organizations_organization" "test" {} -resource "aws_config_configuration_aggregator" "example" { - depends_on = [aws_iam_role_policy_attachment.example] +resource "aws_config_configuration_aggregator" "test" { + depends_on = [aws_iam_role_policy_attachment.test] name = %[1]q organization_aggregation_source { all_regions = true - role_arn = aws_iam_role.example.arn + role_arn = aws_iam_role.test.arn } } @@ -315,17 +338,19 @@ EOF } resource "aws_iam_role_policy_attachment" "example" { - role = aws_iam_role.example.name + role = aws_iam_role.test.name policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSConfigRoleForOrganizations" } `, rName) } -func testAccAWSConfigConfigurationAggregatorConfig_tags(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { +func testAccAWSConfigConfigurationAggregatorConfigTags1(rName, tagKey1, tagValue1 string) string { return fmt.Sprintf(` +data "aws_caller_identity" "current" {} + data "aws_region" "current" {} -resource "aws_config_configuration_aggregator" "example" { +resource "aws_config_configuration_aggregator" "test" { name = %[1]q account_aggregation_source { @@ -334,13 +359,30 @@ resource "aws_config_configuration_aggregator" "example" { } tags = { - Name = %[1]q - %[2]s = %[3]q - %[4]s = %[5]q } } +`, rName, tagKey1, tagValue1) +} +func testAccAWSConfigConfigurationAggregatorConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` data "aws_caller_identity" "current" {} + +data "aws_region" "current" {} + +resource "aws_config_configuration_aggregator" "test" { + name = %[1]q + + account_aggregation_source { + account_ids = [data.aws_caller_identity.current.account_id] + regions = [data.aws_region.current.name] + } + + tags = { + %[2]s = %[3]q + %[4]s = %[5]q + } +} `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } From 786addd5090febce3c99a593588b47080c08b756 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Thu, 27 Aug 2020 23:37:53 +0300 Subject: [PATCH 0006/1252] upper case test --- aws/resource_aws_config_configuration_aggregator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index c20a4e80e1b..e09591d8d11 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -60,7 +60,7 @@ func testSweepConfigConfigurationAggregators(region string) error { func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { var ca configservice.ConfigurationAggregator - rName := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("Tf-acc-test") resourceName := "aws_config_configuration_aggregator.test" resource.ParallelTest(t, resource.TestCase{ From 5cf57bdb09869ce325663928c013377d071791f0 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Sat, 29 Aug 2020 00:20:41 +0300 Subject: [PATCH 0007/1252] add comment --- aws/resource_aws_config_configuration_aggregator_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index e09591d8d11..5bf3ddb0a36 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -60,6 +60,7 @@ func testSweepConfigConfigurationAggregators(region string) error { func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { var ca configservice.ConfigurationAggregator + //Name is upper case on purpose to test https://github.com/terraform-providers/terraform-provider-aws/issues/8432 rName := acctest.RandomWithPrefix("Tf-acc-test") resourceName := "aws_config_configuration_aggregator.test" From 9c179d121574a8683a9d4119b579864f946f7b85 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Wed, 30 Sep 2020 10:40:23 +0300 Subject: [PATCH 0008/1252] lint --- aws/resource_aws_config_configuration_aggregator_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index 5bf3ddb0a36..184bc42785e 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -360,7 +360,7 @@ resource "aws_config_configuration_aggregator" "test" { } tags = { - %[2]s = %[3]q + %[2]q = %[3]q } } `, rName, tagKey1, tagValue1) @@ -381,8 +381,8 @@ resource "aws_config_configuration_aggregator" "test" { } tags = { - %[2]s = %[3]q - %[4]s = %[5]q + %[2]q = %[3]q + %[4]q = %[5]q } } `, rName, tagKey1, tagValue1, tagKey2, tagValue2) From 8be2d07264c2a4fd405cbed316de8ba4b52af937 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 12 Feb 2021 09:57:06 +0200 Subject: [PATCH 0009/1252] changelog --- .changelog/14247.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/14247.txt diff --git a/.changelog/14247.txt b/.changelog/14247.txt new file mode 100644 index 00000000000..93eb2aa3832 --- /dev/null +++ b/.changelog/14247.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_config_configuration_aggregator: Allow name to have uppercase characters +``` From e41ea31340841a56d57441a265a903013c9eef39 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 12 Feb 2021 10:24:19 +0000 Subject: [PATCH 0010/1252] Greetings. This is my first attempt to contribute to terraform and go is not even slightly my first language. This is to resolve 12373 which I would like to resolve for selfish reasons as it affects me. It seemed like a good place to start. The new data source "aws_ec2_transit_gateway_route_tables" is modelled after "aws_route_tables". The code is shamelessly plagiarized from the aws_route_tables and the aws_transit_gateway_route_table resources. I've included tests which I think are right, but I'm not sure on protocol for running them. The code compiles. Which is a good start. --- ...ce_aws_ec2_transit_gateway_route_tables.go | 75 +++++++++++++++++++ ...s_ec2_transit_gateway_route_tables_test.go | 69 +++++++++++++++++ aws/provider.go | 1 + tools/main.go | 2 +- 4 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 aws/data_source_aws_ec2_transit_gateway_route_tables.go create mode 100644 aws/data_source_aws_ec2_transit_gateway_route_tables_test.go diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables.go b/aws/data_source_aws_ec2_transit_gateway_route_tables.go new file mode 100644 index 00000000000..7d4123aafd5 --- /dev/null +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables.go @@ -0,0 +1,75 @@ +package aws + +import ( + "errors" + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func dataSourceAwsEc2TransitGatewayRouteTables() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsEc2TransitGatewayRouteTablesRead, + + Schema: map[string]*schema.Schema{ + "transit_gateway_id": { + Type: schema.TypeString, + Optional: true, + }, + "filter": ec2CustomFiltersSchema(), + "ids": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + }, + } +} + +func dataSourceAwsEc2TransitGatewayRouteTablesRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.DescribeTransitGatewayRouteTablesInput{} + + if v, ok := d.GetOk("transit_gateway_id"); ok { + input.Filters = buildEC2AttributeFilterList( + map[string]string{ + "transit-gateway-id": v.(string), + }, + ) + } + + input.Filters = append(input.Filters, buildEC2TagFilterList( + keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), + )...) + + log.Printf("[DEBUG] Reading EC2 Transit Gateway Route Tables: %s", input) + output, err := conn.DescribeTransitGatewayRouteTables(input) + + if err != nil { + return fmt.Errorf("error reading EC2 Transit Gateway Route Table: %s", err) + } + + if output == nil || len(output.TransitGatewayRouteTables) == 0 { + return errors.New("error reading EC2 Transit Gateway Route Table: no results found") + } + + d.SetId(meta.(*AWSClient).region) + + routeTables := make([]string, 0) + + for _, routeTable := range output.TransitGatewayRouteTables { + routeTables = append(routeTables, aws.StringValue(routeTable.TransitGatewayRouteTableId)) + } + + if err = d.Set("ids", routeTables); err != nil { + return fmt.Errorf("error setting ids: %s", err) + } + + return nil +} diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go new file mode 100644 index 00000000000..fd9bd591792 --- /dev/null +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go @@ -0,0 +1,69 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccAWSEc2TransitGatewayRouteTablesDataSource_Filter(t *testing.T) { + dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" + resourceName := "aws_ec2_transit_gateway_route_tables.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2TransitGatewayRouteTableDataSourceConfigFilter(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "default_association_route_table", dataSourceName, "default_association_route_table"), + resource.TestCheckResourceAttrPair(resourceName, "default_propagation_route_table", dataSourceName, "default_propagation_route_table"), + resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), + resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), + resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"), + ), + }, + }, + }) +} + +func TestAccAWSEc2TransitGatewayRouteTableDataSource_ID(t *testing.T) { + dataSourceName := "data.aws_ec2_transit_gateway_route_table.test" + resourceName := "aws_ec2_transit_gateway_route_table.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2TransitGatewayRouteTablesDataSourceTransitGatewayFilter(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "default_association_route_table", dataSourceName, "default_association_route_table"), + resource.TestCheckResourceAttrPair(resourceName, "default_propagation_route_table", dataSourceName, "default_propagation_route_table"), + resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), + resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), + resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"), + ), + }, + }, + }) +} + +func testAccAWSEc2TransitGatewayRouteTableDataSourceTransitGatewayFilter() string { + return ` +resource "aws_ec2_transit_gateway" "test" {} + +resource "aws_ec2_transit_gateway_route_table" "test" { + transit_gateway_id = aws_ec2_transit_gateway.test.id +} + +data "aws_ec2_transit_gateway_route_tables" "test" { + transit_gateway_id = aws_ec2_transit_gateway.test.id + + depends_on = [ aws_ec2_transit_gateway_route_table.test ] +} +` +} diff --git a/aws/provider.go b/aws/provider.go index 367c9c4bf61..cb75c60950c 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -231,6 +231,7 @@ func Provider() *schema.Provider { "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), + "aws_ec2_transit_gateway_route_tables": dataSourceAwsEc2TransitGatewayRouteTables(), "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), diff --git a/tools/main.go b/tools/main.go index 1e8cedff106..f16d5ded289 100644 --- a/tools/main.go +++ b/tools/main.go @@ -6,7 +6,7 @@ import ( _ "github.com/bflad/tfproviderdocs" _ "github.com/client9/misspell/cmd/misspell" _ "github.com/golangci/golangci-lint/cmd/golangci-lint" + _ "github.com/hashicorp/go-changelog/cmd/changelog-build" _ "github.com/katbyte/terrafmt" _ "github.com/terraform-linters/tflint" - _ "github.com/hashicorp/go-changelog/cmd/changelog-build" ) From 4f99bd96a58e1c690d8c2a501aaabac283f4bdeb Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 12 Feb 2021 11:31:00 +0000 Subject: [PATCH 0011/1252] debugging tests --- ...urce_aws_ec2_transit_gateway_route_tables_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go index fd9bd591792..6e0aace2af1 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go @@ -16,7 +16,7 @@ func TestAccAWSEc2TransitGatewayRouteTablesDataSource_Filter(t *testing.T) { CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEc2TransitGatewayRouteTableDataSourceConfigFilter(), + Config: testAccAWSEc2TransitGatewayRouteTablesDataSourceConfigFilter(), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(resourceName, "default_association_route_table", dataSourceName, "default_association_route_table"), resource.TestCheckResourceAttrPair(resourceName, "default_propagation_route_table", dataSourceName, "default_propagation_route_table"), @@ -29,9 +29,9 @@ func TestAccAWSEc2TransitGatewayRouteTablesDataSource_Filter(t *testing.T) { }) } -func TestAccAWSEc2TransitGatewayRouteTableDataSource_ID(t *testing.T) { - dataSourceName := "data.aws_ec2_transit_gateway_route_table.test" - resourceName := "aws_ec2_transit_gateway_route_table.test" +func TestAccAWSEc2TransitGatewayRouteTablesDataSource_ID(t *testing.T) { + dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" + resourceName := "aws_ec2_transit_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, @@ -52,7 +52,7 @@ func TestAccAWSEc2TransitGatewayRouteTableDataSource_ID(t *testing.T) { }) } -func testAccAWSEc2TransitGatewayRouteTableDataSourceTransitGatewayFilter() string { +func testAccAWSEc2TransitGatewayRouteTablesDataSourceTransitGatewayFilter() string { return ` resource "aws_ec2_transit_gateway" "test" {} @@ -63,7 +63,7 @@ resource "aws_ec2_transit_gateway_route_table" "test" { data "aws_ec2_transit_gateway_route_tables" "test" { transit_gateway_id = aws_ec2_transit_gateway.test.id - depends_on = [ aws_ec2_transit_gateway_route_table.test ] + depends_on = [aws_ec2_transit_gateway_route_table.test] } ` } From 88397f2d72364e803b8afd4b53f4feada825d67b Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 12 Feb 2021 12:20:07 +0000 Subject: [PATCH 0012/1252] added web page --- ...ce_aws_ec2_transit_gateway_route_tables.go | 5 +-- ...s_ec2_transit_gateway_route_tables_test.go | 31 +-------------- ...transit_gateway_route_tables.html.markdown | 39 +++++++++++++++++++ 3 files changed, 43 insertions(+), 32 deletions(-) create mode 100644 website/docs/d/ec2_transit_gateway_route_tables.html.markdown diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables.go b/aws/data_source_aws_ec2_transit_gateway_route_tables.go index 7d4123aafd5..399fcc471dc 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables.go @@ -8,7 +8,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayRouteTables() *schema.Resource { @@ -44,8 +43,8 @@ func dataSourceAwsEc2TransitGatewayRouteTablesRead(d *schema.ResourceData, meta ) } - input.Filters = append(input.Filters, buildEC2TagFilterList( - keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), + input.Filters = append(input.Filters, buildEC2CustomFilterList( + d.Get("filter").(*schema.Set), )...) log.Printf("[DEBUG] Reading EC2 Transit Gateway Route Tables: %s", input) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go index 6e0aace2af1..9656dd874d3 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go @@ -6,32 +6,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccAWSEc2TransitGatewayRouteTablesDataSource_Filter(t *testing.T) { +func TestAccAWSEc2TransitGatewayRouteTablesDataSource_TransitGatewayFilter(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" - resourceName := "aws_ec2_transit_gateway_route_tables.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEc2TransitGatewayRouteTablesDataSourceConfigFilter(), - Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(resourceName, "default_association_route_table", dataSourceName, "default_association_route_table"), - resource.TestCheckResourceAttrPair(resourceName, "default_propagation_route_table", dataSourceName, "default_propagation_route_table"), - resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), - resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), - resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"), - ), - }, - }, - }) -} - -func TestAccAWSEc2TransitGatewayRouteTablesDataSource_ID(t *testing.T) { - dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" - resourceName := "aws_ec2_transit_gateway_route_tables.test" + resourceName := "aws_ec2_transit_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, @@ -41,11 +18,7 @@ func TestAccAWSEc2TransitGatewayRouteTablesDataSource_ID(t *testing.T) { { Config: testAccAWSEc2TransitGatewayRouteTablesDataSourceTransitGatewayFilter(), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(resourceName, "default_association_route_table", dataSourceName, "default_association_route_table"), - resource.TestCheckResourceAttrPair(resourceName, "default_propagation_route_table", dataSourceName, "default_propagation_route_table"), - resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), - resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"), ), }, }, diff --git a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown new file mode 100644 index 00000000000..7eccda7508f --- /dev/null +++ b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown @@ -0,0 +1,39 @@ +--- +subcategory: "EC2" +layout: "aws" +page_title: "AWS: aws_ec2_transit_gateway_route_tables" +description: |- + Get information on an EC2 Transit Gateway Route Tables +--- + +# Data Source: aws_ec2_transit_gateway_route_tables + +Get information on an EC2 Transit Gateway Route Tables. + +## Example Usage + +### By Transit Gateway Id + +```hcl +data "aws_ec2_transit_gateway_route_tables" "example" { + transit_gateway_id = "tgw-12345678" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `filter` - (Optional) One or more configuration blocks containing name-values filters. Detailed below. +* `transit_gateway_id` - (Optional) Identifier of the EC2 Transit Gateway. + +### filter Argument Reference + +* `name` - (Required) Name of the filter. +* `values` - (Required) List of one or more values for the filter. + +## Attribute Reference + +In addition to all arguments above, the following attributes are exported: + +* `ids` - A set of all the transit gateway route table ids found. This data source will fail if none are found. From d698b5b54797bdcfc47a24d0d78cf8e3638004bf Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Fri, 12 Feb 2021 15:40:28 +0000 Subject: [PATCH 0013/1252] correcting some non-code typos --- aws/data_source_aws_ec2_transit_gateway_route_tables.go | 4 ++-- website/docs/d/ec2_transit_gateway_route_tables.html.markdown | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables.go b/aws/data_source_aws_ec2_transit_gateway_route_tables.go index 399fcc471dc..979899ce4d0 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables.go @@ -51,11 +51,11 @@ func dataSourceAwsEc2TransitGatewayRouteTablesRead(d *schema.ResourceData, meta output, err := conn.DescribeTransitGatewayRouteTables(input) if err != nil { - return fmt.Errorf("error reading EC2 Transit Gateway Route Table: %s", err) + return fmt.Errorf("error reading EC2 Transit Gateway Route Tables: %s", err) } if output == nil || len(output.TransitGatewayRouteTables) == 0 { - return errors.New("error reading EC2 Transit Gateway Route Table: no results found") + return errors.New("error reading EC2 Transit Gateway Route Tables: no results found") } d.SetId(meta.(*AWSClient).region) diff --git a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown index 7eccda7508f..64f4c8632d8 100644 --- a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown +++ b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown @@ -3,12 +3,12 @@ subcategory: "EC2" layout: "aws" page_title: "AWS: aws_ec2_transit_gateway_route_tables" description: |- - Get information on an EC2 Transit Gateway Route Tables + Get information on EC2 Transit Gateway Route Tables --- # Data Source: aws_ec2_transit_gateway_route_tables -Get information on an EC2 Transit Gateway Route Tables. +Get information on EC2 Transit Gateway Route Tables. ## Example Usage From ebf81d892d7040743aac822cb87dfe9ce86d340f Mon Sep 17 00:00:00 2001 From: Matt Calhoun Date: Fri, 12 Feb 2021 11:01:38 -0500 Subject: [PATCH 0014/1252] update timeout on resourceAwsFmsAdminAccountCreate --- aws/resource_aws_fms_admin_account.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_fms_admin_account.go b/aws/resource_aws_fms_admin_account.go index 3e126f6d824..64fadfdc754 100644 --- a/aws/resource_aws_fms_admin_account.go +++ b/aws/resource_aws_fms_admin_account.go @@ -56,7 +56,7 @@ func resourceAwsFmsAdminAccountCreate(d *schema.ResourceData, meta interface{}) stateConf := &resource.StateChangeConf{ Target: []string{accountID}, Refresh: associateFmsAdminAccountRefreshFunc(conn, accountID), - Timeout: 1 * time.Minute, + Timeout: 10 * time.Minute, Delay: 10 * time.Second, } From 5ec4ffeafa4f0ea57e56cc35c9da2692d8328c82 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 17 Feb 2021 17:33:46 -0500 Subject: [PATCH 0015/1252] update second resource name param to match config --- aws/resource_aws_config_configuration_aggregator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index db238e97c15..74a8dd1f00a 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -105,7 +105,7 @@ func TestAccAWSConfigConfigurationAggregator_organization(t *testing.T) { testAccCheckAWSConfigConfigurationAggregatorName(resourceName, rName, &ca), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "organization_aggregation_source.#", "1"), - resource.TestCheckResourceAttrPair(resourceName, "organization_aggregation_source.0.role_arn", "aws_iam_role.r", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "organization_aggregation_source.0.role_arn", "aws_iam_role.example", "arn"), resource.TestCheckResourceAttr(resourceName, "organization_aggregation_source.0.all_regions", "true"), ), }, From c0c5010308e9126fef32d7448fa14d8a91d22256 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Sun, 21 Feb 2021 08:22:15 +0900 Subject: [PATCH 0016/1252] aws_ec2_carrier_gateway: Correct the ARN account id --- aws/resource_aws_ec2_carrier_gateway.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ec2_carrier_gateway.go b/aws/resource_aws_ec2_carrier_gateway.go index 85285aaa417..07c1b7f67d2 100644 --- a/aws/resource_aws_ec2_carrier_gateway.go +++ b/aws/resource_aws_ec2_carrier_gateway.go @@ -99,7 +99,7 @@ func resourceAwsEc2CarrierGatewayRead(d *schema.ResourceData, meta interface{}) Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(carrierGateway.OwnerId), Resource: fmt.Sprintf("carrier-gateway/%s", d.Id()), }.String() d.Set("arn", arn) From ee4ffeb8269d20717cec844b5ca4d27b813e3949 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Tue, 23 Feb 2021 11:15:20 +0900 Subject: [PATCH 0017/1252] aws_vpc_dhcp_options: Correct the ARN account id --- aws/data_source_aws_vpc_dhcp_options.go | 2 +- aws/resource_aws_vpc_dhcp_options.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_vpc_dhcp_options.go b/aws/data_source_aws_vpc_dhcp_options.go index 7d8fa1d87e4..667e424a909 100644 --- a/aws/data_source_aws_vpc_dhcp_options.go +++ b/aws/data_source_aws_vpc_dhcp_options.go @@ -138,7 +138,7 @@ func dataSourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) e Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(output.DhcpOptions[0].OwnerId), Resource: fmt.Sprintf("dhcp-options/%s", d.Id()), }.String() diff --git a/aws/resource_aws_vpc_dhcp_options.go b/aws/resource_aws_vpc_dhcp_options.go index b78b86b3ca7..c4443c2b560 100644 --- a/aws/resource_aws_vpc_dhcp_options.go +++ b/aws/resource_aws_vpc_dhcp_options.go @@ -195,7 +195,7 @@ func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) err Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(opts.OwnerId), Resource: fmt.Sprintf("dhcp-options/%s", d.Id()), }.String() From c7bce1832edd7adf1a7686c0c8fd3810c88c577f Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Wed, 24 Feb 2021 07:46:01 +0900 Subject: [PATCH 0018/1252] aws_vpc_endpoint: Correct the ARN account id --- aws/data_source_aws_vpc_endpoint.go | 2 +- aws/resource_aws_vpc_endpoint.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_vpc_endpoint.go b/aws/data_source_aws_vpc_endpoint.go index e3d778e807d..3dee22f20b0 100644 --- a/aws/data_source_aws_vpc_endpoint.go +++ b/aws/data_source_aws_vpc_endpoint.go @@ -163,7 +163,7 @@ func dataSourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) erro Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(vpce.OwnerId), Resource: fmt.Sprintf("vpc-endpoint/%s", d.Id()), }.String() d.Set("arn", arn) diff --git a/aws/resource_aws_vpc_endpoint.go b/aws/resource_aws_vpc_endpoint.go index 6cb8862a3d5..7bb0b47d3c7 100644 --- a/aws/resource_aws_vpc_endpoint.go +++ b/aws/resource_aws_vpc_endpoint.go @@ -228,7 +228,7 @@ func resourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) error Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(vpce.OwnerId), Resource: fmt.Sprintf("vpc-endpoint/%s", d.Id()), }.String() d.Set("arn", arn) From 508d1cc195912aa2b7ccfb526362da5508442fc9 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Thu, 25 Feb 2021 06:07:58 +0900 Subject: [PATCH 0019/1252] Remove aws_vpc_endpoint from the document --- website/docs/index.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index ee1f9fed757..667cd6de295 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -333,8 +333,6 @@ for more information about connecting to alternate AWS endpoints or AWS compatib - [`aws_vpc_dhcp_options` resource](/docs/providers/aws/r/vpc_dhcp_options.html) - [`aws_vpc_endpoint_service` data source](/docs/providers/aws/d/vpc_endpoint_service.html) - [`aws_vpc_endpoint_service` resource](/docs/providers/aws/r/vpc_endpoint_service.html) - - [`aws_vpc_endpoint` data source](/docs/providers/aws/d/vpc_endpoint.html) - - [`aws_vpc_endpoint` resource](/docs/providers/aws/r/vpc_endpoint.html) - [`aws_vpc` data source](/docs/providers/aws/d/vpc.html) - [`aws_vpc` resource](/docs/providers/aws/r/vpc.html) - [`aws_vpn_connection` resource](/docs/providers/aws/r/vpn_connection.html) From 53151cd322042ab9357468666fa656919fe79921 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Thu, 25 Feb 2021 06:10:24 +0900 Subject: [PATCH 0020/1252] Remove vpc_dhcp_options from the document --- website/docs/index.html.markdown | 2 -- 1 file changed, 2 deletions(-) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 99810d6fe98..64f53a32478 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -328,8 +328,6 @@ for more information about connecting to alternate AWS endpoints or AWS compatib - [`aws_ssm_parameter` data source](/docs/providers/aws/d/ssm_parameter.html) - [`aws_ssm_parameter` resource](/docs/providers/aws/r/ssm_parameter.html) - [`aws_synthetics_canary` resource](/docs/providers/aws/r/synthetics_canary.html) - - [`aws_vpc_dhcp_options` data source](/docs/providers/aws/d/vpc_dhcp_options.html) - - [`aws_vpc_dhcp_options` resource](/docs/providers/aws/r/vpc_dhcp_options.html) - [`aws_vpc_endpoint_service` data source](/docs/providers/aws/d/vpc_endpoint_service.html) - [`aws_vpc_endpoint_service` resource](/docs/providers/aws/r/vpc_endpoint_service.html) - [`aws_vpc_endpoint` data source](/docs/providers/aws/d/vpc_endpoint.html) From 27a15546f89a278de3f857016e967963f737ec15 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Thu, 25 Feb 2021 06:37:18 +0900 Subject: [PATCH 0021/1252] aws_internet_gateway: Correct the ARN account id --- aws/data_source_aws_internet_gateway.go | 2 +- aws/resource_aws_internet_gateway.go | 2 +- website/docs/index.html.markdown | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_internet_gateway.go b/aws/data_source_aws_internet_gateway.go index a8db77a3528..92237dc9f33 100644 --- a/aws/data_source_aws_internet_gateway.go +++ b/aws/data_source_aws_internet_gateway.go @@ -100,7 +100,7 @@ func dataSourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(igw.OwnerId), Resource: fmt.Sprintf("internet-gateway/%s", d.Id()), }.String() diff --git a/aws/resource_aws_internet_gateway.go b/aws/resource_aws_internet_gateway.go index 5047a0b59ce..9961677f35a 100644 --- a/aws/resource_aws_internet_gateway.go +++ b/aws/resource_aws_internet_gateway.go @@ -123,7 +123,7 @@ func resourceAwsInternetGatewayRead(d *schema.ResourceData, meta interface{}) er Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(ig.OwnerId), Resource: fmt.Sprintf("internet-gateway/%s", d.Id()), }.String() diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index ee1f9fed757..b63d8feda6d 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -301,8 +301,6 @@ for more information about connecting to alternate AWS endpoints or AWS compatib - [`aws_guardduty_threatintelset` resource](/docs/providers/aws/r/guardduty_threatintelset.html) - [`aws_instance` data source](/docs/providers/aws/d/instance.html) - [`aws_instance` resource](/docs/providers/aws/r/instance.html) - - [`aws_internet_gateway` data source](/docs/providers/aws/d/internet_gateway.html) - - [`aws_internet_gateway` resource](/docs/providers/aws/r/internet_gateway.html) - [`aws_key_pair` resource](/docs/providers/aws/r/key_pair.html) - [`aws_launch_template` data source](/docs/providers/aws/d/launch_template.html) - [`aws_launch_template` resource](/docs/providers/aws/r/launch_template.html) From 345d7e9ca803bc273dd110b3a136c254ef30369c Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Fri, 26 Feb 2021 07:37:06 +0900 Subject: [PATCH 0022/1252] aws_network_acl: Correct the ARN account id --- aws/resource_aws_network_acl.go | 2 +- website/docs/index.html.markdown | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/aws/resource_aws_network_acl.go b/aws/resource_aws_network_acl.go index 7621b33494b..706b64f65f7 100644 --- a/aws/resource_aws_network_acl.go +++ b/aws/resource_aws_network_acl.go @@ -275,7 +275,7 @@ func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error { Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(networkAcl.OwnerId), Resource: fmt.Sprintf("network-acl/%s", d.Id()), }.String() diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index ee1f9fed757..41b69252de4 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -248,7 +248,6 @@ for more information about connecting to alternate AWS endpoints or AWS compatib - [`aws_budgets_budget` resource](/docs/providers/aws/r/budgets_budget.html) - [`aws_cognito_identity_pool` resource](/docs/providers/aws/r/cognito_identity_pool.html) - [`aws_cognito_user_pools` data source](/docs/providers/aws/d/cognito_user_pools.html) - - [`aws_default_network_acl` resource](/docs/providers/aws/r/default_network_acl.html) - [`aws_default_vpc_dhcp_options`](/docs/providers/aws/r/default_vpc_dhcp_options.html) - [`aws_dms_event_subscription` resource](/docs/providers/aws/r/dms_event_subscription.html) - [`aws_dms_replication_subnet_group` resource](/docs/providers/aws/r/dms_replication_subnet_group.html) @@ -306,7 +305,6 @@ for more information about connecting to alternate AWS endpoints or AWS compatib - [`aws_key_pair` resource](/docs/providers/aws/r/key_pair.html) - [`aws_launch_template` data source](/docs/providers/aws/d/launch_template.html) - [`aws_launch_template` resource](/docs/providers/aws/r/launch_template.html) - - [`aws_network_acl` resource](/docs/providers/aws/r/network_acl.html) - [`aws_placement_group` resource](/docs/providers/aws/r/placement_group.html) - [`aws_redshift_cluster` resource](/docs/providers/aws/r/redshift_cluster.html) - [`aws_redshift_event_subscription` resource](/docs/providers/aws/r/redshift_event_subscription.html) From 5b28b69d1e96f377982a64e9812dda7a67032419 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 25 Feb 2021 22:47:41 -0500 Subject: [PATCH 0023/1252] update test config w/config service access principal and depends_on; remove parallism for org and switch tests --- ...esource_aws_config_configuration_aggregator_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index 74a8dd1f00a..fbc87975062 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -93,7 +93,7 @@ func TestAccAWSConfigConfigurationAggregator_organization(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_config_configuration_aggregator.example" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, @@ -122,7 +122,7 @@ func TestAccAWSConfigConfigurationAggregator_switch(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_config_configuration_aggregator.example" - resource.ParallelTest(t, resource.TestCase{ + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, @@ -279,10 +279,12 @@ data "aws_caller_identity" "current" { func testAccAWSConfigConfigurationAggregatorConfig_organization(rName string) string { return fmt.Sprintf(` -resource "aws_organizations_organization" "test" {} +resource "aws_organizations_organization" "test" { + aws_service_access_principals = ["config.${data.aws_partition.current.dns_suffix}"] +} resource "aws_config_configuration_aggregator" "example" { - depends_on = [aws_iam_role_policy_attachment.example] + depends_on = [aws_iam_role_policy_attachment.example, aws_organizations_organization.test] name = %[1]q From 335b2ceea1fdaa9c49438b03bf2f0a45f14d9c7b Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 27 Feb 2021 12:55:26 +0200 Subject: [PATCH 0024/1252] commit --- aws/internal/service/sns/finder/finder.go | 26 +++ aws/internal/service/sns/waiter/status.go | 11 +- aws/internal/service/sns/waiter/waiter.go | 18 ++ aws/resource_aws_sns_topic_subscription.go | 39 ++-- ...esource_aws_sns_topic_subscription_test.go | 182 +++++++++++------- 5 files changed, 181 insertions(+), 95 deletions(-) create mode 100644 aws/internal/service/sns/finder/finder.go diff --git a/aws/internal/service/sns/finder/finder.go b/aws/internal/service/sns/finder/finder.go new file mode 100644 index 00000000000..79628328ebf --- /dev/null +++ b/aws/internal/service/sns/finder/finder.go @@ -0,0 +1,26 @@ +package finder + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sns" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" +) + +func SubscriptionByARN(conn *sns.SNS, id string) (*sns.GetSubscriptionAttributesOutput, error) { + output, err := conn.GetSubscriptionAttributes(&sns.GetSubscriptionAttributesInput{ + SubscriptionArn: aws.String(id), + }) + if tfawserr.ErrCodeEquals(err, sns.ErrCodeNotFoundException) { + return nil, nil + } + + if err != nil { + return nil, err + } + + if output == nil || output.Attributes == nil || len(output.Attributes) == 0 { + return nil, nil + } + + return output, nil +} diff --git a/aws/internal/service/sns/waiter/status.go b/aws/internal/service/sns/waiter/status.go index 31013219404..45e2f163327 100644 --- a/aws/internal/service/sns/waiter/status.go +++ b/aws/internal/service/sns/waiter/status.go @@ -3,20 +3,13 @@ package waiter import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sns" - "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/sns/finder" ) func SubscriptionPendingConfirmation(conn *sns.SNS, id string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - output, err := conn.GetSubscriptionAttributes(&sns.GetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(id), - }) - - if tfawserr.ErrCodeEquals(err, sns.ErrCodeResourceNotFoundException) { - return nil, "", nil - } - + output, err := finder.SubscriptionByARN(conn, id) if err != nil { return nil, "", err } diff --git a/aws/internal/service/sns/waiter/waiter.go b/aws/internal/service/sns/waiter/waiter.go index fb7c5a85008..efd75f3ed49 100644 --- a/aws/internal/service/sns/waiter/waiter.go +++ b/aws/internal/service/sns/waiter/waiter.go @@ -9,6 +9,7 @@ import ( const ( SubscriptionPendingConfirmationTimeout = 2 * time.Minute + SubscriptionDeleteTimeout = 2 * time.Minute ) func SubscriptionConfirmed(conn *sns.SNS, id, expectedValue string, timeout time.Duration) (*sns.GetSubscriptionAttributesOutput, error) { @@ -26,3 +27,20 @@ func SubscriptionConfirmed(conn *sns.SNS, id, expectedValue string, timeout time return nil, err } + +func SubscriptionDeleted(conn *sns.SNS, id string) (*sns.GetSubscriptionAttributesOutput, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{"false", "true"}, + Target: []string{}, + Refresh: SubscriptionPendingConfirmation(conn, id), + Timeout: SubscriptionDeleteTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if output, ok := outputRaw.(*sns.GetSubscriptionAttributesOutput); ok { + return output, err + } + + return nil, err +} diff --git a/aws/resource_aws_sns_topic_subscription.go b/aws/resource_aws_sns_topic_subscription.go index 99d7ff0578a..c970dfded66 100644 --- a/aws/resource_aws_sns_topic_subscription.go +++ b/aws/resource_aws_sns_topic_subscription.go @@ -15,6 +15,7 @@ import ( "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/terraform-providers/terraform-provider-aws/aws/internal/service/sns/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/sns/waiter" ) @@ -104,13 +105,15 @@ func resourceAwsSnsTopicSubscription() *schema.Resource { DiffSuppressFunc: suppressEquivalentJsonDiffs, }, "subscription_role_arn": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateArn, }, "topic_arn": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateArn, }, }, } @@ -168,22 +171,27 @@ func resourceAwsSnsTopicSubscriptionRead(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Loading subscription %s", d.Id()) - output, err := conn.GetSubscriptionAttributes(&sns.GetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(d.Id()), - }) + input := &sns.ListSubscriptionsByTopicInput{ + TopicArn: aws.String(d.Get("topic_arn").(string)), + } - if !d.IsNewResource() && (tfawserr.ErrCodeEquals(err, sns.ErrCodeResourceNotFoundException) || tfawserr.ErrCodeEquals(err, sns.ErrCodeNotFoundException)) { - log.Printf("[WARN] SNS subscription attributes (%s) not found, removing from state", d.Id()) + _, err := conn.ListSubscriptionsByTopic(input) + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, sns.ErrCodeNotFoundException) { + log.Printf("[WARN] SNS Topic Subscription (%s) not found, removing from state", d.Id()) d.SetId("") return nil } + output, err := finder.SubscriptionByARN(conn, d.Id()) if err != nil { return fmt.Errorf("getting SNS subscription attributes (%s): %w", d.Id(), err) } - if output == nil || output.Attributes == nil || len(output.Attributes) == 0 { - return fmt.Errorf("getting SNS subscription attributes (%s): empty response", d.Id()) + if output == nil { + log.Printf("[WARN] SNS subscription attributes (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } attributes := output.Attributes @@ -282,6 +290,13 @@ func resourceAwsSnsTopicSubscriptionDelete(d *schema.ResourceData, meta interfac return nil } + if _, err := waiter.SubscriptionDeleted(conn, d.Id()); err != nil { + if tfawserr.ErrCodeEquals(err, sns.ErrCodeNotFoundException) { + return nil + } + return fmt.Errorf("error waiting for SNS topic subscription (%s) deletion: %w", d.Id(), err) + } + return err } diff --git a/aws/resource_aws_sns_topic_subscription_test.go b/aws/resource_aws_sns_topic_subscription_test.go index 95fe10e4cdf..09339b799a9 100644 --- a/aws/resource_aws_sns_topic_subscription_test.go +++ b/aws/resource_aws_sns_topic_subscription_test.go @@ -12,11 +12,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/sns" "github.com/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/terraform-providers/terraform-provider-aws/aws/internal/service/sns/finder" ) func TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy(t *testing.T) { @@ -67,7 +67,7 @@ func TestSuppressEquivalentSnsTopicSubscriptionDeliveryPolicy(t *testing.T) { func TestAccAWSSNSTopicSubscription_basic(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -82,12 +82,12 @@ func TestAccAWSSNSTopicSubscription_basic(t *testing.T) { testAccMatchResourceAttrRegionalARN(resourceName, "arn", sns.ServiceName, regexp.MustCompile(fmt.Sprintf("%s:.+", rName))), resource.TestCheckResourceAttr(resourceName, "confirmation_was_authenticated", "true"), resource.TestCheckResourceAttr(resourceName, "delivery_policy", ""), - resource.TestCheckResourceAttrPair(resourceName, "endpoint", "aws_sqs_queue.test_queue", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "endpoint", "aws_sqs_queue.test", "arn"), resource.TestCheckResourceAttr(resourceName, "filter_policy", ""), resource.TestCheckResourceAttr(resourceName, "pending_confirmation", "false"), resource.TestCheckResourceAttr(resourceName, "protocol", "sqs"), resource.TestCheckResourceAttr(resourceName, "raw_message_delivery", "false"), - resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test_topic", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test", "arn"), ), }, { @@ -105,7 +105,7 @@ func TestAccAWSSNSTopicSubscription_basic(t *testing.T) { func TestAccAWSSNSTopicSubscription_filterPolicy(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" filterPolicy1 := `{"key1": ["val1"], "key2": ["val2"]}` filterPolicy2 := `{"key3": ["val3"], "key4": ["val4"]}` rName := acctest.RandomWithPrefix("tf-acc-test") @@ -153,7 +153,7 @@ func TestAccAWSSNSTopicSubscription_filterPolicy(t *testing.T) { func TestAccAWSSNSTopicSubscription_deliveryPolicy(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -211,7 +211,7 @@ func TestAccAWSSNSTopicSubscription_deliveryPolicy(t *testing.T) { func TestAccAWSSNSTopicSubscription_redrivePolicy(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" dlqName := acctest.RandomWithPrefix("tf-acc-test") updatedDlqName := acctest.RandomWithPrefix("tf-acc-test") rName := acctest.RandomWithPrefix("tf-acc-test") @@ -268,7 +268,7 @@ func TestAccAWSSNSTopicSubscription_redrivePolicy(t *testing.T) { func TestAccAWSSNSTopicSubscription_rawMessageDelivery(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -314,7 +314,7 @@ func TestAccAWSSNSTopicSubscription_rawMessageDelivery(t *testing.T) { func TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -343,7 +343,7 @@ func TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint(t *testing.T) { func TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -372,7 +372,7 @@ func TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint(t *testing.T) func TestAccAWSSNSTopicSubscription_email(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -392,7 +392,7 @@ func TestAccAWSSNSTopicSubscription_email(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "pending_confirmation", "true"), resource.TestCheckResourceAttr(resourceName, "protocol", "email"), resource.TestCheckResourceAttr(resourceName, "raw_message_delivery", "false"), - resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test_topic", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test", "arn"), ), }, }, @@ -401,7 +401,7 @@ func TestAccAWSSNSTopicSubscription_email(t *testing.T) { func TestAccAWSSNSTopicSubscription_firehose(t *testing.T) { attributes := make(map[string]string) - resourceName := "aws_sns_topic_subscription.test_subscription" + resourceName := "aws_sns_topic_subscription.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -420,7 +420,7 @@ func TestAccAWSSNSTopicSubscription_firehose(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "filter_policy", ""), resource.TestCheckResourceAttr(resourceName, "protocol", "firehose"), resource.TestCheckResourceAttr(resourceName, "raw_message_delivery", "false"), - resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test_topic", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "topic_arn", "aws_sns_topic.test", "arn"), resource.TestCheckResourceAttrPair(resourceName, "subscription_role_arn", "aws_iam_role.firehose_role", "arn"), ), }, @@ -428,6 +428,50 @@ func TestAccAWSSNSTopicSubscription_firehose(t *testing.T) { }) } +func TestAccAWSSNSTopicSubscription_disappears(t *testing.T) { + attributes := make(map[string]string) + resourceName := "aws_sns_topic_subscription.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSNSTopicSubscriptionConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSNSTopicSubscriptionExists(resourceName, attributes), + testAccCheckResourceDisappears(testAccProvider, resourceAwsSnsTopicSubscription(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSSNSTopicSubscription_disappears_topic(t *testing.T) { + attributes := make(map[string]string) + resourceName := "aws_sns_topic_subscription.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSNSTopicSubscriptionConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSNSTopicSubscriptionExists(resourceName, attributes), + testAccCheckResourceDisappears(testAccProvider, resourceAwsSnsTopic(), "aws_sns_topic.test"), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + // testAccErrorCheckSkipSNS skips SNS tests that have error messages indicating unsupported features func testAccErrorCheckSkipSNS(t *testing.T) resource.ErrorCheckFunc { return testAccErrorCheckSkipMessagesContaining(t, @@ -439,26 +483,20 @@ func testAccCheckAWSSNSTopicSubscriptionDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).snsconn for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_sns_topic" { + if rs.Type != "aws_sns_topic_subscription" { continue } - // Try to find key pair - req := &sns.GetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(rs.Primary.ID), + output, err := finder.SubscriptionByARN(conn, rs.Primary.ID) + if err != nil { + return fmt.Errorf("SNS topic subscription still exists, can't continue.") } - _, err := conn.GetSubscriptionAttributes(req) - - if err == nil { - return fmt.Errorf("Subscription still exists, can't continue.") + if output == nil || aws.StringValue(output.Attributes["Protocol"]) == "email" { + return nil } - // Verify the error is an API error, not something else - _, ok := err.(awserr.Error) - if !ok { - return err - } + return fmt.Errorf("SNS topic Subscription (%s) exists when it should be destroyed", rs.Primary.ID) } return nil @@ -477,11 +515,7 @@ func testAccCheckAWSSNSTopicSubscriptionExists(n string, attributes map[string]s conn := testAccProvider.Meta().(*AWSClient).snsconn - params := &sns.GetSubscriptionAttributesInput{ - SubscriptionArn: aws.String(rs.Primary.ID), - } - output, err := conn.GetSubscriptionAttributes(params) - + output, err := finder.SubscriptionByARN(conn, rs.Primary.ID) for k, v := range output.Attributes { attributes[k] = aws.StringValue(v) } @@ -580,105 +614,105 @@ func TestObfuscateEndpointPassword(t *testing.T) { func testAccAWSSNSTopicSubscriptionConfig(rName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue" { +resource "aws_sqs_queue" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { - topic_arn = aws_sns_topic.test_topic.arn +resource "aws_sns_topic_subscription" "test" { + topic_arn = aws_sns_topic.test.arn protocol = "sqs" - endpoint = aws_sqs_queue.test_queue.arn + endpoint = aws_sqs_queue.test.arn } `, rName) } func testAccAWSSNSTopicSubscriptionConfig_filterPolicy(rName, policy string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue" { +resource "aws_sqs_queue" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { - topic_arn = aws_sns_topic.test_topic.arn +resource "aws_sns_topic_subscription" "test" { + topic_arn = aws_sns_topic.test.arn protocol = "sqs" - endpoint = aws_sqs_queue.test_queue.arn - filter_policy = %s + endpoint = aws_sqs_queue.test.arn + filter_policy = %[2]s } `, rName, policy) } func testAccAWSSNSTopicSubscriptionConfig_deliveryPolicy(rName, policy string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue" { +resource "aws_sqs_queue" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { - delivery_policy = %s - endpoint = aws_sqs_queue.test_queue.arn +resource "aws_sns_topic_subscription" "test" { + delivery_policy = %[2]s + endpoint = aws_sqs_queue.test.arn protocol = "sqs" - topic_arn = aws_sns_topic.test_topic.arn + topic_arn = aws_sns_topic.test.arn } `, rName, policy) } func testAccAWSSNSTopicSubscriptionConfig_redrivePolicy(rName, dlqName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue" { +resource "aws_sqs_queue" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue_dlq" { +resource "aws_sqs_queue" "test_dlq" { name = %[2]q } -resource "aws_sns_topic_subscription" "test_subscription" { - redrive_policy = jsonencode({ deadLetterTargetArn : aws_sqs_queue.test_queue_dlq.arn }) - endpoint = aws_sqs_queue.test_queue.arn +resource "aws_sns_topic_subscription" "test" { + redrive_policy = jsonencode({ deadLetterTargetArn : aws_sqs_queue.test_dlq.arn }) + endpoint = aws_sqs_queue.test.arn protocol = "sqs" - topic_arn = aws_sns_topic.test_topic.arn + topic_arn = aws_sns_topic.test.arn } `, rName, dlqName) } func testAccAWSSNSTopicSubscriptionConfig_rawMessageDelivery(rName string, rawMessageDelivery bool) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sqs_queue" "test_queue" { +resource "aws_sqs_queue" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { - endpoint = aws_sqs_queue.test_queue.arn +resource "aws_sns_topic_subscription" "test" { + endpoint = aws_sqs_queue.test.arn protocol = "sqs" - raw_message_delivery = %t - topic_arn = aws_sns_topic.test_topic.arn + raw_message_delivery = %[2]t + topic_arn = aws_sns_topic.test.arn } `, rName, rawMessageDelivery) } func testAccAWSSNSTopicSubscriptionConfig_autoConfirmingEndpoint(rName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } @@ -791,9 +825,9 @@ resource "aws_api_gateway_deployment" "test" { stage_name = "acctest" } -resource "aws_sns_topic_subscription" "test_subscription" { +resource "aws_sns_topic_subscription" "test" { depends_on = [aws_lambda_permission.apigw_lambda] - topic_arn = aws_sns_topic.test_topic.arn + topic_arn = aws_sns_topic.test.arn protocol = "https" endpoint = aws_api_gateway_deployment.test.invoke_url endpoint_auto_confirms = true @@ -803,7 +837,7 @@ resource "aws_sns_topic_subscription" "test_subscription" { func testAccAWSSNSTopicSubscriptionConfig_autoConfirmingSecuredEndpoint(rName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } @@ -993,9 +1027,9 @@ resource "aws_api_gateway_gateway_response" "test" { } } -resource "aws_sns_topic_subscription" "test_subscription" { +resource "aws_sns_topic_subscription" "test" { depends_on = [aws_lambda_permission.apigw_lambda] - topic_arn = aws_sns_topic.test_topic.arn + topic_arn = aws_sns_topic.test.arn protocol = "https" endpoint = replace(aws_api_gateway_deployment.test.invoke_url, "https://", "https://davematthews:granny@") endpoint_auto_confirms = true @@ -1005,12 +1039,12 @@ resource "aws_sns_topic_subscription" "test_subscription" { func testAccAWSSNSTopicSubscriptionEmailConfig(rName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { - topic_arn = aws_sns_topic.test_topic.arn +resource "aws_sns_topic_subscription" "test" { + topic_arn = aws_sns_topic.test.arn protocol = "email" endpoint = "invalid_email@example.com" } @@ -1019,14 +1053,14 @@ resource "aws_sns_topic_subscription" "test_subscription" { func testAccAWSSNSTopicSubscriptionConfig_firehose(rName string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = %[1]q } -resource "aws_sns_topic_subscription" "test_subscription" { +resource "aws_sns_topic_subscription" "test" { endpoint = aws_kinesis_firehose_delivery_stream.test_stream.arn protocol = "firehose" - topic_arn = aws_sns_topic.test_topic.arn + topic_arn = aws_sns_topic.test.arn subscription_role_arn = aws_iam_role.firehose_role.arn } resource "aws_s3_bucket" "bucket" { From 183ee44304aa72572507f9a29fca6e050df9921b Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 27 Feb 2021 16:47:09 +0200 Subject: [PATCH 0025/1252] changelog --- .changelog/14101.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/14101.txt diff --git a/.changelog/14101.txt b/.changelog/14101.txt new file mode 100644 index 00000000000..17b056ebb9c --- /dev/null +++ b/.changelog/14101.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_sns_topic_subscription: Add plan time validation for `subscription_role_arn` and `topic_arn` +``` + +```release-note:bug +resource/aws_sns_topic_subscription: recreate subscription if topic is deleted +``` \ No newline at end of file From 1291515aa07083f11855961ecb8e07695158d324 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 2 Mar 2021 01:58:02 -0500 Subject: [PATCH 0026/1252] catch in-use exception when removing WAF rule; linting --- aws/resource_aws_waf_rule.go | 55 ++++++--- aws/resource_aws_waf_rule_test.go | 56 ++++----- aws/resource_aws_waf_web_acl.go | 58 ++++----- aws/resource_aws_waf_web_acl_test.go | 174 ++++++++++++--------------- 4 files changed, 171 insertions(+), 172 deletions(-) diff --git a/aws/resource_aws_waf_rule.go b/aws/resource_aws_waf_rule.go index 7802bf0e00e..fcecd5a0264 100644 --- a/aws/resource_aws_waf_rule.go +++ b/aws/resource_aws_waf_rule.go @@ -6,8 +6,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" @@ -95,7 +95,7 @@ func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { noPredicates := []interface{}{} err := updateWafRuleResource(d.Id(), noPredicates, newPredicates, conn) if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) + return fmt.Errorf("error updating WAF Rule (%s): %w", d.Id(), err) } } @@ -111,14 +111,24 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { } resp, err := conn.GetRule(params) + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == waf.ErrCodeNonexistentItemException { - log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil + return fmt.Errorf("error getting WAF Rule (%s): %w", d.Id(), err) + } + + if resp == nil || resp.Rule == nil { + if d.IsNewResource() { + return fmt.Errorf("error getting WAF Rule (%s): not found", d.Id()) } - return err + log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } var predicates []map[string]interface{} @@ -143,11 +153,11 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { tags, err := keyvaluetags.WafListTags(conn, arn) if err != nil { - return fmt.Errorf("error listing tags for WAF Rule (%s): %s", arn, err) + return fmt.Errorf("error listing tags for WAF Rule (%s): %w", d.Id(), err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) } d.Set("predicates", predicates) @@ -166,7 +176,7 @@ func resourceAwsWafRuleUpdate(d *schema.ResourceData, meta interface{}) error { err := updateWafRuleResource(d.Id(), oldP, newP, conn) if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) + return fmt.Errorf("error updating WAF Rule (%s): %w", d.Id(), err) } } @@ -174,7 +184,7 @@ func resourceAwsWafRuleUpdate(d *schema.ResourceData, meta interface{}) error { o, n := d.GetChange("tags") if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { - return fmt.Errorf("error updating tags: %s", err) + return fmt.Errorf("error updating WAF Rule (%s) tags: %w", d.Id(), err) } } @@ -189,7 +199,7 @@ func resourceAwsWafRuleDelete(d *schema.ResourceData, meta interface{}) error { noPredicates := []interface{}{} err := updateWafRuleResource(d.Id(), oldPredicates, noPredicates, conn) if err != nil { - return fmt.Errorf("Error updating WAF Rule Predicates: %s", err) + return fmt.Errorf("error updating WAF Rule (%s) predicates: %w", d.Id(), err) } } @@ -199,11 +209,24 @@ func resourceAwsWafRuleDelete(d *schema.ResourceData, meta interface{}) error { ChangeToken: token, RuleId: aws.String(d.Id()), } - log.Printf("[INFO] Deleting WAF Rule") - return conn.DeleteRule(req) + + output, err := conn.DeleteRule(req) + + // Deleting a WAF Rule after being removed from a WAF WebACL + // can return a WAFReferencedItemException when attempted in quick succession; + // thus, we catch the error here and re-attempt + if tfawserr.ErrCodeEquals(err, waf.ErrCodeReferencedItemException) { + return output, nil + } + + return output, err }) + if err != nil { - return fmt.Errorf("Error deleting WAF Rule: %s", err) + if tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + return nil + } + return fmt.Errorf("error deleting WAF Rule (%s): %w", d.Id(), err) } return nil @@ -221,7 +244,7 @@ func updateWafRuleResource(id string, oldP, newP []interface{}, conn *waf.WAF) e return conn.UpdateRule(req) }) if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) + return fmt.Errorf("error updating WAF Rule (%s): %w", id, err) } return nil diff --git a/aws/resource_aws_waf_rule_test.go b/aws/resource_aws_waf_rule_test.go index 167192237d3..b0e27ae347e 100644 --- a/aws/resource_aws_waf_rule_test.go +++ b/aws/resource_aws_waf_rule_test.go @@ -505,7 +505,7 @@ func testAccPreCheckAWSWaf(t *testing.T) { func testAccAWSWafRuleConfig(name string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -515,8 +515,8 @@ resource "aws_waf_ipset" "ipset" { resource "aws_waf_rule" "wafrule" { depends_on = [aws_waf_ipset.ipset] - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_ipset.ipset.id @@ -524,13 +524,13 @@ resource "aws_waf_rule" "wafrule" { type = "IPMatch" } } -`, name, name, name) +`, name) } func testAccAWSWafRuleConfigChangeName(name string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -540,8 +540,8 @@ resource "aws_waf_ipset" "ipset" { resource "aws_waf_rule" "wafrule" { depends_on = [aws_waf_ipset.ipset] - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_ipset.ipset.id @@ -549,13 +549,13 @@ resource "aws_waf_rule" "wafrule" { type = "IPMatch" } } -`, name, name, name) +`, name) } func testAccAWSWafRuleConfig_changePredicates(name string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -564,7 +564,7 @@ resource "aws_waf_ipset" "ipset" { } resource "aws_waf_byte_match_set" "set" { - name = "%s" + name = %[1]q byte_match_tuples { text_transformation = "NONE" @@ -579,8 +579,8 @@ resource "aws_waf_byte_match_set" "set" { } resource "aws_waf_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_byte_match_set.set.id @@ -588,22 +588,22 @@ resource "aws_waf_rule" "wafrule" { type = "ByteMatch" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRuleConfig_noPredicates(name string) string { return fmt.Sprintf(` resource "aws_waf_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } -`, name, name) +`, name) } func testAccAWSWafRuleConfig_geoMatchSetPredicate(name string) string { return fmt.Sprintf(` resource "aws_waf_geo_match_set" "geo_match_set" { - name = "%s" + name = %[1]q geo_match_constraint { type = "Country" @@ -612,8 +612,8 @@ resource "aws_waf_geo_match_set" "geo_match_set" { } resource "aws_waf_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_geo_match_set.geo_match_set.id @@ -621,13 +621,13 @@ resource "aws_waf_rule" "wafrule" { type = "GeoMatch" } } -`, name, name, name) +`, name) } func testAccAWSWafRuleConfigTags1(rName, tag1Key, tag1Value string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -637,8 +637,8 @@ resource "aws_waf_ipset" "ipset" { resource "aws_waf_rule" "wafrule" { depends_on = [aws_waf_ipset.ipset] - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_ipset.ipset.id @@ -650,13 +650,13 @@ resource "aws_waf_rule" "wafrule" { %q = %q } } -`, rName, rName, rName, tag1Key, tag1Value) +`, rName, tag1Key, tag1Value) } func testAccAWSWafRuleConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -666,8 +666,8 @@ resource "aws_waf_ipset" "ipset" { resource "aws_waf_rule" "wafrule" { depends_on = [aws_waf_ipset.ipset] - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicates { data_id = aws_waf_ipset.ipset.id @@ -680,5 +680,5 @@ resource "aws_waf_rule" "wafrule" { %q = %q } } -`, rName, rName, rName, tag1Key, tag1Value, tag2Key, tag2Value) +`, rName, tag1Key, tag1Value, tag2Key, tag2Value) } diff --git a/aws/resource_aws_waf_web_acl.go b/aws/resource_aws_waf_web_acl.go index e9e46f02fa3..d0c9ff91793 100644 --- a/aws/resource_aws_waf_web_acl.go +++ b/aws/resource_aws_waf_web_acl.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" @@ -184,9 +185,8 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error LoggingConfiguration: expandWAFLoggingConfiguration(loggingConfiguration, arn), } - log.Printf("[DEBUG] Updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), input) if _, err := conn.PutLoggingConfiguration(input); err != nil { - return fmt.Errorf("error updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + return fmt.Errorf("error putting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) } } @@ -203,7 +203,7 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error return conn.UpdateWebACL(req) }) if err != nil { - return fmt.Errorf("Error Updating WAF ACL: %s", err) + return fmt.Errorf("error updating WAF Web ACL (%s): %w", d.Id(), err) } } @@ -219,53 +219,56 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { } resp, err := conn.GetWebACL(params) - if err != nil { - if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { - log.Printf("[WARN] WAF ACL (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + log.Printf("[WARN] WAF Web ACL (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } - return err + if err != nil { + return fmt.Errorf("error getting WAF Web ACL (%s): %w", d.Id(), err) } if resp == nil || resp.WebACL == nil { - log.Printf("[WARN] WAF ACL (%s) not found, removing from state", d.Id()) + if d.IsNewResource() { + return fmt.Errorf("error getting WAF Web ACL (%s): not found", d.Id()) + } + + log.Printf("[WARN] WAF Web ACL (%s) not found, removing from state", d.Id()) d.SetId("") return nil } d.Set("arn", resp.WebACL.WebACLArn) - arn := *resp.WebACL.WebACLArn + arn := aws.StringValue(resp.WebACL.WebACLArn) if err := d.Set("default_action", flattenWafAction(resp.WebACL.DefaultAction)); err != nil { - return fmt.Errorf("error setting default_action: %s", err) + return fmt.Errorf("error setting default_action: %w", err) } d.Set("name", resp.WebACL.Name) d.Set("metric_name", resp.WebACL.MetricName) tags, err := keyvaluetags.WafListTags(conn, arn) if err != nil { - return fmt.Errorf("error listing tags for WAF ACL (%s): %s", arn, err) + return fmt.Errorf("error listing tags for WAF Web ACL (%s): %w", d.Id(), err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) } if err := d.Set("rules", flattenWafWebAclRules(resp.WebACL.Rules)); err != nil { - return fmt.Errorf("error setting rules: %s", err) + return fmt.Errorf("error setting rules: %w", err) } getLoggingConfigurationInput := &waf.GetLoggingConfigurationInput{ - ResourceArn: aws.String(d.Get("arn").(string)), + ResourceArn: aws.String(arn), } loggingConfiguration := []interface{}{} - log.Printf("[DEBUG] Getting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), getLoggingConfigurationInput) getLoggingConfigurationOutput, err := conn.GetLoggingConfiguration(getLoggingConfigurationInput) if err != nil && !isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { - return fmt.Errorf("error getting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + return fmt.Errorf("error getting WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) } if getLoggingConfigurationOutput != nil { @@ -273,7 +276,7 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("logging_configuration", loggingConfiguration); err != nil { - return fmt.Errorf("error setting logging_configuration: %s", err) + return fmt.Errorf("error setting logging_configuration: %w", err) } return nil @@ -297,7 +300,7 @@ func resourceAwsWafWebAclUpdate(d *schema.ResourceData, meta interface{}) error return conn.UpdateWebACL(req) }) if err != nil { - return fmt.Errorf("Error Updating WAF ACL: %s", err) + return fmt.Errorf("error updating WAF Web ACL (%s): %w", d.Id(), err) } } @@ -309,18 +312,16 @@ func resourceAwsWafWebAclUpdate(d *schema.ResourceData, meta interface{}) error LoggingConfiguration: expandWAFLoggingConfiguration(loggingConfiguration, d.Get("arn").(string)), } - log.Printf("[DEBUG] Updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), input) if _, err := conn.PutLoggingConfiguration(input); err != nil { - return fmt.Errorf("error updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + return fmt.Errorf("error updating WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) } } else { input := &waf.DeleteLoggingConfigurationInput{ ResourceArn: aws.String(d.Get("arn").(string)), } - log.Printf("[DEBUG] Deleting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), input) if _, err := conn.DeleteLoggingConfiguration(input); err != nil { - return fmt.Errorf("error deleting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + return fmt.Errorf("error deleting WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) } } @@ -330,7 +331,7 @@ func resourceAwsWafWebAclUpdate(d *schema.ResourceData, meta interface{}) error o, n := d.GetChange("tags") if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { - return fmt.Errorf("error updating tags: %s", err) + return fmt.Errorf("error updating WAF Web ACL (%s) tags: %w", d.Id(), err) } } @@ -354,7 +355,7 @@ func resourceAwsWafWebAclDelete(d *schema.ResourceData, meta interface{}) error return conn.UpdateWebACL(req) }) if err != nil { - return fmt.Errorf("Error Removing WAF Regional ACL Rules: %s", err) + return fmt.Errorf("error removing WAF Web ACL (%s) rules: %w", d.Id(), err) } } @@ -365,11 +366,10 @@ func resourceAwsWafWebAclDelete(d *schema.ResourceData, meta interface{}) error WebACLId: aws.String(d.Id()), } - log.Printf("[INFO] Deleting WAF ACL") return conn.DeleteWebACL(req) }) if err != nil { - return fmt.Errorf("Error Deleting WAF ACL: %s", err) + return fmt.Errorf("error deleting WAF Web ACL (%s): %w", d.Id(), err) } return nil } diff --git a/aws/resource_aws_waf_web_acl_test.go b/aws/resource_aws_waf_web_acl_test.go index fa82a5c91e7..20132473f21 100644 --- a/aws/resource_aws_waf_web_acl_test.go +++ b/aws/resource_aws_waf_web_acl_test.go @@ -8,9 +8,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/waf/lister" ) func init() { @@ -23,94 +25,68 @@ func init() { func testSweepWafWebAcls(region string) error { client, err := sharedClientForRegion(region) if err != nil { - return fmt.Errorf("error getting client: %s", err) + return fmt.Errorf("error getting client: %w", err) } conn := client.(*AWSClient).wafconn - input := &waf.ListWebACLsInput{} - - for { - output, err := conn.ListWebACLs(input) + var sweeperErrs *multierror.Error - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping WAF Regional Web ACL sweep for %s: %s", region, err) - return nil - } + input := &waf.ListWebACLsInput{} - if err != nil { - return fmt.Errorf("error listing WAF Regional Web ACLs: %s", err) + err = lister.ListWebACLsPages(conn, input, func(page *waf.ListWebACLsOutput, lastPage bool) bool { + if page == nil { + return !lastPage } - for _, webACL := range output.WebACLs { - deleteInput := &waf.DeleteWebACLInput{ - WebACLId: webACL.WebACLId, + for _, webACL := range page.WebACLs { + if webACL == nil { + continue } + id := aws.StringValue(webACL.WebACLId) - wr := newWafRetryer(conn) - _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { - deleteInput.ChangeToken = token - log.Printf("[INFO] Deleting WAF Regional Web ACL: %s", id) - return conn.DeleteWebACL(deleteInput) - }) + r := resourceAwsWafWebAcl() + d := r.Data(nil) + d.SetId(id) + + // Need to Read first to fill in rules argument + err := r.Read(d, client) + + if err != nil { + sweeperErr := fmt.Errorf("error reading WAF Web ACL (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } - if isAWSErr(err, waf.ErrCodeNonEmptyEntityException, "") { - getWebACLInput := &waf.GetWebACLInput{ - WebACLId: webACL.WebACLId, - } - - getWebACLOutput, getWebACLErr := conn.GetWebACL(getWebACLInput) - - if getWebACLErr != nil { - return fmt.Errorf("error getting WAF Regional Web ACL (%s): %s", id, getWebACLErr) - } - - var updates []*waf.WebACLUpdate - updateWebACLInput := &waf.UpdateWebACLInput{ - DefaultAction: getWebACLOutput.WebACL.DefaultAction, - Updates: updates, - WebACLId: webACL.WebACLId, - } - - for _, rule := range getWebACLOutput.WebACL.Rules { - update := &waf.WebACLUpdate{ - Action: aws.String(waf.ChangeActionDelete), - ActivatedRule: rule, - } - - updateWebACLInput.Updates = append(updateWebACLInput.Updates, update) - } - - _, updateWebACLErr := wr.RetryWithToken(func(token *string) (interface{}, error) { - updateWebACLInput.ChangeToken = token - log.Printf("[INFO] Removing Rules from WAF Regional Web ACL: %s", id) - return conn.UpdateWebACL(updateWebACLInput) - }) - - if updateWebACLErr != nil { - return fmt.Errorf("error removing rules from WAF Regional Web ACL (%s): %s", id, updateWebACLErr) - } - - _, err = wr.RetryWithToken(func(token *string) (interface{}, error) { - deleteInput.ChangeToken = token - log.Printf("[INFO] Deleting WAF Regional Web ACL: %s", id) - return conn.DeleteWebACL(deleteInput) - }) + // In case it was already deleted + if d.Id() == "" { + continue } + err = r.Delete(d, client) + if err != nil { - return fmt.Errorf("error deleting WAF Regional Web ACL (%s): %s", id, err) + sweeperErr := fmt.Errorf("error deleting WAF Web ACL (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } } - if aws.StringValue(output.NextMarker) == "" { - break - } + return !lastPage + }) - input.NextMarker = output.NextMarker + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping WAF Web ACL sweep for %s: %s", region, err) + return sweeperErrs.ErrorOrNil() // In case we have completed some pages, but had errors } - return nil + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error describing WAF Web ACLs: %w", err)) + } + + return sweeperErrs.ErrorOrNil() } func TestAccAWSWafWebAcl_basic(t *testing.T) { @@ -481,33 +457,33 @@ func testAccCheckAWSWafWebAclExists(n string, v *waf.WebACL) resource.TestCheckF func testAccAWSWafWebAclConfig_Required(rName string) string { return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" } } -`, rName, rName) +`, rName) } func testAccAWSWafWebAclConfig_DefaultAction(rName, defaultAction string) string { return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = %q } } -`, rName, rName, defaultAction) +`, rName, defaultAction) } func testAccAWSWafWebAclConfig_Rules_Single_Rule(rName string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "test" { - name = %q + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -516,8 +492,8 @@ resource "aws_waf_ipset" "test" { } resource "aws_waf_rule" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q predicates { data_id = aws_waf_ipset.test.id @@ -527,8 +503,8 @@ resource "aws_waf_rule" "test" { } resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" @@ -543,19 +519,19 @@ resource "aws_waf_web_acl" "test" { } } } -`, rName, rName, rName, rName, rName) +`, rName) } func testAccAWSWafWebAclConfig_Rules_Single_RuleGroup(rName string) string { return fmt.Sprintf(` resource "aws_waf_rule_group" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q } resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" @@ -571,13 +547,13 @@ resource "aws_waf_web_acl" "test" { } } } -`, rName, rName, rName, rName) +`, rName) } func testAccAWSWafWebAclConfig_Rules_Multiple(rName string) string { return fmt.Sprintf(` resource "aws_waf_ipset" "test" { - name = %q + name = %[1]q ip_set_descriptors { type = "IPV4" @@ -586,8 +562,8 @@ resource "aws_waf_ipset" "test" { } resource "aws_waf_rule" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q predicates { data_id = aws_waf_ipset.test.id @@ -597,13 +573,13 @@ resource "aws_waf_rule" "test" { } resource "aws_waf_rule_group" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q } resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" @@ -628,7 +604,7 @@ resource "aws_waf_web_acl" "test" { } } } -`, rName, rName, rName, rName, rName, rName, rName) +`, rName) } func testAccAWSWafWebAclConfig_Logging(rName string) string { @@ -772,8 +748,8 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { func testAccAWSWafWebAclConfigTags1(rName, tag1Key, tag1Value string) string { return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" @@ -783,14 +759,14 @@ resource "aws_waf_web_acl" "test" { %q = %q } } -`, rName, rName, tag1Key, tag1Value) +`, rName, tag1Key, tag1Value) } func testAccAWSWafWebAclConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { return fmt.Sprintf(` resource "aws_waf_web_acl" "test" { - metric_name = %q - name = %q + metric_name = %[1]q + name = %[1]q default_action { type = "ALLOW" @@ -801,5 +777,5 @@ resource "aws_waf_web_acl" "test" { %q = %q } } -`, rName, rName, tag1Key, tag1Value, tag2Key, tag2Value) +`, rName, tag1Key, tag1Value, tag2Key, tag2Value) } From a72bba129a7d34dce351ef293274a7f412a5dcdb Mon Sep 17 00:00:00 2001 From: bill-rich Date: Wed, 24 Feb 2021 13:46:45 -0800 Subject: [PATCH 0027/1252] Add StateFunc --- .changelog/17909.txt | 3 + aws/resource_aws_db_parameter_group.go | 8 ++- aws/resource_aws_db_parameter_group_test.go | 73 +++++++++++++++++++-- 3 files changed, 77 insertions(+), 7 deletions(-) create mode 100644 .changelog/17909.txt diff --git a/.changelog/17909.txt b/.changelog/17909.txt new file mode 100644 index 00000000000..367f7ef6b32 --- /dev/null +++ b/.changelog/17909.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_db_parameter_group: Store all values in lowercase to prevent unexpected diffs +``` diff --git a/aws/resource_aws_db_parameter_group.go b/aws/resource_aws_db_parameter_group.go index 197f93b3a14..43b1d411813 100644 --- a/aws/resource_aws_db_parameter_group.go +++ b/aws/resource_aws_db_parameter_group.go @@ -70,11 +70,17 @@ func resourceAwsDbParameterGroup() *schema.Resource { "value": { Type: schema.TypeString, Required: true, + StateFunc: func(v interface{}) string { + return strings.ToLower(v.(string)) + }, }, "apply_method": { Type: schema.TypeString, Optional: true, - Default: "immediate", + StateFunc: func(v interface{}) string { + return strings.ToLower(v.(string)) + }, + Default: "immediate", }, }, }, diff --git a/aws/resource_aws_db_parameter_group_test.go b/aws/resource_aws_db_parameter_group_test.go index 74ff03b9b5e..ab6c014e09e 100644 --- a/aws/resource_aws_db_parameter_group_test.go +++ b/aws/resource_aws_db_parameter_group_test.go @@ -166,6 +166,22 @@ func TestAccAWSDBParameterGroup_basic(t *testing.T) { }) } +func TestAccAWSDBParameterGroup_caseWithMixedParameters(t *testing.T) { + groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSDBParameterGroupConfigCaseWithMixedParameters(groupName), + Check: resource.ComposeTestCheckFunc(), + }, + }, + }) +} + func TestAccAWSDBParameterGroup_limit(t *testing.T) { var v rds.DBParameterGroup resourceName := "aws_db_parameter_group.test" @@ -286,7 +302,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "event_scheduler", - "value": "ON", + "value": "on", }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "innodb_buffer_pool_dump_at_shutdown", @@ -322,7 +338,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "log_output", - "value": "FILE", + "value": "file", }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "max_allowed_packet", @@ -346,7 +362,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "tx_isolation", - "value": "REPEATABLE-READ", + "value": "repeatable-read", }), ), }, @@ -465,7 +481,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "event_scheduler", - "value": "ON", + "value": "on", }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "innodb_buffer_pool_dump_at_shutdown", @@ -501,7 +517,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "log_output", - "value": "FILE", + "value": "file", }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "max_allowed_packet", @@ -525,7 +541,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { }), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "parameter.*", map[string]string{ "name": "tx_isolation", - "value": "REPEATABLE-READ", + "value": "repeatable-read", }), ), }, @@ -907,6 +923,51 @@ resource "aws_db_parameter_group" "test" { `, n) } +func testAccAWSDBParameterGroupConfigCaseWithMixedParameters(n string) string { + return composeConfig(testAccAWSDBInstanceConfig_orderableClassMysql(), fmt.Sprintf(` +resource "aws_db_parameter_group" "test" { + name = %[1]q + family = "mysql5.6" + + parameter { + name = "character_set_server" + value = "utf8mb4" + apply_method = "pending-reboot" + } + parameter { + name = "innodb_large_prefix" + value = 1 + apply_method = "pending-reboot" + } + parameter { + name = "innodb_file_format" + value = "Barracuda" + apply_method = "pending-reboot" + } + parameter { + name = "innodb_log_file_size" + value = 2147483648 + apply_method = "pending-reboot" + } + parameter { + name = "sql_mode" + value = "STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" + apply_method = "pending-reboot" + } + parameter { + name = "innodb_log_buffer_size" + value = 268435456 + apply_method = "pending-reboot" + } + parameter { + name = "max_allowed_packet" + value = 268435456 + apply_method = "pending-reboot" + } +} +`, n)) +} + func testAccAWSDBParameterGroupConfigWithApplyMethod(n string) string { return fmt.Sprintf(` resource "aws_db_parameter_group" "test" { From a3b920ebd8dc4931597d8a72e0fb5668f4ab8882 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Fri, 5 Mar 2021 07:53:07 +0900 Subject: [PATCH 0028/1252] resource_aws_ec2_traffic_mirror_session: Correct ARN --- aws/resource_aws_ec2_traffic_mirror_session.go | 8 ++++++-- aws/resource_aws_ec2_traffic_mirror_session_test.go | 1 + website/docs/r/ec2_traffic_mirror_session.html.markdown | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_ec2_traffic_mirror_session.go b/aws/resource_aws_ec2_traffic_mirror_session.go index 631aa1ac602..fcfa758b01b 100644 --- a/aws/resource_aws_ec2_traffic_mirror_session.go +++ b/aws/resource_aws_ec2_traffic_mirror_session.go @@ -35,6 +35,10 @@ func resourceAwsEc2TrafficMirrorSession() *schema.Resource { Required: true, ForceNew: true, }, + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, "packet_length": { Type: schema.TypeInt, Optional: true, @@ -217,14 +221,14 @@ func resourceAwsEc2TrafficMirrorSessionRead(d *schema.ResourceData, meta interfa return fmt.Errorf("error setting tags: %s", err) } + d.Set("owner_id", session.OwnerId) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(session.OwnerId), Resource: fmt.Sprintf("traffic-mirror-session/%s", d.Id()), }.String() - d.Set("arn", arn) return nil diff --git a/aws/resource_aws_ec2_traffic_mirror_session_test.go b/aws/resource_aws_ec2_traffic_mirror_session_test.go index e72729664d4..1b5c7cde223 100644 --- a/aws/resource_aws_ec2_traffic_mirror_session_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_session_test.go @@ -40,6 +40,7 @@ func TestAccAWSEc2TrafficMirrorSession_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "session_number", strconv.Itoa(session)), resource.TestMatchResourceAttr(resourceName, "virtual_network_id", regexp.MustCompile(`\d+`)), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`traffic-mirror-session/tms-.+`)), ), }, diff --git a/website/docs/r/ec2_traffic_mirror_session.html.markdown b/website/docs/r/ec2_traffic_mirror_session.html.markdown index 4f609b32c5b..28fbf5b97c5 100644 --- a/website/docs/r/ec2_traffic_mirror_session.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_session.html.markdown @@ -52,6 +52,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN of the traffic mirror session. * `id` - The name of the session. +* `owner_id` - The AWS account ID of the session owner. ## Import From ce7ca2917fd13973063306bfc18a83536427920c Mon Sep 17 00:00:00 2001 From: Steffen Gebert Date: Fri, 5 Mar 2021 11:26:30 +0100 Subject: [PATCH 0029/1252] docs/resource/vpc_peering_connection: Fix markdown Fix some broken Markdown related to links --- website/docs/r/vpc_peering_connection.html.markdown | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/website/docs/r/vpc_peering_connection.html.markdown b/website/docs/r/vpc_peering_connection.html.markdown index 56bbb88ba5a..a204754aa6b 100644 --- a/website/docs/r/vpc_peering_connection.html.markdown +++ b/website/docs/r/vpc_peering_connection.html.markdown @@ -109,22 +109,18 @@ The following arguments are supported: * `peer_vpc_id` - (Required) The ID of the VPC with which you are creating the VPC Peering Connection. * `vpc_id` - (Required) The ID of the requester VPC. * `auto_accept` - (Optional) Accept the peering (both VPCs need to be in the same AWS account). -* `peer_region` - (Optional) The region of the accepter VPC of the [VPC Peering Connection]. `auto_accept` must be `false`, +* `peer_region` - (Optional) The region of the accepter VPC of the VPC Peering Connection. `auto_accept` must be `false`, and use the `aws_vpc_peering_connection_accepter` to manage the accepter side. -* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection] -(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts +* `accepter` (Optional) - An optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that accepts the peering connection (a maximum of one). -* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection] -(https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests +* `requester` (Optional) - A optional configuration block that allows for [VPC Peering Connection](https://docs.aws.amazon.com/vpc/latest/peering/what-is-vpc-peering.html) options to be set for the VPC that requests the peering connection (a maximum of one). * `tags` - (Optional) A map of tags to assign to the resource. #### Accepter and Requester Arguments -> **Note:** When enabled, the DNS resolution feature requires that VPCs participating in the peering -must have support for the DNS hostnames enabled. This can be done using the [`enable_dns_hostnames`] -(vpc.html#enable_dns_hostnames) attribute in the [`aws_vpc`](vpc.html) resource. See [Using DNS with Your VPC] -(http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. +must have support for the DNS hostnames enabled. This can be done using the [`enable_dns_hostnames`](vpc.html#enable_dns_hostnames) attribute in the [`aws_vpc`](vpc.html) resource. See [Using DNS with Your VPC](http://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpc-dns.html) user guide for more information. * `allow_remote_vpc_dns_resolution` - (Optional) Allow a local VPC to resolve public DNS hostnames to private IP addresses when queried from instances in the peer VPC. This is From ed3e6cb6c668f225b06450a4c59dee86f4250fe1 Mon Sep 17 00:00:00 2001 From: Jonathan Nagayoshi Date: Fri, 5 Mar 2021 15:17:44 -0300 Subject: [PATCH 0030/1252] #13605 added base64decode string before sending to aws-sdk-go, so certificate_wallet is not encoded twice --- .changelog/13605.txt | 3 +++ aws/resource_aws_dms_certificate.go | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .changelog/13605.txt diff --git a/.changelog/13605.txt b/.changelog/13605.txt new file mode 100644 index 00000000000..48056587b2b --- /dev/null +++ b/.changelog/13605.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_dms_certificate: Add base64 decode before sending to aws-sdk-go, so oracle-wallet is not encoded twice +``` diff --git a/aws/resource_aws_dms_certificate.go b/aws/resource_aws_dms_certificate.go index 1bae78a6b98..dca37ab8a41 100644 --- a/aws/resource_aws_dms_certificate.go +++ b/aws/resource_aws_dms_certificate.go @@ -1,6 +1,7 @@ package aws import ( + "encoding/base64" "fmt" "log" @@ -72,7 +73,11 @@ func resourceAwsDmsCertificateCreate(d *schema.ResourceData, meta interface{}) e request.CertificatePem = aws.String(pem.(string)) } if walletSet { - request.CertificateWallet = []byte(wallet.(string)) + byteArray, err := base64.StdEncoding.DecodeString(wallet.(string)) + if err != nil { + return fmt.Errorf("certificate_wallet is not a valid base64-encoded string") + } + request.CertificateWallet = byteArray } log.Println("[DEBUG] DMS import certificate:", request) From d7fc1eaee20f7ccb88c0a85ef6a510a331a644c5 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 00:52:48 +0200 Subject: [PATCH 0031/1252] add tagging support for saml provider --- aws/internal/keyvaluetags/iam_tags.go | 35 +++++++++ aws/resource_aws_iam_saml_provider.go | 43 ++++++++--- aws/resource_aws_iam_saml_provider_test.go | 71 +++++++++++++++++++ .../docs/r/iam_saml_provider.html.markdown | 1 + 4 files changed, 139 insertions(+), 11 deletions(-) diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go index 1059708d280..1abe0e0977e 100644 --- a/aws/internal/keyvaluetags/iam_tags.go +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -80,3 +80,38 @@ func IamUserUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, return nil } + +// IamSAMLProviderUpdateTags updates IAM SAML Provider tags. +// The identifier is the SAML Provider ARN. +func IamSAMLProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagSAMLProviderInput{ + SAMLProviderArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagSAMLProvider(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagSAMLProviderInput{ + SAMLProviderArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagSAMLProvider(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} diff --git a/aws/resource_aws_iam_saml_provider.go b/aws/resource_aws_iam_saml_provider.go index a51b1a01bc7..dccb51c9d45 100644 --- a/aws/resource_aws_iam_saml_provider.go +++ b/aws/resource_aws_iam_saml_provider.go @@ -10,6 +10,8 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsIamSamlProvider() *schema.Resource { @@ -33,14 +35,17 @@ func resourceAwsIamSamlProvider() *schema.Resource { Computed: true, }, "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 128), }, "saml_metadata_document": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1000, 10000000), }, + "tags": tagsSchema(), }, } } @@ -51,6 +56,7 @@ func resourceAwsIamSamlProviderCreate(d *schema.ResourceData, meta interface{}) input := &iam.CreateSAMLProviderInput{ Name: aws.String(d.Get("name").(string)), SAMLMetadataDocument: aws.String(d.Get("saml_metadata_document").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().IamTags(), } out, err := conn.CreateSAMLProvider(input) @@ -65,6 +71,7 @@ func resourceAwsIamSamlProviderCreate(d *schema.ResourceData, meta interface{}) func resourceAwsIamSamlProviderRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iamconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig input := &iam.GetSAMLProviderInput{ SAMLProviderArn: aws.String(d.Id()), @@ -88,19 +95,33 @@ func resourceAwsIamSamlProviderRead(d *schema.ResourceData, meta interface{}) er d.Set("valid_until", out.ValidUntil.Format(time.RFC1123)) d.Set("saml_metadata_document", out.SAMLMetadataDocument) + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(out.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + return nil } func resourceAwsIamSamlProviderUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iamconn - input := &iam.UpdateSAMLProviderInput{ - SAMLProviderArn: aws.String(d.Id()), - SAMLMetadataDocument: aws.String(d.Get("saml_metadata_document").(string)), + if d.HasChangeExcept("tags") { + input := &iam.UpdateSAMLProviderInput{ + SAMLProviderArn: aws.String(d.Id()), + SAMLMetadataDocument: aws.String(d.Get("saml_metadata_document").(string)), + } + _, err := conn.UpdateSAMLProvider(input) + if err != nil { + return fmt.Errorf("error updating IAM SAML Provider (%q): %w", d.Id(), err) + } } - _, err := conn.UpdateSAMLProvider(input) - if err != nil { - return fmt.Errorf("error updating IAM SAML Provider (%q): %w", d.Id(), err) + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.IamSAMLProviderUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM SAML Provider (%s): %w", d.Id(), err) + } } return resourceAwsIamSamlProviderRead(d, meta) diff --git a/aws/resource_aws_iam_saml_provider_test.go b/aws/resource_aws_iam_saml_provider_test.go index 53b278bdf1c..98d31f50bd9 100644 --- a/aws/resource_aws_iam_saml_provider_test.go +++ b/aws/resource_aws_iam_saml_provider_test.go @@ -76,6 +76,7 @@ func TestAccAWSIAMSamlProvider_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttrSet(resourceName, "saml_metadata_document"), resource.TestCheckResourceAttrSet(resourceName, "valid_until"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -95,6 +96,49 @@ func TestAccAWSIAMSamlProvider_basic(t *testing.T) { }) } +func TestAccAWSIAMSamlProvider_tags(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_iam_saml_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckIAMSamlProviderDestroy, + Steps: []resource.TestStep{ + { + Config: testAccIAMSamlProviderConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMSamlProviderExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccIAMSamlProviderConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMSamlProviderExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccIAMSamlProviderConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMSamlProviderExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSIAMSamlProvider_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_iam_saml_provider.test" @@ -182,3 +226,30 @@ resource "aws_iam_saml_provider" "test" { } `, rName) } + +func testAccIAMSamlProviderConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_saml_provider" "test" { + name = %q + saml_metadata_document = file("./test-fixtures/saml-metadata.xml") + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccIAMSamlProviderConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_iam_saml_provider" "test" { + name = %q + saml_metadata_document = file("./test-fixtures/saml-metadata.xml") + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/website/docs/r/iam_saml_provider.html.markdown b/website/docs/r/iam_saml_provider.html.markdown index 373bc0e4ccb..6aaf307a7c0 100644 --- a/website/docs/r/iam_saml_provider.html.markdown +++ b/website/docs/r/iam_saml_provider.html.markdown @@ -32,6 +32,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN assigned by AWS for this provider. * `valid_until` - The expiration date and time for the SAML provider in RFC1123 format, e.g. `Mon, 02 Jan 2006 15:04:05 MST`. +* `tags` - Key-value map of tags for the IAM SAML provider. ## Import From 7db5fb70e5fb91be85e1bd9fb52507e9646e342c Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 00:57:15 +0200 Subject: [PATCH 0032/1252] changelog --- .changelog/17965.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/17965.txt diff --git a/.changelog/17965.txt b/.changelog/17965.txt new file mode 100644 index 00000000000..9451408b5c6 --- /dev/null +++ b/.changelog/17965.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_iam_saml_provider: Add tagging support +``` + +```release-note:enhancement +resource/aws_iam_saml_provider: Add plan time validation for `name` and `saml_metadata_document` +``` From f7fcee4b373a55cb5a74d7e32dd418ab691865e4 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 09:52:09 +0200 Subject: [PATCH 0033/1252] server cert tags --- aws/internal/keyvaluetags/iam_tags.go | 35 ++++ aws/resource_aws_iam_server_certificate.go | 51 +++++- ...esource_aws_iam_server_certificate_test.go | 169 ++++++++++++------ .../r/iam_server_certificate.html.markdown | 1 + 4 files changed, 190 insertions(+), 66 deletions(-) diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go index 1059708d280..ab6f08833cc 100644 --- a/aws/internal/keyvaluetags/iam_tags.go +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -80,3 +80,38 @@ func IamUserUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, return nil } + +// IamServerCertificateUpdateTags updates IAM Server Certificate tags. +// The identifier is the Server Certificate name. +func IamServerCertificateUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagServerCertificateInput{ + ServerCertificateName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagServerCertificate(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagServerCertificateInput{ + ServerCertificateName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagServerCertificate(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} diff --git a/aws/resource_aws_iam_server_certificate.go b/aws/resource_aws_iam_server_certificate.go index 870d19537f9..dd1df13ede0 100644 --- a/aws/resource_aws_iam_server_certificate.go +++ b/aws/resource_aws_iam_server_certificate.go @@ -16,12 +16,14 @@ import ( "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsIAMServerCertificate() *schema.Resource { return &schema.Resource{ Create: resourceAwsIAMServerCertificateCreate, Read: resourceAwsIAMServerCertificateRead, + Update: resourceAwsIAMServerCertificateUpdate, Delete: resourceAwsIAMServerCertificateDelete, Importer: &schema.ResourceImporter{ State: resourceAwsIAMServerCertificateImport, @@ -79,9 +81,17 @@ func resourceAwsIAMServerCertificate() *schema.Resource { "arn": { Type: schema.TypeString, - Optional: true, Computed: true, }, + "expiration": { + Type: schema.TypeString, + Computed: true, + }, + "upload_date": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -102,6 +112,7 @@ func resourceAwsIAMServerCertificateCreate(d *schema.ResourceData, meta interfac CertificateBody: aws.String(d.Get("certificate_body").(string)), PrivateKey: aws.String(d.Get("private_key").(string)), ServerCertificateName: aws.String(sslCertName), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().IamTags(), } if v, ok := d.GetOk("certificate_chain"); ok { @@ -126,6 +137,8 @@ func resourceAwsIAMServerCertificateCreate(d *schema.ResourceData, meta interfac func resourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iamconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig + resp, err := conn.GetServerCertificate(&iam.GetServerCertificateInput{ ServerCertificateName: aws.String(d.Get("name").(string)), }) @@ -140,16 +153,38 @@ func resourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error reading IAM Server Certificate (%s): %w", d.Id(), err) } - d.SetId(aws.StringValue(resp.ServerCertificate.ServerCertificateMetadata.ServerCertificateId)) + cert := resp.ServerCertificate + metadata := cert.ServerCertificateMetadata + d.SetId(aws.StringValue(metadata.ServerCertificateId)) - d.Set("certificate_body", resp.ServerCertificate.CertificateBody) - d.Set("certificate_chain", resp.ServerCertificate.CertificateChain) - d.Set("path", resp.ServerCertificate.ServerCertificateMetadata.Path) - d.Set("arn", resp.ServerCertificate.ServerCertificateMetadata.Arn) + d.Set("certificate_body", cert.CertificateBody) + d.Set("certificate_chain", cert.CertificateChain) + d.Set("path", metadata.Path) + d.Set("arn", metadata.Arn) + d.Set("expiration", aws.TimeValue(metadata.Expiration).Format(time.RFC3339)) + d.Set("upload_date", aws.TimeValue(metadata.UploadDate).Format(time.RFC3339)) + + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(cert.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } return nil } +func resourceAwsIAMServerCertificateUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).iamconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.IamServerCertificateUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM Server Certificate (%s): %w", d.Id(), err) + } + } + + return resourceAwsIAMServerCertificateRead(d, meta) +} + func resourceAwsIAMServerCertificateDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).iamconn log.Printf("[INFO] Deleting IAM Server Certificate: %s", d.Id()) @@ -160,12 +195,12 @@ func resourceAwsIAMServerCertificateDelete(d *schema.ResourceData, meta interfac if err != nil { if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "DeleteConflict" && strings.Contains(awsErr.Message(), "currently in use by arn") { + if awsErr.Code() == iam.ErrCodeDeleteConflictException && strings.Contains(awsErr.Message(), "currently in use by arn") { currentlyInUseBy(awsErr.Message(), meta.(*AWSClient).elbconn) log.Printf("[WARN] Conflict deleting server certificate: %s, retrying", awsErr.Message()) return resource.RetryableError(err) } - if awsErr.Code() == "NoSuchEntity" { + if awsErr.Code() == iam.ErrCodeNoSuchEntityException { return nil } } diff --git a/aws/resource_aws_iam_server_certificate_test.go b/aws/resource_aws_iam_server_certificate_test.go index d27cd8c3c07..96fb08d4be6 100644 --- a/aws/resource_aws_iam_server_certificate_test.go +++ b/aws/resource_aws_iam_server_certificate_test.go @@ -56,7 +56,7 @@ func testSweepIamServerCertificates(region string) error { func TestAccAWSIAMServerCertificate_basic(t *testing.T) { var cert iam.ServerCertificate - resourceName := "aws_iam_server_certificate.test_cert" + resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix("tf-acc-test") key := tlsRsaPrivateKeyPem(2048) @@ -71,25 +71,31 @@ func TestAccAWSIAMServerCertificate_basic(t *testing.T) { Config: testAccIAMServerCertConfig(rName, key, certificate), Check: resource.ComposeTestCheckFunc( testAccCheckCertExists(resourceName, &cert), - testAccCheckAWSServerCertAttributes(&cert, &certificate), + testAccCheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("server-certificate/%s", rName)), + testAccCheckResourceAttrRfc3339(resourceName, "expiration"), + testAccCheckResourceAttrRfc3339(resourceName, "upload_date"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "path", "/"), + resource.TestCheckResourceAttr(resourceName, "certificate_body", strings.TrimSpace(certificate)), ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateId: rName, - ImportStateVerifyIgnore: []string{ - "private_key"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: rName, + ImportStateVerifyIgnore: []string{"private_key"}, }, }, }) } -func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) { +func TestAccAWSIAMServerCertificate_tags(t *testing.T) { var cert iam.ServerCertificate - resourceName := "aws_iam_server_certificate.test_cert" + resourceName := "aws_iam_server_certificate.test" + rName := acctest.RandomWithPrefix("tf-acc-test") key := tlsRsaPrivateKeyPem(2048) certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") @@ -100,36 +106,70 @@ func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) { CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ { - Config: testAccIAMServerCertConfig_random(key, certificate), + Config: testAccIAMServerCertConfigTags1(rName, key, certificate, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckCertExists(resourceName, &cert), - testAccCheckAWSServerCertAttributes(&cert, &certificate), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: rName, + ImportStateVerifyIgnore: []string{"private_key"}, + }, + { + Config: testAccIAMServerCertConfigTags2(rName, key, certificate, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCertExists(resourceName, &cert), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccIAMServerCertConfigTags1(rName, key, certificate, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCertExists(resourceName, &cert), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, }) } -func TestAccAWSIAMServerCertificate_disappears(t *testing.T) { +func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) { var cert iam.ServerCertificate - resourceName := "aws_iam_server_certificate.test_cert" + + resourceName := "aws_iam_server_certificate.test" key := tlsRsaPrivateKeyPem(2048) certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") - testDestroyCert := func(*terraform.State) error { - // reach out and DELETE the Cert - conn := testAccProvider.Meta().(*AWSClient).iamconn - _, err := conn.DeleteServerCertificate(&iam.DeleteServerCertificateInput{ - ServerCertificateName: cert.ServerCertificateMetadata.ServerCertificateName, - }) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckIAMServerCertificateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccIAMServerCertConfig_random(key, certificate), + Check: resource.ComposeTestCheckFunc( + testAccCheckCertExists(resourceName, &cert), + ), + }, + }, + }) +} - if err != nil { - return fmt.Errorf("Error destroying cert in test: %s", err) - } +func TestAccAWSIAMServerCertificate_disappears(t *testing.T) { + var cert iam.ServerCertificate + resourceName := "aws_iam_server_certificate.test" - return nil - } + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -140,7 +180,7 @@ func TestAccAWSIAMServerCertificate_disappears(t *testing.T) { Config: testAccIAMServerCertConfig_random(key, certificate), Check: resource.ComposeTestCheckFunc( testAccCheckCertExists(resourceName, &cert), - testDestroyCert, + testAccCheckResourceDisappears(testAccProvider, resourceAwsIAMServerCertificate(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -154,7 +194,7 @@ func TestAccAWSIAMServerCertificate_file(t *testing.T) { rInt := acctest.RandInt() unixFile := "test-fixtures/iam-ssl-unix-line-endings.pem" winFile := "test-fixtures/iam-ssl-windows-line-endings.pem.winfile" - resourceName := "aws_iam_server_certificate.test_cert" + resourceName := "aws_iam_server_certificate.test" resourceId := fmt.Sprintf("terraform-test-cert-%d", rInt) resource.ParallelTest(t, resource.TestCase{ @@ -169,12 +209,11 @@ func TestAccAWSIAMServerCertificate_file(t *testing.T) { ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateId: resourceId, - ImportStateVerifyIgnore: []string{ - "private_key"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: resourceId, + ImportStateVerifyIgnore: []string{"private_key"}, }, { Config: testAccIAMServerCertConfig_file(rInt, winFile), @@ -189,7 +228,7 @@ func TestAccAWSIAMServerCertificate_file(t *testing.T) { func TestAccAWSIAMServerCertificate_Path(t *testing.T) { var cert iam.ServerCertificate - resourceName := "aws_iam_server_certificate.test_cert" + resourceName := "aws_iam_server_certificate.test" rName := acctest.RandomWithPrefix("tf-acc-test") key := tlsRsaPrivateKeyPem(2048) @@ -204,17 +243,15 @@ func TestAccAWSIAMServerCertificate_Path(t *testing.T) { Config: testAccIAMServerCertConfig_path(rName, "/test/", key, certificate), Check: resource.ComposeTestCheckFunc( testAccCheckCertExists(resourceName, &cert), - testAccCheckAWSServerCertAttributes(&cert, &certificate), resource.TestCheckResourceAttr(resourceName, "path", "/test/"), ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateId: rName, - ImportStateVerifyIgnore: []string{ - "private_key"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: rName, + ImportStateVerifyIgnore: []string{"private_key"}, }, }, }) @@ -246,19 +283,6 @@ func testAccCheckCertExists(n string, cert *iam.ServerCertificate) resource.Test } } -func testAccCheckAWSServerCertAttributes(cert *iam.ServerCertificate, certBody *string) resource.TestCheckFunc { - return func(s *terraform.State) error { - if !strings.Contains(*cert.ServerCertificateMetadata.ServerCertificateName, "tf-acc-test") { - return fmt.Errorf("Bad Server Cert Name: %s", *cert.ServerCertificateMetadata.ServerCertificateName) - } - - if *cert.CertificateBody != strings.TrimSpace(*certBody) { - return fmt.Errorf("Bad Server Cert body\n\t expected: %s\n\tgot: %s\n", *certBody, *cert.CertificateBody) - } - return nil - } -} - func testAccCheckIAMServerCertificateDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).iamconn @@ -287,7 +311,7 @@ func testAccCheckIAMServerCertificateDestroy(s *terraform.State) error { func testAccIAMServerCertConfig(rName, key, certificate string) string { return fmt.Sprintf(` -resource "aws_iam_server_certificate" "test_cert" { +resource "aws_iam_server_certificate" "test" { name = "%[1]s" certificate_body = "%[2]s" private_key = "%[3]s" @@ -297,7 +321,7 @@ resource "aws_iam_server_certificate" "test_cert" { func testAccIAMServerCertConfig_random(key, certificate string) string { return fmt.Sprintf(` -resource "aws_iam_server_certificate" "test_cert" { +resource "aws_iam_server_certificate" "test" { name_prefix = "tf-acc-test" certificate_body = "%[1]s" private_key = "%[2]s" @@ -307,7 +331,7 @@ resource "aws_iam_server_certificate" "test_cert" { func testAccIAMServerCertConfig_path(rName, path, key, certificate string) string { return fmt.Sprintf(` -resource "aws_iam_server_certificate" "test_cert" { +resource "aws_iam_server_certificate" "test" { name = "%[1]s" path = "%[2]s" certificate_body = "%[3]s" @@ -319,7 +343,7 @@ resource "aws_iam_server_certificate" "test_cert" { // iam-ssl-unix-line-endings func testAccIAMServerCertConfig_file(rInt int, fName string) string { return fmt.Sprintf(` -resource "aws_iam_server_certificate" "test_cert" { +resource "aws_iam_server_certificate" "test" { name = "terraform-test-cert-%d" certificate_body = file("%s") @@ -343,3 +367,32 @@ EOF } `, rInt, fName) } + +func testAccIAMServerCertConfigTags1(rName, key, certificate, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_server_certificate" "test" { + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" + + tags = { + %[4]q = %[5]q + } +} +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), tagKey1, tagValue1) +} + +func testAccIAMServerCertConfigTags2(rName, key, certificate, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_iam_server_certificate" "test" { + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" + + tags = { + %[4]q = %[5]q + %[6]q = %[7]q + } +} +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index e6ed655fcfa..5557e999210 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -117,6 +117,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The unique Server Certificate name * `name` - The name of the Server Certificate * `arn` - The Amazon Resource Name (ARN) specifying the server certificate. +* `tags` - Key-value mapping of tags for the server certificate. ## Import From 3f6f12b2dff15a389f2cf643950cb91ec8061bd7 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 09:54:20 +0200 Subject: [PATCH 0034/1252] fix update tags --- aws/resource_aws_iam_server_certificate.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_iam_server_certificate.go b/aws/resource_aws_iam_server_certificate.go index dd1df13ede0..ef979904e3c 100644 --- a/aws/resource_aws_iam_server_certificate.go +++ b/aws/resource_aws_iam_server_certificate.go @@ -177,8 +177,8 @@ func resourceAwsIAMServerCertificateUpdate(d *schema.ResourceData, meta interfac if d.HasChange("tags") { o, n := d.GetChange("tags") - if err := keyvaluetags.IamServerCertificateUpdateTags(conn, d.Id(), o, n); err != nil { - return fmt.Errorf("error updating tags for IAM Server Certificate (%s): %w", d.Id(), err) + if err := keyvaluetags.IamServerCertificateUpdateTags(conn, d.Get("name").(string), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM Server Certificate (%s): %w", d.Get("name").(string), err) } } From 0b8be00c37d087fa25c8c95e25fddf26aecd015d Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 10:00:42 +0200 Subject: [PATCH 0035/1252] changelog --- .changelog/17967.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17967.txt diff --git a/.changelog/17967.txt b/.changelog/17967.txt new file mode 100644 index 00000000000..6211bc97134 --- /dev/null +++ b/.changelog/17967.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_iam_server_certificate: Add tagging support +``` From 3c5e1bce9e9e51ce470b1f313fd7a47b6b817d80 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sat, 6 Mar 2021 10:02:06 +0200 Subject: [PATCH 0036/1252] changelog --- .changelog/17967.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.changelog/17967.txt b/.changelog/17967.txt index 6211bc97134..ff8a2683876 100644 --- a/.changelog/17967.txt +++ b/.changelog/17967.txt @@ -1,3 +1,7 @@ ```release-note:enhancement resource/aws_iam_server_certificate: Add tagging support ``` + +```release-note:enhancement +resource/aws_iam_server_certificate: Add `expiration` and `upload_date` attributes +``` From 195e806f7f7bf1950b6109cec3ba30600cdbbe39 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Sun, 7 Mar 2021 10:06:15 +0200 Subject: [PATCH 0037/1252] add docs --- website/docs/r/iam_server_certificate.html.markdown | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index 5557e999210..15bb31e7f24 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -118,7 +118,8 @@ In addition to all arguments above, the following attributes are exported: * `name` - The name of the Server Certificate * `arn` - The Amazon Resource Name (ARN) specifying the server certificate. * `tags` - Key-value mapping of tags for the server certificate. - +* `expiration` - The date on which the certificate is set to expire. +* `upload_date` - The date when the server certificate was uploaded. ## Import IAM Server Certificates can be imported using the `name`, e.g. From d7fad54a908a956e87ef6f1281af301575900531 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Sun, 7 Mar 2021 10:16:41 +0200 Subject: [PATCH 0038/1252] Update iam_server_certificate.html.markdown --- website/docs/r/iam_server_certificate.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index 15bb31e7f24..040f27e0d6c 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -120,6 +120,7 @@ In addition to all arguments above, the following attributes are exported: * `tags` - Key-value mapping of tags for the server certificate. * `expiration` - The date on which the certificate is set to expire. * `upload_date` - The date when the server certificate was uploaded. +* ## Import IAM Server Certificates can be imported using the `name`, e.g. From 3fb2f9ef131cd2ad21bdd7b74abebccf26704d52 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Sun, 7 Mar 2021 10:16:55 +0200 Subject: [PATCH 0039/1252] Update iam_server_certificate.html.markdown --- website/docs/r/iam_server_certificate.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index 040f27e0d6c..2b08f4c3d5d 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -120,7 +120,7 @@ In addition to all arguments above, the following attributes are exported: * `tags` - Key-value mapping of tags for the server certificate. * `expiration` - The date on which the certificate is set to expire. * `upload_date` - The date when the server certificate was uploaded. -* + ## Import IAM Server Certificates can be imported using the `name`, e.g. From e148f45c8c6e61256ed616b6f559021e34b47359 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Mon, 8 Mar 2021 08:52:01 +0900 Subject: [PATCH 0040/1252] aws_ec2_traffic_mirror_target: Correct arn --- aws/resource_aws_ec2_traffic_mirror_target.go | 12 +++++++++--- aws/resource_aws_ec2_traffic_mirror_target_test.go | 1 + .../docs/r/ec2_traffic_mirror_target.html.markdown | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_ec2_traffic_mirror_target.go b/aws/resource_aws_ec2_traffic_mirror_target.go index b712d361838..023500b832d 100644 --- a/aws/resource_aws_ec2_traffic_mirror_target.go +++ b/aws/resource_aws_ec2_traffic_mirror_target.go @@ -21,6 +21,10 @@ func resourceAwsEc2TrafficMirrorTarget() *schema.Resource { State: schema.ImportStatePassthrough, }, Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -45,11 +49,11 @@ func resourceAwsEc2TrafficMirrorTarget() *schema.Resource { }, ValidateFunc: validateArn, }, - "tags": tagsSchema(), - "arn": { + "owner_id": { Type: schema.TypeString, Computed: true, }, + "tags": tagsSchema(), }, } } @@ -133,11 +137,13 @@ func resourceAwsEc2TrafficMirrorTargetRead(d *schema.ResourceData, meta interfac return fmt.Errorf("error setting tags: %s", err) } + d.Set("owner_id", target.OwnerId) + arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(target.OwnerId), Resource: fmt.Sprintf("traffic-mirror-target/%s", d.Id()), }.String() diff --git a/aws/resource_aws_ec2_traffic_mirror_target_test.go b/aws/resource_aws_ec2_traffic_mirror_target_test.go index 6c39895493d..385dbec107d 100644 --- a/aws/resource_aws_ec2_traffic_mirror_target_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_target_test.go @@ -30,6 +30,7 @@ func TestAccAWSEc2TrafficMirrorTarget_nlb(t *testing.T) { Config: testAccTrafficMirrorTargetConfigNlb(rName, description), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEc2TrafficMirrorTargetExists(resourceName, &v), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`traffic-mirror-target/tmt-.+`)), resource.TestCheckResourceAttr(resourceName, "description", description), resource.TestCheckResourceAttrPair(resourceName, "network_load_balancer_arn", "aws_lb.lb", "arn"), diff --git a/website/docs/r/ec2_traffic_mirror_target.html.markdown b/website/docs/r/ec2_traffic_mirror_target.html.markdown index cc185772723..26bd67d350b 100644 --- a/website/docs/r/ec2_traffic_mirror_target.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_target.html.markdown @@ -44,6 +44,7 @@ In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Traffic Mirror target. * `arn` - The ARN of the traffic mirror target. +* `owner_id` - The ID of the AWS account that owns the traffic mirror target. ## Import From 7d85dac8d695a591a03ad3f76bced98067a36508 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Mon, 8 Mar 2021 00:20:34 -0500 Subject: [PATCH 0041/1252] poc resource-level default tags support; vpc and subnet resources --- .changelog/17974.txt | 11 + aws/config.go | 9 +- aws/internal/keyvaluetags/key_value_tags.go | 76 +++ .../keyvaluetags/key_value_tags_test.go | 502 ++++++++++++++++++ aws/provider.go | 32 ++ aws/provider_test.go | 335 +++++++++--- aws/resource_aws_subnet.go | 22 +- aws/resource_aws_subnet_test.go | 285 ++++++++++ aws/resource_aws_vpc.go | 27 +- aws/resource_aws_vpc_test.go | 280 ++++++++++ aws/tags.go | 41 ++ website/docs/index.html.markdown | 141 +++++ website/docs/r/subnet.html.markdown | 3 +- website/docs/r/vpc.html.markdown | 4 +- 14 files changed, 1672 insertions(+), 96 deletions(-) create mode 100644 .changelog/17974.txt diff --git a/.changelog/17974.txt b/.changelog/17974.txt new file mode 100644 index 00000000000..81d093c7a31 --- /dev/null +++ b/.changelog/17974.txt @@ -0,0 +1,11 @@ +```release-note:note +provider: New `default_tags` argument as a public preview for applying tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. +``` + +```release-note:enhancement +aws_subnet: Support provider-wide default tags (in public preview, see note above) +``` + +```release-note:enhancement +aws_vpc: Support provider-wide default tags (in public preview, see note above) +``` diff --git a/aws/config.go b/aws/config.go index 0493b8d71a0..fae75f76583 100644 --- a/aws/config.go +++ b/aws/config.go @@ -191,9 +191,10 @@ type Config struct { AllowedAccountIds []string ForbiddenAccountIds []string - Endpoints map[string]string - IgnoreTagsConfig *keyvaluetags.IgnoreConfig - Insecure bool + DefaultTagsConfig *keyvaluetags.DefaultConfig + Endpoints map[string]string + IgnoreTagsConfig *keyvaluetags.IgnoreConfig + Insecure bool SkipCredsValidation bool SkipGetEC2Platforms bool @@ -249,6 +250,7 @@ type AWSClient struct { datapipelineconn *datapipeline.DataPipeline datasyncconn *datasync.DataSync daxconn *dax.DAX + DefaultTagsConfig *keyvaluetags.DefaultConfig devicefarmconn *devicefarm.DeviceFarm dlmconn *dlm.DLM dmsconn *databasemigrationservice.DatabaseMigrationService @@ -492,6 +494,7 @@ func (c *Config) Client() (interface{}, error) { datapipelineconn: datapipeline.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["datapipeline"])})), datasyncconn: datasync.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["datasync"])})), daxconn: dax.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["dax"])})), + DefaultTagsConfig: c.DefaultTagsConfig, devicefarmconn: devicefarm.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["devicefarm"])})), dlmconn: dlm.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["dlm"])})), dmsconn: databasemigrationservice.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["dms"])})), diff --git a/aws/internal/keyvaluetags/key_value_tags.go b/aws/internal/keyvaluetags/key_value_tags.go index f9af201a7c0..eb69d119a61 100644 --- a/aws/internal/keyvaluetags/key_value_tags.go +++ b/aws/internal/keyvaluetags/key_value_tags.go @@ -25,6 +25,11 @@ const ( ServerlessApplicationRepositoryTagKeyPrefix = `serverlessrepo:` ) +// DefaultConfig contains tags to default across all resources. +type DefaultConfig struct { + Tags KeyValueTags +} + // IgnoreConfig contains various options for removing resource tags. type IgnoreConfig struct { Keys KeyValueTags @@ -50,6 +55,32 @@ func (tags KeyValueTags) IgnoreAws() KeyValueTags { return result } +// Merge calls keyvaluetags.Merge() on the given DefaultConfig.Tags, if any, +// with KeyValueTags provided as an argument, overriding the value +// of any tag with a matching key. +func (config *DefaultConfig) Merge(tags KeyValueTags) KeyValueTags { + if len(config.Tags) == 0 { + return tags + } + + return config.Tags.Merge(tags) +} + +// TagsEqual returns true if the given configuration's Tags +// are equal to those passed in as an argument; +// otherwise returns false +func (config *DefaultConfig) TagsEqual(tags KeyValueTags) bool { + if len(config.Tags) == 0 { + return len(tags) == 0 + } + + if len(tags) == 0 { + return false + } + + return config.Tags.ContainsAll(tags) +} + // IgnoreConfig returns any tags not removed by a given configuration. func (tags KeyValueTags) IgnoreConfig(config *IgnoreConfig) KeyValueTags { if config == nil { @@ -401,6 +432,27 @@ func (tags KeyValueTags) Hash() int { return hash } +// RemoveDefaultConfig returns tags not present in a DefaultConfig object +// in addition to tags with key/value pairs that override those in a DefaultConfig; +// however, if all tags present in the DefaultConfig object are equivalent to those +// in the given KeyValueTags, then the KeyValueTags are returned, effectively +// bypassing the need to remove differing tags. +func (tags KeyValueTags) RemoveDefaultConfig(config *DefaultConfig) KeyValueTags { + if config == nil || len(config.Tags) == 0 { + return tags + } + + result := make(KeyValueTags) + + for k, v := range tags { + if defaultVal, ok := config.Tags[k]; !ok || !v.Equal(defaultVal) { + result[k] = v + } + } + + return result +} + // String returns the default string representation of the KeyValueTags. func (tags KeyValueTags) String() string { var builder strings.Builder @@ -435,6 +487,30 @@ func (tags KeyValueTags) UrlEncode() string { return values.Encode() } +// MergeConfigTags creates KeyValueTags by merging KeyValueTags nested in +// a configuration object with those represented as a map[string]interface{}. +// Currently only supports the DefaultConfig type when passed to the interface{} argument. +func MergeConfigTags(config interface{}, tags map[string]interface{}) KeyValueTags { + kvTags := New(tags) + + if config == nil { + return kvTags + } + + var result KeyValueTags + + switch t := config.(type) { + case *DefaultConfig: + if t == nil || len(t.Tags) == 0 { + result = kvTags + } else { + result = t.Merge(kvTags) + } + } + + return result +} + // New creates KeyValueTags from common Terraform Provider SDK types. // Supports map[string]string, map[string]*string, map[string]interface{}, and []interface{}. // When passed []interface{}, all elements are treated as keys and assigned nil values. diff --git a/aws/internal/keyvaluetags/key_value_tags_test.go b/aws/internal/keyvaluetags/key_value_tags_test.go index 08a9376a2bc..289df0a9151 100644 --- a/aws/internal/keyvaluetags/key_value_tags_test.go +++ b/aws/internal/keyvaluetags/key_value_tags_test.go @@ -4,6 +4,239 @@ import ( "testing" ) +func TestKeyValueTagsDefaultConfigMerge(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + defaultConfig *DefaultConfig + want map[string]string + }{ + { + name: "empty config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{}, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: nil, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no tags", + tags: New(map[string]string{}), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys all matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys some matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys some overridden", + tags: New(map[string]string{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys none matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key4": "value4", + "key5": "value5", + "key6": "value6", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + "key5": "value5", + "key6": "value6", + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + var got KeyValueTags + if testCase.defaultConfig != nil { + got = testCase.defaultConfig.Merge(testCase.tags) + } else { + got = testCase.tags + } + + testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) + }) + } +} + +func TestKeyValueTagsDefaultConfigTagsEqual(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + defaultConfig *DefaultConfig + want bool + }{ + { + name: "empty config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{}, + want: false, + }, + { + name: "no config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: nil, + want: false, + }, + { + name: "no tags", + tags: New(map[string]string{}), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: false, + }, + { + name: "keys and values all matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: true, + }, + { + name: "only keys matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value0", + "key2": "value1", + "key3": "value2", + }), + }, + want: false, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + var got bool + if testCase.defaultConfig != nil { + got = testCase.defaultConfig.TagsEqual(testCase.tags) + } + + if got != testCase.want { + t.Errorf("got %t; want %t", got, testCase.want) + } + }) + } +} + func TestKeyValueTagsIgnoreAws(t *testing.T) { testCases := []struct { name string @@ -1578,6 +1811,135 @@ func TestKeyValueTagsHash(t *testing.T) { } } +func TestKeyValueTagsRemoveDefaultConfig(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + defaultConfig *DefaultConfig + want map[string]string + }{ + { + name: "empty config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{}, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no config", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: nil, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no tags", + tags: New(map[string]string{}), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{}, + }, + { + name: "keys all matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{}, + }, + { + name: "keys some matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys some overridden", + tags: New(map[string]string{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys none matching", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key4": "value4", + "key5": "value5", + "key6": "value6", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.RemoveDefaultConfig(testCase.defaultConfig) + + testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) + }) + } +} + func TestKeyValueTagsUrlEncode(t *testing.T) { testCases := []struct { name string @@ -1634,6 +1996,146 @@ func TestKeyValueTagsUrlEncode(t *testing.T) { } } +func TestMergeConfigTags(t *testing.T) { + testCases := []struct { + name string + tags map[string]interface{} + defaultConfig *DefaultConfig + want map[string]string + }{ + { + name: "empty config", + tags: map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: &DefaultConfig{}, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no config", + tags: map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: nil, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "no tags", + tags: map[string]interface{}{}, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys all matching", + tags: map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys some matching", + tags: map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys some overridden", + tags: map[string]interface{}{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + }), + }, + want: map[string]string{ + "key1": "value2", + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "keys none matching", + tags: map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key4": "value4", + "key5": "value5", + "key6": "value6", + }), + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + "key5": "value5", + "key6": "value6", + }, + }, + } + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := MergeConfigTags(testCase.defaultConfig, testCase.tags) + + testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) + }) + } +} + func TestTagDataEqual(t *testing.T) { testCases := []struct { name string diff --git a/aws/provider.go b/aws/provider.go index 5de81c4636c..3010d126756 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -89,6 +89,23 @@ func Provider() *schema.Provider { Set: schema.HashString, }, + "default_tags": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Description: "Configuration block with settings to default resource tags across all resources.", + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "tags": { + Type: schema.TypeMap, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Description: "Resource tags to default across all resources", + }, + }, + }, + }, + "endpoints": endpointsSchema(), "ignore_tags": { @@ -1337,6 +1354,7 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa Token: d.Get("token").(string), Region: d.Get("region").(string), CredsFilename: d.Get("shared_credentials_file").(string), + DefaultTagsConfig: expandProviderDefaultTags(d.Get("default_tags").([]interface{})), Endpoints: make(map[string]string), MaxRetries: d.Get("max_retries").(int), IgnoreTagsConfig: expandProviderIgnoreTags(d.Get("ignore_tags").([]interface{})), @@ -1522,6 +1540,20 @@ func endpointsSchema() *schema.Schema { } } +func expandProviderDefaultTags(l []interface{}) *keyvaluetags.DefaultConfig { + if len(l) == 0 || l[0] == nil { + return nil + } + + defaultConfig := &keyvaluetags.DefaultConfig{} + m := l[0].(map[string]interface{}) + + if v, ok := m["tags"].(map[string]interface{}); ok { + defaultConfig.Tags = keyvaluetags.New(v) + } + return defaultConfig +} + func expandProviderIgnoreTags(l []interface{}) *keyvaluetags.IgnoreConfig { if len(l) == 0 || l[0] == nil { return nil diff --git a/aws/provider_test.go b/aws/provider_test.go index 70af59809db..d579883dd66 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1269,6 +1269,81 @@ func TestAccAWSProvider_IgnoreTags_Keys_Multiple(t *testing.T) { }) } +func TestAccProvider_DefaultTags_EmptyConfigurationBlock(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccProviderConfigDefaultTagsEmptyConfigurationBlock(), + Check: resource.ComposeTestCheckFunc( + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + ), + }, + }, + }) +} + +func TestAccProvider_DefaultTags_Tags_None(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccProviderConfigDefaultTags_Tags0(), + Check: resource.ComposeTestCheckFunc( + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + ), + }, + }, + }) +} + +func TestAccProvider_DefaultTags_Tags_One(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccProviderConfigDefaultTags_Tags1("test", "value"), + Check: resource.ComposeTestCheckFunc( + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{"test": "value"}), + ), + }, + }, + }) +} + +func TestAccProvider_DefaultTags_Tags_Multiple(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccProviderConfigDefaultTags_Tags2("test1", "value1", "test2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{ + "test1": "value1", + "test2": "value2", + }), + ), + }, + }, + }) +} + func TestAccAWSProvider_Region_AwsC2S(t *testing.T) { var providers []*schema.Provider @@ -1613,6 +1688,69 @@ func testAccCheckAWSProviderIgnoreTagsKeys(providers *[]*schema.Provider, expect } } +func testAccCheckProviderDefaultTags_Tags(providers *[]*schema.Provider, expectedTags map[string]string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if providers == nil { + return fmt.Errorf("no providers initialized") + } + + for _, provider := range *providers { + if provider == nil || provider.Meta() == nil || provider.Meta().(*AWSClient) == nil { + continue + } + + providerClient := provider.Meta().(*AWSClient) + defaultTagsConfig := providerClient.DefaultTagsConfig + + if defaultTagsConfig == nil || len(defaultTagsConfig.Tags) == 0 { + if len(expectedTags) != 0 { + return fmt.Errorf("expected keys (%d) length, got: 0", len(expectedTags)) + } + + continue + } + + actualTags := defaultTagsConfig.Tags + + if len(actualTags) != len(expectedTags) { + return fmt.Errorf("expected tags (%d) length, got: %d", len(expectedTags), len(actualTags)) + } + + for _, expectedElement := range expectedTags { + var found bool + + for _, actualElement := range actualTags { + if *actualElement.Value == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("expected tags element, but was missing: %s", expectedElement) + } + } + + for _, actualElement := range actualTags { + var found bool + + for _, expectedElement := range expectedTags { + if *actualElement.Value == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("unexpected tags element: %s", actualElement) + } + } + } + + return nil + } +} + func testAccCheckAWSProviderPartition(providers *[]*schema.Provider, expectedPartition string) resource.TestCheckFunc { return func(s *terraform.State) error { if providers == nil { @@ -1711,7 +1849,9 @@ func testAccDefaultSubnetCount(t *testing.T) int { func testAccAWSProviderConfigEndpoints(endpoints string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { skip_credentials_validation = true skip_get_ec2_platforms = true @@ -1722,19 +1862,14 @@ provider "aws" { %[1]s } } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, endpoints) +`, endpoints)) } func testAccAWSProviderConfigIgnoreTagsEmptyConfigurationBlock() string { //lintignore:AT004 - return ` + return composeConfig( + testAccProviderConfigBase, + ` provider "aws" { ignore_tags {} @@ -1743,38 +1878,28 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -` +`) } func testAccAWSProviderConfigIgnoreTagsKeyPrefixes0() string { //lintignore:AT004 - return ` + return composeConfig( + testAccProviderConfigBase, + ` provider "aws" { skip_credentials_validation = true skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -` +`) } func testAccAWSProviderConfigIgnoreTagsKeyPrefixes1(tagPrefix1 string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { ignore_tags { key_prefixes = [%[1]q] @@ -1785,19 +1910,14 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, tagPrefix1) +`, tagPrefix1)) } func testAccAWSProviderConfigIgnoreTagsKeyPrefixes2(tagPrefix1, tagPrefix2 string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { ignore_tags { key_prefixes = [%[1]q, %[2]q] @@ -1808,38 +1928,28 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, tagPrefix1, tagPrefix2) +`, tagPrefix1, tagPrefix2)) } func testAccAWSProviderConfigIgnoreTagsKeys0() string { //lintignore:AT004 - return ` + return composeConfig( + testAccProviderConfigBase, + ` provider "aws" { skip_credentials_validation = true skip_get_ec2_platforms = true skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -` +`) } func testAccAWSProviderConfigIgnoreTagsKeys1(tag1 string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { ignore_tags { keys = [%[1]q] @@ -1850,19 +1960,14 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, tag1) +`, tag1)) } func testAccAWSProviderConfigIgnoreTagsKeys2(tag1, tag2 string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { ignore_tags { keys = [%[1]q, %[2]q] @@ -1873,19 +1978,14 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, tag1, tag2) +`, tag1, tag2)) } func testAccAWSProviderConfigRegion(region string) string { //lintignore:AT004 - return fmt.Sprintf(` + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` provider "aws" { region = %[1]q skip_credentials_validation = true @@ -1893,14 +1993,7 @@ provider "aws" { skip_metadata_api_check = true skip_requesting_account_id = true } - -data "aws_partition" "provider_test" {} - -# Required to initialize the provider -data "aws_arn" "test" { - arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" -} -`, region) +`, region)) } func testAccAssumeRoleARNPreCheck(t *testing.T) { @@ -1928,6 +2021,86 @@ provider "aws" { data "aws_caller_identity" "current" {} ` //lintignore:AT004 +const testAccProviderConfigBase = ` +data "aws_partition" "provider_test" {} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:${data.aws_partition.provider_test.partition}:s3:::test" +} +` + +func testAccProviderConfigDefaultTagsEmptyConfigurationBlock() string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + ` +provider "aws" { + default_tags {} + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`) +} + +func testAccProviderConfigDefaultTags_Tags0() string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + ` +provider "aws" { + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`) +} + +func testAccProviderConfigDefaultTags_Tags1(tag1, value1 string) string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %q = %q + } + } + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`, tag1, value1)) +} + +func testAccProviderConfigDefaultTags_Tags2(tag1, value1, tag2, value2 string) string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %q = %q + %q = %q + } + } + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`, tag1, value1, tag2, value2)) +} + func testCheckResourceAttrIsSortedCsv(resourceName, attributeName string) resource.TestCheckFunc { return func(s *terraform.State) error { is, err := primaryInstanceState(s, resourceName) diff --git a/aws/resource_aws_subnet.go b/aws/resource_aws_subnet.go index d93e6ee1257..352d29bbf46 100644 --- a/aws/resource_aws_subnet.go +++ b/aws/resource_aws_subnet.go @@ -24,6 +24,8 @@ func resourceAwsSubnet() *schema.Resource { State: schema.ImportStatePassthrough, }, + CustomizeDiff: SetTagsDiff, + Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(10 * time.Minute), Delete: schema.DefaultTimeout(20 * time.Minute), @@ -111,6 +113,8 @@ func resourceAwsSubnet() *schema.Resource { "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), + "owner_id": { Type: schema.TypeString, Computed: true, @@ -121,13 +125,15 @@ func resourceAwsSubnet() *schema.Resource { func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := keyvaluetags.MergeConfigTags(defaultTagsConfig, d.Get("tags").(map[string]interface{})) createOpts := &ec2.CreateSubnetInput{ AvailabilityZone: aws.String(d.Get("availability_zone").(string)), AvailabilityZoneId: aws.String(d.Get("availability_zone_id").(string)), CidrBlock: aws.String(d.Get("cidr_block").(string)), VpcId: aws.String(d.Get("vpc_id").(string)), - TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeSubnet), + TagSpecifications: ec2TagSpecificationsFromKeyValueTags(tags, ec2.ResourceTypeSubnet), } if v, ok := d.GetOk("ipv6_cidr_block"); ok { @@ -223,6 +229,7 @@ func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{ @@ -267,10 +274,17 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { d.Set("arn", subnet.SubnetArn) - if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + tags := keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) } + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %w", err) + } + d.Set("owner_id", subnet.OwnerId) return nil @@ -279,8 +293,8 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating EC2 Subnet (%s) tags: %w", d.Id(), err) diff --git a/aws/resource_aws_subnet_test.go b/aws/resource_aws_subnet_test.go index fed7b085741..9d230c9ef84 100644 --- a/aws/resource_aws_subnet_test.go +++ b/aws/resource_aws_subnet_test.go @@ -203,6 +203,291 @@ func TestAccAWSSubnet_tags(t *testing.T) { }) } +func TestAccAWSSubnet_defaultTags_providerOnly(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccSubnetConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), + testAccSubnetConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "value1"), + testAccSubnetConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "value1"), + ), + }, + }, + }) +} + +func TestAccAWSSubnet_defaultTags_updateToProviderOnly(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSubnetTagsConfig1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccSubnetConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSSubnet_defaultTags_updateToResourceOnly(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccSubnetConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + Config: testAccSubnetTagsConfig1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccSubnetTagsConfig1(rName, "resourcekey1", "resourcevalue1"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccSubnetTagsConfig2(rName, "resourcekey1", "resourcevalue1", "resourcekey2", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey2", "resourcevalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), + testAccSubnetTagsConfig1(rName, "resourcekey3", "resourcevalue3"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey3", "resourcevalue3"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey3", "resourcevalue3"), + ), + }, + }, + }) +} + +func TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccSubnetTagsConfig1(rName, "overlapkey1", "resourcevalue1"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), + testAccSubnetTagsConfig2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey2", "resourcevalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccSubnetTagsConfig1(rName, "overlapkey1", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue2"), + ), + }, + }, + }) +} + +func TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag(t *testing.T) { + var providers []*schema.Provider + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), + testAccSubnetTagsConfig1(rName, "overlapkey", "overlapvalue"), + ), + PlanOnly: true, + ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), + }, + }, + }) +} + func TestAccAWSSubnet_ignoreTags(t *testing.T) { var providers []*schema.Provider var subnet ec2.Subnet diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index b84b1bd87d7..0540da54cc2 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" + "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" @@ -28,7 +29,11 @@ func resourceAwsVpc() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceAwsVpcInstanceImport, }, - CustomizeDiff: resourceAwsVpcCustomizeDiff, + + CustomizeDiff: customdiff.All( + resourceAwsVpcCustomizeDiff, + SetTagsDiff, + ), SchemaVersion: 1, MigrateState: resourceAwsVpcMigrateState, @@ -120,6 +125,8 @@ func resourceAwsVpc() *schema.Resource { "tags": tagsSchema(), + "tags_all": tagsSchemaComputed(), + "owner_id": { Type: schema.TypeString, Computed: true, @@ -130,13 +137,15 @@ func resourceAwsVpc() *schema.Resource { func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + tags := keyvaluetags.MergeConfigTags(defaultTagsConfig, d.Get("tags").(map[string]interface{})) // Create the VPC createOpts := &ec2.CreateVpcInput{ CidrBlock: aws.String(d.Get("cidr_block").(string)), InstanceTenancy: aws.String(d.Get("instance_tenancy").(string)), AmazonProvidedIpv6CidrBlock: aws.Bool(d.Get("assign_generated_ipv6_cidr_block").(bool)), - TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeVpc), + TagSpecifications: ec2TagSpecificationsFromKeyValueTags(tags, ec2.ResourceTypeVpc), } log.Printf("[DEBUG] VPC create config: %#v", *createOpts) @@ -238,6 +247,7 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig // Refresh the VPC state @@ -267,10 +277,17 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { }.String() d.Set("arn", arn) - if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpc.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + tags := keyvaluetags.Ec2KeyValueTags(vpc.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig) + + //lintignore:AWSR002 + if err := d.Set("tags", tags.RemoveDefaultConfig(defaultTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } + if err := d.Set("tags_all", tags.Map()); err != nil { + return fmt.Errorf("error setting tags_all: %s", err) + } + d.Set("owner_id", vpc.OwnerId) // Make sure those values are set, if an IPv6 block exists it'll be set in the loop @@ -513,8 +530,8 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { } } - if d.HasChange("tags") { - o, n := d.GetChange("tags") + if d.HasChange("tags_all") { + o, n := d.GetChange("tags_all") if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating tags: %s", err) diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index d02d3480ff0..463bd4f4d00 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -159,6 +159,286 @@ func TestAccAWSVpc_disappears(t *testing.T) { }) } +func TestAccAWSVpc_defaultTags_providerOnly(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccVpcConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), + testAccVpcConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "value1"), + testAccVpcConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "value1"), + ), + }, + }, + }) +} + +func TestAccAWSVpc_defaultTags_updateToProviderOnly(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSVPCConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccVpcConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSVpc_defaultTags_updateToResourceOnly(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccVpcConfig, + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + Config: testAccAWSVPCConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSVPCConfigTags1("resourcekey1", "resourcevalue1"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSVPCConfigTags2("resourcekey1", "resourcevalue1", "resourcekey2", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey1", "providervalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey2", "resourcevalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), + testAccAWSVPCConfigTags1("resourcekey3", "resourcevalue3"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.resourcekey3", "resourcevalue3"), + resource.TestCheckResourceAttr(resourceName, "tags_all.providerkey2", "providervalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.resourcekey3", "resourcevalue3"), + ), + }, + }, + }) +} + +func TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSVPCConfigTags1("overlapkey1", "resourcevalue1"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), + testAccAWSVPCConfigTags2("overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey2", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey2", "resourcevalue2"), + ), + }, + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSVPCConfigTags1("overlapkey1", "resourcevalue2"), + ), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags_all.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.overlapkey1", "resourcevalue2"), + resource.TestCheckResourceAttr(resourceName, "tags_all.overlapkey1", "resourcevalue2"), + ), + }, + }, + }) +} + +func TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: composeConfig( + testAccProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), + testAccAWSVPCConfigTags1("overlapkey", "overlapvalue"), + ), + PlanOnly: true, + ExpectError: regexp.MustCompile(`"tags" are identical to those in the "default_tags" configuration block`), + }, + }, + }) +} + func TestAccAWSVpc_ignoreTags(t *testing.T) { var providers []*schema.Provider var vpc ec2.Vpc diff --git a/aws/tags.go b/aws/tags.go index cf9ed21dfe9..02e491677f1 100644 --- a/aws/tags.go +++ b/aws/tags.go @@ -1,6 +1,9 @@ package aws import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -75,3 +78,41 @@ func ec2TagSpecificationsFromMap(m map[string]interface{}, t string) []*ec2.TagS }, } } + +// ec2TagSpecificationsFromKeyValueTags returns the tag specifications for the given KeyValueTags object and resource type. +func ec2TagSpecificationsFromKeyValueTags(tags keyvaluetags.KeyValueTags, t string) []*ec2.TagSpecification { + if len(tags) == 0 { + return nil + } + + return []*ec2.TagSpecification{ + { + ResourceType: aws.String(t), + Tags: tags.IgnoreAws().Ec2Tags(), + }, + } +} + +// SetTagsDiff sets the new plan difference with the result of +// merging resource tags on to those defined at the provider-level; +// returns an error if unsuccessful or if the resource tags are identical +// to those configured at the provider-level to avoid non-empty plans +// after resource READ operations as resource and provider-level tags +// will be indistinguishable when returned from an AWS API. +func SetTagsDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) error { + defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + + resourceTags := diff.Get("tags").(map[string]interface{}) + + if defaultTagsConfig != nil && defaultTagsConfig.TagsEqual(keyvaluetags.New(resourceTags)) { + return fmt.Errorf(`"tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again`) + } + + allTags := keyvaluetags.MergeConfigTags(defaultTagsConfig, resourceTags) + + if err := diff.SetNew("tags_all", allTags.Map()); err != nil { + return fmt.Errorf("error setting new tags_all diff: %w", err) + } + + return nil +} diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index ee1f9fed757..1856f83889b 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -215,6 +215,14 @@ for more information about connecting to alternate AWS endpoints or AWS compatib AWS account IDs to prevent you from mistakenly using the wrong one (and potentially end up destroying a live environment). Conflicts with `allowed_account_ids`. + +* `default_tags` - (Optional) **NOTE: This functionality is in public preview and there are no compatibility promises with future versions of the Terraform AWS Provider until a general availability announcement.** +Map of tags to apply across all resources handled by this provider (see the [Terraform multiple provider instances documentation](/docs/configuration/providers.html#alias-multiple-provider-instances) for more information about additional provider configurations). +This is designed to replace redundant per-resource `tags` configurations. At this time, tags defined within this configuration block can be overridden with new values, but not ignored with the `ignore_changes` argument of a [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html). To override tag values defined within this configuration block, use the `tags` argument within a resource to configure new tag values for matching keys. +See the [`default_tags`](#default_tags-configuration-block) Configuration Block section below for example usage and available arguments. +This functionality is only supported in the following resources: + - `aws_subnet` + - `aws_vpc` * `ignore_tags` - (Optional) Configuration block with resource tag settings to ignore across all resources handled by this provider (except any individual service tag resources such as `aws_ec2_tag`) for situations where external systems are managing certain resource tags. Arguments to the configuration block are described below in the `ignore_tags` Configuration Block section. See the [Terraform multiple provider instances documentation](https://www.terraform.io/docs/configuration/providers.html#alias-multiple-provider-configurations) for more information about additional provider configurations. @@ -382,6 +390,139 @@ The `assume_role` configuration block supports the following optional arguments: * `tags` - (Optional) Map of assume role session tags. * `transitive_tag_keys` - (Optional) Set of assume role session tag keys to pass to any subsequent sessions. +### default_tags Configuration Block + +Example: Resource with provider default tags + +```hcl +provider "aws" { + default_tags { + tags = { + Environment = "Test" + Name = "Provider Tag" + } + } +} + +resource "aws_vpc" "example" { + # ..other configuration... +} + +output "vpc_resource_level_tags" { + value = aws_vpc.example.tags +} + +output "vpc_all_tags" { + value = aws_vpc.example.tags_all +} +``` + +Outputs: + +```console +$ terraform apply +... +Outputs: + +vpc_all_tags = tomap({ + "Environment" = "Test" + "Name" = "Provider Tag" +}) +``` + +Example: Resource with tags and provider default tags + +```hcl +provider "aws" { + default_tags { + tags = { + Environment = "Test" + Name = "Provider Tag" + } + } +} + +resource "aws_vpc" "example" { + # ..other configuration... + tags = { + Owner = "example" + } +} + +output "vpc_resource_level_tags" { + value = aws_vpc.example.tags +} + +output "vpc_all_tags" { + value = aws_vpc.example.tags_all +} +``` + +Outputs: + +```console +$ terraform apply +... +Outputs: + +vpc_all_tags = tomap({ + "Environment" = "Test" + "Name" = "Provider Tag" + "Owner" = "example" +}) +vpc_resource_level_tags = tomap({ + "Owner" = "example" +}) +``` + +Example: Resource overriding provider default tags + +```hcl +provider "aws" { + default_tags { + tags = { + Environment = "Test" + Name = "Provider Tag" + } + } +} + +resource "aws_vpc" "example" { + # ..other configuration... + tags = { + Environment = "Production" + } +} + +output "vpc_resource_level_tags" { + value = aws_vpc.example.tags +} + +output "vpc_all_tags" { + value = aws_vpc.example.tags_all +} +``` + +Outputs: + +```console +$ terraform apply +... +Outputs: + +vpc_all_tags = tomap({ + "Environment" = "Production" + "Name" = "Provider Tag" +}) +vpc_resource_level_tags = tomap({ + "Environment" = "Production" +}) +``` + +The `default_tags` configuration block supports the following argument: + +* `tags` - (Optional) **NOTE: This functionality is in public preview and only supported by the [`aws_subnet`](/docs/providers/aws/r/subnet.html) and [`aws_vpc`](/docs/providers/aws/r/vpc.html) resources.** Key-value map of tags to apply to all resources. + ### ignore_tags Configuration Block Example: diff --git a/website/docs/r/subnet.html.markdown b/website/docs/r/subnet.html.markdown index 3c1d0e9b213..2d62279911e 100644 --- a/website/docs/r/subnet.html.markdown +++ b/website/docs/r/subnet.html.markdown @@ -63,7 +63,7 @@ The following arguments are supported: that network interfaces created in the specified subnet should be assigned an IPv6 address. Default is `false` * `vpc_id` - (Required) The VPC ID. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -73,6 +73,7 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN of the subnet. * `ipv6_cidr_block_association_id` - The association ID for the IPv6 CIDR block. * `owner_id` - The ID of the AWS account that owns the subnet. +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block). ## Timeouts diff --git a/website/docs/r/vpc.html.markdown b/website/docs/r/vpc.html.markdown index 53f9f6dba53..5b4b7c3feb4 100644 --- a/website/docs/r/vpc.html.markdown +++ b/website/docs/r/vpc.html.markdown @@ -50,7 +50,7 @@ The following arguments are supported: * `assign_generated_ipv6_cidr_block` - (Optional) Requests an Amazon-provided IPv6 CIDR block with a /56 prefix length for the VPC. You cannot specify the range of IP addresses, or the size of the CIDR block. Default is `false`. -* `tags` - (Optional) A map of tags to assign to the resource. +* `tags` - (Optional) A map of tags to assign to the resource. If configured with a provider [`default_tags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block) present, tags with matching keys will overwrite those defined at the provider-level. ## Attributes Reference @@ -72,7 +72,7 @@ In addition to all arguments above, the following attributes are exported: * `ipv6_association_id` - The association ID for the IPv6 CIDR block. * `ipv6_cidr_block` - The IPv6 CIDR block. * `owner_id` - The ID of the AWS account that owns the VPC. - +* `tags_all` - A map of tags assigned to the resource, including those inherited from the provider [`default_tags` configuration block](https://www.terraform.io/docs/providers/aws/index.html#default_tags-configuration-block). [1]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html From 0376cae394a95accdbdd48b7f743b2ebbabbdef8 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 9 Mar 2021 19:59:51 -0500 Subject: [PATCH 0042/1252] docs/resource/aws_storagegateway_stored_iscsi_volume: Fix incorrect resource type in import section Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 --- website/docs/r/storagegateway_stored_iscsi_volume.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown b/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown index 4d7bd72e1c2..abd14313a63 100644 --- a/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown +++ b/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown @@ -75,5 +75,5 @@ In addition to all arguments above, the following attributes are exported: `aws_storagegateway_stored_iscsi_volume` can be imported by using the volume Amazon Resource Name (ARN), e.g. ``` -$ terraform import aws_storagegateway_cache.example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678 +$ terraform import aws_storagegateway_stored_iscsi_volume.example arn:aws:storagegateway:us-east-1:123456789012:gateway/sgw-12345678/volume/vol-12345678 ``` From 058994eaaf2cb15bc01b153e774864e60d7a26ab Mon Sep 17 00:00:00 2001 From: Pradeep Bhadani Date: Wed, 10 Mar 2021 14:53:10 +0000 Subject: [PATCH 0043/1252] update aws_cloudwatch_metric_alarm doc --- website/docs/r/cloudwatch_metric_alarm.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/cloudwatch_metric_alarm.html.markdown b/website/docs/r/cloudwatch_metric_alarm.html.markdown index 7fc8b555e4f..40cd304d6dd 100644 --- a/website/docs/r/cloudwatch_metric_alarm.html.markdown +++ b/website/docs/r/cloudwatch_metric_alarm.html.markdown @@ -238,12 +238,12 @@ The following values are supported: `ignore`, and `evaluate`. In addition to all arguments above, the following attributes are exported: -* `arn` - The ARN of the cloudwatch metric alarm. -* `id` - The ID of the health check +* `arn` - The ARN of the CloudWatch Metric Alarm. +* `id` - The ID of the health check. ## Import -Cloud Metric Alarms can be imported using the `alarm_name`, e.g. +CloudWatch Metric Alarm can be imported using the `alarm_name`, e.g. ``` $ terraform import aws_cloudwatch_metric_alarm.test alarm-12345 From 9aba1fb894a4ebe886246b5a147e9bd74409c3b4 Mon Sep 17 00:00:00 2001 From: DrFaust92 Date: Wed, 15 Jul 2020 22:39:58 +0300 Subject: [PATCH 0044/1252] add plan time validation to `policy` use enums read after update add disappears tests + make tests more specific --- aws/resource_aws_ecr_repository_policy.go | 74 ++++----- ...resource_aws_ecr_repository_policy_test.go | 141 ++++++++++++++---- 2 files changed, 140 insertions(+), 75 deletions(-) diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index ba710623901..4a74c90d3c3 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -6,10 +6,10 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ecr" "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" ) func resourceAwsEcrRepositoryPolicy() *schema.Resource { @@ -31,6 +31,7 @@ func resourceAwsEcrRepositoryPolicy() *schema.Resource { "policy": { Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringIsJSON, DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, }, "registry_id": { @@ -49,7 +50,7 @@ func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface PolicyText: aws.String(d.Get("policy").(string)), } - log.Printf("[DEBUG] Creating ECR resository policy: %s", input) + log.Printf("[DEBUG] Creating ECR resository policy: %#v", input) // Retry due to IAM eventual consistency var err error @@ -57,7 +58,7 @@ func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface err = resource.Retry(2*time.Minute, func() *resource.RetryError { out, err = conn.SetRepositoryPolicy(&input) - if isAWSErr(err, "InvalidParameterException", "Invalid repository policy provided") { + if isAWSErr(err, ecr.ErrCodeInvalidParameterException, "Invalid repository policy provided") { return resource.RetryableError(err) } if err != nil { @@ -69,15 +70,12 @@ func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface out, err = conn.SetRepositoryPolicy(&input) } if err != nil { - return fmt.Errorf("Error creating ECR Repository Policy: %s", err) + return fmt.Errorf("error creating ECR Repository Policy: %w", err) } - repositoryPolicy := *out + log.Printf("[DEBUG] ECR repository policy created: %s", aws.StringValue(out.RepositoryName)) - log.Printf("[DEBUG] ECR repository policy created: %s", *repositoryPolicy.RepositoryName) - - d.SetId(aws.StringValue(repositoryPolicy.RepositoryName)) - d.Set("registry_id", repositoryPolicy.RegistryId) + d.SetId(aws.StringValue(out.RepositoryName)) return resourceAwsEcrRepositoryPolicyRead(d, meta) } @@ -90,26 +88,20 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{} RepositoryName: aws.String(d.Id()), }) if err != nil { - if ecrerr, ok := err.(awserr.Error); ok { - switch ecrerr.Code() { - case "RepositoryNotFoundException", "RepositoryPolicyNotFoundException": - d.SetId("") - return nil - default: - return err - } + if isAWSErr(err, ecr.ErrCodeRepositoryNotFoundException, "") || + isAWSErr(err, ecr.ErrCodeRepositoryPolicyNotFoundException, "") { + log.Printf("[WARN] ECR Repositoy Policy %s not found, removing", d.Id()) + d.SetId("") + return nil } return err } - log.Printf("[DEBUG] Received repository policy %s", out) - - repositoryPolicy := out + log.Printf("[DEBUG] Received repository policy %#v", out) - d.SetId(aws.StringValue(repositoryPolicy.RepositoryName)) - d.Set("repository", repositoryPolicy.RepositoryName) - d.Set("registry_id", repositoryPolicy.RegistryId) - d.Set("policy", repositoryPolicy.PolicyText) + d.Set("repository", out.RepositoryName) + d.Set("registry_id", out.RegistryId) + d.Set("policy", out.PolicyText) return nil } @@ -117,25 +109,20 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{} func resourceAwsEcrRepositoryPolicyUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ecrconn - if !d.HasChange("policy") { - return nil - } - input := ecr.SetRepositoryPolicyInput{ - RepositoryName: aws.String(d.Get("repository").(string)), + RepositoryName: aws.String(d.Id()), RegistryId: aws.String(d.Get("registry_id").(string)), PolicyText: aws.String(d.Get("policy").(string)), } - log.Printf("[DEBUG] Updating ECR resository policy: %s", input) + log.Printf("[DEBUG] Updating ECR resository policy: %#v", input) // Retry due to IAM eventual consistency var err error - var out *ecr.SetRepositoryPolicyOutput err = resource.Retry(2*time.Minute, func() *resource.RetryError { - out, err = conn.SetRepositoryPolicy(&input) + _, err = conn.SetRepositoryPolicy(&input) - if isAWSErr(err, "InvalidParameterException", "Invalid repository policy provided") { + if isAWSErr(err, ecr.ErrCodeInvalidParameterException, "Invalid repository policy provided") { return resource.RetryableError(err) } if err != nil { @@ -144,18 +131,13 @@ func resourceAwsEcrRepositoryPolicyUpdate(d *schema.ResourceData, meta interface return nil }) if isResourceTimeoutError(err) { - out, err = conn.SetRepositoryPolicy(&input) + _, err = conn.SetRepositoryPolicy(&input) } if err != nil { - return fmt.Errorf("Error updating ECR Repository Policy: %s", err) + return fmt.Errorf("error updating ECR Repository Policy: %w", err) } - repositoryPolicy := *out - - d.SetId(aws.StringValue(repositoryPolicy.RepositoryName)) - d.Set("registry_id", repositoryPolicy.RegistryId) - - return nil + return resourceAwsEcrRepositoryPolicyRead(d, meta) } func resourceAwsEcrRepositoryPolicyDelete(d *schema.ResourceData, meta interface{}) error { @@ -166,13 +148,9 @@ func resourceAwsEcrRepositoryPolicyDelete(d *schema.ResourceData, meta interface RegistryId: aws.String(d.Get("registry_id").(string)), }) if err != nil { - if ecrerr, ok := err.(awserr.Error); ok { - switch ecrerr.Code() { - case "RepositoryNotFoundException", "RepositoryPolicyNotFoundException": - return nil - default: - return err - } + if isAWSErr(err, ecr.ErrCodeRepositoryNotFoundException, "") || + isAWSErr(err, ecr.ErrCodeRepositoryPolicyNotFoundException, "") { + return nil } return err } diff --git a/aws/resource_aws_ecr_repository_policy_test.go b/aws/resource_aws_ecr_repository_policy_test.go index 4bbff0651e7..6721199be89 100644 --- a/aws/resource_aws_ecr_repository_policy_test.go +++ b/aws/resource_aws_ecr_repository_policy_test.go @@ -2,10 +2,10 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -13,8 +13,8 @@ import ( ) func TestAccAWSEcrRepositoryPolicy_basic(t *testing.T) { - randString := acctest.RandString(10) - resourceName := "aws_ecr_repository_policy.default" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,9 +22,12 @@ func TestAccAWSEcrRepositoryPolicy_basic(t *testing.T) { CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcrRepositoryPolicy(randString), + Config: testAccAWSEcrRepositoryPolicyConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcrRepositoryPolicyExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "repository", "aws_ecr_repository.test", "name"), + resource.TestMatchResourceAttr(resourceName, "policy", regexp.MustCompile(rName)), + testAccCheckResourceAttrAccountID(resourceName, "registry_id"), ), }, { @@ -32,13 +35,23 @@ func TestAccAWSEcrRepositoryPolicy_basic(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + { + Config: testAccAWSEcrRepositoryPolicyConfigUpdated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcrRepositoryPolicyExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "repository", "aws_ecr_repository.test", "name"), + resource.TestMatchResourceAttr(resourceName, "policy", regexp.MustCompile(rName)), + resource.TestMatchResourceAttr(resourceName, "policy", regexp.MustCompile("ecr:DescribeImages")), + testAccCheckResourceAttrAccountID(resourceName, "registry_id"), + ), + }, }, }) } func TestAccAWSEcrRepositoryPolicy_iam(t *testing.T) { - randString := acctest.RandString(10) - resourceName := "aws_ecr_repository_policy.default" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecr_repository_policy.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -46,9 +59,11 @@ func TestAccAWSEcrRepositoryPolicy_iam(t *testing.T) { CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcrRepositoryPolicyWithIAMRole(randString), + Config: testAccAWSEcrRepositoryPolicyWithIAMRoleConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcrRepositoryPolicyExists(resourceName), + resource.TestMatchResourceAttr(resourceName, "policy", regexp.MustCompile(rName)), + resource.TestMatchResourceAttr(resourceName, "policy", regexp.MustCompile("iam")), ), }, { @@ -60,6 +75,48 @@ func TestAccAWSEcrRepositoryPolicy_iam(t *testing.T) { }) } +func TestAccAWSEcrRepositoryPolicy_disappears(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecr_repository_policy.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcrRepositoryPolicyConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcrRepositoryPolicyExists(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsEcrRepositoryPolicy(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSEcrRepositoryPolicy_disappears_repository(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecr_repository_policy.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcrRepositoryPolicyConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcrRepositoryPolicyExists(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsEcrRepository(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSEcrRepositoryPolicyDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ecrconn @@ -70,10 +127,11 @@ func testAccCheckAWSEcrRepositoryPolicyDestroy(s *terraform.State) error { _, err := conn.GetRepositoryPolicy(&ecr.GetRepositoryPolicyInput{ RegistryId: aws.String(rs.Primary.Attributes["registry_id"]), - RepositoryName: aws.String(rs.Primary.Attributes["repository"]), + RepositoryName: aws.String(rs.Primary.ID), }) if err != nil { - if ecrerr, ok := err.(awserr.Error); ok && ecrerr.Code() == "RepositoryNotFoundException" { + if isAWSErr(err, ecr.ErrCodeRepositoryNotFoundException, "") || + isAWSErr(err, ecr.ErrCodeRepositoryPolicyNotFoundException, "") { return nil } return err @@ -94,21 +152,21 @@ func testAccCheckAWSEcrRepositoryPolicyExists(name string) resource.TestCheckFun } } -func testAccAWSEcrRepositoryPolicy(randString string) string { +func testAccAWSEcrRepositoryPolicyConfig(rName string) string { return fmt.Sprintf(` -resource "aws_ecr_repository" "foo" { - name = "tf-acc-test-ecr-%s" +resource "aws_ecr_repository" "test" { + name = %[1]q } -resource "aws_ecr_repository_policy" "default" { - repository = aws_ecr_repository.foo.name +resource "aws_ecr_repository_policy" "test" { + repository = aws_ecr_repository.test.name policy = < Date: Sat, 29 Aug 2020 00:27:20 +0300 Subject: [PATCH 0045/1252] tf 12 syntax --- aws/resource_aws_ecr_repository_policy_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ecr_repository_policy_test.go b/aws/resource_aws_ecr_repository_policy_test.go index 6721199be89..0c151de512c 100644 --- a/aws/resource_aws_ecr_repository_policy_test.go +++ b/aws/resource_aws_ecr_repository_policy_test.go @@ -187,7 +187,7 @@ resource "aws_ecr_repository" "test" { } resource "aws_ecr_repository_policy" "test" { - repository = "${aws_ecr_repository.test.name}" + repository = aws_ecr_repository.test.name policy = < Date: Tue, 8 Sep 2020 15:43:04 +0300 Subject: [PATCH 0046/1252] Update aws/resource_aws_ecr_repository_policy.go Co-authored-by: Carl Henrik Lunde --- aws/resource_aws_ecr_repository_policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index 4a74c90d3c3..b2509fe87f2 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -90,7 +90,7 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{} if err != nil { if isAWSErr(err, ecr.ErrCodeRepositoryNotFoundException, "") || isAWSErr(err, ecr.ErrCodeRepositoryPolicyNotFoundException, "") { - log.Printf("[WARN] ECR Repositoy Policy %s not found, removing", d.Id()) + log.Printf("[WARN] ECR Repository Policy %s not found, removing", d.Id()) d.SetId("") return nil } From 746298ec072fb8f3bf962b99eaf30e6f43aa8a7e Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 8 Sep 2020 15:44:12 +0300 Subject: [PATCH 0047/1252] Update aws/resource_aws_ecr_repository_policy.go Co-authored-by: Carl Henrik Lunde --- aws/resource_aws_ecr_repository_policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index b2509fe87f2..2110ef2d814 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -115,7 +115,7 @@ func resourceAwsEcrRepositoryPolicyUpdate(d *schema.ResourceData, meta interface PolicyText: aws.String(d.Get("policy").(string)), } - log.Printf("[DEBUG] Updating ECR resository policy: %#v", input) + log.Printf("[DEBUG] Updating ECR repository policy: %#v", input) // Retry due to IAM eventual consistency var err error From 7d0c8cfaaa44bdc45521b1f37f7fa4ddd208c74e Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Tue, 8 Sep 2020 15:44:35 +0300 Subject: [PATCH 0048/1252] Update aws/resource_aws_ecr_repository_policy.go Co-authored-by: Carl Henrik Lunde --- aws/resource_aws_ecr_repository_policy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index 2110ef2d814..348246a69df 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -50,7 +50,7 @@ func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface PolicyText: aws.String(d.Get("policy").(string)), } - log.Printf("[DEBUG] Creating ECR resository policy: %#v", input) + log.Printf("[DEBUG] Creating ECR repository policy: %#v", input) // Retry due to IAM eventual consistency var err error From 7b7a02d90623723df87ef3fa34fa92cb95f5cc67 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 18 Dec 2020 01:11:01 +0200 Subject: [PATCH 0049/1252] remove update func --- aws/resource_aws_ecr_repository_policy.go | 40 ++--------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index 348246a69df..53d0c2e9859 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -14,9 +14,9 @@ import ( func resourceAwsEcrRepositoryPolicy() *schema.Resource { return &schema.Resource{ - Create: resourceAwsEcrRepositoryPolicyCreate, + Create: resourceAwsEcrRepositoryPolicyPut, Read: resourceAwsEcrRepositoryPolicyRead, - Update: resourceAwsEcrRepositoryPolicyUpdate, + Update: resourceAwsEcrRepositoryPolicyPut, Delete: resourceAwsEcrRepositoryPolicyDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -42,7 +42,7 @@ func resourceAwsEcrRepositoryPolicy() *schema.Resource { } } -func resourceAwsEcrRepositoryPolicyCreate(d *schema.ResourceData, meta interface{}) error { +func resourceAwsEcrRepositoryPolicyPut(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ecrconn input := ecr.SetRepositoryPolicyInput{ @@ -106,40 +106,6 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{} return nil } -func resourceAwsEcrRepositoryPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).ecrconn - - input := ecr.SetRepositoryPolicyInput{ - RepositoryName: aws.String(d.Id()), - RegistryId: aws.String(d.Get("registry_id").(string)), - PolicyText: aws.String(d.Get("policy").(string)), - } - - log.Printf("[DEBUG] Updating ECR repository policy: %#v", input) - - // Retry due to IAM eventual consistency - var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { - _, err = conn.SetRepositoryPolicy(&input) - - if isAWSErr(err, ecr.ErrCodeInvalidParameterException, "Invalid repository policy provided") { - return resource.RetryableError(err) - } - if err != nil { - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.SetRepositoryPolicy(&input) - } - if err != nil { - return fmt.Errorf("error updating ECR Repository Policy: %w", err) - } - - return resourceAwsEcrRepositoryPolicyRead(d, meta) -} - func resourceAwsEcrRepositoryPolicyDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ecrconn From 5ad49fc92c9a4be3b993cf155687fe206b00848b Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Thu, 11 Mar 2021 01:36:26 +0200 Subject: [PATCH 0050/1252] changelog --- .changelog/14193.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/14193.txt diff --git a/.changelog/14193.txt b/.changelog/14193.txt new file mode 100644 index 00000000000..9d588853c0d --- /dev/null +++ b/.changelog/14193.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ecr_repository_policy: Add plan time validation for `policy` +``` From 0f6fc530d109d8487e0a551ae978df00f11bf368 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Mar 2021 06:11:01 +0000 Subject: [PATCH 0051/1252] build(deps): bump breathingdust/firewatch from v1 to v2 Bumps [breathingdust/firewatch](https://github.com/breathingdust/firewatch) from v1 to v2. - [Release notes](https://github.com/breathingdust/firewatch/releases) - [Commits](https://github.com/breathingdust/firewatch/compare/v1...2781b13d452d844c82455f185c738c575550557f) Signed-off-by: dependabot[bot] --- .github/workflows/firewatch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/firewatch.yml b/.github/workflows/firewatch.yml index 3585f801d06..f4d264ed0cd 100644 --- a/.github/workflows/firewatch.yml +++ b/.github/workflows/firewatch.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Firewatch - uses: breathingdust/firewatch@v1 + uses: breathingdust/firewatch@v2 with: github_token: ${{ secrets.GITHUB_TOKEN }} alert_threshold: 10 From f7f52a5183a9639abbd941cf0cbd2697da5332ac Mon Sep 17 00:00:00 2001 From: Edmund Craske Date: Thu, 11 Mar 2021 16:08:00 +0000 Subject: [PATCH 0052/1252] aws_instance: move notes to be in the right place Somehow the note about using `vpc_security_group_ids` got separated from `security_groups` - put it back in the right place. Also, the `volume_tags` note should come after `volume_tags`, not before. --- website/docs/r/instance.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index 0a3d37c92d6..acc8213ab22 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -121,18 +121,18 @@ The following arguments are supported: * `root_block_device` - (Optional) Configuration block to customize details about the root block device of the instance. See [Block Devices](#ebs-ephemeral-and-root-block-devices) below for details. When accessing this as an attribute reference, it is a list containing one object. * `secondary_private_ips` - (Optional) A list of secondary private IPv4 addresses to assign to the instance's primary network interface (eth0) in a VPC. Can only be assigned to the primary network interface (eth0) attached at instance creation, not a pre-existing network interface i.e. referenced in a `network_interface` block. Refer to the [Elastic network interfaces documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) to see the maximum number of private IP addresses allowed per instance type. * `security_groups` - (Optional, EC2-Classic and default VPC only) A list of security group names (EC2-Classic) or IDs (default VPC) to associate with. + +-> **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead. + * `source_dest_check` - (Optional) Controls if traffic is routed to the instance when the destination address does not match the instance. Used for NAT or VPNs. Defaults true. * `subnet_id` - (Optional) VPC Subnet ID to launch in. * `tags` - (Optional) A map of tags to assign to the resource. Note that these tags apply to the instance and not block storage devices. * `tenancy` - (Optional) Tenancy of the instance (if the instance is running in a VPC). An instance with a tenancy of dedicated runs on single-tenant hardware. The host tenancy is not supported for the import-instance command. * `user_data` - (Optional) User data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `user_data_base64` instead. * `user_data_base64` - (Optional) Can be used instead of `user_data` to pass base64-encoded binary data directly. Use this instead of `user_data` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption. - -~> **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws_instance` configuration, such as using `tags` in an [`aws_ebs_volume`](/docs/providers/aws/r/ebs_volume.html) resource attached via [`aws_volume_attachment`](/docs/providers/aws/r/volume_attachment.html). Doing so will result in resource cycling and inconsistent behavior. - * `volume_tags` - (Optional) A map of tags to assign, at instance-creation time, to root and EBS volumes. --> **NOTE:** If you are creating Instances in a VPC, use `vpc_security_group_ids` instead. +~> **NOTE:** Do not use `volume_tags` if you plan to manage block device tags outside the `aws_instance` configuration, such as using `tags` in an [`aws_ebs_volume`](/docs/providers/aws/r/ebs_volume.html) resource attached via [`aws_volume_attachment`](/docs/providers/aws/r/volume_attachment.html). Doing so will result in resource cycling and inconsistent behavior. * `vpc_security_group_ids` - (Optional, VPC only) A list of security group IDs to associate with. From 8f7c41cea26357276bf81dba34516157c39dd13b Mon Sep 17 00:00:00 2001 From: bill-rich Date: Wed, 10 Mar 2021 22:13:53 -0800 Subject: [PATCH 0053/1252] Remove Computed from `forwarded_values` --- .changelog/18042.txt | 3 +++ aws/resource_aws_cloudfront_distribution.go | 2 -- ...source_aws_cloudfront_distribution_test.go | 24 +++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 .changelog/18042.txt diff --git a/.changelog/18042.txt b/.changelog/18042.txt new file mode 100644 index 00000000000..a62ba19d471 --- /dev/null +++ b/.changelog/18042.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set +``` diff --git a/aws/resource_aws_cloudfront_distribution.go b/aws/resource_aws_cloudfront_distribution.go index 961a9ed6f23..00c1d947908 100644 --- a/aws/resource_aws_cloudfront_distribution.go +++ b/aws/resource_aws_cloudfront_distribution.go @@ -80,7 +80,6 @@ func resourceAwsCloudFrontDistribution() *schema.Resource { Type: schema.TypeList, Optional: true, MaxItems: 1, - Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "cookies": { @@ -257,7 +256,6 @@ func resourceAwsCloudFrontDistribution() *schema.Resource { "forwarded_values": { Type: schema.TypeList, Optional: true, - Computed: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index b0d1cf3c1ba..86e6cf43426 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -364,6 +364,30 @@ func TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy(t *testing }) } +func TestAccAWSCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) { + var distribution cloudfront.Distribution + resourceName := "aws_cloudfront_distribution.main" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckCloudFrontDistributionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCloudFrontDistributionOrderedCacheBehavior, + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudFrontDistributionExists(resourceName, &distribution), + ), + }, + { + Config: testAccAWSCloudFrontDistributionOrderedCacheBehaviorCachePolicy, + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudFrontDistributionExists(resourceName, &distribution), + ), + }, + }, + }) +} + func TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, From 586a9e7b86eef078948c776f8da3c81dc6835449 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 18:17:05 -0500 Subject: [PATCH 0054/1252] docs/tests: Add ErrorCheck documentation --- .../running-and-writing-acceptance-tests.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/docs/contributing/running-and-writing-acceptance-tests.md b/docs/contributing/running-and-writing-acceptance-tests.md index 208a1cc309a..ca406f78acf 100644 --- a/docs/contributing/running-and-writing-acceptance-tests.md +++ b/docs/contributing/running-and-writing-acceptance-tests.md @@ -17,6 +17,9 @@ - [PreChecks](#prechecks) - [Standard Provider PreChecks](#standard-provider-prechecks) - [Custom PreChecks](#custom-prechecks) + - [ErrorChecks](#errorchecks) + - [Common ErrorCheck](#common-errorcheck) + - [Service-Specific ErrorChecks](#service-specific-errorchecks) - [Disappears Acceptance Tests](#disappears-acceptance-tests) - [Per Attribute Acceptance Tests](#per-attribute-acceptance-tests) - [Cross-Account Acceptance Tests](#cross-account-acceptance-tests) @@ -192,6 +195,7 @@ func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, Steps: []resource.TestStep{ @@ -488,6 +492,7 @@ func TestAccAwsExampleThing_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsExampleThingDestroy, Steps: []resource.TestStep{ @@ -595,6 +600,59 @@ func testAccPreCheckAwsExample(t *testing.T) { } ``` +#### ErrorChecks + +Acceptance test cases have an ErrorCheck. The ErrorCheck provides a chance to take a look at errors before the test fails. While most errors should result in test failure, some should not. For example, an error that indicates an API operation is not supported in a particular region should cause the test to skip instead of fail. Since errors should flow through the ErrorCheck, do not handle the vast majority of failing conditions. Instead, in ErrorCheck, focus on the rare errors that should cause a test to skip, or in other words, be ignored. + +##### Common ErrorCheck + +In many situations, the common ErrorCheck is sufficient. It will skip tests for several normal occurrences such as when AWS reports a feature is not supported in the current region. + +Here is an example of the common ErrorCheck: + +```go +func TestAccAwsExampleThing_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_example_thing.test" + + resource.ParallelTest(t, resource.TestCase{ + // PreCheck + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), + // ... additional checks follow ... + }) +} +``` + +##### Service-Specific ErrorChecks + +However, some services have special conditions that aren't caught by the common ErrorCheck. In these cases, you can create a service-specific ErrorCheck. + +To add a service-specific ErrorCheck, follow these steps: + +1. Make sure there is not already an ErrorCheck for the service you have in mind. For example, search the codebase for `RegisterServiceErrorCheckFunc(service.EndpointsID` replacing "service" with the package name of the service you're working on (e.g., `ec2`). If there is already an ErrorCheck for the service, add to the existing service-specific ErrorCheck. +2. Create the service-specific ErrorCheck in an `_test.go` file for the service. See the example below. +3. Register the new service-specific ErrorCheck in the `init()` at the top of the `_test.go` file. See the example below. + +An example of adding a service-specific ErrorCheck: + +```go +// just after the imports, create or add to the init() function +func init() { + RegisterServiceErrorCheck(service.EndpointsID, testAccErrorCheckSkipService) +} + +// ... additional code and tests ... + +// this is the service-specific ErrorCheck +func testAccErrorCheckSkipService(t *testing.T) resource.ErrorCheckFunc { + return testAccErrorCheckSkipMessagesContaining(t, + "Error message specific to the service that indicates unsupported features", + "You can include from one to many portions of error messages", + "Be careful to not inadvertently capture errors that should not be skipped", + ) +} +``` + #### Disappears Acceptance Tests This test is generally implemented second. It is straightforward to setup once the basic test is passing since it can reuse that test configuration. It prevents a common bug report with Terraform resources that error when they can not be found (e.g. deleted outside Terraform). @@ -610,6 +668,7 @@ func TestAccAwsExampleThing_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsExampleThingDestroy, Steps: []resource.TestStep{ @@ -652,6 +711,7 @@ func TestAccAwsExampleChildThing_disappears_ParentThing(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsExampleChildThingDestroy, Steps: []resource.TestStep{ @@ -681,6 +741,7 @@ func TestAccAwsExampleThing_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsExampleThingDestroy, Steps: []resource.TestStep{ @@ -741,6 +802,7 @@ func TestAccAwsExample_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsExampleDestroy, Steps: []resource.TestStep{ @@ -804,6 +866,7 @@ func TestAccAwsExample_basic(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), CheckDestroy: testAccCheckAwsExampleDestroy, Steps: []resource.TestStep{ @@ -1018,6 +1081,7 @@ func TestAccAwsExampleThingDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsExampleThingDestroy, Steps: []resource.TestStep{ @@ -1212,6 +1276,7 @@ The below are required items that will be noted during submission review and pre - [ ] __Implements Exists Check Function__: Resource testing should include a `TestCheckFunc` function (typically named `testAccCheckAws{SERVICE}{RESOURCE}Exists`) that calls the API to verify that the Terraform resource has been created or associated as appropriate. Preferably, this function will also accept a pointer to an API object representing the Terraform resource from the API response that can be set for potential usage in later `TestCheckFunc`. More information about these functions can be found in the [Extending Terraform Custom Check Functions documentation](https://www.terraform.io/docs/extend/testing/acceptance-tests/testcase.html#checkdestroy). - [ ] __Excludes Provider Declarations__: Test configurations should not include `provider "aws" {...}` declarations. If necessary, only the provider declarations in `provider_test.go` should be used for multiple account/region or otherwise specialized testing. - [ ] __Passes in us-west-2 Region__: Tests default to running in `us-west-2` and at a minimum should pass in that region or include necessary `PreCheck` functions to skip the test when ran outside an expected environment. +- [ ] __Includes ErrorCheck__: All acceptance tests should include a call to the common ErrorCheck (`ErrorCheck: testAccErrorCheck(t, service.EndpointsID),`). - [ ] __Uses resource.ParallelTest__: Tests should utilize [`resource.ParallelTest()`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#ParallelTest) instead of [`resource.Test()`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#Test) except where serialized testing is absolutely required. - [ ] __Uses fmt.Sprintf()__: Test configurations preferably should to be separated into their own functions (typically named `testAccAws{SERVICE}{RESOURCE}Config{PURPOSE}`) that call [`fmt.Sprintf()`](https://golang.org/pkg/fmt/#Sprintf) for variable injection or a string `const` for completely static configurations. Test configurations should avoid `var` or other variable injection functionality such as [`text/template`](https://golang.org/pkg/text/template/). - [ ] __Uses Randomized Infrastructure Naming__: Test configurations that utilize resources where a unique name is required should generate a random name. Typically this is created via `rName := acctest.RandomWithPrefix("tf-acc-test")` in the acceptance test function before generating the configuration. From 2f18efc5b0b69d62b2559bcd69badf0b614a5814 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 18:20:35 -0500 Subject: [PATCH 0055/1252] docs/tests: Fix spaces to be tabs --- docs/contributing/running-and-writing-acceptance-tests.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contributing/running-and-writing-acceptance-tests.md b/docs/contributing/running-and-writing-acceptance-tests.md index ca406f78acf..5340c133425 100644 --- a/docs/contributing/running-and-writing-acceptance-tests.md +++ b/docs/contributing/running-and-writing-acceptance-tests.md @@ -195,7 +195,7 @@ func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, Steps: []resource.TestStep{ @@ -648,7 +648,7 @@ func testAccErrorCheckSkipService(t *testing.T) resource.ErrorCheckFunc { return testAccErrorCheckSkipMessagesContaining(t, "Error message specific to the service that indicates unsupported features", "You can include from one to many portions of error messages", - "Be careful to not inadvertently capture errors that should not be skipped", + "Be careful to not inadvertently capture errors that should not be skipped", ) } ``` From efe1b584cec4e832ad79ab90e2966a74dac304d0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 12 Mar 2021 10:12:36 -0500 Subject: [PATCH 0056/1252] docs/contribution-checklist: Add ErrorCheck --- docs/contributing/contribution-checklists.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/contributing/contribution-checklists.md b/docs/contributing/contribution-checklists.md index b45bcabe38c..8d1c2db2980 100644 --- a/docs/contributing/contribution-checklists.md +++ b/docs/contributing/contribution-checklists.md @@ -136,6 +136,7 @@ func TestAccAWSServiceThing_Name_Generated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSServiceThingDestroy, Steps: []resource.TestStep{ @@ -163,6 +164,7 @@ func TestAccAWSServiceThing_NamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, service.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSServiceThingDestroy, Steps: []resource.TestStep{ @@ -353,6 +355,7 @@ More details about this code generation, including fixes for potential error mes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ From ceb4c185a26c1635b6f3d26f3adce1be301a3667 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 12 Mar 2021 10:46:10 -0500 Subject: [PATCH 0057/1252] New Service: Audit Manager --- .hashibot.hcl | 8 ++++++++ aws/config.go | 3 +++ aws/provider.go | 1 + infrastructure/repository/labels-service.tf | 1 + website/allowed-subcategories.txt | 1 + website/docs/guides/custom-service-endpoints.html.md | 1 + 6 files changed, 15 insertions(+) diff --git a/.hashibot.hcl b/.hashibot.hcl index 51c18acafa9..d73a58cbd43 100644 --- a/.hashibot.hcl +++ b/.hashibot.hcl @@ -138,6 +138,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/athena" = [ "aws_athena_", ], + "service/auditmanager" = [ + "aws_auditmanager_", + ], "service/autoscaling" = [ "aws_autoscaling_", "aws_launch_configuration", @@ -740,6 +743,11 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_athena_*", "**/athena_*" ] + "service/auditmanager" = [ + "aws/internal/service/auditmanager/**/*", + "**/*_auditmanager_*", + "**/auditmanager_*" + ] "service/autoscaling" = [ "aws/internal/service/autoscaling/**/*", "**/*_autoscaling_*", diff --git a/aws/config.go b/aws/config.go index 0493b8d71a0..51015ec45dc 100644 --- a/aws/config.go +++ b/aws/config.go @@ -20,6 +20,7 @@ import ( "github.com/aws/aws-sdk-go/service/appstream" "github.com/aws/aws-sdk-go/service/appsync" "github.com/aws/aws-sdk-go/service/athena" + "github.com/aws/aws-sdk-go/service/auditmanager" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/autoscalingplans" "github.com/aws/aws-sdk-go/service/backup" @@ -219,6 +220,7 @@ type AWSClient struct { appstreamconn *appstream.AppStream appsyncconn *appsync.AppSync athenaconn *athena.Athena + auditmanagerconn *auditmanager.AuditManager autoscalingconn *autoscaling.AutoScaling autoscalingplansconn *autoscalingplans.AutoScalingPlans backupconn *backup.Backup @@ -462,6 +464,7 @@ func (c *Config) Client() (interface{}, error) { appstreamconn: appstream.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["appstream"])})), appsyncconn: appsync.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["appsync"])})), athenaconn: athena.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["athena"])})), + auditmanagerconn: auditmanager.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["auditmanager"])})), autoscalingconn: autoscaling.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["autoscaling"])})), autoscalingplansconn: autoscalingplans.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["autoscalingplans"])})), backupconn: backup.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["backup"])})), diff --git a/aws/provider.go b/aws/provider.go index a8078c1ff52..c44cbf810ca 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -1189,6 +1189,7 @@ func init() { "appstream", "appsync", "athena", + "auditmanager", "autoscaling", "autoscalingplans", "backup", diff --git a/infrastructure/repository/labels-service.tf b/infrastructure/repository/labels-service.tf index 1b7750b4788..acd17a27508 100644 --- a/infrastructure/repository/labels-service.tf +++ b/infrastructure/repository/labels-service.tf @@ -22,6 +22,7 @@ variable "service_labels" { "appstream", "appsync", "athena", + "auditmanager", "autoscaling", "autoscalingplans", "backup", diff --git a/website/allowed-subcategories.txt b/website/allowed-subcategories.txt index ee70be760e5..4bcf7aaf80a 100644 --- a/website/allowed-subcategories.txt +++ b/website/allowed-subcategories.txt @@ -8,6 +8,7 @@ AppMesh AppSync Application Autoscaling Athena +Audit Manager Autoscaling Autoscaling Plans Amazon Managed Service for Prometheus (AMP) diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index 8d42da3429a..c63f6e17e38 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -65,6 +65,7 @@ The Terraform AWS Provider allows the following endpoints to be customized:
  • appstream
  • appsync
  • athena
  • +
  • auditmanager
  • autoscaling
  • autoscalingplans
  • backup
  • From 047c78474ea382014c2f0a036dd42cbaef5a7479 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 12 Mar 2021 23:08:57 +0200 Subject: [PATCH 0058/1252] add smb_file_share_visibility --- aws/resource_aws_storagegateway_gateway.go | 31 +++++++++++ ...esource_aws_storagegateway_gateway_test.go | 54 +++++++++++++++++++ 2 files changed, 85 insertions(+) diff --git a/aws/resource_aws_storagegateway_gateway.go b/aws/resource_aws_storagegateway_gateway.go index 54094ae29cb..5507d7ddc09 100644 --- a/aws/resource_aws_storagegateway_gateway.go +++ b/aws/resource_aws_storagegateway_gateway.go @@ -193,6 +193,10 @@ func resourceAwsStorageGatewayGateway() *schema.Resource { Computed: true, ValidateFunc: validation.StringInSlice(storagegateway.SMBSecurityStrategy_Values(), false), }, + "smb_file_share_visibility": { + Type: schema.TypeBool, + Optional: true, + }, "average_download_rate_limit_in_bits_per_sec": { Type: schema.TypeInt, Optional: true, @@ -391,6 +395,19 @@ func resourceAwsStorageGatewayGatewayCreate(d *schema.ResourceData, meta interfa } } + if v, ok := d.GetOk("smb_file_share_visibility"); ok { + input := &storagegateway.UpdateSMBFileShareVisibilityInput{ + GatewayARN: aws.String(d.Id()), + FileSharesVisible: aws.Bool(v.(bool)), + } + + log.Printf("[DEBUG] Storage Gateway Gateway %q setting SMB File Share Visibility", input) + _, err := conn.UpdateSMBFileShareVisibility(input) + if err != nil { + return fmt.Errorf("error setting SMB File Share Visibility: %w", err) + } + } + bandwidthInput := &storagegateway.UpdateBandwidthRateLimitInput{ GatewayARN: aws.String(d.Id()), } @@ -526,6 +543,7 @@ func resourceAwsStorageGatewayGatewayRead(d *schema.ResourceData, meta interface d.Set("tape_drive_type", d.Get("tape_drive_type").(string)) d.Set("cloudwatch_log_group_arn", output.CloudWatchLogGroupARN) d.Set("smb_security_strategy", smbSettingsOutput.SMBSecurityStrategy) + d.Set("smb_file_share_visibility", smbSettingsOutput.FileSharesVisible) d.Set("ec2_instance_id", output.Ec2InstanceId) d.Set("endpoint_type", output.EndpointType) d.Set("host_environment", output.HostEnvironment) @@ -615,6 +633,19 @@ func resourceAwsStorageGatewayGatewayUpdate(d *schema.ResourceData, meta interfa } } + if d.HasChange("smb_file_share_visibility") { + input := &storagegateway.UpdateSMBFileShareVisibilityInput{ + GatewayARN: aws.String(d.Id()), + FileSharesVisible: aws.Bool(d.Get("smb_file_share_visibility").(bool)), + } + + log.Printf("[DEBUG] Storage Gateway Gateway %q updating SMB File Share Visibility", input) + _, err := conn.UpdateSMBFileShareVisibility(input) + if err != nil { + return fmt.Errorf("error updating SMB File Share Visibility: %w", err) + } + } + if d.HasChanges("average_download_rate_limit_in_bits_per_sec", "average_upload_rate_limit_in_bits_per_sec") { diff --git a/aws/resource_aws_storagegateway_gateway_test.go b/aws/resource_aws_storagegateway_gateway_test.go index 2cd33b782a5..f7184d4c04f 100644 --- a/aws/resource_aws_storagegateway_gateway_test.go +++ b/aws/resource_aws_storagegateway_gateway_test.go @@ -500,6 +500,7 @@ func TestAccAWSStorageGatewayGateway_SMBSecurityStrategy(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), resource.TestCheckResourceAttr(resourceName, "smb_security_strategy", "ClientSpecified"), + resource.TestCheckResourceAttr(resourceName, "smb_file_share_visibility", "false"), ), }, { @@ -519,6 +520,47 @@ func TestAccAWSStorageGatewayGateway_SMBSecurityStrategy(t *testing.T) { }) } +func TestAccAWSStorageGatewayGateway_SMBVisibility(t *testing.T) { + var gateway storagegateway.DescribeGatewayInformationOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_gateway.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayGatewayConfigSMBVisibility(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttr(resourceName, "smb_file_share_visibility", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"activation_key", "gateway_ip_address"}, + }, + { + Config: testAccAWSStorageGatewayGatewayConfigSMBVisibility(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttr(resourceName, "smb_file_share_visibility", "false"), + ), + }, + { + Config: testAccAWSStorageGatewayGatewayConfigSMBVisibility(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttr(resourceName, "smb_file_share_visibility", "true"), + ), + }, + }, + }) +} + func TestAccAWSStorageGatewayGateway_disappears(t *testing.T) { var gateway storagegateway.DescribeGatewayInformationOutput rName := acctest.RandomWithPrefix("tf-acc-test") @@ -1108,6 +1150,18 @@ resource "aws_storagegateway_gateway" "test" { `, rName, strategy) } +func testAccAWSStorageGatewayGatewayConfigSMBVisibility(rName string, visible bool) string { + return testAccAWSStorageGateway_FileGatewayBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_gateway" "test" { + gateway_ip_address = aws_instance.test.public_ip + gateway_name = %[1]q + gateway_timezone = "GMT" + gateway_type = "FILE_S3" + smb_file_share_visibility = %[2]t +} +`, rName, visible) +} + func testAccAWSStorageGatewayGatewayConfigTags1(rName, tagKey1, tagValue1 string) string { return testAccAWSStorageGateway_TapeAndVolumeGatewayBase(rName) + fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { From a4150f22cfe65e035ef77708d05c1f04d33311e4 Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 12 Mar 2021 23:11:22 +0200 Subject: [PATCH 0059/1252] docs --- website/docs/r/storagegateway_gateway.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/storagegateway_gateway.html.markdown b/website/docs/r/storagegateway_gateway.html.markdown index c07f62bf937..10428274d2c 100644 --- a/website/docs/r/storagegateway_gateway.html.markdown +++ b/website/docs/r/storagegateway_gateway.html.markdown @@ -79,6 +79,7 @@ The following arguments are supported: * `smb_active_directory_settings` - (Optional) Nested argument with Active Directory domain join information for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `ActiveDirectory` authentication SMB file shares. More details below. * `smb_guest_password` - (Optional) Guest password for Server Message Block (SMB) file shares. Only valid for `FILE_S3` gateway type. Must be set before creating `GuestAccess` authentication SMB file shares. Terraform can only detect drift of the existence of a guest password, not its actual value from the gateway. Terraform can however update the password with changing the argument. * `smb_security_strategy` - (Optional) Specifies the type of security strategy. Valid values are: `ClientSpecified`, `MandatorySigning`, and `MandatoryEncryption`. See [Setting a Security Level for Your Gateway](https://docs.aws.amazon.com/storagegateway/latest/userguide/managing-gateway-file.html#security-strategy) for more information. +* `smb_file_share_visibility` - (Optional) Specifies whether the shares on this gateway appear when listing shares. * `tape_drive_type` - (Optional) Type of tape drive to use for tape gateway. Terraform cannot detect drift of this argument. Valid values: `IBM-ULT3580-TD5`. * `tags` - (Optional) Key-value map of resource tags From 4ff2895ed3881ed78a5de258356e9d9ec910698f Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 12 Mar 2021 23:15:37 +0200 Subject: [PATCH 0060/1252] changelog --- .changelog/18076.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18076.txt diff --git a/.changelog/18076.txt b/.changelog/18076.txt new file mode 100644 index 00000000000..630f6f7c7e6 --- /dev/null +++ b/.changelog/18076.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. +``` From 23da6fc90e987343e0df699908c66f46a632489d Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Sat, 13 Mar 2021 15:09:47 +0200 Subject: [PATCH 0061/1252] Apply suggestions from code review Co-authored-by: Kit Ewbank --- aws/resource_aws_storagegateway_gateway.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_storagegateway_gateway.go b/aws/resource_aws_storagegateway_gateway.go index 5507d7ddc09..9a14e3fc0e9 100644 --- a/aws/resource_aws_storagegateway_gateway.go +++ b/aws/resource_aws_storagegateway_gateway.go @@ -404,7 +404,7 @@ func resourceAwsStorageGatewayGatewayCreate(d *schema.ResourceData, meta interfa log.Printf("[DEBUG] Storage Gateway Gateway %q setting SMB File Share Visibility", input) _, err := conn.UpdateSMBFileShareVisibility(input) if err != nil { - return fmt.Errorf("error setting SMB File Share Visibility: %w", err) + return fmt.Errorf("error updating Storage Gateway Gateway (%s) SMB file share visibility: %w", d.Id(), err) } } @@ -642,7 +642,7 @@ func resourceAwsStorageGatewayGatewayUpdate(d *schema.ResourceData, meta interfa log.Printf("[DEBUG] Storage Gateway Gateway %q updating SMB File Share Visibility", input) _, err := conn.UpdateSMBFileShareVisibility(input) if err != nil { - return fmt.Errorf("error updating SMB File Share Visibility: %w", err) + return fmt.Errorf("error updating Storage Gateway Gateway (%s) SMB file share visibility: %w", d.Id(), err) } } From 1beda8190753aec5bba4f0a00ab277bab43e142f Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Mon, 15 Mar 2021 17:04:28 -0400 Subject: [PATCH 0062/1252] update per CR comments in #17941 --- .changelog/17974.txt | 4 + aws/internal/keyvaluetags/key_value_tags.go | 56 ++-- .../keyvaluetags/key_value_tags_test.go | 181 ++--------- aws/provider_test.go | 299 +++++++++++------- aws/resource_aws_subnet.go | 2 +- aws/resource_aws_subnet_test.go | 61 +++- aws/resource_aws_vpc.go | 2 +- aws/resource_aws_vpc_test.go | 60 +++- aws/tags.go | 7 +- website/docs/index.html.markdown | 2 +- 10 files changed, 338 insertions(+), 336 deletions(-) diff --git a/.changelog/17974.txt b/.changelog/17974.txt index 81d093c7a31..24d5f966595 100644 --- a/.changelog/17974.txt +++ b/.changelog/17974.txt @@ -2,6 +2,10 @@ provider: New `default_tags` argument as a public preview for applying tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ``` +```release-note:enhancement +provider: Add `default_tags` argument (in public preview, see note above) + + ```release-note:enhancement aws_subnet: Support provider-wide default tags (in public preview, see note above) ``` diff --git a/aws/internal/keyvaluetags/key_value_tags.go b/aws/internal/keyvaluetags/key_value_tags.go index eb69d119a61..1f48f3c1cd6 100644 --- a/aws/internal/keyvaluetags/key_value_tags.go +++ b/aws/internal/keyvaluetags/key_value_tags.go @@ -55,30 +55,34 @@ func (tags KeyValueTags) IgnoreAws() KeyValueTags { return result } -// Merge calls keyvaluetags.Merge() on the given DefaultConfig.Tags, if any, -// with KeyValueTags provided as an argument, overriding the value -// of any tag with a matching key. -func (config *DefaultConfig) Merge(tags KeyValueTags) KeyValueTags { - if len(config.Tags) == 0 { +// MergeTags returns the result of keyvaluetags.Merge() on the given +// DefaultConfig.Tags with KeyValueTags provided as an argument, +// overriding the value of any tag with a matching key. +func (dc *DefaultConfig) MergeTags(tags KeyValueTags) KeyValueTags { + if dc == nil || dc.Tags == nil { return tags } - return config.Tags.Merge(tags) + return dc.Tags.Merge(tags) } // TagsEqual returns true if the given configuration's Tags // are equal to those passed in as an argument; // otherwise returns false -func (config *DefaultConfig) TagsEqual(tags KeyValueTags) bool { - if len(config.Tags) == 0 { - return len(tags) == 0 +func (dc *DefaultConfig) TagsEqual(tags KeyValueTags) bool { + if dc == nil || dc.Tags == nil { + return tags == nil } - if len(tags) == 0 { + if tags == nil { return false } - return config.Tags.ContainsAll(tags) + if len(tags) == 0 { + return len(dc.Tags) == 0 + } + + return dc.Tags.ContainsAll(tags) } // IgnoreConfig returns any tags not removed by a given configuration. @@ -437,15 +441,15 @@ func (tags KeyValueTags) Hash() int { // however, if all tags present in the DefaultConfig object are equivalent to those // in the given KeyValueTags, then the KeyValueTags are returned, effectively // bypassing the need to remove differing tags. -func (tags KeyValueTags) RemoveDefaultConfig(config *DefaultConfig) KeyValueTags { - if config == nil || len(config.Tags) == 0 { +func (tags KeyValueTags) RemoveDefaultConfig(dc *DefaultConfig) KeyValueTags { + if dc == nil || dc.Tags == nil { return tags } result := make(KeyValueTags) for k, v := range tags { - if defaultVal, ok := config.Tags[k]; !ok || !v.Equal(defaultVal) { + if defaultVal, ok := dc.Tags[k]; !ok || !v.Equal(defaultVal) { result[k] = v } } @@ -487,30 +491,6 @@ func (tags KeyValueTags) UrlEncode() string { return values.Encode() } -// MergeConfigTags creates KeyValueTags by merging KeyValueTags nested in -// a configuration object with those represented as a map[string]interface{}. -// Currently only supports the DefaultConfig type when passed to the interface{} argument. -func MergeConfigTags(config interface{}, tags map[string]interface{}) KeyValueTags { - kvTags := New(tags) - - if config == nil { - return kvTags - } - - var result KeyValueTags - - switch t := config.(type) { - case *DefaultConfig: - if t == nil || len(t.Tags) == 0 { - result = kvTags - } else { - result = t.Merge(kvTags) - } - } - - return result -} - // New creates KeyValueTags from common Terraform Provider SDK types. // Supports map[string]string, map[string]*string, map[string]interface{}, and []interface{}. // When passed []interface{}, all elements are treated as keys and assigned nil values. diff --git a/aws/internal/keyvaluetags/key_value_tags_test.go b/aws/internal/keyvaluetags/key_value_tags_test.go index 289df0a9151..39717e69757 100644 --- a/aws/internal/keyvaluetags/key_value_tags_test.go +++ b/aws/internal/keyvaluetags/key_value_tags_test.go @@ -4,7 +4,7 @@ import ( "testing" ) -func TestKeyValueTagsDefaultConfigMerge(t *testing.T) { +func TestKeyValueTagsDefaultConfigMergeTags(t *testing.T) { testCases := []struct { name string tags KeyValueTags @@ -138,13 +138,7 @@ func TestKeyValueTagsDefaultConfigMerge(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - var got KeyValueTags - if testCase.defaultConfig != nil { - got = testCase.defaultConfig.Merge(testCase.tags) - } else { - got = testCase.tags - } - + got := testCase.defaultConfig.MergeTags(testCase.tags) testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) }) } @@ -178,7 +172,7 @@ func TestKeyValueTagsDefaultConfigTagsEqual(t *testing.T) { want: false, }, { - name: "no tags", + name: "empty tags", tags: New(map[string]string{}), defaultConfig: &DefaultConfig{ Tags: New(map[string]string{ @@ -189,6 +183,30 @@ func TestKeyValueTagsDefaultConfigTagsEqual(t *testing.T) { }, want: false, }, + { + name: "no tags", + tags: nil, + defaultConfig: &DefaultConfig{ + Tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + }, + want: false, + }, + { + name: "empty config and no tags", + tags: nil, + defaultConfig: &DefaultConfig{}, + want: true, + }, + { + name: "no config and tags", + tags: nil, + defaultConfig: nil, + want: true, + }, { name: "keys and values all matching", tags: New(map[string]string{ @@ -225,10 +243,7 @@ func TestKeyValueTagsDefaultConfigTagsEqual(t *testing.T) { for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - var got bool - if testCase.defaultConfig != nil { - got = testCase.defaultConfig.TagsEqual(testCase.tags) - } + got := testCase.defaultConfig.TagsEqual(testCase.tags) if got != testCase.want { t.Errorf("got %t; want %t", got, testCase.want) @@ -1996,146 +2011,6 @@ func TestKeyValueTagsUrlEncode(t *testing.T) { } } -func TestMergeConfigTags(t *testing.T) { - testCases := []struct { - name string - tags map[string]interface{} - defaultConfig *DefaultConfig - want map[string]string - }{ - { - name: "empty config", - tags: map[string]interface{}{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: &DefaultConfig{}, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "no config", - tags: map[string]interface{}{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: nil, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "no tags", - tags: map[string]interface{}{}, - defaultConfig: &DefaultConfig{ - Tags: New(map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }), - }, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "keys all matching", - tags: map[string]interface{}{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: &DefaultConfig{ - Tags: New(map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }), - }, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "keys some matching", - tags: map[string]interface{}{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: &DefaultConfig{ - Tags: New(map[string]string{ - "key1": "value1", - }), - }, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "keys some overridden", - tags: map[string]interface{}{ - "key1": "value2", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: &DefaultConfig{ - Tags: New(map[string]string{ - "key1": "value1", - }), - }, - want: map[string]string{ - "key1": "value2", - "key2": "value2", - "key3": "value3", - }, - }, - { - name: "keys none matching", - tags: map[string]interface{}{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - }, - defaultConfig: &DefaultConfig{ - Tags: New(map[string]string{ - "key4": "value4", - "key5": "value5", - "key6": "value6", - }), - }, - want: map[string]string{ - "key1": "value1", - "key2": "value2", - "key3": "value3", - "key4": "value4", - "key5": "value5", - "key6": "value6", - }, - }, - } - for _, testCase := range testCases { - t.Run(testCase.name, func(t *testing.T) { - got := MergeConfigTags(testCase.defaultConfig, testCase.tags) - - testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) - }) - } -} - func TestTagDataEqual(t *testing.T) { testCases := []struct { name string diff --git a/aws/provider_test.go b/aws/provider_test.go index d579883dd66..69f5d987c2e 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -888,6 +888,38 @@ func testAccMultipleRegionProviderConfig(regions int) string { return config.String() } +func testAccProviderConfigDefaultAndIgnoreTagsKeyPrefixes1(key1, value1, keyPrefix1 string) string { + //lintignore:AT004 + return fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %q = %q + } + } + ignore_tags { + key_prefixes = [%q] + } +} +`, key1, value1, keyPrefix1) +} + +func testAccProviderConfigDefaultAndIgnoreTagsKeys1(key1, value1 string) string { + //lintignore:AT004 + return fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %[1]q = %q + } + } + ignore_tags { + keys = [%[1]q] + } +} +`, key1, value1) +} + func testAccProviderConfigIgnoreTagsKeyPrefixes1(keyPrefix1 string) string { //lintignore:AT004 return fmt.Sprintf(` @@ -1118,14 +1150,26 @@ func testSweepSkipResourceError(err error) bool { return tfawserr.ErrCodeContains(err, "AccessDenied") } -func TestAccAWSProvider_Endpoints(t *testing.T) { +func TestAccProvider_DefaultTags_EmptyConfigurationBlock(t *testing.T) { var providers []*schema.Provider - var endpoints strings.Builder - // Initialize each endpoint configuration with matching name and value - for _, endpointServiceName := range endpointServiceNames { - endpoints.WriteString(fmt.Sprintf("%s = \"http://%s\"\n", endpointServiceName, endpointServiceName)) - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigDefaultTagsEmptyConfigurationBlock(), + Check: resource.ComposeTestCheckFunc( + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_DefaultTags_Tags_None(t *testing.T) { + var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1133,16 +1177,16 @@ func TestAccAWSProvider_Endpoints(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigEndpoints(endpoints.String()), + Config: testAccAWSProviderConfigDefaultTags_Tags0(), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderEndpoints(&providers), + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock(t *testing.T) { +func TestAccAWSProvider_DefaultTags_Tags_One(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1151,17 +1195,16 @@ func TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsEmptyConfigurationBlock(), + Config: testAccAWSProviderConfigDefaultTags_Tags1("test", "value"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{}), - testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{}), + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{"test": "value"}), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_KeyPrefixes_None(t *testing.T) { +func TestAccAWSProvider_DefaultTags_Tags_Multiple(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1170,16 +1213,19 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_None(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes0(), + Config: testAccAWSProviderConfigDefaultTags_Tags2("test1", "value1", "test2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{}), + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{ + "test1": "value1", + "test2": "value2", + }), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_KeyPrefixes_One(t *testing.T) { +func TestAccAWSProvider_DefaultAndIgnoreTags_EmptyConfigurationBlocks(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1188,17 +1234,25 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_One(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes1("test"), + Config: testAccAWSProviderConfigDefaultAndIgnoreTagsEmptyConfigurationBlock(), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{"test"}), + testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{}), + testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{}), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple(t *testing.T) { +func TestAccAWSProvider_Endpoints(t *testing.T) { var providers []*schema.Provider + var endpoints strings.Builder + + // Initialize each endpoint configuration with matching name and value + for _, endpointServiceName := range endpointServiceNames { + endpoints.WriteString(fmt.Sprintf("%s = \"http://%s\"\n", endpointServiceName, endpointServiceName)) + } resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1206,16 +1260,16 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes2("test1", "test2"), + Config: testAccAWSProviderConfigEndpoints(endpoints.String()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{"test1", "test2"}), + testAccCheckAWSProviderEndpoints(&providers), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_Keys_None(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1224,16 +1278,17 @@ func TestAccAWSProvider_IgnoreTags_Keys_None(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeys0(), + Config: testAccAWSProviderConfigIgnoreTagsEmptyConfigurationBlock(), Check: resource.ComposeTestCheckFunc( testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{}), + testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{}), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_Keys_One(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_KeyPrefixes_None(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1242,16 +1297,16 @@ func TestAccAWSProvider_IgnoreTags_Keys_One(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeys1("test"), + Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes0(), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{"test"}), + testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{}), ), }, }, }) } -func TestAccAWSProvider_IgnoreTags_Keys_Multiple(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_KeyPrefixes_One(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1260,16 +1315,16 @@ func TestAccAWSProvider_IgnoreTags_Keys_Multiple(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccAWSProviderConfigIgnoreTagsKeys2("test1", "test2"), + Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes1("test"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{"test1", "test2"}), + testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{"test"}), ), }, }, }) } -func TestAccProvider_DefaultTags_EmptyConfigurationBlock(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1278,16 +1333,16 @@ func TestAccProvider_DefaultTags_EmptyConfigurationBlock(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccProviderConfigDefaultTagsEmptyConfigurationBlock(), + Config: testAccAWSProviderConfigIgnoreTagsKeyPrefixes2("test1", "test2"), Check: resource.ComposeTestCheckFunc( - testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + testAccCheckAWSProviderIgnoreTagsKeyPrefixes(&providers, []string{"test1", "test2"}), ), }, }, }) } -func TestAccProvider_DefaultTags_Tags_None(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_Keys_None(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1296,16 +1351,16 @@ func TestAccProvider_DefaultTags_Tags_None(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccProviderConfigDefaultTags_Tags0(), + Config: testAccAWSProviderConfigIgnoreTagsKeys0(), Check: resource.ComposeTestCheckFunc( - testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{}), + testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{}), ), }, }, }) } -func TestAccProvider_DefaultTags_Tags_One(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_Keys_One(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1314,16 +1369,16 @@ func TestAccProvider_DefaultTags_Tags_One(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccProviderConfigDefaultTags_Tags1("test", "value"), + Config: testAccAWSProviderConfigIgnoreTagsKeys1("test"), Check: resource.ComposeTestCheckFunc( - testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{"test": "value"}), + testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{"test"}), ), }, }, }) } -func TestAccProvider_DefaultTags_Tags_Multiple(t *testing.T) { +func TestAccAWSProvider_IgnoreTags_Keys_Multiple(t *testing.T) { var providers []*schema.Provider resource.ParallelTest(t, resource.TestCase{ @@ -1332,12 +1387,9 @@ func TestAccProvider_DefaultTags_Tags_Multiple(t *testing.T) { CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: testAccProviderConfigDefaultTags_Tags2("test1", "value1", "test2", "value2"), + Config: testAccAWSProviderConfigIgnoreTagsKeys2("test1", "test2"), Check: resource.ComposeTestCheckFunc( - testAccCheckProviderDefaultTags_Tags(&providers, map[string]string{ - "test1": "value1", - "test2": "value2", - }), + testAccCheckAWSProviderIgnoreTagsKeys(&providers, []string{"test1", "test2"}), ), }, }, @@ -1847,6 +1899,94 @@ func testAccDefaultSubnetCount(t *testing.T) int { return len(output.Subnets) } +func testAccAWSProviderConfigDefaultTags_Tags0() string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + ` +provider "aws" { + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`) +} + +func testAccAWSProviderConfigDefaultTags_Tags1(tag1, value1 string) string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %q = %q + } + } + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`, tag1, value1)) +} + +func testAccAWSProviderConfigDefaultTags_Tags2(tag1, value1, tag2, value2 string) string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + fmt.Sprintf(` +provider "aws" { + default_tags { + tags = { + %q = %q + %q = %q + } + } + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`, tag1, value1, tag2, value2)) +} + +func testAccAWSProviderConfigDefaultTagsEmptyConfigurationBlock() string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + ` +provider "aws" { + default_tags {} + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`) +} + +func testAccAWSProviderConfigDefaultAndIgnoreTagsEmptyConfigurationBlock() string { + //lintignore:AT004 + return composeConfig( + testAccProviderConfigBase, + ` +provider "aws" { + default_tags {} + ignore_tags {} + + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} +`) +} + func testAccAWSProviderConfigEndpoints(endpoints string) string { //lintignore:AT004 return composeConfig( @@ -2030,77 +2170,6 @@ data "aws_arn" "test" { } ` -func testAccProviderConfigDefaultTagsEmptyConfigurationBlock() string { - //lintignore:AT004 - return composeConfig( - testAccProviderConfigBase, - ` -provider "aws" { - default_tags {} - - skip_credentials_validation = true - skip_get_ec2_platforms = true - skip_metadata_api_check = true - skip_requesting_account_id = true -} -`) -} - -func testAccProviderConfigDefaultTags_Tags0() string { - //lintignore:AT004 - return composeConfig( - testAccProviderConfigBase, - ` -provider "aws" { - skip_credentials_validation = true - skip_get_ec2_platforms = true - skip_metadata_api_check = true - skip_requesting_account_id = true -} -`) -} - -func testAccProviderConfigDefaultTags_Tags1(tag1, value1 string) string { - //lintignore:AT004 - return composeConfig( - testAccProviderConfigBase, - fmt.Sprintf(` -provider "aws" { - default_tags { - tags = { - %q = %q - } - } - - skip_credentials_validation = true - skip_get_ec2_platforms = true - skip_metadata_api_check = true - skip_requesting_account_id = true -} -`, tag1, value1)) -} - -func testAccProviderConfigDefaultTags_Tags2(tag1, value1, tag2, value2 string) string { - //lintignore:AT004 - return composeConfig( - testAccProviderConfigBase, - fmt.Sprintf(` -provider "aws" { - default_tags { - tags = { - %q = %q - %q = %q - } - } - - skip_credentials_validation = true - skip_get_ec2_platforms = true - skip_metadata_api_check = true - skip_requesting_account_id = true -} -`, tag1, value1, tag2, value2)) -} - func testCheckResourceAttrIsSortedCsv(resourceName, attributeName string) resource.TestCheckFunc { return func(s *terraform.State) error { is, err := primaryInstanceState(s, resourceName) diff --git a/aws/resource_aws_subnet.go b/aws/resource_aws_subnet.go index 352d29bbf46..46e98235d3c 100644 --- a/aws/resource_aws_subnet.go +++ b/aws/resource_aws_subnet.go @@ -126,7 +126,7 @@ func resourceAwsSubnet() *schema.Resource { func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig - tags := keyvaluetags.MergeConfigTags(defaultTagsConfig, d.Get("tags").(map[string]interface{})) + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) createOpts := &ec2.CreateSubnetInput{ AvailabilityZone: aws.String(d.Get("availability_zone").(string)), diff --git a/aws/resource_aws_subnet_test.go b/aws/resource_aws_subnet_test.go index 9d230c9ef84..10215d5c9b2 100644 --- a/aws/resource_aws_subnet_test.go +++ b/aws/resource_aws_subnet_test.go @@ -215,7 +215,7 @@ func TestAccAWSSubnet_defaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccSubnetConfig, ), Check: resource.ComposeTestCheckFunc( @@ -232,7 +232,7 @@ func TestAccAWSSubnet_defaultTags_providerOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), testAccSubnetConfig, ), Check: resource.ComposeTestCheckFunc( @@ -245,7 +245,7 @@ func TestAccAWSSubnet_defaultTags_providerOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "value1"), testAccSubnetConfig, ), Check: resource.ComposeTestCheckFunc( @@ -282,7 +282,7 @@ func TestAccAWSSubnet_defaultTags_updateToProviderOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("key1", "value1"), testAccSubnetConfig, ), Check: resource.ComposeTestCheckFunc( @@ -314,7 +314,7 @@ func TestAccAWSSubnet_defaultTags_updateToResourceOnly(t *testing.T) { Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("key1", "value1"), testAccSubnetConfig, ), Check: resource.ComposeTestCheckFunc( @@ -356,7 +356,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag(t *testi Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccSubnetTagsConfig1(rName, "resourcekey1", "resourcevalue1"), ), Check: resource.ComposeTestCheckFunc( @@ -375,7 +375,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag(t *testi }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccSubnetTagsConfig2(rName, "resourcekey1", "resourcevalue1", "resourcekey2", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -391,7 +391,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag(t *testi }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), testAccSubnetTagsConfig1(rName, "resourcekey3", "resourcevalue3"), ), Check: resource.ComposeTestCheckFunc( @@ -420,7 +420,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag(t *testing. Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), testAccSubnetTagsConfig1(rName, "overlapkey1", "resourcevalue1"), ), Check: resource.ComposeTestCheckFunc( @@ -437,7 +437,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag(t *testing. }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), testAccSubnetTagsConfig2(rName, "overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -452,7 +452,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag(t *testing. }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), testAccSubnetTagsConfig1(rName, "overlapkey1", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -478,7 +478,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag(t *testing.T) Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), testAccSubnetTagsConfig1(rName, "overlapkey", "overlapvalue"), ), PlanOnly: true, @@ -488,6 +488,43 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag(t *testing.T) }) } +func TestAccAWSSubnet_defaultAndIgnoreTags(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckSubnetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSubnetTagsConfig1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + testAccCheckSubnetUpdateTags(&subnet, nil, map[string]string{"defaultkey1": "defaultvalue1"}), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultAndIgnoreTagsKeyPrefixes1("defaultkey1", "defaultvalue1", "defaultkey"), + testAccSubnetTagsConfig1(rName, "key1", "value1"), + ), + PlanOnly: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultAndIgnoreTagsKeys1("defaultkey1", "defaultvalue1"), + testAccSubnetTagsConfig1(rName, "key1", "value1"), + ), + PlanOnly: true, + }, + }, + }) +} + func TestAccAWSSubnet_ignoreTags(t *testing.T) { var providers []*schema.Provider var subnet ec2.Subnet diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index 0540da54cc2..8b2a82b740d 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -138,7 +138,7 @@ func resourceAwsVpc() *schema.Resource { func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig - tags := keyvaluetags.MergeConfigTags(defaultTagsConfig, d.Get("tags").(map[string]interface{})) + tags := defaultTagsConfig.MergeTags(keyvaluetags.New(d.Get("tags").(map[string]interface{}))) // Create the VPC createOpts := &ec2.CreateVpcInput{ diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index 463bd4f4d00..8b98bd3bde6 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -171,7 +171,7 @@ func TestAccAWSVpc_defaultTags_providerOnly(t *testing.T) { Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccVpcConfig, ), Check: resource.ComposeTestCheckFunc( @@ -188,7 +188,7 @@ func TestAccAWSVpc_defaultTags_providerOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags2("providerkey1", "providervalue1", "providerkey2", "providervalue2"), testAccVpcConfig, ), Check: resource.ComposeTestCheckFunc( @@ -201,7 +201,7 @@ func TestAccAWSVpc_defaultTags_providerOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "value1"), testAccVpcConfig, ), Check: resource.ComposeTestCheckFunc( @@ -237,7 +237,7 @@ func TestAccAWSVpc_defaultTags_updateToProviderOnly(t *testing.T) { }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("key1", "value1"), testAccVpcConfig, ), Check: resource.ComposeTestCheckFunc( @@ -268,7 +268,7 @@ func TestAccAWSVpc_defaultTags_updateToResourceOnly(t *testing.T) { Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("key1", "value1"), + testAccAWSProviderConfigDefaultTags_Tags1("key1", "value1"), testAccVpcConfig, ), Check: resource.ComposeTestCheckFunc( @@ -309,7 +309,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag(t *testing. Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccAWSVPCConfigTags1("resourcekey1", "resourcevalue1"), ), Check: resource.ComposeTestCheckFunc( @@ -328,7 +328,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag(t *testing. }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey1", "providervalue1"), testAccAWSVPCConfigTags2("resourcekey1", "resourcevalue1", "resourcekey2", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -344,7 +344,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag(t *testing. }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags1("providerkey2", "providervalue2"), testAccAWSVPCConfigTags1("resourcekey3", "resourcevalue3"), ), Check: resource.ComposeTestCheckFunc( @@ -372,7 +372,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag(t *testing.T) Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), testAccAWSVPCConfigTags1("overlapkey1", "resourcevalue1"), ), Check: resource.ComposeTestCheckFunc( @@ -389,7 +389,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag(t *testing.T) }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), + testAccAWSProviderConfigDefaultTags_Tags2("overlapkey1", "providervalue1", "overlapkey2", "providervalue2"), testAccAWSVPCConfigTags2("overlapkey1", "resourcevalue1", "overlapkey2", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -404,7 +404,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag(t *testing.T) }, { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey1", "providervalue1"), testAccAWSVPCConfigTags1("overlapkey1", "resourcevalue2"), ), Check: resource.ComposeTestCheckFunc( @@ -429,7 +429,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag(t *testing.T) { Steps: []resource.TestStep{ { Config: composeConfig( - testAccProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), + testAccAWSProviderConfigDefaultTags_Tags1("overlapkey", "overlapvalue"), testAccAWSVPCConfigTags1("overlapkey", "overlapvalue"), ), PlanOnly: true, @@ -439,6 +439,42 @@ func TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag(t *testing.T) { }) } +func TestAccAWSVpc_defaultAndIgnoreTags(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactoriesInternal(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSVPCConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + testAccCheckVpcUpdateTags(&vpc, nil, map[string]string{"defaultkey1": "defaultvalue1"}), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultAndIgnoreTagsKeyPrefixes1("defaultkey1", "defaultvalue1", "defaultkey"), + testAccAWSVPCConfigTags1("key1", "value1"), + ), + PlanOnly: true, + }, + { + Config: composeConfig( + testAccProviderConfigDefaultAndIgnoreTagsKeys1("defaultkey1", "defaultvalue1"), + testAccAWSVPCConfigTags1("key1", "value1"), + ), + PlanOnly: true, + }, + }, + }) +} + func TestAccAWSVpc_ignoreTags(t *testing.T) { var providers []*schema.Provider var vpc ec2.Vpc diff --git a/aws/tags.go b/aws/tags.go index 02e491677f1..d7b5f96580a 100644 --- a/aws/tags.go +++ b/aws/tags.go @@ -101,14 +101,15 @@ func ec2TagSpecificationsFromKeyValueTags(tags keyvaluetags.KeyValueTags, t stri // will be indistinguishable when returned from an AWS API. func SetTagsDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) error { defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - resourceTags := diff.Get("tags").(map[string]interface{}) + resourceTags := keyvaluetags.New(diff.Get("tags").(map[string]interface{})) - if defaultTagsConfig != nil && defaultTagsConfig.TagsEqual(keyvaluetags.New(resourceTags)) { + if defaultTagsConfig.TagsEqual(resourceTags) { return fmt.Errorf(`"tags" are identical to those in the "default_tags" configuration block of the provider: please de-duplicate and try again`) } - allTags := keyvaluetags.MergeConfigTags(defaultTagsConfig, resourceTags) + allTags := defaultTagsConfig.MergeTags(resourceTags).IgnoreConfig(ignoreTagsConfig) if err := diff.SetNew("tags_all", allTags.Map()); err != nil { return fmt.Errorf("error setting new tags_all diff: %w", err) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 1856f83889b..c7617475a27 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -218,7 +218,7 @@ for more information about connecting to alternate AWS endpoints or AWS compatib * `default_tags` - (Optional) **NOTE: This functionality is in public preview and there are no compatibility promises with future versions of the Terraform AWS Provider until a general availability announcement.** Map of tags to apply across all resources handled by this provider (see the [Terraform multiple provider instances documentation](/docs/configuration/providers.html#alias-multiple-provider-instances) for more information about additional provider configurations). -This is designed to replace redundant per-resource `tags` configurations. At this time, tags defined within this configuration block can be overridden with new values, but not ignored with the `ignore_changes` argument of a [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html). To override tag values defined within this configuration block, use the `tags` argument within a resource to configure new tag values for matching keys. +This is designed to replace redundant per-resource `tags` configurations. At this time, tags defined within this configuration block can be overridden with new values, but not excluded from specific resources. To override tag values defined within this configuration block, use the `tags` argument within a resource to configure new tag values for matching keys. See the [`default_tags`](#default_tags-configuration-block) Configuration Block section below for example usage and available arguments. This functionality is only supported in the following resources: - `aws_subnet` From 62adf9a24cab20196349e9661ccae6317ee45f68 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 16 Mar 2021 01:05:12 -0400 Subject: [PATCH 0063/1252] add AWS SDK enumerations and simplify validations; test linting --- .changelog/17876.txt | 3 + aws/resource_aws_waf_rule.go | 65 ++++++--- aws/resource_aws_waf_rule_test.go | 205 ++++++++++++--------------- aws/resource_aws_waf_web_acl.go | 37 ++--- aws/resource_aws_waf_web_acl_test.go | 38 ++--- 5 files changed, 166 insertions(+), 182 deletions(-) create mode 100644 .changelog/17876.txt diff --git a/.changelog/17876.txt b/.changelog/17876.txt new file mode 100644 index 00000000000..5c7ab8bd602 --- /dev/null +++ b/.changelog/17876.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL +``` diff --git a/aws/resource_aws_waf_rule.go b/aws/resource_aws_waf_rule.go index fcecd5a0264..964cbb945c2 100644 --- a/aws/resource_aws_waf_rule.go +++ b/aws/resource_aws_waf_rule.go @@ -3,14 +3,22 @@ package aws import ( "fmt" "log" + "regexp" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" +) + +const ( + WafRuleDeleteTimeout = 5 * time.Minute ) func resourceAwsWafRule() *schema.Resource { @@ -33,7 +41,7 @@ func resourceAwsWafRule() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateWafMetricName, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[0-9A-Za-z]+$`), "must contain only alphanumeric characters"), }, "predicates": { Type: schema.TypeSet, @@ -52,7 +60,7 @@ func resourceAwsWafRule() *schema.Resource { "type": { Type: schema.TypeString, Required: true, - ValidateFunc: validateWafPredicatesType(), + ValidateFunc: validation.StringInSlice(waf.PredicateType_Values(), false), }, }, }, @@ -84,9 +92,11 @@ func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { return conn.CreateRule(params) }) + if err != nil { - return err + return fmt.Errorf("error creating WAF Rule (%s): %w", d.Get("name").(string), err) } + resp := out.(*waf.CreateRuleOutput) d.SetId(aws.StringValue(resp.Rule.RuleId)) @@ -118,12 +128,12 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("error getting WAF Rule (%s): %w", d.Id(), err) + return fmt.Errorf("error reading WAF Rule (%s): %w", d.Id(), err) } if resp == nil || resp.Rule == nil { if d.IsNewResource() { - return fmt.Errorf("error getting WAF Rule (%s): not found", d.Id()) + return fmt.Errorf("error reading WAF Rule (%s): not found", d.Id()) } log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) @@ -153,7 +163,7 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { tags, err := keyvaluetags.WafListTags(conn, arn) if err != nil { - return fmt.Errorf("error listing tags for WAF Rule (%s): %w", d.Id(), err) + return fmt.Errorf("error listing tags for WAF Rule (%s): %w", arn, err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { @@ -204,24 +214,38 @@ func resourceAwsWafRuleDelete(d *schema.ResourceData, meta interface{}) error { } wr := newWafRetryer(conn) - _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { - req := &waf.DeleteRuleInput{ - ChangeToken: token, - RuleId: aws.String(d.Id()), - } + err := resource.Retry(WafRuleDeleteTimeout, func() *resource.RetryError { + var err error + _, err = wr.RetryWithToken(func(token *string) (interface{}, error) { + req := &waf.DeleteRuleInput{ + ChangeToken: token, + RuleId: aws.String(d.Id()), + } - output, err := conn.DeleteRule(req) + return conn.DeleteRule(req) + }) - // Deleting a WAF Rule after being removed from a WAF WebACL - // can return a WAFReferencedItemException when attempted in quick succession; - // thus, we catch the error here and re-attempt - if tfawserr.ErrCodeEquals(err, waf.ErrCodeReferencedItemException) { - return output, nil + if err != nil { + if tfawserr.ErrCodeEquals(err, waf.ErrCodeReferencedItemException) { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) } - return output, err + return nil }) + if tfresource.TimedOut(err) { + _, err = wr.RetryWithToken(func(token *string) (interface{}, error) { + req := &waf.DeleteRuleInput{ + ChangeToken: token, + RuleId: aws.String(d.Id()), + } + + return conn.DeleteRule(req) + }) + } + if err != nil { if tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { return nil @@ -243,9 +267,6 @@ func updateWafRuleResource(id string, oldP, newP []interface{}, conn *waf.WAF) e return conn.UpdateRule(req) }) - if err != nil { - return fmt.Errorf("error updating WAF Rule (%s): %w", id, err) - } - return nil + return err } diff --git a/aws/resource_aws_waf_rule_test.go b/aws/resource_aws_waf_rule_test.go index b0e27ae347e..1ab79ee6f3e 100644 --- a/aws/resource_aws_waf_rule_test.go +++ b/aws/resource_aws_waf_rule_test.go @@ -7,12 +7,11 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/go-multierror" "github.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/terraform-providers/terraform-provider-aws/aws/internal/service/waf/lister" ) @@ -45,6 +44,10 @@ func testSweepWafRules(region string) error { } for _, rule := range page.Rules { + if rule == nil { + continue + } + id := aws.StringValue(rule.RuleId) r := resourceAwsWafRule() @@ -166,7 +169,7 @@ func TestAccAWSWafRule_disappears(t *testing.T) { Config: testAccAWSWafRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRuleExists(resourceName, &v), - testAccCheckAWSWafRuleDisappears(&v), + testAccCheckResourceDisappears(testAccProvider, resourceAwsWafRule(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -179,7 +182,6 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { var byteMatchSet waf.ByteMatchSet var before, after waf.Rule - var idx int ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) resourceName := "aws_waf_rule.wafrule" @@ -195,7 +197,6 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { testAccCheckAWSWafRuleExists(resourceName, &before), resource.TestCheckResourceAttr(resourceName, "name", ruleName), resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), - computeWafRulePredicateWithIpSet(&ipset, false, "IPMatch", &idx), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "predicates.*", map[string]string{ "negated": "false", "type": "IPMatch", @@ -209,7 +210,6 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { testAccCheckAWSWafRuleExists(resourceName, &after), resource.TestCheckResourceAttr(resourceName, "name", ruleName), resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), - computeWafRulePredicateWithByteMatchSet(&byteMatchSet, true, "ByteMatch", &idx), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "predicates.*", map[string]string{ "negated": "true", "type": "ByteMatch", @@ -224,7 +224,6 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { var geoMatchSet waf.GeoMatchSet var v waf.Rule - var idx int ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) resourceName := "aws_waf_rule.wafrule" @@ -240,7 +239,6 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { testAccCheckAWSWafRuleExists(resourceName, &v), resource.TestCheckResourceAttr(resourceName, "name", ruleName), resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), - computeWafRulePredicateWithGeoMatchSet(&geoMatchSet, true, "GeoMatch", &idx), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "predicates.*", map[string]string{ "negated": "true", "type": "GeoMatch", @@ -251,61 +249,29 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { }) } -// computeWafRulePredicateWithIpSet calculates index -// which isn't static because dataId is generated as part of the test -func computeWafRulePredicateWithIpSet(ipSet *waf.IPSet, negated bool, pType string, idx *int) resource.TestCheckFunc { - return func(s *terraform.State) error { - predicateResource := resourceAwsWafRule().Schema["predicates"].Elem.(*schema.Resource) - - m := map[string]interface{}{ - "data_id": *ipSet.IPSetId, - "negated": negated, - "type": pType, - } - - f := schema.HashResource(predicateResource) - *idx = f(m) - - return nil - } -} - -// computeWafRulePredicateWithByteMatchSet calculates index -// which isn't static because dataId is generated as part of the test -func computeWafRulePredicateWithByteMatchSet(set *waf.ByteMatchSet, negated bool, pType string, idx *int) resource.TestCheckFunc { - return func(s *terraform.State) error { - predicateResource := resourceAwsWafRule().Schema["predicates"].Elem.(*schema.Resource) - - m := map[string]interface{}{ - "data_id": *set.ByteMatchSetId, - "negated": negated, - "type": pType, - } - - f := schema.HashResource(predicateResource) - *idx = f(m) - - return nil - } -} - -// computeWafRulePredicateWithGeoMatchSet calculates index -// which isn't static because dataId is generated as part of the test -func computeWafRulePredicateWithGeoMatchSet(set *waf.GeoMatchSet, negated bool, pType string, idx *int) resource.TestCheckFunc { - return func(s *terraform.State) error { - predicateResource := resourceAwsWafRule().Schema["predicates"].Elem.(*schema.Resource) - - m := map[string]interface{}{ - "data_id": *set.GeoMatchSetId, - "negated": negated, - "type": pType, - } - - f := schema.HashResource(predicateResource) - *idx = f(m) +// TestAccAWSWafRule_webACL validates the resource's +// retry behavior when removed from a WebACL +func TestAccAWSWafRule_webACL(t *testing.T) { + var rule waf.Rule + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_waf_rule.test" - return nil - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRuleConfig_referencedByWebACL(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleExists(resourceName, &rule), + ), + }, + { + Config: testAccAWSWafWebAclConfig_noRules(rName), + }, + }, + }) } func TestAccAWSWafRule_noPredicates(t *testing.T) { @@ -383,49 +349,6 @@ func TestAccAWSWafRule_Tags(t *testing.T) { }) } -func testAccCheckAWSWafRuleDisappears(v *waf.Rule) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).wafconn - - wr := newWafRetryer(conn) - _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { - req := &waf.UpdateRuleInput{ - ChangeToken: token, - RuleId: v.RuleId, - } - - for _, Predicate := range v.Predicates { - Predicate := &waf.RuleUpdate{ - Action: aws.String("DELETE"), - Predicate: &waf.Predicate{ - Negated: Predicate.Negated, - Type: Predicate.Type, - DataId: Predicate.DataId, - }, - } - req.Updates = append(req.Updates, Predicate) - } - - return conn.UpdateRule(req) - }) - if err != nil { - return fmt.Errorf("Error Updating WAF Rule: %s", err) - } - - _, err = wr.RetryWithToken(func(token *string) (interface{}, error) { - opts := &waf.DeleteRuleInput{ - ChangeToken: token, - RuleId: v.RuleId, - } - return conn.DeleteRule(opts) - }) - if err != nil { - return fmt.Errorf("Error Deleting WAF Rule: %s", err) - } - return nil - } -} - func testAccCheckAWSWafRuleDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_waf_rule" { @@ -438,20 +361,17 @@ func testAccCheckAWSWafRuleDestroy(s *terraform.State) error { RuleId: aws.String(rs.Primary.ID), }) - if err == nil { - if *resp.Rule.RuleId == rs.Primary.ID { - return fmt.Errorf("WAF Rule %s still exists", rs.Primary.ID) - } + if tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + continue } - // Return nil if the Rule is already destroyed - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == waf.ErrCodeNonexistentItemException { - return nil - } + if err != nil { + return fmt.Errorf("error reading WAF Rule (%s): %w", rs.Primary.ID, err) } - return err + if resp != nil && resp.Rule != nil { + return fmt.Errorf("WAF Rule (%s) still exists", rs.Primary.ID) + } } return nil @@ -682,3 +602,58 @@ resource "aws_waf_rule" "wafrule" { } `, rName, tag1Key, tag1Value, tag2Key, tag2Value) } + +func testAccAWSWafRuleConfig_referencedByWebACL(rName string) string { + return fmt.Sprintf(` +resource "aws_waf_ipset" "test" { + name = %[1]q + + ip_set_descriptors { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_waf_rule" "test" { + metric_name = "testrulemetric" + name = %[1]q + + predicates { + data_id = aws_waf_ipset.test.id + negated = false + type = "IPMatch" + } +} + +resource "aws_waf_web_acl" "test" { + metric_name = "testwebaclmetric" + name = %[1]q + + default_action { + type = "ALLOW" + } + + rules { + priority = 1 + rule_id = aws_waf_rule.test.id + + action { + type = "BLOCK" + } + } +} +`, rName) +} + +func testAccAWSWafWebAclConfig_noRules(rName string) string { + return fmt.Sprintf(` +resource "aws_waf_web_acl" "test" { + metric_name = "testwebaclmetric" + name = %[1]q + + default_action { + type = "ALLOW" + } +} +`, rName) +} diff --git a/aws/resource_aws_waf_web_acl.go b/aws/resource_aws_waf_web_acl.go index d0c9ff91793..7295cfb26f8 100644 --- a/aws/resource_aws_waf_web_acl.go +++ b/aws/resource_aws_waf_web_acl.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" @@ -50,7 +51,7 @@ func resourceAwsWafWebAcl() *schema.Resource { Type: schema.TypeString, Required: true, ForceNew: true, - ValidateFunc: validateWafMetricName, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[0-9A-Za-z]+$`), "must contain only alphanumeric characters"), }, "logging_configuration": { Type: schema.TypeList, @@ -126,14 +127,10 @@ func resourceAwsWafWebAcl() *schema.Resource { Required: true, }, "type": { - Type: schema.TypeString, - Optional: true, - Default: waf.WafRuleTypeRegular, - ValidateFunc: validation.StringInSlice([]string{ - waf.WafRuleTypeRegular, - waf.WafRuleTypeRateBased, - waf.WafRuleTypeGroup, - }, false), + Type: schema.TypeString, + Optional: true, + Default: waf.WafRuleTypeRegular, + ValidateFunc: validation.StringInSlice(waf.WafRuleType_Values(), false), }, "rule_id": { Type: schema.TypeString, @@ -166,9 +163,11 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error return conn.CreateWebACL(params) }) + if err != nil { - return err + return fmt.Errorf("error creating WAF Web ACL (%s): %w", d.Get("name").(string), err) } + resp := out.(*waf.CreateWebACLOutput) d.SetId(aws.StringValue(resp.WebACL.WebACLId)) @@ -186,7 +185,7 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error } if _, err := conn.PutLoggingConfiguration(input); err != nil { - return fmt.Errorf("error putting WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + return fmt.Errorf("error putting WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) } } @@ -202,6 +201,7 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error } return conn.UpdateWebACL(req) }) + if err != nil { return fmt.Errorf("error updating WAF Web ACL (%s): %w", d.Id(), err) } @@ -226,12 +226,12 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("error getting WAF Web ACL (%s): %w", d.Id(), err) + return fmt.Errorf("error reading WAF Web ACL (%s): %w", d.Id(), err) } if resp == nil || resp.WebACL == nil { if d.IsNewResource() { - return fmt.Errorf("error getting WAF Web ACL (%s): not found", d.Id()) + return fmt.Errorf("error reading WAF Web ACL (%s): not found", d.Id()) } log.Printf("[WARN] WAF Web ACL (%s) not found, removing from state", d.Id()) @@ -250,7 +250,7 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { tags, err := keyvaluetags.WafListTags(conn, arn) if err != nil { - return fmt.Errorf("error listing tags for WAF Web ACL (%s): %w", d.Id(), err) + return fmt.Errorf("error listing tags for WAF Web ACL (%s): %w", arn, err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) @@ -267,8 +267,8 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { getLoggingConfigurationOutput, err := conn.GetLoggingConfiguration(getLoggingConfigurationInput) - if err != nil && !isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { - return fmt.Errorf("error getting WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) + if err != nil && !tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + return fmt.Errorf("error reading WAF Web ACL (%s) Logging Configuration: %w", d.Id(), err) } if getLoggingConfigurationOutput != nil { @@ -368,9 +368,14 @@ func resourceAwsWafWebAclDelete(d *schema.ResourceData, meta interface{}) error return conn.DeleteWebACL(req) }) + if err != nil { + if tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + return nil + } return fmt.Errorf("error deleting WAF Web ACL (%s): %w", d.Id(), err) } + return nil } diff --git a/aws/resource_aws_waf_web_acl_test.go b/aws/resource_aws_waf_web_acl_test.go index 20132473f21..4c089b219f6 100644 --- a/aws/resource_aws_waf_web_acl_test.go +++ b/aws/resource_aws_waf_web_acl_test.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -309,7 +310,7 @@ func TestAccAWSWafWebAcl_disappears(t *testing.T) { Config: testAccAWSWafWebAclConfig_Required(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafWebAclExists(resourceName, &webACL), - testAccCheckAWSWafWebAclDisappears(&webACL), + testAccCheckResourceDisappears(testAccProvider, resourceAwsWafWebAcl(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -376,26 +377,6 @@ func TestAccAWSWafWebAcl_Tags(t *testing.T) { }) } -func testAccCheckAWSWafWebAclDisappears(v *waf.WebACL) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).wafconn - - wr := newWafRetryer(conn) - - _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { - opts := &waf.DeleteWebACLInput{ - ChangeToken: token, - WebACLId: v.WebACLId, - } - return conn.DeleteWebACL(opts) - }) - if err != nil { - return fmt.Errorf("Error Deleting WAF ACL: %s", err) - } - return nil - } -} - func testAccCheckAWSWafWebAclDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_waf_web_acl" { @@ -408,18 +389,17 @@ func testAccCheckAWSWafWebAclDestroy(s *terraform.State) error { WebACLId: aws.String(rs.Primary.ID), }) - if err == nil { - if *resp.WebACL.WebACLId == rs.Primary.ID { - return fmt.Errorf("WebACL %s still exists", rs.Primary.ID) - } + if tfawserr.ErrCodeEquals(err, waf.ErrCodeNonexistentItemException) { + continue } - // Return nil if the WebACL is already destroyed - if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { - continue + if err != nil { + return fmt.Errorf("error reading WAF Web ACL (%s): %w", rs.Primary.ID, err) } - return err + if resp != nil && resp.WebACL != nil { + return fmt.Errorf("WAF Web ACL (%s) still exists", rs.Primary.ID) + } } return nil From 7202bde3f1c66153f8d6f00a3059fb0e662700b3 Mon Sep 17 00:00:00 2001 From: Aaron Smith Date: Fri, 7 Feb 2020 21:35:54 -0600 Subject: [PATCH 0064/1252] r/aws_ssm_parameter: Adding support for Intelligent-Tiering --- aws/resource_aws_ssm_parameter.go | 1 + aws/resource_aws_ssm_parameter_test.go | 4 ++-- website/docs/r/ssm_parameter.html.markdown | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index b085eee4080..d1c1728c50a 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -47,6 +47,7 @@ func resourceAwsSsmParameter() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ ssm.ParameterTierStandard, ssm.ParameterTierAdvanced, + ssm.ParameterTierIntelligentTiering, }, false), }, "type": { diff --git a/aws/resource_aws_ssm_parameter_test.go b/aws/resource_aws_ssm_parameter_test.go index cc3650af14f..c50e61226dd 100644 --- a/aws/resource_aws_ssm_parameter_test.go +++ b/aws/resource_aws_ssm_parameter_test.go @@ -55,10 +55,10 @@ func TestAccAWSSSMParameter_Tier(t *testing.T) { CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSSMParameterConfigTier(rName, "Advanced"), + Config: testAccAWSSSMParameterConfigTier(rName, "Intelligent-Tiering"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶meter1), - resource.TestCheckResourceAttr(resourceName, "tier", "Advanced"), + resource.TestCheckResourceAttr(resourceName, "tier", "Standard"), ), }, { diff --git a/website/docs/r/ssm_parameter.html.markdown b/website/docs/r/ssm_parameter.html.markdown index a97415e3fd8..269b9d7e47d 100644 --- a/website/docs/r/ssm_parameter.html.markdown +++ b/website/docs/r/ssm_parameter.html.markdown @@ -61,7 +61,7 @@ The following arguments are supported: * `type` - (Required) The type of the parameter. Valid types are `String`, `StringList` and `SecureString`. * `value` - (Required) The value of the parameter. * `description` - (Optional) The description of the parameter. -* `tier` - (Optional) The tier of the parameter. If not specified, will default to `Standard`. Valid tiers are `Standard` and `Advanced`. For more information on parameter tiers, see the [AWS SSM Parameter tier comparison and guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html). +* `tier` - (Optional) The tier of the parameter. If not specified, will default to `Standard`. Valid tiers are `Standard`, `Advanced`, and `Intelligent-Tiering`. For more information on parameter tiers, see the [AWS SSM Parameter tier comparison and guide](https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-advanced-parameters.html). * `key_id` - (Optional) The KMS key id or arn for encrypting a SecureString. * `overwrite` - (Optional) Overwrite an existing parameter. If not specified, will default to `false` if the resource has not been created by terraform to avoid overwrite of existing resource and will default to `true` otherwise (terraform lifecycle rules should then be used to manage the update behavior). * `allowed_pattern` - (Optional) A regular expression used to validate the parameter value. From 212cc7f6d1d10d9c42dde453a36849b9328aafd4 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 16 Mar 2021 02:42:26 -0400 Subject: [PATCH 0065/1252] Update CHANGELOG for #11967 --- .changelog/11967.txt | 3 + aws/resource_aws_ssm_parameter.go | 29 +++--- aws/resource_aws_ssm_parameter_test.go | 139 ++++++++++++++++++++----- 3 files changed, 130 insertions(+), 41 deletions(-) create mode 100644 .changelog/11967.txt diff --git a/.changelog/11967.txt b/.changelog/11967.txt new file mode 100644 index 00000000000..c76920ac6e0 --- /dev/null +++ b/.changelog/11967.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` +``` diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index d1c1728c50a..901fd3d81be 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -41,23 +41,18 @@ func resourceAwsSsmParameter() *schema.Resource { Optional: true, }, "tier": { - Type: schema.TypeString, - Optional: true, - Default: ssm.ParameterTierStandard, - ValidateFunc: validation.StringInSlice([]string{ - ssm.ParameterTierStandard, - ssm.ParameterTierAdvanced, - ssm.ParameterTierIntelligentTiering, - }, false), + Type: schema.TypeString, + Optional: true, + Default: ssm.ParameterTierStandard, + ValidateFunc: validation.StringInSlice(ssm.ParameterTier_Values(), false), + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return d.Get("tier").(string) == ssm.ParameterTierIntelligentTiering + }, }, "type": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - ssm.ParameterTypeString, - ssm.ParameterTypeStringList, - ssm.ParameterTypeSecureString, - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(ssm.ParameterType_Values(), false), }, "value": { Type: schema.TypeString, @@ -101,8 +96,10 @@ func resourceAwsSsmParameter() *schema.Resource { CustomizeDiff: customdiff.All( // Prevent the following error during tier update from Advanced to Standard: // ValidationException: This parameter uses the advanced-parameter tier. You can't downgrade a parameter from the advanced-parameter tier to the standard-parameter tier. If necessary, you can delete the advanced parameter and recreate it as a standard parameter. + // In the case of Advanced to Intelligent-Tiering, a ValidationException is not thrown + // but rather no change occurs without resource re-creation customdiff.ForceNewIfChange("tier", func(_ context.Context, old, new, meta interface{}) bool { - return old.(string) == ssm.ParameterTierAdvanced && new.(string) == ssm.ParameterTierStandard + return old.(string) == ssm.ParameterTierAdvanced && (new.(string) == ssm.ParameterTierStandard || new.(string) == ssm.ParameterTierIntelligentTiering) }), ), } diff --git a/aws/resource_aws_ssm_parameter_test.go b/aws/resource_aws_ssm_parameter_test.go index c50e61226dd..c1ca33f899a 100644 --- a/aws/resource_aws_ssm_parameter_test.go +++ b/aws/resource_aws_ssm_parameter_test.go @@ -6,6 +6,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -55,10 +56,10 @@ func TestAccAWSSSMParameter_Tier(t *testing.T) { CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSSMParameterConfigTier(rName, "Intelligent-Tiering"), + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierAdvanced), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶meter1), - resource.TestCheckResourceAttr(resourceName, "tier", "Standard"), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierAdvanced), ), }, { @@ -68,19 +69,113 @@ func TestAccAWSSSMParameter_Tier(t *testing.T) { ImportStateVerifyIgnore: []string{"overwrite"}, }, { - Config: testAccAWSSSMParameterConfigTier(rName, "Standard"), + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierStandard), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶meter2), - resource.TestCheckResourceAttr(resourceName, "tier", "Standard"), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), ), }, { - Config: testAccAWSSSMParameterConfigTier(rName, "Advanced"), + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierAdvanced), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶meter3), - resource.TestCheckResourceAttr(resourceName, "tier", "Advanced"), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierAdvanced), + ), + }, + }, + }) +} + +func TestAccAWSSSMParameter_Tier_IntelligentTieringToStandard(t *testing.T) { + var parameter ssm.Parameter + rName := fmt.Sprintf("%s_%s", t.Name(), acctest.RandString(10)) + resourceName := "aws_ssm_parameter.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMParameterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierIntelligentTiering), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"overwrite"}, + }, + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierStandard), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), + ), + }, + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierIntelligentTiering), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"overwrite"}, + }, + }, + }) +} + +func TestAccAWSSSMParameter_Tier_IntelligentTieringToAdvanced(t *testing.T) { + var parameter1, parameter2 ssm.Parameter + rName := fmt.Sprintf("%s_%s", t.Name(), acctest.RandString(10)) + resourceName := "aws_ssm_parameter.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMParameterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierIntelligentTiering), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter1), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"overwrite"}, + }, + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierAdvanced), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter1), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierAdvanced), + ), + }, + { + Config: testAccAWSSSMParameterConfigTier(rName, ssm.ParameterTierIntelligentTiering), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶meter2), + resource.TestCheckResourceAttr(resourceName, "tier", ssm.ParameterTierStandard), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"overwrite"}, + }, }, }) } @@ -99,7 +194,7 @@ func TestAccAWSSSMParameter_disappears(t *testing.T) { Config: testAccAWSSSMParameterBasicConfig(name, "String", "test2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶m), - testAccCheckAWSSSMParameterDisappears(¶m), + testAccCheckResourceDisappears(testAccProvider, resourceAwsSsmParameter(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -476,20 +571,6 @@ func testAccCheckAWSSSMParameterExists(n string, param *ssm.Parameter) resource. } } -func testAccCheckAWSSSMParameterDisappears(param *ssm.Parameter) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).ssmconn - - paramInput := &ssm.DeleteParameterInput{ - Name: param.Name, - } - - _, err := conn.DeleteParameter(paramInput) - - return err - } -} - func testAccCheckAWSSSMParameterDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ssmconn @@ -504,13 +585,21 @@ func testAccCheckAWSSSMParameterDestroy(s *terraform.State) error { }, } - resp, _ := conn.GetParameters(paramInput) + resp, err := conn.GetParameters(paramInput) - if len(resp.Parameters) > 0 { - return fmt.Errorf("Expected AWS SSM Parameter to be gone, but was still found") + if tfawserr.ErrCodeEquals(err, ssm.ErrCodeParameterNotFound) { + continue } - return nil + if err != nil { + return fmt.Errorf("error reading SSM Parameter (%s): %w", rs.Primary.ID, err) + } + + if resp == nil || len(resp.Parameters) == 0 { + continue + } + + return fmt.Errorf("Expected AWS SSM Parameter to be gone, but was still found") } return nil From db11409de90c2a6b4a57702b825368a688df3b39 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 16 Mar 2021 10:16:27 -0400 Subject: [PATCH 0066/1252] docs/provider: Fix various header issues (#18007) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 This targets header issues except "missing attribute section" across the provider, which will be submitted separately to reduce review burden. Previously: ``` * website/docs/r/acm_certificate.html.markdown: error checking file contents: import section heading level (3) should be: 2 * website/docs/r/cognito_user_pool_ui_customization.html.markdown: error checking file contents: example section heading level (3) should be: 2 * website/docs/r/config_conformance_pack.html.markdown: error checking file contents: example section heading (Example Usage with Template Body) should be: Example Usage * website/docs/r/devicefarm_project.html.markdown: error checking file contents: missing example section: ## Example Usage * website/docs/r/emr_instance_fleet.html.markdown: error checking file contents: title section heading (aws_emr_instance_fleet) should have prefix: "Data Source: " or "Resource: " * website/docs/r/iam_user_group_membership.html.markdown: error checking file contents: example section heading (Example usage) should be: Example Usage * website/docs/r/lightsail_domain.html.markdown: error checking file contents: example section heading (Example Usage, creating a new domain) should be: Example Usage * website/docs/r/lightsail_key_pair.html.markdown: error checking file contents: example section heading (Example Usage, creating a new Key Pair) should be: Example Usage * website/docs/r/load_balancer_listener_policy.html.markdown: error checking file contents: example section heading (Example Usage for Custom Policy) should be: Example Usage * website/docs/r/networkfirewall_resource_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/secretsmanager_secret_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/securityhub_invite_accepter.markdown: error checking file contents: title section heading (aws_securityhub_invite_accepter) should have prefix: "Data Source: " or "Resource: " * website/docs/r/ssm_maintenance_window_target.html.markdown: error checking file contents: missing example section: ## Example Usage * website/docs/r/transfer_server.html.markdown: error checking file contents: title section code examples should be in Example Usage section * website/docs/r/transfer_ssh_key.html.markdown: error checking file contents: title section code examples should be in Example Usage section * website/docs/r/transfer_user.html.markdown: error checking file contents: title section code examples should be in Example Usage section * website/docs/r/vpc_peering_connection_options.html.markdown: error checking file contents: title section code examples should be in Example Usage section * website/docs/r/wafregional_web_acl_association.html.markdown: error checking file contents: missing example section: ## Example Usage * website/docs/r/cognito_user_pool_client.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/fms_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/workspaces_directory.html.markdown: error checking file contents: arguments section heading (Arguments Reference) should be: Argument Reference ``` --- website/docs/r/acm_certificate.html.markdown | 4 ++-- website/docs/r/cognito_user_pool_client.markdown | 2 +- .../r/cognito_user_pool_ui_customization.html.markdown | 2 +- website/docs/r/config_conformance_pack.html.markdown | 6 ++++-- website/docs/r/devicefarm_project.html.markdown | 2 +- website/docs/r/emr_instance_fleet.html.markdown | 2 +- website/docs/r/fms_policy.html.markdown | 2 +- website/docs/r/glue_dev_endpoint.markdown | 2 +- website/docs/r/iam_user_group_membership.html.markdown | 2 +- website/docs/r/lightsail_domain.html.markdown | 2 +- website/docs/r/lightsail_key_pair.html.markdown | 8 +++++--- .../docs/r/load_balancer_listener_policy.html.markdown | 6 ++++-- .../docs/r/networkfirewall_resource_policy.html.markdown | 2 +- website/docs/r/secretsmanager_secret_policy.html.markdown | 2 +- website/docs/r/securityhub_invite_accepter.markdown | 2 +- .../docs/r/ssm_maintenance_window_target.html.markdown | 6 ++++-- website/docs/r/transfer_server.html.markdown | 1 + website/docs/r/transfer_ssh_key.html.markdown | 1 + website/docs/r/transfer_user.html.markdown | 1 + .../docs/r/vpc_peering_connection_options.html.markdown | 6 ++++-- .../docs/r/wafregional_web_acl_association.html.markdown | 6 ++++-- website/docs/r/workspaces_directory.html.markdown | 2 +- 22 files changed, 42 insertions(+), 27 deletions(-) diff --git a/website/docs/r/acm_certificate.html.markdown b/website/docs/r/acm_certificate.html.markdown index 632596cc772..533b16ade56 100644 --- a/website/docs/r/acm_certificate.html.markdown +++ b/website/docs/r/acm_certificate.html.markdown @@ -28,7 +28,7 @@ which is currently in use (eg, by [`aws_lb_listener`](lb_listener.html)). ## Example Usage -### Certificate creation +### Create Certificate ```hcl resource "aws_acm_certificate" "cert" { @@ -45,7 +45,7 @@ resource "aws_acm_certificate" "cert" { } ``` -### Importing an existing certificate +### Existing Certificate Body Import ```hcl resource "tls_private_key" "example" { diff --git a/website/docs/r/cognito_user_pool_client.markdown b/website/docs/r/cognito_user_pool_client.markdown index c8b6ec2193e..712c4e91ea0 100644 --- a/website/docs/r/cognito_user_pool_client.markdown +++ b/website/docs/r/cognito_user_pool_client.markdown @@ -155,7 +155,7 @@ Valid values for the following arguments are: `seconds`, `minutes`, `hours` or ` * `id_token` - (Optional) Time unit in for the value in `id_token_validity`, defaults to `hours`. * `refresh_token` - (Optional) Time unit in for the value in `refresh_token_validity`, defaults to `days`. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/cognito_user_pool_ui_customization.html.markdown b/website/docs/r/cognito_user_pool_ui_customization.html.markdown index cca7ca7da7d..2aff7abc2f9 100644 --- a/website/docs/r/cognito_user_pool_ui_customization.html.markdown +++ b/website/docs/r/cognito_user_pool_ui_customization.html.markdown @@ -12,7 +12,7 @@ Provides a Cognito User Pool UI Customization resource. ~> **Note:** To use this resource, the user pool must have a domain associated with it. For more information, see the Amazon Cognito Developer Guide on [Customizing the Built-in Sign-In and Sign-up Webpages](https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-ui-customization.html). -### Example Usage +## Example Usage ### UI customization settings for a single client diff --git a/website/docs/r/config_conformance_pack.html.markdown b/website/docs/r/config_conformance_pack.html.markdown index bd2f77c50f9..8a60c517cfc 100644 --- a/website/docs/r/config_conformance_pack.html.markdown +++ b/website/docs/r/config_conformance_pack.html.markdown @@ -17,7 +17,9 @@ Sample Conformance Pack templates may be found in the successfully create or update. See also the [`aws_config_configuration_recorder` resource](/docs/providers/aws/r/config_configuration_recorder.html). -## Example Usage with Template Body +## Example Usage + +### Template Body ```hcl resource "aws_config_conformance_pack" "example" { @@ -46,7 +48,7 @@ EOT } ``` -## Example Usage with Template S3 URI +### Template S3 URI ```hcl resource "aws_config_conformance_pack" "example" { diff --git a/website/docs/r/devicefarm_project.html.markdown b/website/docs/r/devicefarm_project.html.markdown index 7c77699b4d9..002f0ecfbe5 100644 --- a/website/docs/r/devicefarm_project.html.markdown +++ b/website/docs/r/devicefarm_project.html.markdown @@ -15,7 +15,7 @@ For more information about Device Farm Projects, see the AWS Documentation on ~> **NOTE:** AWS currently has limited regional support for Device Farm (e.g. `us-west-2`). See [AWS Device Farm endpoints and quotas](https://docs.aws.amazon.com/general/latest/gr/devicefarm.html) for information on supported regions. -## Basic Example Usage +## Example Usage ```hcl diff --git a/website/docs/r/emr_instance_fleet.html.markdown b/website/docs/r/emr_instance_fleet.html.markdown index 8c3837ce941..6c0eda05dc0 100644 --- a/website/docs/r/emr_instance_fleet.html.markdown +++ b/website/docs/r/emr_instance_fleet.html.markdown @@ -6,7 +6,7 @@ description: |- Provides an Elastic MapReduce Cluster Instance Fleet --- -# aws_emr_instance_fleet +# Resource: aws_emr_instance_fleet Provides an Elastic MapReduce Cluster Instance Fleet configuration. See [Amazon Elastic MapReduce Documentation](https://aws.amazon.com/documentation/emr/) for more information. diff --git a/website/docs/r/fms_policy.html.markdown b/website/docs/r/fms_policy.html.markdown index 1edea10b9c8..6b6d886d979 100644 --- a/website/docs/r/fms_policy.html.markdown +++ b/website/docs/r/fms_policy.html.markdown @@ -72,7 +72,7 @@ The following arguments are supported: * `managed_service_data` (Optional) Details about the service that are specific to the service type, in JSON format. For service type `SHIELD_ADVANCED`, this is an empty string. Examples depending on `type` can be found in the [AWS Firewall Manager SecurityServicePolicyData API Reference](https://docs.aws.amazon.com/fms/2018-01-01/APIReference/API_SecurityServicePolicyData.html). * `type` - (Required, Forces new resource) The service that the policy is using to protect the resources. Valid values are `WAFV2`, `WAF`, `SHIELD_ADVANCED`, `SECURITY_GROUPS_COMMON`, `SECURITY_GROUPS_CONTENT_AUDIT`, and `SECURITY_GROUPS_USAGE_AUDIT`. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/glue_dev_endpoint.markdown b/website/docs/r/glue_dev_endpoint.markdown index 9ae314e235c..847f62962ba 100644 --- a/website/docs/r/glue_dev_endpoint.markdown +++ b/website/docs/r/glue_dev_endpoint.markdown @@ -6,7 +6,7 @@ description: |- Provides a Glue Development Endpoint resource. --- -# aws_glue_dev_endpoint +# Resource: aws_glue_dev_endpoint Provides a Glue Development Endpoint resource. diff --git a/website/docs/r/iam_user_group_membership.html.markdown b/website/docs/r/iam_user_group_membership.html.markdown index 5c412cc61b0..a53e9c4a85d 100644 --- a/website/docs/r/iam_user_group_membership.html.markdown +++ b/website/docs/r/iam_user_group_membership.html.markdown @@ -16,7 +16,7 @@ groups. To exclusively manage the users in a group, see the [`aws_iam_group_membership` resource][3]. -## Example usage +## Example Usage ```hcl resource "aws_iam_user_group_membership" "example1" { diff --git a/website/docs/r/lightsail_domain.html.markdown b/website/docs/r/lightsail_domain.html.markdown index 027c3168c00..b00f7314be0 100644 --- a/website/docs/r/lightsail_domain.html.markdown +++ b/website/docs/r/lightsail_domain.html.markdown @@ -16,7 +16,7 @@ this parameter to manage the DNS records for that domain. ~> **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details -## Example Usage, creating a new domain +## Example Usage ```hcl resource "aws_lightsail_domain" "domain_test" { diff --git a/website/docs/r/lightsail_key_pair.html.markdown b/website/docs/r/lightsail_key_pair.html.markdown index 7f5e8c02f37..2c8d3c7bf34 100644 --- a/website/docs/r/lightsail_key_pair.html.markdown +++ b/website/docs/r/lightsail_key_pair.html.markdown @@ -14,7 +14,9 @@ Lightsail. ~> **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details -## Example Usage, creating a new Key Pair +## Example Usage + +### Create New Key Pair ```hcl # Create a new Lightsail Key Pair @@ -23,7 +25,7 @@ resource "aws_lightsail_key_pair" "lg_key_pair" { } ``` -## Create new Key Pair, encrypting the private key with a PGP Key +### Create New Key Pair with PGP Encrypted Private Key ```hcl resource "aws_lightsail_key_pair" "lg_key_pair" { @@ -32,7 +34,7 @@ resource "aws_lightsail_key_pair" "lg_key_pair" { } ``` -## Import an existing public key +### Existing Public Key Import ```hcl resource "aws_lightsail_key_pair" "lg_key_pair" { diff --git a/website/docs/r/load_balancer_listener_policy.html.markdown b/website/docs/r/load_balancer_listener_policy.html.markdown index 05ebc11ad05..eb72817ad91 100644 --- a/website/docs/r/load_balancer_listener_policy.html.markdown +++ b/website/docs/r/load_balancer_listener_policy.html.markdown @@ -11,7 +11,9 @@ description: |- Attaches a load balancer policy to an ELB Listener. -## Example Usage for Custom Policy +## Example Usage + +### Custom Policy ```hcl resource "aws_elb" "wu-tang" { @@ -59,7 +61,7 @@ resource "aws_load_balancer_listener_policy" "wu-tang-listener-policies-443" { This example shows how to customize the TLS settings of an HTTPS listener. -## Example Usage for AWS Predefined Security Policy +### AWS Predefined Security Policy ```hcl resource "aws_elb" "wu-tang" { diff --git a/website/docs/r/networkfirewall_resource_policy.html.markdown b/website/docs/r/networkfirewall_resource_policy.html.markdown index e4efd999965..ede3b3dfad0 100644 --- a/website/docs/r/networkfirewall_resource_policy.html.markdown +++ b/website/docs/r/networkfirewall_resource_policy.html.markdown @@ -69,7 +69,7 @@ The following arguments are supported: * `resource_arn` - (Required, Forces new resource) The Amazon Resource Name (ARN) of the rule group or firewall policy. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attribute is exported: diff --git a/website/docs/r/secretsmanager_secret_policy.html.markdown b/website/docs/r/secretsmanager_secret_policy.html.markdown index 5416eeb09c2..d564419a044 100644 --- a/website/docs/r/secretsmanager_secret_policy.html.markdown +++ b/website/docs/r/secretsmanager_secret_policy.html.markdown @@ -49,7 +49,7 @@ The following arguments are supported: * `policy` - (Required) A valid JSON document representing a [resource policy](https://docs.aws.amazon.com/secretsmanager/latest/userguide/auth-and-access_resource-based-policies.html). For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). * `block_public_policy` - (Optional) Makes an optional API call to Zelkova to validate the Resource Policy to prevent broad access to your secret. -## Attribute Reference +## Attributes Reference * `id` - Amazon Resource Name (ARN) of the secret. diff --git a/website/docs/r/securityhub_invite_accepter.markdown b/website/docs/r/securityhub_invite_accepter.markdown index fac4506ebfb..319416bb942 100644 --- a/website/docs/r/securityhub_invite_accepter.markdown +++ b/website/docs/r/securityhub_invite_accepter.markdown @@ -6,7 +6,7 @@ description: |- Accepts a Security Hub invitation. --- -# aws_securityhub_invite_accepter +# Resource: aws_securityhub_invite_accepter -> **Note:** AWS accounts can only be associated with a single Security Hub master account. Destroying this resource will disassociate the member account from the master account. diff --git a/website/docs/r/ssm_maintenance_window_target.html.markdown b/website/docs/r/ssm_maintenance_window_target.html.markdown index dce46031e6b..4a7e31cd4a2 100644 --- a/website/docs/r/ssm_maintenance_window_target.html.markdown +++ b/website/docs/r/ssm_maintenance_window_target.html.markdown @@ -10,7 +10,9 @@ description: |- Provides an SSM Maintenance Window Target resource -## Instance Target Example Usage +## Example Usage + +### Instance Target ```hcl resource "aws_ssm_maintenance_window" "window" { @@ -33,7 +35,7 @@ resource "aws_ssm_maintenance_window_target" "target1" { } ``` -## Resource Group Target Example Usage +### Resource Group Target ```hcl resource "aws_ssm_maintenance_window" "window" { diff --git a/website/docs/r/transfer_server.html.markdown b/website/docs/r/transfer_server.html.markdown index 550a3175e46..09bc5988851 100644 --- a/website/docs/r/transfer_server.html.markdown +++ b/website/docs/r/transfer_server.html.markdown @@ -10,6 +10,7 @@ description: |- Provides a AWS Transfer Server resource. +## Example Usage ```hcl resource "aws_transfer_server" "example" { diff --git a/website/docs/r/transfer_ssh_key.html.markdown b/website/docs/r/transfer_ssh_key.html.markdown index d0ac0f7d7e3..fd3f222feab 100644 --- a/website/docs/r/transfer_ssh_key.html.markdown +++ b/website/docs/r/transfer_ssh_key.html.markdown @@ -10,6 +10,7 @@ description: |- Provides a AWS Transfer User SSH Key resource. +## Example Usage ```hcl resource "aws_transfer_ssh_key" "example" { diff --git a/website/docs/r/transfer_user.html.markdown b/website/docs/r/transfer_user.html.markdown index e5c12663b74..e3612371a3c 100644 --- a/website/docs/r/transfer_user.html.markdown +++ b/website/docs/r/transfer_user.html.markdown @@ -10,6 +10,7 @@ description: |- Provides a AWS Transfer User resource. Managing SSH keys can be accomplished with the [`aws_transfer_ssh_key` resource](/docs/providers/aws/r/transfer_ssh_key.html). +## Example Usage ```hcl resource "aws_transfer_server" "foo" { diff --git a/website/docs/r/vpc_peering_connection_options.html.markdown b/website/docs/r/vpc_peering_connection_options.html.markdown index ce5a9a463f1..efaec0ada0c 100644 --- a/website/docs/r/vpc_peering_connection_options.html.markdown +++ b/website/docs/r/vpc_peering_connection_options.html.markdown @@ -19,7 +19,9 @@ Using a VPC Peering Connection Options resource decouples management of the conn management of the VPC Peering Connection and allows options to be set correctly in cross-region and cross-account scenarios. -Basic usage: +## Example Usage + +### Basic Usage ```hcl resource "aws_vpc" "foo" { @@ -50,7 +52,7 @@ resource "aws_vpc_peering_connection_options" "foo" { } ``` -Basic cross-account usage: +### Cross-Account Usage ```hcl provider "aws" { diff --git a/website/docs/r/wafregional_web_acl_association.html.markdown b/website/docs/r/wafregional_web_acl_association.html.markdown index 383ae77c435..acbfe6358f3 100644 --- a/website/docs/r/wafregional_web_acl_association.html.markdown +++ b/website/docs/r/wafregional_web_acl_association.html.markdown @@ -12,7 +12,9 @@ Manages an association with WAF Regional Web ACL. -> **Note:** An Application Load Balancer can only be associated with one WAF Regional WebACL. -## Application Load Balancer Association Example +## Example Usage + +### Application Load Balancer Association ```hcl resource "aws_wafregional_ipset" "ipset" { @@ -82,7 +84,7 @@ resource "aws_wafregional_web_acl_association" "foo" { } ``` -## API Gateway Association Example +### API Gateway Association ```hcl resource "aws_wafregional_ipset" "ipset" { diff --git a/website/docs/r/workspaces_directory.html.markdown b/website/docs/r/workspaces_directory.html.markdown index f9b523949d0..53bd1a31882 100644 --- a/website/docs/r/workspaces_directory.html.markdown +++ b/website/docs/r/workspaces_directory.html.markdown @@ -142,7 +142,7 @@ resource "aws_workspaces_ip_group" "example" { } ``` -## Arguments Reference +## Argument Reference The following arguments are supported: From 2f858b3f4457f5be4caf06ea585b031bdd889ab3 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 16 Mar 2021 10:20:26 -0400 Subject: [PATCH 0067/1252] docs/provider: Attribute headers and byline fixes (S-W resources) (#18021) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Previously: ``` * website/docs/r/s3_bucket_analytics_configuration.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/s3_bucket_inventory.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/s3_bucket_metric.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/s3_bucket_notification.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/s3_bucket_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/s3_object_copy.html.markdown: error checking file contents: attributes section byline (The following attributes are exported) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_app.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_domain.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_image.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_image_version.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_model_package_group.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/sagemaker_user_profile.html.markdown: error checking file contents: attributes section byline (The following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/secretsmanager_secret_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/ses_active_receipt_rule_set.html.markdown: error checking file contents: attributes section byline (In addition to the arguments, which are exported, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/ses_configuration_set.html.markdown: error checking file contents: attributes section byline (In addition to the arguments, which are exported, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/ses_event_destination.html.markdown: error checking file contents: attributes section byline (In addition to the arguments, which are exported, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/ses_identity_notification_topic.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ses_identity_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ses_receipt_rule.html.markdown: error checking file contents: attributes section byline (In addition to the arguments, which are exported, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/ses_receipt_rule_set.html.markdown: error checking file contents: attributes section byline (In addition to the arguments, which are exported, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/signer_signing_profile_permission.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/sns_sms_preferences.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/sns_topic_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/spot_datafeed_subscription.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/sqs_queue_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ssm_resource_data_sync.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ssoadmin_account_assignment.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/ssoadmin_managed_policy_attachment.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/ssoadmin_permission_set.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/storagegateway_tape_pool.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/vpc_peering_connection_accepter.html.markdown: error checking file contents: attributes section byline (All of the argument attributes except auto_accept are also exported as result attributes.) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/vpn_gateway_route_propagation.html.markdown: error checking file contents: attributes section byline (This resource does not export any additional attributes.) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/wafv2_web_acl_association.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference ``` --- .../docs/r/s3_bucket_analytics_configuration.html.markdown | 4 ++++ website/docs/r/s3_bucket_inventory.html.markdown | 4 ++++ website/docs/r/s3_bucket_metric.html.markdown | 4 ++++ website/docs/r/s3_bucket_notification.html.markdown | 4 ++++ website/docs/r/s3_bucket_policy.html.markdown | 3 +++ website/docs/r/s3_object_copy.html.markdown | 2 +- website/docs/r/sagemaker_app.html.markdown | 3 +-- website/docs/r/sagemaker_domain.html.markdown | 3 +-- website/docs/r/sagemaker_image.html.markdown | 2 +- website/docs/r/sagemaker_image_version.html.markdown | 2 +- website/docs/r/sagemaker_model_package_group.html.markdown | 2 +- website/docs/r/sagemaker_user_profile.html.markdown | 3 +-- website/docs/r/secretsmanager_secret_policy.html.markdown | 2 ++ website/docs/r/ses_active_receipt_rule_set.html.markdown | 2 +- website/docs/r/ses_configuration_set.html.markdown | 2 +- website/docs/r/ses_event_destination.html.markdown | 2 +- website/docs/r/ses_identity_notification_topic.markdown | 4 ++++ website/docs/r/ses_identity_policy.html.markdown | 4 ++++ website/docs/r/ses_receipt_rule.html.markdown | 2 +- website/docs/r/ses_receipt_rule_set.html.markdown | 2 +- .../docs/r/signer_signing_profile_permission.html.markdown | 4 ++++ website/docs/r/sns_sms_preferences.html.markdown | 4 ++++ website/docs/r/sns_topic_policy.html.markdown | 4 ++++ website/docs/r/spot_datafeed_subscription.html.markdown | 4 ++++ website/docs/r/sqs_queue_policy.html.markdown | 4 ++++ website/docs/r/ssm_resource_data_sync.html.markdown | 4 ++++ website/docs/r/ssoadmin_account_assignment.html.markdown | 2 +- .../docs/r/ssoadmin_managed_policy_attachment.html.markdown | 2 +- website/docs/r/ssoadmin_permission_set.html.markdown | 2 +- .../r/ssoadmin_permission_set_inline_policy.html.markdown | 2 +- website/docs/r/storagegateway_tape_pool.html.markdown | 2 +- website/docs/r/vpc_peering_connection_accepter.html.markdown | 2 +- website/docs/r/vpn_gateway_route_propagation.html.markdown | 2 +- website/docs/r/wafv2_web_acl_association.html.markdown | 4 ++++ 34 files changed, 76 insertions(+), 22 deletions(-) diff --git a/website/docs/r/s3_bucket_analytics_configuration.html.markdown b/website/docs/r/s3_bucket_analytics_configuration.html.markdown index efdf0a91938..81820a70bc9 100644 --- a/website/docs/r/s3_bucket_analytics_configuration.html.markdown +++ b/website/docs/r/s3_bucket_analytics_configuration.html.markdown @@ -95,6 +95,10 @@ The `s3_bucket_destination` configuration supports the following: * `format` - (Optional) The output format of exported analytics data. Allowed values: `CSV`. Default value: `CSV`. * `prefix` - (Optional) The prefix to append to exported analytics data. +## Attributes Reference + +No additional attributes are exported. + ## Import S3 bucket analytics configurations can be imported using `bucket:analytics`, e.g. diff --git a/website/docs/r/s3_bucket_inventory.html.markdown b/website/docs/r/s3_bucket_inventory.html.markdown index 59fabe61c66..02e99e8bab9 100644 --- a/website/docs/r/s3_bucket_inventory.html.markdown +++ b/website/docs/r/s3_bucket_inventory.html.markdown @@ -120,6 +120,10 @@ The `sse_kms` configuration supports the following: * `key_id` - (Required) The ARN of the KMS customer master key (CMK) used to encrypt the inventory file. +## Attributes Reference + +No additional attributes are exported. + ## Import S3 bucket inventory configurations can be imported using `bucket:inventory`, e.g. diff --git a/website/docs/r/s3_bucket_metric.html.markdown b/website/docs/r/s3_bucket_metric.html.markdown index ca638137ae0..91fde862861 100644 --- a/website/docs/r/s3_bucket_metric.html.markdown +++ b/website/docs/r/s3_bucket_metric.html.markdown @@ -62,6 +62,10 @@ The `filter` metric configuration supports the following: * `prefix` - (Optional) Object prefix for filtering (singular). * `tags` - (Optional) Object tags for filtering (up to 10). +## Attributes Reference + +No additional attributes are exported. + ## Import S3 bucket metric configurations can be imported using `bucket:metric`, e.g. diff --git a/website/docs/r/s3_bucket_notification.html.markdown b/website/docs/r/s3_bucket_notification.html.markdown index fb4b66d9833..28504815be2 100644 --- a/website/docs/r/s3_bucket_notification.html.markdown +++ b/website/docs/r/s3_bucket_notification.html.markdown @@ -329,6 +329,10 @@ The `lambda_function` notification configuration supports the following: * `filter_prefix` - (Optional) Specifies object key name prefix. * `filter_suffix` - (Optional) Specifies object key name suffix. +## Attributes Reference + +No additional attributes are exported. + ## Import S3 bucket notification can be imported using the `bucket`, e.g. diff --git a/website/docs/r/s3_bucket_policy.html.markdown b/website/docs/r/s3_bucket_policy.html.markdown index 8c7931910f8..69c59555175 100644 --- a/website/docs/r/s3_bucket_policy.html.markdown +++ b/website/docs/r/s3_bucket_policy.html.markdown @@ -55,6 +55,9 @@ The following arguments are supported: * `bucket` - (Required) The name of the bucket to which to apply the policy. * `policy` - (Required) The text of the policy. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). Note: Bucket policies are limited to 20 KB in size. +## Attributes Reference + +No additional attributes are exported. ## Import diff --git a/website/docs/r/s3_object_copy.html.markdown b/website/docs/r/s3_object_copy.html.markdown index bc92efe0c47..344d2d2eef3 100644 --- a/website/docs/r/s3_object_copy.html.markdown +++ b/website/docs/r/s3_object_copy.html.markdown @@ -91,7 +91,7 @@ This configuration block has the following optional arguments (one of the three ## Attributes Reference -The following attributes are exported +In addition to all arguments above, the following attributes are exported: * `etag` - The ETag generated for the object (an MD5 sum of the object content). For plaintext objects or objects encrypted with an AWS-managed key, the hash is an MD5 digest of the object data. For objects encrypted with a KMS key or objects created by either the Multipart Upload or Part Copy operation, the hash is not an MD5 digest, regardless of the method of encryption. More information on possible values can be found on [Common Response Headers](https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html). * `expiration` - If the object expiration is configured, this attribute will be set. diff --git a/website/docs/r/sagemaker_app.html.markdown b/website/docs/r/sagemaker_app.html.markdown index 8da790af889..365bcc0c4e8 100644 --- a/website/docs/r/sagemaker_app.html.markdown +++ b/website/docs/r/sagemaker_app.html.markdown @@ -42,12 +42,11 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The Amazon Resource Name (ARN) of the app. * `arn` - The Amazon Resource Name (ARN) of the app. - ## Import Sagemaker Code Apps can be imported using the `id`, e.g. diff --git a/website/docs/r/sagemaker_domain.html.markdown b/website/docs/r/sagemaker_domain.html.markdown index 1e663fb07ea..05932c20264 100644 --- a/website/docs/r/sagemaker_domain.html.markdown +++ b/website/docs/r/sagemaker_domain.html.markdown @@ -140,7 +140,7 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The ID of the Domain. * `arn` - The Amazon Resource Name (ARN) assigned by AWS to this Domain. @@ -148,7 +148,6 @@ The following attributes are exported: * `single_sign_on_managed_application_instance_id` - The SSO managed application instance ID. * `home_efs_file_system_id` - The ID of the Amazon Elastic File System (EFS) managed by this Domain. - ## Import Sagemaker Code Domains can be imported using the `id`, e.g. diff --git a/website/docs/r/sagemaker_image.html.markdown b/website/docs/r/sagemaker_image.html.markdown index ebe5416cee1..9f1d329bd0b 100644 --- a/website/docs/r/sagemaker_image.html.markdown +++ b/website/docs/r/sagemaker_image.html.markdown @@ -33,7 +33,7 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The name of the Image. * `arn` - The Amazon Resource Name (ARN) assigned by AWS to this Image. diff --git a/website/docs/r/sagemaker_image_version.html.markdown b/website/docs/r/sagemaker_image_version.html.markdown index ad86e2fac40..8c19800d04c 100644 --- a/website/docs/r/sagemaker_image_version.html.markdown +++ b/website/docs/r/sagemaker_image_version.html.markdown @@ -30,7 +30,7 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The name of the Image. * `arn` - The Amazon Resource Name (ARN) assigned by AWS to this Image Version. diff --git a/website/docs/r/sagemaker_model_package_group.html.markdown b/website/docs/r/sagemaker_model_package_group.html.markdown index d5346652e3e..9570e375adc 100644 --- a/website/docs/r/sagemaker_model_package_group.html.markdown +++ b/website/docs/r/sagemaker_model_package_group.html.markdown @@ -30,7 +30,7 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The name of the Model Package Group. * `arn` - The Amazon Resource Name (ARN) assigned by AWS to this Model Package Group. diff --git a/website/docs/r/sagemaker_user_profile.html.markdown b/website/docs/r/sagemaker_user_profile.html.markdown index fe8d26dfed3..cb7afaa7e89 100644 --- a/website/docs/r/sagemaker_user_profile.html.markdown +++ b/website/docs/r/sagemaker_user_profile.html.markdown @@ -73,13 +73,12 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The user profile Amazon Resource Name (ARN). * `arn` - The user profile Amazon Resource Name (ARN). * `home_efs_file_system_uid` - The ID of the user's profile in the Amazon Elastic File System (EFS) volume. - ## Import Sagemaker Code User Profiles can be imported using the `arn`, e.g. diff --git a/website/docs/r/secretsmanager_secret_policy.html.markdown b/website/docs/r/secretsmanager_secret_policy.html.markdown index d564419a044..2dab6768396 100644 --- a/website/docs/r/secretsmanager_secret_policy.html.markdown +++ b/website/docs/r/secretsmanager_secret_policy.html.markdown @@ -51,6 +51,8 @@ The following arguments are supported: ## Attributes Reference +In addition to all arguments above, the following attributes are exported: + * `id` - Amazon Resource Name (ARN) of the secret. ## Import diff --git a/website/docs/r/ses_active_receipt_rule_set.html.markdown b/website/docs/r/ses_active_receipt_rule_set.html.markdown index 23fb50b536c..f40d17e303e 100644 --- a/website/docs/r/ses_active_receipt_rule_set.html.markdown +++ b/website/docs/r/ses_active_receipt_rule_set.html.markdown @@ -26,7 +26,7 @@ The following arguments are supported: ## Attributes Reference -In addition to the arguments, which are exported, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The SES receipt rule set name. * `arn` - The SES receipt rule set ARN. diff --git a/website/docs/r/ses_configuration_set.html.markdown b/website/docs/r/ses_configuration_set.html.markdown index a45c051a980..492fb862139 100644 --- a/website/docs/r/ses_configuration_set.html.markdown +++ b/website/docs/r/ses_configuration_set.html.markdown @@ -46,7 +46,7 @@ The following argument is optional: ## Attributes Reference -In addition to the arguments, which are exported, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - SES configuration set ARN. * `id` - SES configuration set name. diff --git a/website/docs/r/ses_event_destination.html.markdown b/website/docs/r/ses_event_destination.html.markdown index 82c5f76d52e..d665811a0a8 100644 --- a/website/docs/r/ses_event_destination.html.markdown +++ b/website/docs/r/ses_event_destination.html.markdown @@ -91,7 +91,7 @@ The following arguments are supported: ## Attributes Reference -In addition to the arguments, which are exported, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The SES event destination name. * `arn` - The SES event destination ARN. diff --git a/website/docs/r/ses_identity_notification_topic.markdown b/website/docs/r/ses_identity_notification_topic.markdown index 6148b6d6649..f367e910fff 100644 --- a/website/docs/r/ses_identity_notification_topic.markdown +++ b/website/docs/r/ses_identity_notification_topic.markdown @@ -30,6 +30,10 @@ The following arguments are supported: * `identity` - (Required) The identity for which the Amazon SNS topic will be set. You can specify an identity by using its name or by using its Amazon Resource Name (ARN). * `include_original_headers` - (Optional) Whether SES should include original email headers in SNS notifications of this type. *false* by default. +## Attributes Reference + +No additional attributes are exported. + ## Import Identity Notification Topics can be imported using ID of the record. The ID is made up as IDENTITY|TYPE where IDENTITY is the SES Identity and TYPE is the Notification Type. diff --git a/website/docs/r/ses_identity_policy.html.markdown b/website/docs/r/ses_identity_policy.html.markdown index 0318eef21a6..c244cff2a77 100644 --- a/website/docs/r/ses_identity_policy.html.markdown +++ b/website/docs/r/ses_identity_policy.html.markdown @@ -44,6 +44,10 @@ The following arguments are supported: * `name` - (Required) Name of the policy. * `policy` - (Required) JSON string of the policy. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +## Attributes Reference + +No additional attributes are exported. + ## Import SES Identity Policies can be imported using the identity and policy name, separated by a pipe character (`|`), e.g. diff --git a/website/docs/r/ses_receipt_rule.html.markdown b/website/docs/r/ses_receipt_rule.html.markdown index 62257fcd93b..93ce0e2ba0f 100644 --- a/website/docs/r/ses_receipt_rule.html.markdown +++ b/website/docs/r/ses_receipt_rule.html.markdown @@ -102,7 +102,7 @@ WorkMail actions support the following: ## Attributes Reference -In addition to the arguments, which are exported, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `id` - The SES receipt rule name. * `arn` - The SES receipt rule ARN. diff --git a/website/docs/r/ses_receipt_rule_set.html.markdown b/website/docs/r/ses_receipt_rule_set.html.markdown index 9d16f0ffd52..6f94e3bed98 100644 --- a/website/docs/r/ses_receipt_rule_set.html.markdown +++ b/website/docs/r/ses_receipt_rule_set.html.markdown @@ -26,7 +26,7 @@ The following arguments are supported: ## Attributes Reference -In addition to the arguments, which are exported, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - SES receipt rule set ARN. * `id` - SES receipt rule set name. diff --git a/website/docs/r/signer_signing_profile_permission.html.markdown b/website/docs/r/signer_signing_profile_permission.html.markdown index 636f5290678..2312649cba4 100644 --- a/website/docs/r/signer_signing_profile_permission.html.markdown +++ b/website/docs/r/signer_signing_profile_permission.html.markdown @@ -59,6 +59,10 @@ resource "aws_signer_signing_profile_permission" "sp_permission_3" { * `statement_id` - (Optional) A unique statement identifier. By default generated by Terraform. * `statement_id_prefix` - (Optional) A statement identifier prefix. Terraform will generate a unique suffix. Conflicts with `statement_id`. +## Attributes Reference + +No additional attributes are exported. + ## Import Signer signing profile permission statements can be imported using profile_name/statement_id, e.g. diff --git a/website/docs/r/sns_sms_preferences.html.markdown b/website/docs/r/sns_sms_preferences.html.markdown index dd3efead6f0..9218ea0ed92 100644 --- a/website/docs/r/sns_sms_preferences.html.markdown +++ b/website/docs/r/sns_sms_preferences.html.markdown @@ -26,3 +26,7 @@ The following arguments are supported: * `default_sender_id` - (Optional) A string, such as your business brand, that is displayed as the sender on the receiving device. * `default_sms_type` - (Optional) The type of SMS message that you will send by default. Possible values are: Promotional, Transactional * `usage_report_s3_bucket` - (Optional) The name of the Amazon S3 bucket to receive daily SMS usage reports from Amazon SNS. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/sns_topic_policy.html.markdown b/website/docs/r/sns_topic_policy.html.markdown index 99a35c9fb66..9f82ec6cf62 100644 --- a/website/docs/r/sns_topic_policy.html.markdown +++ b/website/docs/r/sns_topic_policy.html.markdown @@ -73,6 +73,10 @@ The following arguments are supported: * `arn` - (Required) The ARN of the SNS topic * `policy` - (Required) The fully-formed AWS policy as JSON. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +## Attributes Reference + +No additional attributes are exported. + ## Import SNS Topic Policy can be imported using the topic ARN, e.g. diff --git a/website/docs/r/spot_datafeed_subscription.html.markdown b/website/docs/r/spot_datafeed_subscription.html.markdown index 9723e35329a..73a0461dd56 100644 --- a/website/docs/r/spot_datafeed_subscription.html.markdown +++ b/website/docs/r/spot_datafeed_subscription.html.markdown @@ -31,6 +31,10 @@ resource "aws_spot_datafeed_subscription" "default" { * `bucket` - (Required) The Amazon S3 bucket in which to store the Spot instance data feed. * `prefix` - (Optional) Path of folder inside bucket to place spot pricing data. +## Attributes Reference + +No additional attributes are exported. + ## Import A Spot Datafeed Subscription can be imported using the word `spot-datafeed-subscription`, e.g. diff --git a/website/docs/r/sqs_queue_policy.html.markdown b/website/docs/r/sqs_queue_policy.html.markdown index e7367343cf7..b63be0e06ef 100644 --- a/website/docs/r/sqs_queue_policy.html.markdown +++ b/website/docs/r/sqs_queue_policy.html.markdown @@ -51,6 +51,10 @@ The following arguments are supported: * `queue_url` - (Required) The URL of the SQS Queue to which to attach the policy * `policy` - (Required) The JSON policy for the SQS queue. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +## Attributes Reference + +No additional attributes are exported. + ## Import SQS Queue Policies can be imported using the queue URL, e.g. diff --git a/website/docs/r/ssm_resource_data_sync.html.markdown b/website/docs/r/ssm_resource_data_sync.html.markdown index 61a98af5310..f693ebe47fd 100644 --- a/website/docs/r/ssm_resource_data_sync.html.markdown +++ b/website/docs/r/ssm_resource_data_sync.html.markdown @@ -79,6 +79,10 @@ The following arguments are supported: * `prefix` - (Optional) Prefix for the bucket. * `sync_format` - (Optional) A supported sync format. Only JsonSerDe is currently supported. Defaults to JsonSerDe. +## Attributes Reference + +No additional attributes are exported. + ## Import SSM resource data sync can be imported using the `name`, e.g. diff --git a/website/docs/r/ssoadmin_account_assignment.html.markdown b/website/docs/r/ssoadmin_account_assignment.html.markdown index d3fe7164466..176b5cd2486 100644 --- a/website/docs/r/ssoadmin_account_assignment.html.markdown +++ b/website/docs/r/ssoadmin_account_assignment.html.markdown @@ -52,7 +52,7 @@ The following arguments are supported: * `target_id` - (Required, Forces new resource) An AWS account identifier, typically a 10-12 digit string. * `target_type` - (Optional, Forces new resource) The entity type for which the assignment will be created. Valid values: `AWS_ACCOUNT`. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown b/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown index b3ec1aff7e9..f10b8b99e86 100644 --- a/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown +++ b/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: * `managed_policy_arn` - (Required, Forces new resource) The IAM managed policy Amazon Resource Name (ARN) to be attached to the Permission Set. * `permission_set_arn` - (Required, Forces new resource) The Amazon Resource Name (ARN) of the Permission Set. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/ssoadmin_permission_set.html.markdown b/website/docs/r/ssoadmin_permission_set.html.markdown index d54c562738a..c682196481b 100644 --- a/website/docs/r/ssoadmin_permission_set.html.markdown +++ b/website/docs/r/ssoadmin_permission_set.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: * `session_duration` - (Optional) The length of time that the application user sessions are valid in the ISO-8601 standard. Default: `PT1H`. * `tags` - (Optional) Key-value map of resource tags. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: 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 422871b77ed..e5c19127b19 100644 --- a/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown +++ b/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown @@ -53,7 +53,7 @@ The following arguments are supported: * `instance_arn` - (Required, Forces new resource) The Amazon Resource Name (ARN) of the SSO Instance under which the operation will be executed. * `permission_set_arn` - (Required, Forces new resource) The Amazon Resource Name (ARN) of the Permission Set. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/storagegateway_tape_pool.html.markdown b/website/docs/r/storagegateway_tape_pool.html.markdown index f67ba25b168..07921c9184a 100644 --- a/website/docs/r/storagegateway_tape_pool.html.markdown +++ b/website/docs/r/storagegateway_tape_pool.html.markdown @@ -29,7 +29,7 @@ The following arguments are supported: * `retention_lock_time_in_days` - (Optional) Tape retention lock time is set in days. Tape retention lock can be enabled for up to 100 years (36,500 days). Default value is 0. * `tags` - (Optional) Key-value map of resource tags -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/vpc_peering_connection_accepter.html.markdown b/website/docs/r/vpc_peering_connection_accepter.html.markdown index e80165ce49b..8d734896d78 100644 --- a/website/docs/r/vpc_peering_connection_accepter.html.markdown +++ b/website/docs/r/vpc_peering_connection_accepter.html.markdown @@ -89,7 +89,7 @@ from your statefile and management, **but will not destroy the VPC Peering Conne ## Attributes Reference -All of the argument attributes except `auto_accept` are also exported as result attributes. +In addition to all arguments above, the following attributes are exported: * `id` - The ID of the VPC Peering Connection. * `accept_status` - The status of the VPC Peering Connection request. diff --git a/website/docs/r/vpn_gateway_route_propagation.html.markdown b/website/docs/r/vpn_gateway_route_propagation.html.markdown index 8eefa046082..6aad37e90eb 100644 --- a/website/docs/r/vpn_gateway_route_propagation.html.markdown +++ b/website/docs/r/vpn_gateway_route_propagation.html.markdown @@ -32,4 +32,4 @@ The following arguments are required: ## Attributes Reference -This resource does not export any additional attributes. +No additional attributes are exported. diff --git a/website/docs/r/wafv2_web_acl_association.html.markdown b/website/docs/r/wafv2_web_acl_association.html.markdown index 30be8046b3c..03e41dd8e63 100644 --- a/website/docs/r/wafv2_web_acl_association.html.markdown +++ b/website/docs/r/wafv2_web_acl_association.html.markdown @@ -89,6 +89,10 @@ The following arguments are supported: * `resource_arn` - (Required) The Amazon Resource Name (ARN) of the resource to associate with the web ACL. This must be an ARN of an Application Load Balancer or an Amazon API Gateway stage. * `web_acl_arn` - (Required) The Amazon Resource Name (ARN) of the Web ACL that you want to associate with the resource. +## Attributes Reference + +No additional attributes are exported. + ## Import WAFv2 Web ACL Association can be imported using `WEB_ACL_ARN,RESOURCE_ARN` e.g. From 9ffa207a403cb37def269c6898182bbac9ca2493 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 16 Mar 2021 10:33:17 -0400 Subject: [PATCH 0068/1252] resource/aws_globalaccelerator_accelerator: Correct name validation length (#17985) Output from acceptance testing in AWS Commercial: ``` --- FAIL: TestAccAwsGlobalAcceleratorAccelerator_attributes (361.78s) # https://github.com/hashicorp/terraform-provider-aws/issues/18121 --- PASS: TestAccAwsGlobalAcceleratorAccelerator_basic (78.46s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_disappears (73.64s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_tags (107.66s) --- PASS: TestAccAwsGlobalAcceleratorAccelerator_update (166.17s) --- PASS: TestAccAwsGlobalAcceleratorListener_basic (136.40s) --- PASS: TestAccAwsGlobalAcceleratorListener_disappears (134.18s) --- PASS: TestAccAwsGlobalAcceleratorListener_update (178.99s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- SKIP: TestAccAwsGlobalAcceleratorAccelerator_attributes (30.06s) --- SKIP: TestAccAwsGlobalAcceleratorAccelerator_basic (36.40s) --- SKIP: TestAccAwsGlobalAcceleratorAccelerator_tags (28.51s) --- SKIP: TestAccAwsGlobalAcceleratorAccelerator_update (27.43s) --- SKIP: TestAccAwsGlobalAcceleratorAccelerator_disappears (28.93s) --- SKIP: TestAccAwsGlobalAcceleratorListener_basic (28.74s) --- SKIP: TestAccAwsGlobalAcceleratorListener_disappears (31.23s) --- SKIP: TestAccAwsGlobalAcceleratorListener_update (30.72s) ``` --- .changelog/17985.txt | 3 ++ ...ource_aws_globalaccelerator_accelerator.go | 2 +- ...resource_aws_globalaccelerator_listener.go | 28 ++++++++----------- 3 files changed, 15 insertions(+), 18 deletions(-) create mode 100644 .changelog/17985.txt diff --git a/.changelog/17985.txt b/.changelog/17985.txt new file mode 100644 index 00000000000..44f559b3325 --- /dev/null +++ b/.changelog/17985.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation +``` diff --git a/aws/resource_aws_globalaccelerator_accelerator.go b/aws/resource_aws_globalaccelerator_accelerator.go index e4da133f245..11fc01c14d2 100644 --- a/aws/resource_aws_globalaccelerator_accelerator.go +++ b/aws/resource_aws_globalaccelerator_accelerator.go @@ -43,7 +43,7 @@ func resourceAwsGlobalAcceleratorAccelerator() *schema.Resource { Type: schema.TypeString, Required: true, ValidateFunc: validation.All( - validation.StringLenBetween(1, 32), + validation.StringLenBetween(1, 255), validation.StringMatch(regexp.MustCompile(`^[0-9A-Za-z-]+$`), "only alphanumeric characters and hyphens are allowed"), validation.StringDoesNotMatch(regexp.MustCompile(`^-`), "cannot start with a hyphen"), validation.StringDoesNotMatch(regexp.MustCompile(`-$`), "cannot end with a hyphen"), diff --git a/aws/resource_aws_globalaccelerator_listener.go b/aws/resource_aws_globalaccelerator_listener.go index 05fc81cfb6d..5f9f37078bd 100644 --- a/aws/resource_aws_globalaccelerator_listener.go +++ b/aws/resource_aws_globalaccelerator_listener.go @@ -41,21 +41,15 @@ func resourceAwsGlobalAcceleratorListener() *schema.Resource { ForceNew: true, }, "client_affinity": { - Type: schema.TypeString, - Optional: true, - Default: globalaccelerator.ClientAffinityNone, - ValidateFunc: validation.StringInSlice([]string{ - globalaccelerator.ClientAffinityNone, - globalaccelerator.ClientAffinitySourceIp, - }, false), + Type: schema.TypeString, + Optional: true, + Default: globalaccelerator.ClientAffinityNone, + ValidateFunc: validation.StringInSlice(globalaccelerator.ClientAffinity_Values(), false), }, "protocol": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - globalaccelerator.ProtocolTcp, - globalaccelerator.ProtocolUdp, - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(globalaccelerator.Protocol_Values(), false), }, "port_range": { Type: schema.TypeSet, @@ -67,12 +61,12 @@ func resourceAwsGlobalAcceleratorListener() *schema.Resource { "from_port": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validation.IntBetween(0, 65535), + ValidateFunc: validation.IsPortNumber, }, "to_port": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validation.IntBetween(0, 65535), + ValidateFunc: validation.IsPortNumber, }, }, }, @@ -97,7 +91,7 @@ func resourceAwsGlobalAcceleratorListenerCreate(d *schema.ResourceData, meta int resp, err := conn.CreateListener(opts) if err != nil { - return fmt.Errorf("Error creating Global Accelerator listener: %s", err) + return fmt.Errorf("error creating Global Accelerator listener: %w", err) } d.SetId(aws.StringValue(resp.Listener.ListenerArn)) @@ -135,7 +129,7 @@ func resourceAwsGlobalAcceleratorListenerRead(d *schema.ResourceData, meta inter d.Set("client_affinity", listener.ClientAffinity) d.Set("protocol", listener.Protocol) if err := d.Set("port_range", resourceAwsGlobalAcceleratorListenerFlattenPortRanges(listener.PortRanges)); err != nil { - return fmt.Errorf("error setting port_range: %s", err) + return fmt.Errorf("error setting port_range: %w", err) } return nil From 923988601ed2e4da9fd5101875c0017e39ee13e3 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Tue, 16 Mar 2021 14:39:40 +0000 Subject: [PATCH 0069/1252] Update CHANGELOG.md for #17876 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b12907113e6..8438fb8a974 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ ## 3.32.0 (March 12, 2021) +BUG FIXES: + +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + FEATURES: * **New Data Source:** `aws_acmpca_certificate` ([#10213](https://github.com/hashicorp/terraform-provider-aws/issues/10213)) From 21a251b1985df9b33d7fc0f04ee1887abe07bfbe Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Tue, 16 Mar 2021 23:13:08 -0400 Subject: [PATCH 0070/1252] CR updates; base64encode in state; test coverage; linting --- .changelog/13605.txt | 3 - .changelog/17958.txt | 3 + aws/resource_aws_dms_certificate.go | 70 ++++++--- aws/resource_aws_dms_certificate_test.go | 142 +++++++++++++----- .../service/dms/oracle_wallet_certificate.pem | 10 ++ aws/validators.go | 19 --- aws/validators_test.go | 31 ---- website/docs/r/dms_certificate.html.markdown | 2 +- 8 files changed, 165 insertions(+), 115 deletions(-) delete mode 100644 .changelog/13605.txt create mode 100644 .changelog/17958.txt create mode 100644 aws/testdata/service/dms/oracle_wallet_certificate.pem diff --git a/.changelog/13605.txt b/.changelog/13605.txt deleted file mode 100644 index 48056587b2b..00000000000 --- a/.changelog/13605.txt +++ /dev/null @@ -1,3 +0,0 @@ -```release-note:bug -resource/aws_dms_certificate: Add base64 decode before sending to aws-sdk-go, so oracle-wallet is not encoded twice -``` diff --git a/.changelog/17958.txt b/.changelog/17958.txt new file mode 100644 index 00000000000..810bc032a80 --- /dev/null +++ b/.changelog/17958.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value +``` diff --git a/aws/resource_aws_dms_certificate.go b/aws/resource_aws_dms_certificate.go index dca37ab8a41..1acb17759f7 100644 --- a/aws/resource_aws_dms_certificate.go +++ b/aws/resource_aws_dms_certificate.go @@ -4,11 +4,13 @@ import ( "encoding/base64" "fmt" "log" + "regexp" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) @@ -29,10 +31,15 @@ func resourceAwsDmsCertificate() *schema.Resource { Computed: true, }, "certificate_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateDmsCertificateId, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 255), + validation.StringMatch(regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$"), "must start with a letter, only contain alphanumeric characters and hyphens"), + validation.StringDoesNotMatch(regexp.MustCompile(`--`), "cannot contain two consecutive hyphens"), + validation.StringDoesNotMatch(regexp.MustCompile(`-$`), "cannot end in a hyphen"), + ), }, "certificate_pem": { Type: schema.TypeString, @@ -53,9 +60,10 @@ func resourceAwsDmsCertificate() *schema.Resource { func resourceAwsDmsCertificateCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).dmsconn + certificateID := d.Get("certificate_id").(string) request := &dms.ImportCertificateInput{ - CertificateIdentifier: aws.String(d.Get("certificate_id").(string)), + CertificateIdentifier: aws.String(certificateID), Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatabasemigrationserviceTags(), } @@ -63,31 +71,29 @@ func resourceAwsDmsCertificateCreate(d *schema.ResourceData, meta interface{}) e wallet, walletSet := d.GetOk("certificate_wallet") if !pemSet && !walletSet { - return fmt.Errorf("Must set either certificate_pem and certificate_wallet.") + return fmt.Errorf("Must set either certificate_pem or certificate_wallet for DMS Certificate (%s)", certificateID) } if pemSet && walletSet { - return fmt.Errorf("Cannot set both certificate_pem and certificate_wallet.") + return fmt.Errorf("Cannot set both certificate_pem and certificate_wallet for DMS Certificate (%s)", certificateID) } if pemSet { request.CertificatePem = aws.String(pem.(string)) } if walletSet { - byteArray, err := base64.StdEncoding.DecodeString(wallet.(string)) + certWallet, err := base64.StdEncoding.DecodeString(wallet.(string)) if err != nil { - return fmt.Errorf("certificate_wallet is not a valid base64-encoded string") + return fmt.Errorf("error Base64 decoding certificate_wallet for DMS Certificate (%s): %w", certificateID, err) } - request.CertificateWallet = byteArray + request.CertificateWallet = certWallet } - log.Println("[DEBUG] DMS import certificate:", request) - _, err := conn.ImportCertificate(request) if err != nil { - return err + return fmt.Errorf("error creating DMS certificate (%s): %w", certificateID, err) } - d.SetId(d.Get("certificate_id").(string)) + d.SetId(certificateID) return resourceAwsDmsCertificateRead(d, meta) } @@ -103,12 +109,24 @@ func resourceAwsDmsCertificateRead(d *schema.ResourceData, meta interface{}) err }, }, }) + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, dms.ErrCodeResourceNotFoundFault) { + log.Printf("[WARN] DMS Certificate (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { - if dmserr, ok := err.(awserr.Error); ok && dmserr.Code() == "ResourceNotFoundFault" { - d.SetId("") - return nil + return fmt.Errorf("error reading DMS Certificate (%s): %w", d.Id(), err) + } + + if response == nil || len(response.Certificates) == 0 || response.Certificates[0] == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading DMS Certificate (%s): not found", d.Id()) } - return err + log.Printf("[WARN] DMS Certificate (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } err = resourceAwsDmsCertificateSetState(d, response.Certificates[0]) @@ -151,10 +169,16 @@ func resourceAwsDmsCertificateDelete(d *schema.ResourceData, meta interface{}) e CertificateArn: aws.String(d.Get("certificate_arn").(string)), } - log.Printf("[DEBUG] DMS delete certificate: %#v", request) - _, err := conn.DeleteCertificate(request) - return err + + if err != nil { + if tfawserr.ErrCodeEquals(err, dms.ErrCodeResourceNotFoundFault) { + return nil + } + return fmt.Errorf("error deleting DMS Certificate (%s): %w", d.Id(), err) + } + + return nil } func resourceAwsDmsCertificateSetState(d *schema.ResourceData, cert *dms.Certificate) error { @@ -167,7 +191,7 @@ func resourceAwsDmsCertificateSetState(d *schema.ResourceData, cert *dms.Certifi d.Set("certificate_pem", cert.CertificatePem) } if cert.CertificateWallet != nil && len(cert.CertificateWallet) != 0 { - d.Set("certificate_wallet", string(cert.CertificateWallet)) + d.Set("certificate_wallet", base64Encode(cert.CertificateWallet)) } return nil diff --git a/aws/resource_aws_dms_certificate_test.go b/aws/resource_aws_dms_certificate_test.go index 44a268d7eb5..cf902dbf89f 100644 --- a/aws/resource_aws_dms_certificate_test.go +++ b/aws/resource_aws_dms_certificate_test.go @@ -6,9 +6,9 @@ import ( "github.com/aws/aws-sdk-go/aws" dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.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" ) @@ -19,12 +19,12 @@ func TestAccAWSDmsCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: dmsCertificateDestroy, + CheckDestroy: testAccCheckAWSDmsCertificateDestroy, Steps: []resource.TestStep{ { - Config: dmsCertificateConfig(randId), + Config: testAccAWSDmsCertificateConfig(randId), Check: resource.ComposeTestCheckFunc( - checkDmsCertificateExists(resourceName), + testAccAWSDmsCertificateExists(resourceName), resource.TestCheckResourceAttrSet(resourceName, "certificate_arn"), ), }, @@ -37,6 +37,52 @@ func TestAccAWSDmsCertificate_basic(t *testing.T) { }) } +func TestAccAWSDmsCertificate_disappears(t *testing.T) { + resourceName := "aws_dms_certificate.dms_certificate" + randId := acctest.RandString(8) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSDmsCertificateConfig(randId), + Check: resource.ComposeTestCheckFunc( + testAccAWSDmsCertificateExists(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsDmsCertificate(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSDmsCertificate_CertificateWallet(t *testing.T) { + resourceName := "aws_dms_certificate.dms_certificate" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDmsCertificateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSDmsCertificateConfigCertificateWallet(rName), + Check: resource.ComposeTestCheckFunc( + testAccAWSDmsCertificateExists(resourceName), + resource.TestCheckResourceAttrSet(resourceName, "certificate_wallet"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSDmsCertificate_tags(t *testing.T) { resourceName := "aws_dms_certificate.dms_certificate" randId := acctest.RandString(8) @@ -44,12 +90,12 @@ func TestAccAWSDmsCertificate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: dmsCertificateDestroy, + CheckDestroy: testAccCheckAWSDmsCertificateDestroy, Steps: []resource.TestStep{ { Config: testAccAWSDmsCertificateConfigTags1(randId, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - checkDmsCertificateExists(resourceName), + testAccAWSDmsCertificateExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), @@ -62,7 +108,7 @@ func TestAccAWSDmsCertificate_tags(t *testing.T) { { Config: testAccAWSDmsCertificateConfigTags2(randId, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeAggregateTestCheckFunc( - checkDmsCertificateExists(resourceName), + testAccAWSDmsCertificateExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), @@ -71,7 +117,7 @@ func TestAccAWSDmsCertificate_tags(t *testing.T) { { Config: testAccAWSDmsCertificateConfigTags1(randId, "key2", "value2"), Check: resource.ComposeAggregateTestCheckFunc( - checkDmsCertificateExists(resourceName), + testAccAWSDmsCertificateExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), @@ -80,27 +126,40 @@ func TestAccAWSDmsCertificate_tags(t *testing.T) { }) } -func dmsCertificateDestroy(s *terraform.State) error { +func testAccCheckAWSDmsCertificateDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_dms_certificate" { continue } - err := checkDmsCertificateExists(rs.Primary.ID) - if err == nil { - return fmt.Errorf("Found a certificate that was not destroyed: %s", rs.Primary.ID) + conn := testAccProvider.Meta().(*AWSClient).dmsconn + + output, err := conn.DescribeCertificates(&dms.DescribeCertificatesInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("certificate-id"), + Values: []*string{aws.String(rs.Primary.ID)}, + }, + }, + }) + + if tfawserr.ErrCodeEquals(err, dms.ErrCodeResourceNotFoundFault) { + continue + } + + if err != nil { + return fmt.Errorf("error reading DMS Certificate (%s): %w", rs.Primary.ID, err) + } + + if output != nil && len(output.Certificates) != 0 { + return fmt.Errorf("DMS Certificate (%s) still exists", rs.Primary.ID) } } return nil } -func checkDmsCertificateExists(n string) resource.TestCheckFunc { - providers := []*schema.Provider{testAccProvider} - return checkDmsCertificateExistsWithProviders(n, &providers) -} - -func checkDmsCertificateExistsWithProviders(n string, providers *[]*schema.Provider) resource.TestCheckFunc { +func testAccAWSDmsCertificateExists(n string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -110,33 +169,31 @@ func checkDmsCertificateExistsWithProviders(n string, providers *[]*schema.Provi if rs.Primary.ID == "" { return fmt.Errorf("No ID is set") } - for _, provider := range *providers { - // Ignore if Meta is empty, this can happen for validation providers - if provider.Meta() == nil { - continue - } - - conn := provider.Meta().(*AWSClient).dmsconn - _, err := conn.DescribeCertificates(&dms.DescribeCertificatesInput{ - Filters: []*dms.Filter{ - { - Name: aws.String("certificate-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, + + conn := testAccProvider.Meta().(*AWSClient).dmsconn + + output, err := conn.DescribeCertificates(&dms.DescribeCertificatesInput{ + Filters: []*dms.Filter{ + { + Name: aws.String("certificate-id"), + Values: []*string{aws.String(rs.Primary.ID)}, }, - }) + }, + }) - if err != nil { - return fmt.Errorf("DMS certificate error: %v", err) - } - return nil + if err != nil { + return fmt.Errorf("error reading DMS Certificate (%s): %w", rs.Primary.ID, err) } - return fmt.Errorf("DMS certificate not found") + if output == nil || len(output.Certificates) == 0 { + return fmt.Errorf("DMS Certificate (%s) not found", rs.Primary.ID) + } + + return nil } } -func dmsCertificateConfig(randId string) string { +func testAccAWSDmsCertificateConfig(randId string) string { return fmt.Sprintf(` resource "aws_dms_certificate" "dms_certificate" { certificate_id = "tf-test-dms-certificate-%[1]s" @@ -145,6 +202,15 @@ resource "aws_dms_certificate" "dms_certificate" { `, randId) } +func testAccAWSDmsCertificateConfigCertificateWallet(rName string) string { + return fmt.Sprintf(` +resource "aws_dms_certificate" "dms_certificate" { + certificate_id = %q + certificate_wallet = filebase64("testdata/service/dms/oracle_wallet_certificate.pem") +} +`, rName) +} + func testAccAWSDmsCertificateConfigTags1(randId, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_dms_certificate" "dms_certificate" { diff --git a/aws/testdata/service/dms/oracle_wallet_certificate.pem b/aws/testdata/service/dms/oracle_wallet_certificate.pem new file mode 100644 index 00000000000..0e20b50a826 --- /dev/null +++ b/aws/testdata/service/dms/oracle_wallet_certificate.pem @@ -0,0 +1,10 @@ +-----BEGIN CERTIFICATE----- +MIIBsTCCARoCAQAwDQYJKoZIhvcNAQEEBQAwITEfMB0GA1UEAxMWZ2JyMzAxMzkudWsub3JhY2xl +LmNvbTAeFw0xNjA1MTExMTQzMzFaFw0yNjA1MDkxMTQzMzFaMCExHzAdBgNVBAMTFmdicjMwMTM5 +LnVrLm9yYWNsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKH8G8sFS6l0llu+RMfl +7Yt+Ppw8J0PfDEDbTGP5wtsrs/22dUCipU9l+vif1VgSPLE2UPJbGM8tQzTC6UYbBtWHe4CshmvD +EVlcIMsEFvD7a5Q+P45jqNSEtV9VdbGyxaD6i5Y/Smd+B87FcQQCX54LaI9BJ8SZwmPXgDweADLf +AgMBAAEwDQYJKoZIhvcNAQEEBQADgYEAai742jfNYYTKMq2xxRygGJGn1LhpFenHvuHLBvnTup1N +nZOBwBi4VxW3CImvwONYcCEFp3E1SRswS5evlfIfruCZ1xQBoUNei3EJ6O3OdKeRRp2E+muXEtfe +U+jwUE+SzpnzfpI23Okl2vo8Q7VHrSalxE2KEhAzC1UYX7ZYp1U= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/aws/validators.go b/aws/validators.go index d5c20782d5d..4b7cd06f940 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -1211,25 +1211,6 @@ func validateSfnStateMachineName(v interface{}, k string) (ws []string, errors [ return } -func validateDmsCertificateId(v interface{}, k string) (ws []string, es []error) { - val := v.(string) - - if len(val) > 255 { - es = append(es, fmt.Errorf("%q must not be longer than 255 characters", k)) - } - if !regexp.MustCompile("^[a-zA-Z][a-zA-Z0-9-]+$").MatchString(val) { - es = append(es, fmt.Errorf("%q must start with a letter, only contain alphanumeric characters and hyphens", k)) - } - if strings.Contains(val, "--") { - es = append(es, fmt.Errorf("%q must not contain consecutive hyphens", k)) - } - if strings.HasSuffix(val, "-") { - es = append(es, fmt.Errorf("%q must not end in a hyphen", k)) - } - - return -} - func validateDmsEndpointId(v interface{}, k string) (ws []string, es []error) { val := v.(string) diff --git a/aws/validators_test.go b/aws/validators_test.go index e9941893c64..084c7f7d519 100644 --- a/aws/validators_test.go +++ b/aws/validators_test.go @@ -1308,37 +1308,6 @@ func TestValidateDmsEndpointId(t *testing.T) { } } -func TestValidateDmsCertificateId(t *testing.T) { - validIds := []string{ - "tf-test-certificate-1", - "tfTestEndpoint", - } - - for _, s := range validIds { - _, errors := validateDmsCertificateId(s, "certificate_id") - if len(errors) > 0 { - t.Fatalf("%q should be a valid certificate id: %v", s, errors) - } - } - - invalidIds := []string{ - "tf_test_certificate_1", - "tf.test.certificate.1", - "tf test certificate 1", - "tf-test-certificate-1!", - "tf-test-certificate-1-", - "tf-test-certificate--1", - "tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1tf-test-certificate-1", - } - - for _, s := range invalidIds { - _, errors := validateDmsEndpointId(s, "certificate_id") - if len(errors) == 0 { - t.Fatalf("%q should not be a valid certificate id: %v", s, errors) - } - } -} - func TestValidateDmsReplicationInstanceId(t *testing.T) { validIds := []string{ "tf-test-replication-instance-1", diff --git a/website/docs/r/dms_certificate.html.markdown b/website/docs/r/dms_certificate.html.markdown index 8ab27b88edd..03eeab39011 100644 --- a/website/docs/r/dms_certificate.html.markdown +++ b/website/docs/r/dms_certificate.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: - Must contain from 1 to 255 alphanumeric characters and hyphens. * `certificate_pem` - (Optional) The contents of the .pem X.509 certificate file for the certificate. Either `certificate_pem` or `certificate_wallet` must be set. -* `certificate_wallet` - (Optional) The contents of the Oracle Wallet certificate for use with SSL. Either `certificate_pem` or `certificate_wallet` must be set. +* `certificate_wallet` - (Optional) The contents of the Oracle Wallet certificate for use with SSL, provided as a base64-encoded String. Either `certificate_pem` or `certificate_wallet` must be set. * `tags` - (Optional) A map of tags to assign to the resource. ## Attributes Reference From aeeb20de2c278a20a3b6d39c5b34229eb08d45d7 Mon Sep 17 00:00:00 2001 From: Michael Ward Date: Fri, 18 Sep 2020 08:37:12 +1000 Subject: [PATCH 0071/1252] Add pagination support (introduced in aws-sdk-go v1.33.21) and multiple baselines per patch group. --- .changelog/15213.txt | 7 + aws/internal/service/ssm/finder/finder.go | 29 ++++ aws/resource_aws_ssm_patch_group.go | 91 +++++++--- aws/resource_aws_ssm_patch_group_migrate.go | 37 ++++ ...source_aws_ssm_patch_group_migrate_test.go | 37 ++++ aws/resource_aws_ssm_patch_group_test.go | 163 +++++++++++++----- website/docs/r/ssm_patch_group.html.markdown | 2 +- 7 files changed, 299 insertions(+), 67 deletions(-) create mode 100644 .changelog/15213.txt create mode 100644 aws/resource_aws_ssm_patch_group_migrate.go create mode 100644 aws/resource_aws_ssm_patch_group_migrate_test.go diff --git a/.changelog/15213.txt b/.changelog/15213.txt new file mode 100644 index 00000000000..5dae4dbff30 --- /dev/null +++ b/.changelog/15213.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines +``` + +```release-note:bug +resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message +``` diff --git a/aws/internal/service/ssm/finder/finder.go b/aws/internal/service/ssm/finder/finder.go index 4621f375fe5..66f938b8a2e 100644 --- a/aws/internal/service/ssm/finder/finder.go +++ b/aws/internal/service/ssm/finder/finder.go @@ -30,3 +30,32 @@ func DocumentByName(conn *ssm.SSM, name string) (*ssm.DocumentDescription, error return output.Document, nil } + +// PatchGroup returns matching SSM Patch Group by Patch Group and BaselineId. +func PatchGroup(conn *ssm.SSM, patchGroup, baselineId string) (*ssm.PatchGroupPatchBaselineMapping, error) { + input := &ssm.DescribePatchGroupsInput{} + var result *ssm.PatchGroupPatchBaselineMapping + + err := conn.DescribePatchGroupsPages(input, func(page *ssm.DescribePatchGroupsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, mapping := range page.Mappings { + if mapping == nil { + continue + } + + if aws.StringValue(mapping.PatchGroup) == patchGroup { + if mapping.BaselineIdentity != nil && aws.StringValue(mapping.BaselineIdentity.BaselineId) == baselineId { + result = mapping + return false + } + } + } + + return !lastPage + }) + + return result, err +} diff --git a/aws/resource_aws_ssm_patch_group.go b/aws/resource_aws_ssm_patch_group.go index 07e23114bc5..2d33eda1909 100644 --- a/aws/resource_aws_ssm_patch_group.go +++ b/aws/resource_aws_ssm_patch_group.go @@ -3,10 +3,13 @@ package aws import ( "fmt" "log" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ssm" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ssm/finder" ) func resourceAwsSsmPatchGroup() *schema.Resource { @@ -15,6 +18,15 @@ func resourceAwsSsmPatchGroup() *schema.Resource { Read: resourceAwsSsmPatchGroupRead, Delete: resourceAwsSsmPatchGroupDelete, + SchemaVersion: 1, + StateUpgraders: []schema.StateUpgrader{ + { + Type: resourceAwsSsmPatchGroupV0().CoreConfigSchema().ImpliedType(), + Upgrade: resourceAwsSsmPatchGroupStateUpgradeV0, + Version: 0, + }, + }, + Schema: map[string]*schema.Schema{ "baseline_id": { Type: schema.TypeString, @@ -31,66 +43,93 @@ func resourceAwsSsmPatchGroup() *schema.Resource { } func resourceAwsSsmPatchGroupCreate(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn + conn := meta.(*AWSClient).ssmconn + + baselineId := d.Get("baseline_id").(string) + patchGroup := d.Get("patch_group").(string) params := &ssm.RegisterPatchBaselineForPatchGroupInput{ - BaselineId: aws.String(d.Get("baseline_id").(string)), - PatchGroup: aws.String(d.Get("patch_group").(string)), + BaselineId: aws.String(baselineId), + PatchGroup: aws.String(patchGroup), } - resp, err := ssmconn.RegisterPatchBaselineForPatchGroup(params) + resp, err := conn.RegisterPatchBaselineForPatchGroup(params) if err != nil { - return err + return fmt.Errorf("error registering SSM Patch Baseline (%s) for Patch Group (%s): %w", baselineId, patchGroup, err) } - d.SetId(aws.StringValue(resp.PatchGroup)) + d.SetId(fmt.Sprintf("%s,%s", aws.StringValue(resp.PatchGroup), aws.StringValue(resp.BaselineId))) + return resourceAwsSsmPatchGroupRead(d, meta) } func resourceAwsSsmPatchGroupRead(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn - - params := &ssm.DescribePatchGroupsInput{} + conn := meta.(*AWSClient).ssmconn - resp, err := ssmconn.DescribePatchGroups(params) + patchGroup, baselineId, err := parseSsmPatchGroupId(d.Id()) if err != nil { - return err + return fmt.Errorf("error parsing SSM Patch Group ID (%s): %w", d.Id(), err) } - found := false - for _, t := range resp.Mappings { - if *t.PatchGroup == d.Id() { - found = true + group, err := finder.PatchGroup(conn, patchGroup, baselineId) - d.Set("patch_group", t.PatchGroup) - d.Set("baseline_id", t.BaselineIdentity.BaselineId) - } + if err != nil { + return fmt.Errorf("error reading SSM Patch Group (%s): %w", d.Id(), err) } - if !found { - log.Printf("[INFO] Patch Group not found. Removing from state") + if group == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading SSM Patch Group (%s): not found after creation", d.Id()) + } + + log.Printf("[WARN] SSM Patch Group (%s) not found, removing from state", d.Id()) d.SetId("") return nil } + var groupBaselineId string + if group.BaselineIdentity != nil { + groupBaselineId = aws.StringValue(group.BaselineIdentity.BaselineId) + } + + d.Set("baseline_id", groupBaselineId) + d.Set("patch_group", aws.StringValue(group.PatchGroup)) + return nil } func resourceAwsSsmPatchGroupDelete(d *schema.ResourceData, meta interface{}) error { - ssmconn := meta.(*AWSClient).ssmconn + conn := meta.(*AWSClient).ssmconn - log.Printf("[INFO] Deleting SSM Patch Group: %s", d.Id()) + patchGroup, baselineId, err := parseSsmPatchGroupId(d.Id()) + if err != nil { + return fmt.Errorf("error parsing SSM Patch Group ID (%s): %w", d.Id(), err) + } params := &ssm.DeregisterPatchBaselineForPatchGroupInput{ - BaselineId: aws.String(d.Get("baseline_id").(string)), - PatchGroup: aws.String(d.Get("patch_group").(string)), + BaselineId: aws.String(baselineId), + PatchGroup: aws.String(patchGroup), } - _, err := ssmconn.DeregisterPatchBaselineForPatchGroup(params) + _, err = conn.DeregisterPatchBaselineForPatchGroup(params) + if err != nil { - return fmt.Errorf("error deregistering SSM Patch Group (%s): %s", d.Id(), err) + if tfawserr.ErrCodeEquals(err, ssm.ErrCodeDoesNotExistException) { + return nil + } + return fmt.Errorf("error deregistering SSM Patch Baseline (%s) for Patch Group (%s): %w", baselineId, patchGroup, err) } return nil } + +func parseSsmPatchGroupId(id string) (string, string, error) { + parts := strings.SplitN(id, ",", 2) + + if len(parts) != 2 || parts[0] == "" || parts[1] == "" { + return "", "", fmt.Errorf("please make sure ID is in format PATCH_GROUP,BASELINE_ID") + } + + return parts[0], parts[1], nil +} diff --git a/aws/resource_aws_ssm_patch_group_migrate.go b/aws/resource_aws_ssm_patch_group_migrate.go new file mode 100644 index 00000000000..9072d0b263f --- /dev/null +++ b/aws/resource_aws_ssm_patch_group_migrate.go @@ -0,0 +1,37 @@ +package aws + +import ( + "context" + "fmt" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceAwsSsmPatchGroupV0() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "baseline_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "patch_group": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + } +} + +func resourceAwsSsmPatchGroupStateUpgradeV0(_ context.Context, rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + if rawState == nil { + rawState = map[string]interface{}{} + } + + if _, ok := rawState["id"]; ok { + rawState["id"] = fmt.Sprintf("%s,%s", rawState["patch_group"], rawState["baseline_id"]) + } + + return rawState, nil +} diff --git a/aws/resource_aws_ssm_patch_group_migrate_test.go b/aws/resource_aws_ssm_patch_group_migrate_test.go new file mode 100644 index 00000000000..7e9f7934690 --- /dev/null +++ b/aws/resource_aws_ssm_patch_group_migrate_test.go @@ -0,0 +1,37 @@ +package aws + +import ( + "context" + "fmt" + "reflect" + "testing" +) + +func testResourceAwsSsmPatchGroupStateDataV0() map[string]interface{} { + return map[string]interface{}{ + "id": "testgroup", + "baseline_id": "pb-0c4e592064EXAMPLE", + "patch_group": "testgroup", + } +} + +func testResourceAwsSsmPatchGroupStateDataV1() map[string]interface{} { + v0 := testResourceAwsSsmPatchGroupStateDataV0() + return map[string]interface{}{ + "id": fmt.Sprintf("%s,%s", v0["patch_group"], v0["baseline_id"]), + "baseline_id": v0["baseline_id"], + "patch_group": v0["patch_group"], + } +} + +func TestResourceAWSSSMPatchGroupStateUpgradeV0(t *testing.T) { + expected := testResourceAwsSsmPatchGroupStateDataV1() + actual, err := resourceAwsSsmPatchGroupStateUpgradeV0(context.Background(), testResourceAwsSsmPatchGroupStateDataV0(), nil) + if err != nil { + t.Fatalf("error migrating state: %s", err) + } + + if !reflect.DeepEqual(expected, actual) { + t.Fatalf("\n\nexpected:\n\n%#v\n\ngot:\n\n%#v\n\n", expected, actual) + } +} diff --git a/aws/resource_aws_ssm_patch_group_test.go b/aws/resource_aws_ssm_patch_group_test.go index 06dafda10a3..d985be2320a 100644 --- a/aws/resource_aws_ssm_patch_group_test.go +++ b/aws/resource_aws_ssm_patch_group_test.go @@ -4,98 +4,181 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ssm" "github.com/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/terraform-providers/terraform-provider-aws/aws/internal/service/ssm/finder" ) func TestAccAWSSSMPatchGroup_basic(t *testing.T) { - name := acctest.RandString(10) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ssm_patch_group.patchgroup" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSSMPatchGroupBasicConfig(name), + Config: testAccAWSSSMPatchGroupBasicConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMPatchGroupExists("aws_ssm_patch_group.patchgroup"), + testAccCheckAWSSSMPatchGroupExists(resourceName), ), }, }, }) } -func testAccCheckAWSSSMPatchGroupExists(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) +func TestAccAWSSSMPatchGroup_disappears(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ssm_patch_group.patchgroup" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMPatchGroupBasicConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMPatchGroupExists(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsSsmPatchGroup(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSSSMPatchGroup_multipleBaselines(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName1 := "aws_ssm_patch_group.test1" + resourceName2 := "aws_ssm_patch_group.test2" + resourceName3 := "aws_ssm_patch_group.test3" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMPatchGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMPatchGroupConfigMultipleBaselines(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMPatchGroupExists(resourceName1), + testAccCheckAWSSSMPatchGroupExists(resourceName2), + testAccCheckAWSSSMPatchGroupExists(resourceName3), + ), + }, + }, + }) +} + +func testAccCheckAWSSSMPatchGroupDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ssmconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ssm_patch_group" { + continue } - if rs.Primary.ID == "" { - return fmt.Errorf("No SSM Patch Baseline ID is set") + patchGroup, baselineId, err := parseSsmPatchGroupId(rs.Primary.ID) + if err != nil { + return fmt.Errorf("error parsing SSM Patch Group ID (%s): %w", rs.Primary.ID, err) } - conn := testAccProvider.Meta().(*AWSClient).ssmconn + group, err := finder.PatchGroup(conn, patchGroup, baselineId) - resp, err := conn.DescribePatchGroups(&ssm.DescribePatchGroupsInput{}) if err != nil { - return err + return fmt.Errorf("error describing SSM Patch Group ID (%s): %w", rs.Primary.ID, err) } - for _, i := range resp.Mappings { - if *i.BaselineIdentity.BaselineId == rs.Primary.Attributes["baseline_id"] && *i.PatchGroup == rs.Primary.ID { - return nil - } + if group != nil { + return fmt.Errorf("SSM Patch Group %q still exists", rs.Primary.ID) } - - return fmt.Errorf("No AWS SSM Patch Group found") } + + return nil } -func testAccCheckAWSSSMPatchGroupDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).ssmconn +func testAccCheckAWSSSMPatchGroupExists(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) + } - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_ssm_patch_group" { - continue + if rs.Primary.ID == "" { + return fmt.Errorf("No SSM Patch Baseline ID is set") } - resp, err := conn.DescribePatchGroups(&ssm.DescribePatchGroupsInput{}) + patchGroup, baselineId, err := parseSsmPatchGroupId(rs.Primary.ID) + if err != nil { + return fmt.Errorf("error parsing SSM Patch Group ID (%s): %w", rs.Primary.ID, err) + } + + conn := testAccProvider.Meta().(*AWSClient).ssmconn + + group, err := finder.PatchGroup(conn, patchGroup, baselineId) if err != nil { - // Verify the error is what we want - if ae, ok := err.(awserr.Error); ok && ae.Code() == "DoesNotExistException" { - continue - } - return err + return fmt.Errorf("error reading SSM Patch Group (%s): %w", rs.Primary.ID, err) } - for _, i := range resp.Mappings { - if *i.BaselineIdentity.BaselineId == rs.Primary.Attributes["baseline_id"] && *i.PatchGroup == rs.Primary.ID { - return fmt.Errorf("Expected AWS SSM Patch Group to be gone, but was still found") - } + if group == nil { + return fmt.Errorf("No SSM Patch Group found") } return nil } - - return nil } func testAccAWSSSMPatchGroupBasicConfig(rName string) string { return fmt.Sprintf(` resource "aws_ssm_patch_baseline" "foo" { - name = "patch-baseline-%s" + name = %[1]q approved_patches = ["KB123456"] } resource "aws_ssm_patch_group" "patchgroup" { baseline_id = aws_ssm_patch_baseline.foo.id - patch_group = "patch-group" + patch_group = %[1]q +} +`, rName) +} + +func testAccAWSSSMPatchGroupConfigMultipleBaselines(rName string) string { + return fmt.Sprintf(` +resource "aws_ssm_patch_baseline" "test1" { + approved_patches = ["KB123456"] + name = %[1]q + operating_system = "CENTOS" +} + +resource "aws_ssm_patch_baseline" "test2" { + approved_patches = ["KB123456"] + name = %[1]q + operating_system = "AMAZON_LINUX_2" +} + +resource "aws_ssm_patch_baseline" "test3" { + approved_patches = ["KB123456"] + name = %[1]q + operating_system = "AMAZON_LINUX" +} + +resource "aws_ssm_patch_group" "test1" { + baseline_id = aws_ssm_patch_baseline.test1.id + patch_group = %[1]q +} + +resource "aws_ssm_patch_group" "test2" { + baseline_id = aws_ssm_patch_baseline.test2.id + patch_group = %[1]q +} + +resource "aws_ssm_patch_group" "test3" { + baseline_id = aws_ssm_patch_baseline.test3.id + patch_group = %[1]q } `, rName) } diff --git a/website/docs/r/ssm_patch_group.html.markdown b/website/docs/r/ssm_patch_group.html.markdown index 8010e68be55..93d6d97f7e8 100644 --- a/website/docs/r/ssm_patch_group.html.markdown +++ b/website/docs/r/ssm_patch_group.html.markdown @@ -35,4 +35,4 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: -* `id` - The ID of the patch baseline. +* `id` - The name of the patch group and ID of the patch baseline separated by a comma (`,`). From 778ad1a962874588758a5a641f4aa14c1006c6d5 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 14:37:04 +0000 Subject: [PATCH 0072/1252] Update CHANGELOG.md for #18071 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8438fb8a974..972e26f0d90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ ## 3.32.0 (March 12, 2021) +ENHANCEMENTS: + +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + BUG FIXES: * resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) From 6db3be983a5abb01cc1dc14cd74b2e529a5ca999 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 17 Mar 2021 10:47:38 -0400 Subject: [PATCH 0073/1252] in migrate state, always set id to concatenated string --- aws/resource_aws_ssm_patch_group_migrate.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/aws/resource_aws_ssm_patch_group_migrate.go b/aws/resource_aws_ssm_patch_group_migrate.go index 9072d0b263f..1bc32bbea46 100644 --- a/aws/resource_aws_ssm_patch_group_migrate.go +++ b/aws/resource_aws_ssm_patch_group_migrate.go @@ -29,9 +29,7 @@ func resourceAwsSsmPatchGroupStateUpgradeV0(_ context.Context, rawState map[stri rawState = map[string]interface{}{} } - if _, ok := rawState["id"]; ok { - rawState["id"] = fmt.Sprintf("%s,%s", rawState["patch_group"], rawState["baseline_id"]) - } + rawState["id"] = fmt.Sprintf("%s,%s", rawState["patch_group"], rawState["baseline_id"]) return rawState, nil } From b3d5ab362b5920efe1056708632907a7543fc63e Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 11:03:24 -0400 Subject: [PATCH 0074/1252] docs/provider: Attribute headers and byline fixes (A-C resources) (#18017) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Previously: ``` * website/docs/r/api_gateway_base_path_mapping.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_gateway_response.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_integration.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_integration_response.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_method.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_method_response.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/api_gateway_method_settings.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/appautoscaling_target.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/autoscaling_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/autoscaling_lifecycle_hook.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cloudwatch_event_target.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cloudwatch_log_destination_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cloudwatch_log_subscription_filter.html.markdown: error checking file contents: attributes section byline (No extra attributes are exported.) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/codebuild_project.html.markdown: error checking file contents: attributes section byline (In addition to the arguments above, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/codecommit_trigger.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cognito_identity_provider.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cognito_user_group.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/config_configuration_recorder_status.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/config_remediation_configuration.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cur_report_definition.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference ``` --- website/docs/r/api_gateway_base_path_mapping.html.markdown | 4 ++++ website/docs/r/api_gateway_gateway_response.markdown | 4 ++++ website/docs/r/api_gateway_integration.html.markdown | 4 ++++ .../docs/r/api_gateway_integration_response.html.markdown | 4 ++++ website/docs/r/api_gateway_method.html.markdown | 4 ++++ website/docs/r/api_gateway_method_response.html.markdown | 4 ++++ website/docs/r/api_gateway_method_settings.html.markdown | 4 ++++ website/docs/r/appautoscaling_target.html.markdown | 4 ++++ website/docs/r/autoscaling_attachment.html.markdown | 3 +++ website/docs/r/autoscaling_lifecycle_hook.html.markdown | 4 ++++ website/docs/r/cloudwatch_event_target.html.markdown | 4 ++++ .../docs/r/cloudwatch_log_destination_policy.html.markdown | 4 ++++ .../docs/r/cloudwatch_log_subscription_filter.html.markdown | 2 +- website/docs/r/codebuild_project.html.markdown | 2 +- website/docs/r/codecommit_trigger.html.markdown | 6 ++++++ website/docs/r/cognito_user_group.html.markdown | 4 ++++ .../r/config_configuration_recorder_status.html.markdown | 4 ++++ .../docs/r/config_remediation_configuration.html.markdown | 6 ++++++ website/docs/r/cur_report_definition.html.markdown | 4 ++++ 19 files changed, 73 insertions(+), 2 deletions(-) diff --git a/website/docs/r/api_gateway_base_path_mapping.html.markdown b/website/docs/r/api_gateway_base_path_mapping.html.markdown index 671be127304..1485d02a829 100644 --- a/website/docs/r/api_gateway_base_path_mapping.html.markdown +++ b/website/docs/r/api_gateway_base_path_mapping.html.markdown @@ -48,6 +48,10 @@ The following arguments are supported: * `stage_name` - (Optional) The name of a specific deployment stage to expose at the given path. If omitted, callers may select any stage by including its name as a path element after the base path. * `base_path` - (Optional) Path segment that must be prepended to the path when accessing the API via this mapping. If omitted, the API is exposed at the root of the given domain. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_base_path_mapping` can be imported by using the domain name and base path, e.g. diff --git a/website/docs/r/api_gateway_gateway_response.markdown b/website/docs/r/api_gateway_gateway_response.markdown index 1322b6dac30..f34202f4778 100644 --- a/website/docs/r/api_gateway_gateway_response.markdown +++ b/website/docs/r/api_gateway_gateway_response.markdown @@ -42,6 +42,10 @@ The following arguments are supported: * `response_templates` - (Optional) A map specifying the templates used to transform the response body. * `response_parameters` - (Optional) A map specifying the parameters (paths, query strings and headers) of the Gateway Response. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_gateway_response` can be imported using `REST-API-ID/RESPONSE-TYPE`, e.g. diff --git a/website/docs/r/api_gateway_integration.html.markdown b/website/docs/r/api_gateway_integration.html.markdown index 6f87ab65002..e6561fb25d0 100644 --- a/website/docs/r/api_gateway_integration.html.markdown +++ b/website/docs/r/api_gateway_integration.html.markdown @@ -237,6 +237,10 @@ The `tls_config` configuration block supports the following arguments: * `insecure_skip_verification` - (Optional) Specifies whether or not API Gateway skips verification that the certificate for an integration endpoint is issued by a [supported certificate authority](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-supported-certificate-authorities-for-http-endpoints.html). This isn’t recommended, but it enables you to use certificates that are signed by private certificate authorities, or certificates that are self-signed. If enabled, API Gateway still performs basic certificate validation, which includes checking the certificate's expiration date, hostname, and presence of a root certificate authority. Supported only for `HTTP` and `HTTP_PROXY` integrations. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_integration` can be imported using `REST-API-ID/RESOURCE-ID/HTTP-METHOD`, e.g. diff --git a/website/docs/r/api_gateway_integration_response.html.markdown b/website/docs/r/api_gateway_integration_response.html.markdown index 9347801b5e5..16c74e1632c 100644 --- a/website/docs/r/api_gateway_integration_response.html.markdown +++ b/website/docs/r/api_gateway_integration_response.html.markdown @@ -84,6 +84,10 @@ The following arguments are supported: For example: `response_parameters = { "method.response.header.X-Some-Header" = "integration.response.header.X-Some-Other-Header" }` * `content_handling` - (Optional) Specifies how to handle request payload content type conversions. Supported values are `CONVERT_TO_BINARY` and `CONVERT_TO_TEXT`. If this property is not defined, the response payload will be passed through from the integration response to the method response without modification. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_integration_response` can be imported using `REST-API-ID/RESOURCE-ID/HTTP-METHOD/STATUS-CODE`, e.g. diff --git a/website/docs/r/api_gateway_method.html.markdown b/website/docs/r/api_gateway_method.html.markdown index 59917adb05d..3964bc39c3b 100644 --- a/website/docs/r/api_gateway_method.html.markdown +++ b/website/docs/r/api_gateway_method.html.markdown @@ -90,6 +90,10 @@ The following arguments are supported: * `request_parameters` - (Optional) A map of request parameters (from the path, query string and headers) that should be passed to the integration. The boolean value indicates whether the parameter is required (`true`) or optional (`false`). For example: `request_parameters = {"method.request.header.X-Some-Header" = true "method.request.querystring.some-query-param" = true}` would define that the header `X-Some-Header` and the query string `some-query-param` must be provided in the request. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_method` can be imported using `REST-API-ID/RESOURCE-ID/HTTP-METHOD`, e.g. diff --git a/website/docs/r/api_gateway_method_response.html.markdown b/website/docs/r/api_gateway_method_response.html.markdown index 2a4a51f970f..99cf469365e 100644 --- a/website/docs/r/api_gateway_method_response.html.markdown +++ b/website/docs/r/api_gateway_method_response.html.markdown @@ -59,6 +59,10 @@ The following arguments are supported: For example: `response_parameters = { "method.response.header.X-Some-Header" = true }` would define that the header `X-Some-Header` can be provided on the response. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_method_response` can be imported using `REST-API-ID/RESOURCE-ID/HTTP-METHOD/STATUS-CODE`, e.g. diff --git a/website/docs/r/api_gateway_method_settings.html.markdown b/website/docs/r/api_gateway_method_settings.html.markdown index d7f7a9d8f0f..3e60afa16aa 100644 --- a/website/docs/r/api_gateway_method_settings.html.markdown +++ b/website/docs/r/api_gateway_method_settings.html.markdown @@ -104,6 +104,10 @@ The following arguments are supported: * `require_authorization_for_cache_control` - (Optional) Specifies whether authorization is required for a cache invalidation request. * `unauthorized_cache_control_header_strategy` - (Optional) Specifies how to handle unauthorized requests for cache invalidation. The available values are `FAIL_WITH_403`, `SUCCEED_WITH_RESPONSE_HEADER`, `SUCCEED_WITHOUT_RESPONSE_HEADER`. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_api_gateway_method_settings` can be imported using `REST-API-ID/STAGE-NAME/METHOD-PATH`, e.g. diff --git a/website/docs/r/appautoscaling_target.html.markdown b/website/docs/r/appautoscaling_target.html.markdown index c3363716d20..2eda533698c 100644 --- a/website/docs/r/appautoscaling_target.html.markdown +++ b/website/docs/r/appautoscaling_target.html.markdown @@ -73,6 +73,10 @@ The following arguments are supported: * `scalable_dimension` - (Required) The scalable dimension of the scalable target. Documentation can be found in the `ScalableDimension` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) * `service_namespace` - (Required) The AWS service namespace of the scalable target. Documentation can be found in the `ServiceNamespace` parameter at: [AWS Application Auto Scaling API Reference](https://docs.aws.amazon.com/autoscaling/application/APIReference/API_RegisterScalableTarget.html#API_RegisterScalableTarget_RequestParameters) +## Attributes Reference + +No additional attributes are exported. + ## Import Application AutoScaling Target can be imported using the `service-namespace` , `resource-id` and `scalable-dimension` separated by `/`. diff --git a/website/docs/r/autoscaling_attachment.html.markdown b/website/docs/r/autoscaling_attachment.html.markdown index 6c6fc929f0a..8e898bc4569 100644 --- a/website/docs/r/autoscaling_attachment.html.markdown +++ b/website/docs/r/autoscaling_attachment.html.markdown @@ -62,3 +62,6 @@ The following arguments are supported: * `elb` - (Optional) The name of the ELB. * `alb_target_group_arn` - (Optional) The ARN of an ALB Target Group. +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/autoscaling_lifecycle_hook.html.markdown b/website/docs/r/autoscaling_lifecycle_hook.html.markdown index c981b134bff..322616737f9 100644 --- a/website/docs/r/autoscaling_lifecycle_hook.html.markdown +++ b/website/docs/r/autoscaling_lifecycle_hook.html.markdown @@ -69,6 +69,10 @@ The following arguments are supported: * `notification_target_arn` - (Optional) The ARN of the notification target that Auto Scaling will use to notify you when an instance is in the transition state for the lifecycle hook. This ARN target can be either an SQS queue or an SNS topic. * `role_arn` - (Optional) The ARN of the IAM role that allows the Auto Scaling group to publish to the specified notification target. +## Attributes Reference + +No additional attributes are exported. + ## Import AutoScaling Lifecycle Hooks can be imported using the role autoscaling_group_name and name separated by `/`. diff --git a/website/docs/r/cloudwatch_event_target.html.markdown b/website/docs/r/cloudwatch_event_target.html.markdown index bb2d76f1480..5cc84cb295c 100644 --- a/website/docs/r/cloudwatch_event_target.html.markdown +++ b/website/docs/r/cloudwatch_event_target.html.markdown @@ -365,6 +365,10 @@ For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonEC * `arn` - (Optional) - ARN of the SQS queue specified as the target for the dead-letter queue. +## Attributes Reference + +No additional attributes are exported. + ## Import EventBridge Targets can be imported using `event_bus_name/rule-name/target-id` (if you omit `event_bus_name`, the `default` event bus will be used). diff --git a/website/docs/r/cloudwatch_log_destination_policy.html.markdown b/website/docs/r/cloudwatch_log_destination_policy.html.markdown index f191e49986a..f413f6f490b 100644 --- a/website/docs/r/cloudwatch_log_destination_policy.html.markdown +++ b/website/docs/r/cloudwatch_log_destination_policy.html.markdown @@ -54,6 +54,10 @@ The following arguments are supported: * `destination_name` - (Required) A name for the subscription filter * `access_policy` - (Required) The policy document. This is a JSON formatted string. +## Attributes Reference + +No additional attributes are exported. + ## Import CloudWatch Logs destination policies can be imported using the `destination_name`, e.g. diff --git a/website/docs/r/cloudwatch_log_subscription_filter.html.markdown b/website/docs/r/cloudwatch_log_subscription_filter.html.markdown index 94a412da8b6..d9516a828b1 100644 --- a/website/docs/r/cloudwatch_log_subscription_filter.html.markdown +++ b/website/docs/r/cloudwatch_log_subscription_filter.html.markdown @@ -36,7 +36,7 @@ The following arguments are supported: ## Attributes Reference -No extra attributes are exported. +No additional attributes are exported. ## Import diff --git a/website/docs/r/codebuild_project.html.markdown b/website/docs/r/codebuild_project.html.markdown index 29a631841f5..13074112877 100755 --- a/website/docs/r/codebuild_project.html.markdown +++ b/website/docs/r/codebuild_project.html.markdown @@ -367,7 +367,7 @@ This block is only valid when the `type` is `CODECOMMIT`, `GITHUB` or `GITHUB_EN ## Attributes Reference -In addition to the arguments above, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - ARN of the CodeBuild project. * `badge_url` - URL of the build badge when `badge_enabled` is enabled. diff --git a/website/docs/r/codecommit_trigger.html.markdown b/website/docs/r/codecommit_trigger.html.markdown index 43e58723c01..945e6240f5d 100644 --- a/website/docs/r/codecommit_trigger.html.markdown +++ b/website/docs/r/codecommit_trigger.html.markdown @@ -38,3 +38,9 @@ The following arguments are supported: * `custom_data` - (Optional) Any custom data associated with the trigger that will be included in the information sent to the target of the trigger. * `branches` - (Optional) The branches that will be included in the trigger configuration. If no branches are specified, the trigger will apply to all branches. * `events` - (Required) The repository events that will cause the trigger to run actions in another service, such as sending a notification through Amazon Simple Notification Service (SNS). If no events are specified, the trigger will run for all repository events. Event types include: `all`, `updateReference`, `createReference`, `deleteReference`. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `configuration_id` - System-generated unique identifier. diff --git a/website/docs/r/cognito_user_group.html.markdown b/website/docs/r/cognito_user_group.html.markdown index 3dd4bd65068..f4563a1a27f 100644 --- a/website/docs/r/cognito_user_group.html.markdown +++ b/website/docs/r/cognito_user_group.html.markdown @@ -64,6 +64,10 @@ The following arguments are supported: * `precedence` - (Optional) The precedence of the user group. * `role_arn` - (Optional) The ARN of the IAM role to be associated with the user group. +## Attributes Reference + +No additional attributes are exported. + ## Import Cognito User Groups can be imported using the `user_pool_id`/`name` attributes concatenated, e.g. diff --git a/website/docs/r/config_configuration_recorder_status.html.markdown b/website/docs/r/config_configuration_recorder_status.html.markdown index f0aa73bc5ce..4ce7f8a2472 100644 --- a/website/docs/r/config_configuration_recorder_status.html.markdown +++ b/website/docs/r/config_configuration_recorder_status.html.markdown @@ -91,6 +91,10 @@ The following arguments are supported: * `name` - (Required) The name of the recorder * `is_enabled` - (Required) Whether the configuration recorder should be enabled or disabled. +## Attributes Reference + +No additional attributes are exported. + ## Import Configuration Recorder Status can be imported using the name of the Configuration Recorder, e.g. diff --git a/website/docs/r/config_remediation_configuration.html.markdown b/website/docs/r/config_remediation_configuration.html.markdown index 9a58229e7db..cb93481e60c 100644 --- a/website/docs/r/config_remediation_configuration.html.markdown +++ b/website/docs/r/config_remediation_configuration.html.markdown @@ -69,6 +69,12 @@ You must select either a dynamic value or a static value. * `resource_value` - (Optional) The value is dynamic and changes at run-time. * `static_value` - (Optional) The value is static and does not change at run-time. +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the Config Remediation Configuration. + ## Import Remediation Configurations can be imported using the name config_rule_name, e.g. diff --git a/website/docs/r/cur_report_definition.html.markdown b/website/docs/r/cur_report_definition.html.markdown index 615dfb3971f..e7e8544e866 100644 --- a/website/docs/r/cur_report_definition.html.markdown +++ b/website/docs/r/cur_report_definition.html.markdown @@ -45,6 +45,10 @@ The following arguments are supported: * `refresh_closed_reports` - (Optional) Set to true to update your reports after they have been finalized if AWS detects charges related to previous months. * `report_versioning` - (Optional) Overwrite the previous version of each report or to deliver the report in addition to the previous versions. Valid values are: CREATE_NEW_REPORT, OVERWRITE_REPORT +## Attributes Reference + +No additional attributes are exported. + ## Import Report Definitions can be imported using the `report_name`, e.g. From 8a532d019bee7af6bd2aeb3d8e312e435c9d837e Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 11:04:29 -0400 Subject: [PATCH 0075/1252] docs/provider: Attribute headers and byline fixes (D-I resources) (#18019) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Previously: ``` * website/docs/r/db_event_subscription.html.markdown: error checking file contents: attributes section heading (Attributes) should be: Attributes Reference * website/docs/r/directory_service_conditional_forwarder.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/directory_service_log_subscription.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/dms_event_subscription.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/dx_connection_association.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ebs_default_kms_key.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ebs_encryption_by_default.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/ec2_client_vpn_authorization_rule.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/elasticsearch_domain_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/elastictranscoder_preset.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/elb_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/emr_managed_scaling_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/glue_resource_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iam_account_alias.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iam_group_policy_attachment.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iam_instance_profile.html.markdown: error checking file contents: attributes section byline (In addition to the arguments above, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/iam_role.html.markdown: error checking file contents: attributes section byline (In addition to the arguments above, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/iam_role_policy_attachment.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iam_user_policy_attachment.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iot_policy_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/iot_thing_principal_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference ``` --- website/docs/r/db_event_subscription.html.markdown | 4 ++-- .../r/directory_service_conditional_forwarder.html.markdown | 4 ++++ .../docs/r/directory_service_log_subscription.html.markdown | 4 ++++ website/docs/r/dms_event_subscription.html.markdown | 6 ++++++ website/docs/r/dx_connection_association.html.markdown | 4 ++++ website/docs/r/ebs_default_kms_key.html.markdown | 4 ++++ website/docs/r/ebs_encryption_by_default.html.markdown | 4 ++++ .../docs/r/ec2_client_vpn_authorization_rule.html.markdown | 4 ++++ website/docs/r/elasticsearch_domain_policy.html.markdown | 4 ++++ website/docs/r/elastictranscoder_preset.html.markdown | 6 ++++++ website/docs/r/elb_attachment.html.markdown | 4 ++++ website/docs/r/emr_managed_scaling_policy.html.markdown | 4 ++++ website/docs/r/glue_resource_policy.html.markdown | 3 +++ website/docs/r/iam_account_alias.html.markdown | 4 ++++ website/docs/r/iam_group_policy_attachment.markdown | 4 ++++ website/docs/r/iam_instance_profile.html.markdown | 2 +- website/docs/r/iam_role.html.markdown | 2 +- website/docs/r/iam_role_policy_attachment.markdown | 4 ++++ website/docs/r/iam_user_policy_attachment.markdown | 4 ++++ website/docs/r/iot_policy_attachment.html.markdown | 4 ++++ website/docs/r/iot_thing_principal_attachment.html.markdown | 4 ++++ 21 files changed, 79 insertions(+), 4 deletions(-) diff --git a/website/docs/r/db_event_subscription.html.markdown b/website/docs/r/db_event_subscription.html.markdown index 21f7f226724..1384b3d0eb6 100644 --- a/website/docs/r/db_event_subscription.html.markdown +++ b/website/docs/r/db_event_subscription.html.markdown @@ -64,9 +64,9 @@ The following arguments are supported: * `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true. * `tags` - (Optional) A map of tags to assign to the resource. -## Attributes +## Attributes Reference -The following additional atttributes are provided: +In addition to all arguments above, the following attributes are exported: * `id` - The name of the RDS event notification subscription * `arn` - The Amazon Resource Name of the RDS event notification subscription diff --git a/website/docs/r/directory_service_conditional_forwarder.html.markdown b/website/docs/r/directory_service_conditional_forwarder.html.markdown index bbb3e15eea4..936849caf2f 100644 --- a/website/docs/r/directory_service_conditional_forwarder.html.markdown +++ b/website/docs/r/directory_service_conditional_forwarder.html.markdown @@ -32,6 +32,10 @@ The following arguments are supported: * `dns_ips` - (Required) A list of forwarder IP addresses. * `remote_domain_name` - (Required) The fully qualified domain name of the remote domain for which forwarders will be used. +## Attributes Reference + +No additional attributes are exported. + ## Import Conditional forwarders can be imported using the directory id and remote_domain_name, e.g. diff --git a/website/docs/r/directory_service_log_subscription.html.markdown b/website/docs/r/directory_service_log_subscription.html.markdown index 2fda1aac4fd..d74976af0d3 100644 --- a/website/docs/r/directory_service_log_subscription.html.markdown +++ b/website/docs/r/directory_service_log_subscription.html.markdown @@ -54,6 +54,10 @@ The following arguments are supported: * `directory_id` - (Required) The id of directory. * `log_group_name` - (Required) Name of the cloudwatch log group to which the logs should be published. The log group should be already created and the directory service principal should be provided with required permission to create stream and publish logs. Changing this value would delete the current subscription and create a new one. A directory can only have one log subscription at a time. +## Attributes Reference + +No additional attributes are exported. + ## Import Directory Service Log Subscriptions can be imported using the directory id, e.g. diff --git a/website/docs/r/dms_event_subscription.html.markdown b/website/docs/r/dms_event_subscription.html.markdown index e0f69d24182..c0707ca37c3 100644 --- a/website/docs/r/dms_event_subscription.html.markdown +++ b/website/docs/r/dms_event_subscription.html.markdown @@ -38,6 +38,12 @@ The following arguments are supported: * `source_ids` - (Required) Ids of sources to listen to. * `sns_topic_arn` - (Required) SNS topic arn to send events on. +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the DMS Event Subscription. + ## Timeouts `aws_dms_event_subscription` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: diff --git a/website/docs/r/dx_connection_association.html.markdown b/website/docs/r/dx_connection_association.html.markdown index 715e9d5e2c0..5602befd3f9 100644 --- a/website/docs/r/dx_connection_association.html.markdown +++ b/website/docs/r/dx_connection_association.html.markdown @@ -37,3 +37,7 @@ The following arguments are supported: * `connection_id` - (Required) The ID of the connection. * `lag_id` - (Required) The ID of the LAG with which to associate the connection. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/ebs_default_kms_key.html.markdown b/website/docs/r/ebs_default_kms_key.html.markdown index a5afe25554c..c211e09534e 100644 --- a/website/docs/r/ebs_default_kms_key.html.markdown +++ b/website/docs/r/ebs_default_kms_key.html.markdown @@ -31,6 +31,10 @@ The following arguments are supported: * `key_arn` - (Required, ForceNew) The ARN of the AWS Key Management Service (AWS KMS) customer master key (CMK) to use to encrypt the EBS volume. +## Attributes Reference + +No additional attributes are exported. + ## Import The EBS default KMS CMK can be imported with the KMS key ARN, e.g. diff --git a/website/docs/r/ebs_encryption_by_default.html.markdown b/website/docs/r/ebs_encryption_by_default.html.markdown index 0acbc4554ff..b25c662d4cb 100644 --- a/website/docs/r/ebs_encryption_by_default.html.markdown +++ b/website/docs/r/ebs_encryption_by_default.html.markdown @@ -25,3 +25,7 @@ resource "aws_ebs_encryption_by_default" "example" { The following arguments are supported: * `enabled` - (Optional) Whether or not default EBS encryption is enabled. Valid values are `true` or `false`. Defaults to `true`. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown b/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown index 7abfc44f3b0..e08c91a364f 100644 --- a/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown +++ b/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown @@ -31,6 +31,10 @@ The following arguments are supported: * `authorize_all_groups` - (Optional) Indicates whether the authorization rule grants access to all clients. One of `access_group_id` or `authorize_all_groups` must be set. * `description` - (Optional) A brief description of the authorization rule. +## Attributes Reference + +No additional attributes are exported. + ## Import AWS Client VPN authorization rules can be imported using the endpoint ID and target network CIDR. If there is a specific group name that is included as well. All values are separated by a `,`. diff --git a/website/docs/r/elasticsearch_domain_policy.html.markdown b/website/docs/r/elasticsearch_domain_policy.html.markdown index 94872e959d2..8194695eba8 100644 --- a/website/docs/r/elasticsearch_domain_policy.html.markdown +++ b/website/docs/r/elasticsearch_domain_policy.html.markdown @@ -46,3 +46,7 @@ The following arguments are supported: * `domain_name` - (Required) Name of the domain. * `access_policies` - (Optional) IAM policy document specifying the access policies for the domain + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/elastictranscoder_preset.html.markdown b/website/docs/r/elastictranscoder_preset.html.markdown index d5e3592982c..4ce4285698f 100644 --- a/website/docs/r/elastictranscoder_preset.html.markdown +++ b/website/docs/r/elastictranscoder_preset.html.markdown @@ -159,6 +159,12 @@ The `video_codec_options` map supports the following: * `ChromaSubsampling` - The sampling pattern for the chroma (color) channels of the output video. Valid values are `yuv420p` and `yuv422p`. * `LoopCount` - The number of times you want the output gif to loop (Gif only) +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the Elastic Transcoder Preset. + ## Import Elastic Transcoder presets can be imported using the `id`, e.g. diff --git a/website/docs/r/elb_attachment.html.markdown b/website/docs/r/elb_attachment.html.markdown index 1f3754a6228..d932c898138 100644 --- a/website/docs/r/elb_attachment.html.markdown +++ b/website/docs/r/elb_attachment.html.markdown @@ -33,3 +33,7 @@ The following arguments are supported: * `elb` - (Required) The name of the ELB. * `instance` - (Required) Instance ID to place in the ELB pool. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/emr_managed_scaling_policy.html.markdown b/website/docs/r/emr_managed_scaling_policy.html.markdown index 1a850997792..13b0025e1f5 100644 --- a/website/docs/r/emr_managed_scaling_policy.html.markdown +++ b/website/docs/r/emr_managed_scaling_policy.html.markdown @@ -54,6 +54,10 @@ The following arguments are supported: * `maximum_ondemand_capacity_units` - (Optional) The upper boundary of On-Demand EC2 units. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The On-Demand units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between On-Demand and Spot instances. * `maximum_core_capacity_units` - (Optional) The upper boundary of EC2 units for core node type in a cluster. It is measured through VCPU cores or instances for instance groups and measured through units for instance fleets. The core units are not allowed to scale beyond this boundary. The parameter is used to split capacity allocation between core and task nodes. +## Attributes Reference + +No additional attributes are exported. + ## Import EMR Managed Scaling Policies can be imported via the EMR Cluster identifier, e.g. diff --git a/website/docs/r/glue_resource_policy.html.markdown b/website/docs/r/glue_resource_policy.html.markdown index 40da2d552a6..c59ca268652 100644 --- a/website/docs/r/glue_resource_policy.html.markdown +++ b/website/docs/r/glue_resource_policy.html.markdown @@ -44,6 +44,9 @@ The following arguments are supported: * `policy` – (Required) The policy to be applied to the aws glue data catalog. +## Attributes Reference + +No additional attributes are exported. ## Import diff --git a/website/docs/r/iam_account_alias.html.markdown b/website/docs/r/iam_account_alias.html.markdown index 4bf6c0c5f18..31e880ce2cf 100644 --- a/website/docs/r/iam_account_alias.html.markdown +++ b/website/docs/r/iam_account_alias.html.markdown @@ -26,6 +26,10 @@ The following arguments are supported: * `account_alias` - (Required) The account alias +## Attributes Reference + +No additional attributes are exported. + ## Import The current Account Alias can be imported using the `account_alias`, e.g. diff --git a/website/docs/r/iam_group_policy_attachment.markdown b/website/docs/r/iam_group_policy_attachment.markdown index 2a3284a0b39..52a460e8e12 100644 --- a/website/docs/r/iam_group_policy_attachment.markdown +++ b/website/docs/r/iam_group_policy_attachment.markdown @@ -38,6 +38,10 @@ The following arguments are supported: * `group` (Required) - The group the policy should be applied to * `policy_arn` (Required) - The ARN of the policy you want to apply +## Attributes Reference + +No additional attributes are exported. + ## Import IAM group policy attachments can be imported using the group name and policy arn separated by `/`. diff --git a/website/docs/r/iam_instance_profile.html.markdown b/website/docs/r/iam_instance_profile.html.markdown index 5a97590858b..53c55337fdd 100644 --- a/website/docs/r/iam_instance_profile.html.markdown +++ b/website/docs/r/iam_instance_profile.html.markdown @@ -51,7 +51,7 @@ The following arguments are optional: ## Attributes Reference -In addition to the arguments above, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - ARN assigned by AWS to the instance profile. * `create_date` - Creation timestamp of the instance profile. diff --git a/website/docs/r/iam_role.html.markdown b/website/docs/r/iam_role.html.markdown index 9ac2eea8719..12e7bf758cb 100644 --- a/website/docs/r/iam_role.html.markdown +++ b/website/docs/r/iam_role.html.markdown @@ -201,7 +201,7 @@ This configuration block supports the following: ## Attributes Reference -In addition to the arguments above, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) specifying the role. * `create_date` - Creation date of the IAM role. diff --git a/website/docs/r/iam_role_policy_attachment.markdown b/website/docs/r/iam_role_policy_attachment.markdown index 030909c1263..ccae5ba5926 100644 --- a/website/docs/r/iam_role_policy_attachment.markdown +++ b/website/docs/r/iam_role_policy_attachment.markdown @@ -70,6 +70,10 @@ The following arguments are supported: * `role` (Required) - The name of the IAM role to which the policy should be applied * `policy_arn` (Required) - The ARN of the policy you want to apply +## Attributes Reference + +No additional attributes are exported. + ## Import IAM role policy attachments can be imported using the role name and policy arn separated by `/`. diff --git a/website/docs/r/iam_user_policy_attachment.markdown b/website/docs/r/iam_user_policy_attachment.markdown index 94311090719..d6dc860e2ff 100644 --- a/website/docs/r/iam_user_policy_attachment.markdown +++ b/website/docs/r/iam_user_policy_attachment.markdown @@ -38,6 +38,10 @@ The following arguments are supported: * `user` (Required) - The user the policy should be applied to * `policy_arn` (Required) - The ARN of the policy you want to apply +## Attributes Reference + +No additional attributes are exported. + ## Import IAM user policy attachments can be imported using the user name and policy arn separated by `/`. diff --git a/website/docs/r/iot_policy_attachment.html.markdown b/website/docs/r/iot_policy_attachment.html.markdown index f176e918fe1..cae9b503fd7 100644 --- a/website/docs/r/iot_policy_attachment.html.markdown +++ b/website/docs/r/iot_policy_attachment.html.markdown @@ -49,3 +49,7 @@ The following arguments are supported: * `policy` - (Required) The name of the policy to attach. * `target` - (Required) The identity to which the policy is attached. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/iot_thing_principal_attachment.html.markdown b/website/docs/r/iot_thing_principal_attachment.html.markdown index c3a592f1985..73a135e0b6f 100644 --- a/website/docs/r/iot_thing_principal_attachment.html.markdown +++ b/website/docs/r/iot_thing_principal_attachment.html.markdown @@ -32,3 +32,7 @@ resource "aws_iot_thing_principal_attachment" "att" { * `principal` - (Required) The AWS IoT Certificate ARN or Amazon Cognito Identity ID. * `thing` - (Required) The name of the thing. + +## Attributes Reference + +No additional attributes are exported. From abf3fe63c136de40dc1ee4c5c05d7a49fe0be520 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 11:06:11 -0400 Subject: [PATCH 0076/1252] docs/provider: Attribute headers and byline fixes (L-R resources) (#18020) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Previously: ``` * website/docs/r/lakeformation_data_lake_settings.html.markdown: error checking file contents: attributes section byline (In addition to all arguments above, no attributes are exported.) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/lakeformation_permissions.html.markdown: error checking file contents: attributes section byline (In addition to the above arguments, no attributes are exported.) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/lambda_code_signing_config.html.markdown: error checking file contents: attributes section byline should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/lambda_function.html.markdown: error checking file contents: attributes section byline (In addition to arguments above, the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/lambda_permission.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/media_store_container_policy.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/neptune_event_subscription.html.markdown: error checking file contents: attributes section heading (Attributes) should be: Attributes Reference * website/docs/r/network_interface_sg_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/networkfirewall_resource_policy.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/organizations_policy_attachment.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_adm_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_apns_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_apns_sandbox_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_apns_voip_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_baidu_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_event_stream.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_gcm_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/quicksight_user.html.markdown: error checking file contents: attributes section byline (All above attributes except for session_name and identity_type are exported as well as:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/redshift_event_subscription.html.markdown: error checking file contents: attributes section heading (Attributes) should be: Attributes Reference * website/docs/r/redshift_snapshot_schedule.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/redshift_snapshot_schedule_association.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference ``` --- .../docs/r/lakeformation_data_lake_settings.html.markdown | 2 +- website/docs/r/lakeformation_permissions.html.markdown | 2 +- website/docs/r/lambda_code_signing_config.html.markdown | 3 ++- website/docs/r/lambda_function.html.markdown | 2 +- website/docs/r/lambda_permission.html.markdown | 4 ++++ website/docs/r/media_store_container_policy.html.markdown | 4 ++++ website/docs/r/neptune_event_subscription.html.markdown | 4 ++-- .../docs/r/network_interface_sg_attachment.html.markdown | 4 ++-- .../docs/r/organizations_policy_attachment.html.markdown | 4 ++++ website/docs/r/pinpoint_adm_channel.markdown | 4 ++++ website/docs/r/pinpoint_apns_channel.markdown | 4 ++++ website/docs/r/pinpoint_apns_sandbox_channel.markdown | 4 ++++ website/docs/r/pinpoint_apns_voip_channel.markdown | 4 ++++ website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown | 4 ++++ website/docs/r/quicksight_user.html.markdown | 2 +- website/docs/r/redshift_event_subscription.html.markdown | 4 ++-- website/docs/r/redshift_snapshot_schedule.html.markdown | 6 ++++++ .../r/redshift_snapshot_schedule_association.html.markdown | 4 ++++ 18 files changed, 54 insertions(+), 11 deletions(-) diff --git a/website/docs/r/lakeformation_data_lake_settings.html.markdown b/website/docs/r/lakeformation_data_lake_settings.html.markdown index 768efe4400d..03278b63531 100644 --- a/website/docs/r/lakeformation_data_lake_settings.html.markdown +++ b/website/docs/r/lakeformation_data_lake_settings.html.markdown @@ -68,4 +68,4 @@ The following arguments are optional: ## Attributes Reference -In addition to all arguments above, no attributes are exported. +No additional attributes are exported. diff --git a/website/docs/r/lakeformation_permissions.html.markdown b/website/docs/r/lakeformation_permissions.html.markdown index 610761119f5..211913593b9 100644 --- a/website/docs/r/lakeformation_permissions.html.markdown +++ b/website/docs/r/lakeformation_permissions.html.markdown @@ -114,4 +114,4 @@ The following arguments are optional: ## Attributes Reference -In addition to the above arguments, no attributes are exported. +No additional attributes are exported. diff --git a/website/docs/r/lambda_code_signing_config.html.markdown b/website/docs/r/lambda_code_signing_config.html.markdown index 1fd8e01073f..b96ef0667ee 100644 --- a/website/docs/r/lambda_code_signing_config.html.markdown +++ b/website/docs/r/lambda_code_signing_config.html.markdown @@ -45,9 +45,10 @@ The `policies` block supports the following argument: * `untrusted_artifact_on_deployment` - (Required) Code signing configuration policy for deployment validation failure. If you set the policy to Enforce, Lambda blocks the deployment request if code-signing validation checks fail. If you set the policy to Warn, Lambda allows the deployment and creates a CloudWatch log. Valid values: `Warn`, `Enforce`. Default value: `Warn`. - ## Attributes Reference +In addition to all arguments above, the following attributes are exported: + * `arn` - The Amazon Resource Name (ARN) of the code signing configuration. * `config_id` - Unique identifier for the code signing configuration. * `last_modified` - The date and time that the code signing configuration was last modified. diff --git a/website/docs/r/lambda_function.html.markdown b/website/docs/r/lambda_function.html.markdown index 13bd67569b9..0caad2b51c7 100644 --- a/website/docs/r/lambda_function.html.markdown +++ b/website/docs/r/lambda_function.html.markdown @@ -279,7 +279,7 @@ For network connectivity to AWS resources in a VPC, specify a list of security g ## Attributes Reference -In addition to arguments above, the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) identifying your Lambda Function. * `invoke_arn` - ARN to be used for invoking Lambda Function from API Gateway - to be used in [`aws_api_gateway_integration`](/docs/providers/aws/r/api_gateway_integration.html)'s `uri`. diff --git a/website/docs/r/lambda_permission.html.markdown b/website/docs/r/lambda_permission.html.markdown index 7fa3f7741e7..9f015392b12 100644 --- a/website/docs/r/lambda_permission.html.markdown +++ b/website/docs/r/lambda_permission.html.markdown @@ -198,6 +198,10 @@ EOF [1]: https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html#use-aws-cli [2]: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-control-access-using-iam-policies-to-invoke-api.html +## Attributes Reference + +No additional attributes are exported. + ## Import Lambda permission statements can be imported using function_name/statement_id, with an optional qualifier, e.g. diff --git a/website/docs/r/media_store_container_policy.html.markdown b/website/docs/r/media_store_container_policy.html.markdown index 1476c77b5a0..93a51ef5cd8 100644 --- a/website/docs/r/media_store_container_policy.html.markdown +++ b/website/docs/r/media_store_container_policy.html.markdown @@ -49,6 +49,10 @@ The following arguments are supported: * `container_name` - (Required) The name of the container. * `policy` - (Required) The contents of the policy. For more information about building AWS IAM policy documents with Terraform, see the [AWS IAM Policy Document Guide](https://learn.hashicorp.com/terraform/aws/iam-policy). +## Attributes Reference + +No additional attributes are exported. + ## Import MediaStore Container Policy can be imported using the MediaStore Container Name, e.g. diff --git a/website/docs/r/neptune_event_subscription.html.markdown b/website/docs/r/neptune_event_subscription.html.markdown index 9ac8afb4be8..25a68c7d0c6 100644 --- a/website/docs/r/neptune_event_subscription.html.markdown +++ b/website/docs/r/neptune_event_subscription.html.markdown @@ -73,9 +73,9 @@ The following arguments are supported: * `source_type` - (Optional) The type of source that will be generating the events. Valid options are `db-instance`, `db-security-group`, `db-parameter-group`, `db-snapshot`, `db-cluster` or `db-cluster-snapshot`. If not set, all sources will be subscribed to. * `tags` - (Optional) A map of tags to assign to the resource. -## Attributes +## Attributes Reference -The following additional atttributes are provided: +In addition to all arguments above, the following attributes are exported: * `id` - The name of the Neptune event notification subscription. * `arn` - The Amazon Resource Name of the Neptune event notification subscription. diff --git a/website/docs/r/network_interface_sg_attachment.html.markdown b/website/docs/r/network_interface_sg_attachment.html.markdown index c3a16e2f637..2c8dfef57b8 100644 --- a/website/docs/r/network_interface_sg_attachment.html.markdown +++ b/website/docs/r/network_interface_sg_attachment.html.markdown @@ -89,6 +89,6 @@ resource "aws_network_interface_sg_attachment" "sg_attachment" { * `security_group_id` - (Required) The ID of the security group. * `network_interface_id` - (Required) The ID of the network interface to attach to. -## Output Reference +## Attributes Reference -There are no outputs for this resource. +No additional attributes are exported. diff --git a/website/docs/r/organizations_policy_attachment.html.markdown b/website/docs/r/organizations_policy_attachment.html.markdown index 7fb9d761a93..f55a33fe7a8 100644 --- a/website/docs/r/organizations_policy_attachment.html.markdown +++ b/website/docs/r/organizations_policy_attachment.html.markdown @@ -46,6 +46,10 @@ The following arguments are supported: * `policy_id` - (Required) The unique identifier (ID) of the policy that you want to attach to the target. * `target_id` - (Required) The unique identifier (ID) of the root, organizational unit, or account number that you want to attach the policy to. +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_organizations_policy_attachment` can be imported by using the target ID and policy ID, e.g. with an account target diff --git a/website/docs/r/pinpoint_adm_channel.markdown b/website/docs/r/pinpoint_adm_channel.markdown index c3de242a374..2e93f991eea 100644 --- a/website/docs/r/pinpoint_adm_channel.markdown +++ b/website/docs/r/pinpoint_adm_channel.markdown @@ -37,6 +37,10 @@ The following arguments are supported: * `client_secret` - (Required) Client Secret (part of OAuth Credentials) obtained via Amazon Developer Account. * `enabled` - (Optional) Specifies whether to enable the channel. Defaults to `true`. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint ADM Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_apns_channel.markdown b/website/docs/r/pinpoint_apns_channel.markdown index 63c37c1a3a1..d9f5a013946 100644 --- a/website/docs/r/pinpoint_apns_channel.markdown +++ b/website/docs/r/pinpoint_apns_channel.markdown @@ -52,6 +52,10 @@ If you choose to use __Key credentials__ you will have to provide: * `token_key` - (Required) The `.p8` file that you download from your Apple developer account when you create an authentication key. * `token_key_id` - (Required) The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint APNs Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_apns_sandbox_channel.markdown b/website/docs/r/pinpoint_apns_sandbox_channel.markdown index e960514236d..f11465e62a6 100644 --- a/website/docs/r/pinpoint_apns_sandbox_channel.markdown +++ b/website/docs/r/pinpoint_apns_sandbox_channel.markdown @@ -52,6 +52,10 @@ If you choose to use __Key credentials__ you will have to provide: * `token_key` - (Required) The `.p8` file that you download from your Apple developer account when you create an authentication key. * `token_key_id` - (Required) The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint APNs Sandbox Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_apns_voip_channel.markdown b/website/docs/r/pinpoint_apns_voip_channel.markdown index f4ad7f4c2d6..4822fb1fae0 100644 --- a/website/docs/r/pinpoint_apns_voip_channel.markdown +++ b/website/docs/r/pinpoint_apns_voip_channel.markdown @@ -52,6 +52,10 @@ If you choose to use __Key credentials__ you will have to provide: * `token_key` - (Required) The `.p8` file that you download from your Apple developer account when you create an authentication key. * `token_key_id` - (Required) The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint APNs VoIP Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown b/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown index 16a6da76193..308dd0812ea 100644 --- a/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown +++ b/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown @@ -52,6 +52,10 @@ If you choose to use __Key credentials__ you will have to provide: * `token_key` - (Required) The `.p8` file that you download from your Apple developer account when you create an authentication key. * `token_key_id` - (Required) The ID assigned to your signing key. To find this value, choose Certificates, IDs & Profiles, and choose your key in the Keys section. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint APNs VoIP Sandbox Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/quicksight_user.html.markdown b/website/docs/r/quicksight_user.html.markdown index 60a2e4e6b3f..f3be62bc1c1 100644 --- a/website/docs/r/quicksight_user.html.markdown +++ b/website/docs/r/quicksight_user.html.markdown @@ -37,7 +37,7 @@ The following arguments are supported: ## Attributes Reference -All above attributes except for `session_name` and `identity_type` are exported as well as: +In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the user diff --git a/website/docs/r/redshift_event_subscription.html.markdown b/website/docs/r/redshift_event_subscription.html.markdown index 09dfa25f31b..8395bda963b 100644 --- a/website/docs/r/redshift_event_subscription.html.markdown +++ b/website/docs/r/redshift_event_subscription.html.markdown @@ -59,9 +59,9 @@ The following arguments are supported: * `enabled` - (Optional) A boolean flag to enable/disable the subscription. Defaults to true. * `tags` - (Optional) A map of tags to assign to the resource. -## Attributes +## Attributes Reference -The following additional atttributes are provided: +In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the Redshift event notification subscription * `id` - The name of the Redshift event notification subscription diff --git a/website/docs/r/redshift_snapshot_schedule.html.markdown b/website/docs/r/redshift_snapshot_schedule.html.markdown index fa5f0f23ae1..476b40d978c 100644 --- a/website/docs/r/redshift_snapshot_schedule.html.markdown +++ b/website/docs/r/redshift_snapshot_schedule.html.markdown @@ -31,6 +31,12 @@ identifier beginning with the specified prefix. Conflicts with `identifier`. * `force_destroy` - (Optional) Whether to destroy all associated clusters with this snapshot schedule on deletion. Must be enabled and applied before attempting deletion. * `tags` - (Optional) A map of tags to assign to the resource. +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `arn` - Amazon Resource Name (ARN) of the Redshift Snapshot Schedule. + ## Import Redshift Snapshot Schedule can be imported using the `identifier`, e.g. diff --git a/website/docs/r/redshift_snapshot_schedule_association.html.markdown b/website/docs/r/redshift_snapshot_schedule_association.html.markdown index 14b9c8b0194..601d6162dfb 100644 --- a/website/docs/r/redshift_snapshot_schedule_association.html.markdown +++ b/website/docs/r/redshift_snapshot_schedule_association.html.markdown @@ -40,6 +40,10 @@ The following arguments are supported: * `cluster_identifier` - (Required, Forces new resource) The cluster identifier. * `schedule_identifier` - (Required, Forces new resource) The snapshot schedule identifier. +## Attributes Reference + +No additional attributes are exported. + ## Import Redshift Snapshot Schedule Association can be imported using the `/`, e.g. From b7e7551130a777c6b854e94bbaf1aa7ce955651d Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 15:09:03 +0000 Subject: [PATCH 0077/1252] Update CHANGELOG.md for #18020 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 972e26f0d90..42019b7fcae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,18 @@ BUG FIXES: ## 3.32.0 (March 12, 2021) +ENHANCEMENTS: + +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + BUG FIXES: * resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) From 3cd2c0b1ff738d3b53620393fc968f3530ee8a1e Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 11:09:39 -0400 Subject: [PATCH 0078/1252] docs/provider: Remove other examples code block languages (#18022) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Previously: ``` * website/docs/r/ecs_task_definition.html.markdown: error checking file contents: example section code block language (json) should be: ```terraform * website/docs/r/load_balancer_backend_server_policy.html.markdown: error checking file contents: example section code block language (shell) should be: ```terraform * website/docs/r/load_balancer_policy.html.markdown: error checking file contents: example section code block language (shell) should be: ```terraform ``` The resource documentation examples sections are designated for Terraform configurations and in the future these files will only be generated from resource/attribute descriptions and configuration files. For these in particular: * Disallow json as a code block languange as it could allow Terraform JSON configuration files to be shown, where Terraform HCL configuration files are the norm. Instead, use jsonencode() function to show the container definitions inline. * Move shell commands to code comments (or alteratively could be added to the relevant attribute description, but in this case it seems clearer to denote via comment the exact situation). --- .../docs/r/ecs_task_definition.html.markdown | 69 ++++++++----------- ...lancer_backend_server_policy.html.markdown | 10 +-- .../docs/r/load_balancer_policy.html.markdown | 10 +-- 3 files changed, 34 insertions(+), 55 deletions(-) diff --git a/website/docs/r/ecs_task_definition.html.markdown b/website/docs/r/ecs_task_definition.html.markdown index 3683054e1c9..b78f311b1a6 100644 --- a/website/docs/r/ecs_task_definition.html.markdown +++ b/website/docs/r/ecs_task_definition.html.markdown @@ -12,10 +12,37 @@ Manages a revision of an ECS task definition to be used in `aws_ecs_service`. ## Example Usage -```hcl +```terraform resource "aws_ecs_task_definition" "service" { - family = "service" - container_definitions = file("task-definitions/service.json") + family = "service" + container_definitions = jsonencode([ + { + name = "first" + image = "service-first" + cpu = 10 + memory = 512 + essential = true + portMappings = [ + { + containerPort = 80 + hostPort = 80 + } + ] + }, + { + name = "second" + image = "service-second" + cpu = 10 + memory = 256 + essential = true + portMappings = [ + { + containerPort = 443 + hostPort = 443 + } + ] + } + ]) volume { name = "service-storage" @@ -29,42 +56,6 @@ resource "aws_ecs_task_definition" "service" { } ``` -The referenced `task-definitions/service.json` file contains a valid JSON document, -which is shown below, and its content is going to be passed directly into the -`container_definitions` attribute as a string. Please note that this example -contains only a small subset of the available parameters. - -```json -[ - { - "name": "first", - "image": "service-first", - "cpu": 10, - "memory": 512, - "essential": true, - "portMappings": [ - { - "containerPort": 80, - "hostPort": 80 - } - ] - }, - { - "name": "second", - "image": "service-second", - "cpu": 10, - "memory": 256, - "essential": true, - "portMappings": [ - { - "containerPort": 443, - "hostPort": 443 - } - ] - } -] -``` - ### With AppMesh Proxy ```hcl diff --git a/website/docs/r/load_balancer_backend_server_policy.html.markdown b/website/docs/r/load_balancer_backend_server_policy.html.markdown index 63961e2fd37..631a0b3ba3b 100644 --- a/website/docs/r/load_balancer_backend_server_policy.html.markdown +++ b/website/docs/r/load_balancer_backend_server_policy.html.markdown @@ -36,6 +36,8 @@ resource "aws_load_balancer_policy" "wu-tang-ca-pubkey-policy" { policy_name = "wu-tang-ca-pubkey-policy" policy_type_name = "PublicKeyPolicyType" + # The public key of a CA certificate file can be extracted with: + # $ cat wu-tang-ca.pem | openssl x509 -pubkey -noout | grep -v '\-\-\-\-' | tr -d '\n' > wu-tang-pubkey policy_attribute { name = "PublicKey" value = file("wu-tang-pubkey") @@ -63,14 +65,6 @@ resource "aws_load_balancer_backend_server_policy" "wu-tang-backend-auth-policie } ``` -Where the file `pubkey` in the current directory contains only the _public key_ of the certificate. - -```shell -cat wu-tang-ca.pem | openssl x509 -pubkey -noout | grep -v '\-\-\-\-' | tr -d '\n' > wu-tang-pubkey -``` - -This example shows how to enable backend authentication for an ELB as well as customize the TLS settings. - ## Argument Reference The following arguments are supported: diff --git a/website/docs/r/load_balancer_policy.html.markdown b/website/docs/r/load_balancer_policy.html.markdown index 8bf1b8fb766..527e9b346dd 100644 --- a/website/docs/r/load_balancer_policy.html.markdown +++ b/website/docs/r/load_balancer_policy.html.markdown @@ -35,6 +35,8 @@ resource "aws_load_balancer_policy" "wu-tang-ca-pubkey-policy" { policy_name = "wu-tang-ca-pubkey-policy" policy_type_name = "PublicKeyPolicyType" + # The public key of a CA certificate file can be extracted with: + # $ cat wu-tang-ca.pem | openssl x509 -pubkey -noout | grep -v '\-\-\-\-' | tr -d '\n' > wu-tang-pubkey policy_attribute { name = "PublicKey" value = file("wu-tang-pubkey") @@ -98,14 +100,6 @@ resource "aws_load_balancer_listener_policy" "wu-tang-listener-policies-443" { } ``` -Where the file `pubkey` in the current directory contains only the _public key_ of the certificate. - -```shell -cat wu-tang-ca.pem | openssl x509 -pubkey -noout | grep -v '\-\-\-\-' | tr -d '\n' > wu-tang-pubkey -``` - -This example shows how to enable backend authentication for an ELB as well as customize the TLS settings. - ## Argument Reference The following arguments are supported: From 08c08b2750aab0da00fda1823335091d4ac7edf2 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 15:12:06 +0000 Subject: [PATCH 0079/1252] Update CHANGELOG.md for #18022 --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 42019b7fcae..43a594b9b4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,18 @@ BUG FIXES: ## 3.32.0 (March 12, 2021) +ENHANCEMENTS: + +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + BUG FIXES: * resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) From a4386d24d427b418341367849abb0221389a2a41 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 17 Mar 2021 11:14:29 -0400 Subject: [PATCH 0080/1252] Update .changelog/17974.txt entry syntax Co-authored-by: Brian Flad --- .changelog/17974.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/17974.txt b/.changelog/17974.txt index 24d5f966595..6511a0a6a3b 100644 --- a/.changelog/17974.txt +++ b/.changelog/17974.txt @@ -7,7 +7,7 @@ provider: Add `default_tags` argument (in public preview, see note above) ```release-note:enhancement -aws_subnet: Support provider-wide default tags (in public preview, see note above) +resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) ``` ```release-note:enhancement From 6560fefe982ff361a6202b3798f385df97db1554 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Wed, 17 Mar 2021 11:14:41 -0400 Subject: [PATCH 0081/1252] Update .changelog/17974.txt entry syntax Co-authored-by: Brian Flad --- .changelog/17974.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/17974.txt b/.changelog/17974.txt index 6511a0a6a3b..6370c123b4e 100644 --- a/.changelog/17974.txt +++ b/.changelog/17974.txt @@ -11,5 +11,5 @@ resource/aws_subnet: Support provider-wide default tags (in public preview, see ``` ```release-note:enhancement -aws_vpc: Support provider-wide default tags (in public preview, see note above) +resource/aws_vpc: Support provider-wide default tags (in public preview, see note above) ``` From cdfb09057aafb3b75201cf764ace39a785a1a76d Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 11:38:15 -0400 Subject: [PATCH 0082/1252] docs/provider: Bulk update hcl code block language to terraform (#18008) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17810 This is a simple find-replace of ```hcl with ```terraform. This will be automatically covered by `tfproviderdocs` checking in the future when `-enable-contents-check` is turned on in GitHub Actions (and other potential Markdown linting). Previously (example reports): ``` * website/docs/r/ami.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/ami_copy.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/ami_from_instance.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/ami_launch_permission.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/api_gateway_account.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/api_gateway_api_key.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/api_gateway_authorizer.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform ... ``` --- website/docs/d/acm_certificate.html.markdown | 2 +- ...acmpca_certificate_authority.html.markdown | 2 +- website/docs/d/ami.html.markdown | 2 +- website/docs/d/ami_ids.html.markdown | 2 +- .../docs/d/api_gateway_api_key.html.markdown | 2 +- .../d/api_gateway_domain_name.html.markdown | 2 +- .../docs/d/api_gateway_resource.html.markdown | 2 +- .../docs/d/api_gateway_rest_api.html.markdown | 2 +- .../docs/d/api_gateway_vpc_link.html.markdown | 2 +- website/docs/d/apigatewayv2_api.html.markdown | 2 +- .../docs/d/apigatewayv2_apis.html.markdown | 2 +- website/docs/d/arn.html.markdown | 2 +- .../docs/d/autoscaling_group.html.markdown | 2 +- .../docs/d/autoscaling_groups.html.markdown | 2 +- .../docs/d/availability_zone.html.markdown | 2 +- .../docs/d/availability_zones.html.markdown | 4 +- website/docs/d/backup_plan.html.markdown | 2 +- website/docs/d/backup_selection.html.markdown | 2 +- website/docs/d/backup_vault.html.markdown | 2 +- .../d/batch_compute_environment.html.markdown | 2 +- website/docs/d/batch_job_queue.html.markdown | 2 +- .../d/billing_service_account.html.markdown | 2 +- website/docs/d/caller_identity.html.markdown | 2 +- .../docs/d/canonical_user_id.html.markdown | 2 +- .../d/cloudformation_export.html.markdown | 2 +- .../docs/d/cloudformation_stack.html.markdown | 2 +- .../d/cloudfront_cache_policy.html.markdown | 2 +- .../d/cloudfront_distribution.html.markdown | 2 +- ...dfront_origin_request_policy.html.markdown | 2 +- .../docs/d/cloudhsm_v2_cluster.html.markdown | 2 +- .../cloudtrail_service_account.html.markdown | 2 +- .../docs/d/cloudwatch_log_group.html.markdown | 2 +- ...artifact_authorization_token.html.markdown | 2 +- ...artifact_repository_endpoint.html.markdown | 2 +- .../d/codecommit_repository.html.markdown | 2 +- website/docs/d/cognito_user_pools.markdown | 2 +- .../d/cur_report_definition.html.markdown | 2 +- website/docs/d/customer_gateway.html.markdown | 2 +- .../docs/d/db_cluster_snapshot.html.markdown | 2 +- .../docs/d/db_event_categories.html.markdown | 4 +- website/docs/d/db_instance.html.markdown | 2 +- website/docs/d/db_snapshot.html.markdown | 2 +- website/docs/d/db_subnet_group.html.markdown | 2 +- .../directory_service_directory.html.markdown | 2 +- website/docs/d/docdb_engine_version.markdown | 2 +- .../d/docdb_orderable_db_instance.markdown | 2 +- website/docs/d/dx_gateway.html.markdown | 2 +- website/docs/d/dynamodb_table.html.markdown | 2 +- .../docs/d/ebs_default_kms_key.html.markdown | 2 +- .../d/ebs_encryption_by_default.html.markdown | 2 +- website/docs/d/ebs_snapshot.html.markdown | 2 +- website/docs/d/ebs_snapshot_ids.html.markdown | 2 +- website/docs/d/ebs_volume.html.markdown | 2 +- website/docs/d/ebs_volumes.html.markdown | 4 +- website/docs/d/ec2_coip_pool.html.markdown | 2 +- website/docs/d/ec2_coip_pools.html.markdown | 2 +- .../docs/d/ec2_instance_type.html.markdown | 2 +- .../ec2_instance_type_offering.html.markdown | 2 +- .../ec2_instance_type_offerings.html.markdown | 2 +- .../docs/d/ec2_local_gateway.html.markdown | 2 +- ...c2_local_gateway_route_table.html.markdown | 2 +- ...2_local_gateway_route_tables.html.markdown | 2 +- ...al_gateway_virtual_interface.html.markdown | 2 +- ...eway_virtual_interface_group.html.markdown | 2 +- ...way_virtual_interface_groups.html.markdown | 2 +- .../docs/d/ec2_local_gateways.html.markdown | 2 +- .../d/ec2_managed_prefix_list.html.markdown | 4 +- website/docs/d/ec2_spot_price.html.markdown | 2 +- .../docs/d/ec2_transit_gateway.html.markdown | 4 +- ...ateway_dx_gateway_attachment.html.markdown | 2 +- ...t_gateway_peering_attachment.html.markdown | 4 +- ..._transit_gateway_route_table.html.markdown | 4 +- ...ansit_gateway_vpc_attachment.html.markdown | 4 +- ...ansit_gateway_vpn_attachment.html.markdown | 4 +- .../d/ecr_authorization_token.html.markdown | 2 +- website/docs/d/ecr_image.html.markdown | 2 +- website/docs/d/ecr_repository.html.markdown | 2 +- website/docs/d/ecs_cluster.html.markdown | 2 +- .../d/ecs_container_definition.html.markdown | 2 +- website/docs/d/ecs_service.html.markdown | 2 +- .../docs/d/ecs_task_definition.html.markdown | 2 +- website/docs/d/efs_access_point.html.markdown | 2 +- .../docs/d/efs_access_points.html.markdown | 2 +- website/docs/d/efs_file_system.html.markdown | 2 +- website/docs/d/efs_mount_target.html.markdown | 2 +- website/docs/d/eip.html.markdown | 8 +- website/docs/d/eks_cluster.html.markdown | 2 +- website/docs/d/eks_cluster_auth.html.markdown | 2 +- ...lastic_beanstalk_application.html.markdown | 2 +- ...lastic_beanstalk_hosted_zone.html.markdown | 2 +- ...tic_beanstalk_solution_stack.html.markdown | 2 +- .../docs/d/elasticache_cluster.html.markdown | 2 +- ...lasticache_replication_group.html.markdown | 2 +- .../docs/d/elasticsearch_domain.html.markdown | 2 +- website/docs/d/elb.html.markdown | 2 +- .../docs/d/elb_hosted_zone_id.html.markdown | 2 +- .../docs/d/elb_service_account.html.markdown | 2 +- website/docs/d/glue_script.html.markdown | 4 +- .../docs/d/guardduty_detector.html.markdown | 2 +- .../docs/d/iam_account_alias.html.markdown | 2 +- website/docs/d/iam_group.html.markdown | 2 +- .../docs/d/iam_instance_profile.html.markdown | 2 +- website/docs/d/iam_policy.html.markdown | 2 +- .../docs/d/iam_policy_document.html.markdown | 14 +-- website/docs/d/iam_role.html.markdown | 2 +- .../d/iam_server_certificate.html.markdown | 2 +- website/docs/d/iam_user.html.markdown | 2 +- .../docs/d/identitystore_group.html.markdown | 2 +- .../docs/d/identitystore_user.html.markdown | 2 +- .../d/imagebuilder_component.html.markdown | 2 +- ...r_distribution_configuration.html.markdown | 2 +- .../docs/d/imagebuilder_image.html.markdown | 2 +- .../imagebuilder_image_pipeline.html.markdown | 2 +- .../d/imagebuilder_image_recipe.html.markdown | 2 +- ...infrastructure_configuration.html.markdown | 2 +- .../d/inspector_rules_packages.html.markdown | 2 +- website/docs/d/instance.html.markdown | 2 +- website/docs/d/instances.html.markdown | 2 +- website/docs/d/internet_gateway.html.markdown | 2 +- website/docs/d/iot_endpoint.html.markdown | 2 +- website/docs/d/ip_ranges.html.markdown | 2 +- website/docs/d/kinesis_stream.html.markdown | 2 +- website/docs/d/kms_alias.html.markdown | 2 +- website/docs/d/kms_ciphertext.html.markdown | 2 +- website/docs/d/kms_key.html.markdown | 2 +- website/docs/d/kms_secrets.html.markdown | 2 +- ...formation_data_lake_settings.html.markdown | 2 +- .../d/lakeformation_permissions.html.markdown | 4 +- .../d/lakeformation_resource.html.markdown | 2 +- website/docs/d/lambda_alias.html.markdown | 2 +- .../lambda_code_signing_config.html.markdown | 2 +- website/docs/d/lambda_function.html.markdown | 2 +- .../docs/d/lambda_invocation.html.markdown | 2 +- .../docs/d/lambda_layer_version.html.markdown | 2 +- .../docs/d/launch_configuration.html.markdown | 2 +- website/docs/d/launch_template.html.markdown | 4 +- website/docs/d/lb.html.markdown | 2 +- website/docs/d/lb_listener.html.markdown | 2 +- website/docs/d/lb_target_group.html.markdown | 2 +- website/docs/d/lex_bot.html.markdown | 2 +- website/docs/d/lex_bot_alias.html.markdown | 2 +- website/docs/d/lex_intent.html.markdown | 2 +- website/docs/d/lex_slot_type.html.markdown | 2 +- website/docs/d/mq_broker.html.markdown | 2 +- website/docs/d/msk_cluster.html.markdown | 2 +- .../docs/d/msk_configuration.html.markdown | 2 +- website/docs/d/nat_gateway.html.markdown | 4 +- .../docs/d/neptune_engine_version.markdown | 2 +- .../d/neptune_orderable_db_instance.markdown | 2 +- website/docs/d/network_acls.html.markdown | 6 +- .../docs/d/network_interface.html.markdown | 2 +- .../docs/d/network_interfaces.html.markdown | 6 +- .../organizations_organization.html.markdown | 4 +- ...zations_organizational_units.html.markdown | 2 +- website/docs/d/outposts_outpost.html.markdown | 2 +- ...tposts_outpost_instance_type.html.markdown | 2 +- ...posts_outpost_instance_types.html.markdown | 2 +- .../docs/d/outposts_outposts.html.markdown | 2 +- website/docs/d/outposts_site.html.markdown | 2 +- website/docs/d/outposts_sites.html.markdown | 2 +- website/docs/d/partition.html.markdown | 2 +- website/docs/d/prefix_list.html.markdown | 4 +- website/docs/d/pricing_product.html.markdown | 4 +- website/docs/d/qldb_ledger.html.markdown | 2 +- .../docs/d/ram_resource_share.html.markdown | 4 +- website/docs/d/rds_certificate.html.markdown | 2 +- website/docs/d/rds_cluster.html.markdown | 2 +- website/docs/d/rds_engine_version.markdown | 2 +- .../docs/d/rds_orderable_db_instance.markdown | 4 +- website/docs/d/redshift_cluster.html.markdown | 2 +- .../redshift_orderable_cluster.html.markdown | 2 +- .../d/redshift_service_account.html.markdown | 2 +- website/docs/d/region.html.markdown | 2 +- website/docs/d/regions.html.markdown | 6 +- website/docs/d/route.html.markdown | 2 +- .../d/route53_delegation_set.html.markdown | 2 +- .../d/route53_resolver_endpoint.html.markdown | 4 +- .../d/route53_resolver_rule.html.markdown | 2 +- .../d/route53_resolver_rules.html.markdown | 4 +- website/docs/d/route53_zone.html.markdown | 2 +- website/docs/d/route_table.html.markdown | 2 +- website/docs/d/route_tables.html.markdown | 2 +- website/docs/d/s3_bucket.html.markdown | 4 +- website/docs/d/s3_bucket_object.html.markdown | 4 +- .../docs/d/s3_bucket_objects.html.markdown | 2 +- ...sagemaker_prebuilt_ecr_image.html.markdown | 2 +- .../d/secretsmanager_secret.html.markdown | 4 +- ...cretsmanager_secret_rotation.html.markdown | 2 +- ...ecretsmanager_secret_version.html.markdown | 6 +- website/docs/d/security_group.html.markdown | 2 +- website/docs/d/security_groups.html.markdown | 4 +- ...cationrepository_application.html.markdown | 2 +- .../d/servicequotas_service.html.markdown | 2 +- .../servicequotas_service_quota.html.markdown | 2 +- website/docs/d/sfn_activity.html.markdown | 2 +- .../docs/d/sfn_state_machine.html.markdown | 2 +- .../docs/d/signer_signing_job.html.markdown | 2 +- .../d/signer_signing_profile.html.markdown | 2 +- website/docs/d/sns_topic.html.markdown | 2 +- website/docs/d/sqs_queue.html.markdown | 2 +- website/docs/d/ssm_document.html.markdown | 4 +- website/docs/d/ssm_parameter.html.markdown | 2 +- .../docs/d/ssm_patch_baseline.html.markdown | 4 +- .../docs/d/ssoadmin_instances.html.markdown | 2 +- .../d/ssoadmin_permission_set.html.markdown | 2 +- .../d/storagegateway_local_disk.html.markdown | 2 +- website/docs/d/subnet.html.markdown | 4 +- website/docs/d/subnet_ids.html.markdown | 6 +- website/docs/d/transfer_server.html.markdown | 2 +- website/docs/d/vpc.html.markdown | 2 +- website/docs/d/vpc_dhcp_options.html.markdown | 4 +- website/docs/d/vpc_endpoint.html.markdown | 2 +- .../docs/d/vpc_endpoint_service.html.markdown | 6 +- .../d/vpc_peering_connection.html.markdown | 2 +- .../d/vpc_peering_connections.html.markdown | 2 +- website/docs/d/vpcs.html.markdown | 4 +- website/docs/d/vpn_gateway.html.markdown | 2 +- website/docs/d/waf_ipset.html.markdown | 2 +- .../docs/d/waf_rate_based_rule.html.markdown | 2 +- website/docs/d/waf_rule.html.markdown | 2 +- website/docs/d/waf_web_acl.html.markdown | 2 +- .../docs/d/wafregional_ipset.html.markdown | 2 +- .../wafregional_rate_based_rule.html.markdown | 2 +- website/docs/d/wafregional_rule.html.markdown | 2 +- .../docs/d/wafregional_web_acl.html.markdown | 2 +- website/docs/d/wafv2_ip_set.html.markdown | 2 +- .../d/wafv2_regex_pattern_set.html.markdown | 2 +- website/docs/d/wafv2_rule_group.html.markdown | 2 +- website/docs/d/wafv2_web_acl.html.markdown | 2 +- .../docs/d/workspaces_bundle.html.markdown | 4 +- .../docs/d/workspaces_directory.html.markdown | 2 +- website/docs/d/workspaces_image.html.markdown | 2 +- .../docs/d/workspaces_workspace.html.markdown | 4 +- .../guides/custom-service-endpoints.html.md | 6 +- website/docs/guides/resource-tagging.html.md | 16 +-- website/docs/guides/version-2-upgrade.html.md | 76 ++++++------- website/docs/guides/version-3-upgrade.html.md | 104 +++++++++--------- website/docs/index.html.markdown | 14 +-- .../r/accessanalyzer_analyzer.html.markdown | 4 +- website/docs/r/acm_certificate.html.markdown | 6 +- .../acm_certificate_validation.html.markdown | 6 +- ...acmpca_certificate_authority.html.markdown | 4 +- website/docs/r/ami.html.markdown | 2 +- website/docs/r/ami_copy.html.markdown | 2 +- .../docs/r/ami_from_instance.html.markdown | 2 +- .../r/ami_launch_permission.html.markdown | 2 +- .../docs/r/api_gateway_account.html.markdown | 2 +- .../docs/r/api_gateway_api_key.html.markdown | 2 +- .../r/api_gateway_authorizer.html.markdown | 2 +- ...pi_gateway_base_path_mapping.html.markdown | 2 +- ...i_gateway_client_certificate.html.markdown | 2 +- .../r/api_gateway_deployment.html.markdown | 4 +- ...i_gateway_documentation_part.html.markdown | 2 +- ...ateway_documentation_version.html.markdown | 2 +- .../r/api_gateway_domain_name.html.markdown | 8 +- .../r/api_gateway_gateway_response.markdown | 2 +- .../r/api_gateway_integration.html.markdown | 6 +- ...gateway_integration_response.html.markdown | 2 +- .../docs/r/api_gateway_method.html.markdown | 4 +- .../api_gateway_method_response.html.markdown | 2 +- .../api_gateway_method_settings.html.markdown | 2 +- .../docs/r/api_gateway_model.html.markdown | 2 +- ...pi_gateway_request_validator.html.markdown | 2 +- .../docs/r/api_gateway_resource.html.markdown | 2 +- .../docs/r/api_gateway_rest_api.html.markdown | 4 +- .../api_gateway_rest_api_policy.html.markdown | 2 +- .../docs/r/api_gateway_stage.html.markdown | 4 +- .../r/api_gateway_usage_plan.html.markdown | 2 +- .../api_gateway_usage_plan_key.html.markdown | 2 +- .../docs/r/api_gateway_vpc_link.html.markdown | 2 +- website/docs/r/apigatewayv2_api.html.markdown | 4 +- .../r/apigatewayv2_api_mapping.html.markdown | 2 +- .../r/apigatewayv2_authorizer.html.markdown | 4 +- .../r/apigatewayv2_deployment.html.markdown | 4 +- .../r/apigatewayv2_domain_name.html.markdown | 4 +- .../r/apigatewayv2_integration.html.markdown | 8 +- ...tewayv2_integration_response.html.markdown | 2 +- .../docs/r/apigatewayv2_model.html.markdown | 2 +- .../docs/r/apigatewayv2_route.html.markdown | 4 +- .../apigatewayv2_route_response.html.markdown | 2 +- .../docs/r/apigatewayv2_stage.html.markdown | 2 +- .../r/apigatewayv2_vpc_link.html.markdown | 2 +- ...app_cookie_stickiness_policy.html.markdown | 2 +- .../r/appautoscaling_policy.html.markdown | 12 +- ...autoscaling_scheduled_action.html.markdown | 4 +- .../r/appautoscaling_target.html.markdown | 8 +- .../r/appmesh_gateway_route.html.markdown | 2 +- website/docs/r/appmesh_mesh.html.markdown | 4 +- website/docs/r/appmesh_route.html.markdown | 8 +- .../r/appmesh_virtual_gateway.html.markdown | 4 +- .../docs/r/appmesh_virtual_node.html.markdown | 8 +- .../r/appmesh_virtual_router.html.markdown | 2 +- .../r/appmesh_virtual_service.html.markdown | 4 +- website/docs/r/appsync_api_key.html.markdown | 2 +- .../docs/r/appsync_datasource.html.markdown | 2 +- website/docs/r/appsync_function.html.markdown | 2 +- .../docs/r/appsync_graphql_api.html.markdown | 14 +-- website/docs/r/appsync_resolver.html.markdown | 2 +- website/docs/r/athena_database.html.markdown | 2 +- .../docs/r/athena_named_query.html.markdown | 2 +- website/docs/r/athena_workgroup.html.markdown | 2 +- .../r/autoscaling_attachment.html.markdown | 6 +- .../docs/r/autoscaling_group.html.markdown | 14 +-- .../autoscaling_lifecycle_hook.html.markdown | 2 +- .../r/autoscaling_notification.html.markdown | 2 +- .../docs/r/autoscaling_policy.html.markdown | 6 +- .../docs/r/autoscaling_schedule.html.markdown | 2 +- ...utoscalingplans_scaling_plan.html.markdown | 4 +- .../r/backup_global_settings.html.markdown | 2 +- website/docs/r/backup_plan.html.markdown | 2 +- .../r/backup_region_settings.html.markdown | 2 +- website/docs/r/backup_selection.html.markdown | 6 +- website/docs/r/backup_vault.html.markdown | 2 +- .../backup_vault_notifications.html.markdown | 2 +- .../docs/r/backup_vault_policy.html.markdown | 2 +- .../r/batch_compute_environment.html.markdown | 2 +- .../docs/r/batch_job_definition.html.markdown | 2 +- website/docs/r/batch_job_queue.html.markdown | 2 +- website/docs/r/budgets_budget.html.markdown | 10 +- .../r/cloud9_environment_ec2.html.markdown | 2 +- .../docs/r/cloudformation_stack.html.markdown | 2 +- .../r/cloudformation_stack_set.html.markdown | 2 +- ...formation_stack_set_instance.html.markdown | 4 +- .../r/cloudfront_cache_policy.html.markdown | 2 +- .../r/cloudfront_distribution.html.markdown | 6 +- ...front_origin_access_identity.html.markdown | 6 +- ...dfront_origin_request_policy.html.markdown | 2 +- .../r/cloudfront_public_key.html.markdown | 2 +- ...oudfront_realtime_log_config.html.markdown | 2 +- .../docs/r/cloudhsm_v2_cluster.html.markdown | 2 +- website/docs/r/cloudhsm_v2_hsm.html.markdown | 2 +- website/docs/r/cloudtrail.html.markdown | 10 +- .../cloudwatch_composite_alarm.html.markdown | 2 +- .../docs/r/cloudwatch_dashboard.html.markdown | 2 +- .../r/cloudwatch_event_archive.html.markdown | 4 +- .../docs/r/cloudwatch_event_bus.html.markdown | 2 +- .../cloudwatch_event_permission.html.markdown | 4 +- .../r/cloudwatch_event_rule.html.markdown | 2 +- .../r/cloudwatch_event_target.html.markdown | 8 +- .../cloudwatch_log_destination.html.markdown | 2 +- ...watch_log_destination_policy.html.markdown | 2 +- .../docs/r/cloudwatch_log_group.html.markdown | 2 +- ...cloudwatch_log_metric_filter.html.markdown | 2 +- ...oudwatch_log_resource_policy.html.markdown | 4 +- .../r/cloudwatch_log_stream.html.markdown | 2 +- ...atch_log_subscription_filter.html.markdown | 2 +- .../r/cloudwatch_metric_alarm.html.markdown | 10 +- .../docs/r/codeartifact_domain.html.markdown | 2 +- ...ct_domain_permissions_policy.html.markdown | 2 +- .../r/codeartifact_repository.html.markdown | 6 +- ...epository_permissions_policy.html.markdown | 2 +- .../docs/r/codebuild_project.html.markdown | 2 +- .../r/codebuild_report_group.html.markdown | 2 +- .../codebuild_source_credential.html.markdown | 4 +- .../docs/r/codebuild_webhook.html.markdown | 4 +- .../r/codecommit_repository.html.markdown | 2 +- .../docs/r/codecommit_trigger.html.markdown | 2 +- website/docs/r/codedeploy_app.html.markdown | 6 +- ...codedeploy_deployment_config.html.markdown | 4 +- .../codedeploy_deployment_group.html.markdown | 6 +- website/docs/r/codepipeline.markdown | 2 +- website/docs/r/codepipeline_webhook.markdown | 2 +- .../r/codestarconnections_connection.markdown | 2 +- ...arnotifications_notification_rule.markdown | 2 +- website/docs/r/cognito_identity_pool.markdown | 2 +- ...to_identity_pool_roles_attachment.markdown | 2 +- .../r/cognito_identity_provider.html.markdown | 2 +- .../docs/r/cognito_resource_server.markdown | 4 +- .../docs/r/cognito_user_group.html.markdown | 2 +- website/docs/r/cognito_user_pool.markdown | 8 +- .../docs/r/cognito_user_pool_client.markdown | 6 +- .../docs/r/cognito_user_pool_domain.markdown | 4 +- ...o_user_pool_ui_customization.html.markdown | 4 +- .../r/config_aggregate_authorization.markdown | 2 +- .../docs/r/config_config_rule.html.markdown | 4 +- ...fig_configuration_aggregator.html.markdown | 4 +- ...onfig_configuration_recorder.html.markdown | 2 +- ...onfiguration_recorder_status.html.markdown | 2 +- .../r/config_conformance_pack.html.markdown | 4 +- .../r/config_delivery_channel.html.markdown | 2 +- ...fig_organization_custom_rule.html.markdown | 2 +- ...ig_organization_managed_rule.html.markdown | 2 +- ...ig_remediation_configuration.html.markdown | 2 +- .../r/cur_report_definition.html.markdown | 2 +- website/docs/r/customer_gateway.html.markdown | 2 +- .../r/datapipeline_pipeline.html.markdown | 2 +- website/docs/r/datasync_agent.html.markdown | 2 +- .../r/datasync_location_efs.html.markdown | 2 +- ...tion_fsx_windows_file_system.html.markdown | 2 +- .../r/datasync_location_nfs.html.markdown | 2 +- .../docs/r/datasync_location_s3.html.markdown | 2 +- .../r/datasync_location_smb.html.markdown | 2 +- website/docs/r/datasync_task.html.markdown | 2 +- website/docs/r/dax_cluster.html.markdown | 2 +- .../docs/r/dax_parameter_group.html.markdown | 2 +- website/docs/r/dax_subnet_group.html.markdown | 2 +- .../docs/r/db_cluster_snapshot.html.markdown | 2 +- .../r/db_event_subscription.html.markdown | 2 +- website/docs/r/db_instance.html.markdown | 6 +- ...db_instance_role_association.html.markdown | 2 +- website/docs/r/db_option_group.html.markdown | 2 +- .../docs/r/db_parameter_group.html.markdown | 2 +- website/docs/r/db_proxy.html.markdown | 2 +- ...b_proxy_default_target_group.html.markdown | 2 +- website/docs/r/db_proxy_target.html.markdown | 2 +- .../docs/r/db_security_group.html.markdown | 2 +- website/docs/r/db_snapshot.html.markdown | 2 +- website/docs/r/db_subnet_group.html.markdown | 2 +- .../docs/r/default_network_acl.html.markdown | 8 +- .../docs/r/default_route_table.html.markdown | 2 +- .../r/default_security_group.html.markdown | 4 +- website/docs/r/default_subnet.html.markdown | 2 +- website/docs/r/default_vpc.html.markdown | 2 +- .../r/default_vpc_dhcp_options.html.markdown | 2 +- .../docs/r/devicefarm_project.html.markdown | 2 +- ...ervice_conditional_forwarder.html.markdown | 2 +- .../directory_service_directory.html.markdown | 6 +- ...ory_service_log_subscription.html.markdown | 2 +- website/docs/r/dlm_lifecycle_policy.markdown | 2 +- website/docs/r/dms_certificate.html.markdown | 2 +- website/docs/r/dms_endpoint.html.markdown | 2 +- .../r/dms_event_subscription.html.markdown | 2 +- .../r/dms_replication_instance.html.markdown | 2 +- ...dms_replication_subnet_group.html.markdown | 2 +- .../docs/r/dms_replication_task.html.markdown | 2 +- website/docs/r/docdb_cluster.html.markdown | 2 +- .../r/docdb_cluster_instance.html.markdown | 2 +- ...ocdb_cluster_parameter_group.html.markdown | 2 +- .../r/docdb_cluster_snapshot.html.markdown | 2 +- .../docs/r/docdb_subnet_group.html.markdown | 2 +- website/docs/r/dx_bgp_peer.html.markdown | 2 +- website/docs/r/dx_connection.html.markdown | 2 +- .../r/dx_connection_association.html.markdown | 2 +- website/docs/r/dx_gateway.html.markdown | 2 +- .../r/dx_gateway_association.html.markdown | 6 +- ...gateway_association_proposal.html.markdown | 2 +- ...ed_private_virtual_interface.html.markdown | 2 +- ...e_virtual_interface_accepter.html.markdown | 2 +- ...ted_public_virtual_interface.html.markdown | 2 +- ...c_virtual_interface_accepter.html.markdown | 2 +- ...ed_transit_virtual_interface.html.markdown | 2 +- ...t_virtual_interface_accepter.html.markdown | 2 +- website/docs/r/dx_lag.html.markdown | 2 +- ...dx_private_virtual_interface.html.markdown | 2 +- .../dx_public_virtual_interface.html.markdown | 2 +- ...dx_transit_virtual_interface.html.markdown | 2 +- .../r/dynamodb_global_table.html.markdown | 2 +- website/docs/r/dynamodb_table.html.markdown | 4 +- .../docs/r/dynamodb_table_item.html.markdown | 2 +- .../docs/r/ebs_default_kms_key.html.markdown | 2 +- .../r/ebs_encryption_by_default.html.markdown | 2 +- website/docs/r/ebs_snapshot.html.markdown | 2 +- .../docs/r/ebs_snapshot_copy.html.markdown | 2 +- website/docs/r/ebs_volume.html.markdown | 2 +- .../ec2_availability_zone_group.html.markdown | 2 +- .../r/ec2_capacity_reservation.html.markdown | 2 +- .../docs/r/ec2_carrier_gateway.html.markdown | 2 +- ...lient_vpn_authorization_rule.html.markdown | 2 +- .../r/ec2_client_vpn_endpoint.html.markdown | 2 +- ...ient_vpn_network_association.html.markdown | 4 +- .../docs/r/ec2_client_vpn_route.html.markdown | 2 +- website/docs/r/ec2_fleet.html.markdown | 4 +- .../r/ec2_local_gateway_route.html.markdown | 2 +- ..._route_table_vpc_association.html.markdown | 2 +- .../r/ec2_managed_prefix_list.html.markdown | 2 +- website/docs/r/ec2_tag.html.markdown | 2 +- .../r/ec2_traffic_mirror_filter.html.markdown | 2 +- ...2_traffic_mirror_filter_rule.html.markdown | 2 +- .../ec2_traffic_mirror_session.html.markdown | 2 +- .../r/ec2_traffic_mirror_target.html.markdown | 2 +- .../docs/r/ec2_transit_gateway.html.markdown | 2 +- ...t_gateway_peering_attachment.html.markdown | 2 +- ...teway_peering_attachment_accepter.markdown | 2 +- ...ateway_prefix_list_reference.html.markdown | 4 +- .../r/ec2_transit_gateway_route.html.markdown | 4 +- ..._transit_gateway_route_table.html.markdown | 2 +- ...eway_route_table_association.html.markdown | 2 +- ...eway_route_table_propagation.html.markdown | 2 +- ...ansit_gateway_vpc_attachment.html.markdown | 2 +- ...eway_vpc_attachment_accepter.html.markdown | 2 +- .../docs/r/ecr_lifecycle_policy.html.markdown | 4 +- website/docs/r/ecr_repository.html.markdown | 2 +- .../r/ecr_repository_policy.html.markdown | 2 +- .../docs/r/ecrpublic_repository.html.markdown | 2 +- .../r/ecs_capacity_provider.html.markdown | 2 +- website/docs/r/ecs_cluster.html.markdown | 2 +- website/docs/r/ecs_service.html.markdown | 8 +- .../docs/r/ecs_task_definition.html.markdown | 8 +- website/docs/r/efs_access_point.html.markdown | 2 +- website/docs/r/efs_file_system.html.markdown | 4 +- .../r/efs_file_system_policy.html.markdown | 2 +- website/docs/r/efs_mount_target.html.markdown | 2 +- ...egress_only_internet_gateway.html.markdown | 2 +- website/docs/r/eip.html.markdown | 8 +- website/docs/r/eip_association.html.markdown | 2 +- website/docs/r/eks_cluster.html.markdown | 8 +- .../docs/r/eks_fargate_profile.html.markdown | 4 +- website/docs/r/eks_node_group.html.markdown | 8 +- ...lastic_beanstalk_application.html.markdown | 2 +- ...eanstalk_application_version.html.markdown | 2 +- ...stalk_configuration_template.html.markdown | 2 +- ...lastic_beanstalk_environment.html.markdown | 4 +- .../docs/r/elasticache_cluster.html.markdown | 6 +- ...che_global_replication_group.html.markdown | 2 +- .../elasticache_parameter_group.html.markdown | 2 +- ...lasticache_replication_group.html.markdown | 6 +- .../elasticache_security_group.html.markdown | 2 +- .../r/elasticache_subnet_group.html.markdown | 2 +- .../docs/r/elasticsearch_domain.html.markdown | 8 +- .../elasticsearch_domain_policy.html.markdown | 2 +- .../elastictranscoder_pipeline.html.markdown | 2 +- .../r/elastictranscoder_preset.html.markdown | 2 +- website/docs/r/elb.html.markdown | 2 +- website/docs/r/elb_attachment.html.markdown | 2 +- website/docs/r/emr_cluster.html.markdown | 14 +-- .../docs/r/emr_instance_fleet.html.markdown | 2 +- .../docs/r/emr_instance_group.html.markdown | 4 +- .../emr_managed_scaling_policy.html.markdown | 2 +- .../emr_security_configuration.html.markdown | 2 +- website/docs/r/flow_log.html.markdown | 4 +- .../docs/r/fms_admin_account.html.markdown | 2 +- website/docs/r/fms_policy.html.markdown | 2 +- .../r/fsx_lustre_file_system.html.markdown | 4 +- .../r/fsx_windows_file_system.html.markdown | 6 +- website/docs/r/gamelift_alias.html.markdown | 2 +- website/docs/r/gamelift_build.html.markdown | 2 +- website/docs/r/gamelift_fleet.html.markdown | 2 +- .../gamelift_game_session_queue.html.markdown | 2 +- website/docs/r/glacier_vault.html.markdown | 2 +- .../docs/r/glacier_vault_lock.html.markdown | 4 +- .../r/globalaccelerator_accelerator.markdown | 2 +- ...alaccelerator_endpoint_group.html.markdown | 2 +- .../r/globalaccelerator_listener.markdown | 2 +- .../r/glue_catalog_database.html.markdown | 2 +- .../docs/r/glue_catalog_table.html.markdown | 4 +- website/docs/r/glue_classifier.html.markdown | 8 +- website/docs/r/glue_connection.html.markdown | 4 +- website/docs/r/glue_crawler.html.markdown | 12 +- ..._catalog_encryption_settings.html.markdown | 2 +- website/docs/r/glue_dev_endpoint.markdown | 2 +- website/docs/r/glue_job.html.markdown | 6 +- .../docs/r/glue_ml_transform.html.markdown | 2 +- website/docs/r/glue_partition.html.markdown | 2 +- website/docs/r/glue_registry.html.markdown | 2 +- .../docs/r/glue_resource_policy.html.markdown | 2 +- website/docs/r/glue_schema.html.markdown | 2 +- .../glue_security_configuration.html.markdown | 2 +- website/docs/r/glue_trigger.html.markdown | 10 +- .../glue_user_defined_function.html.markdown | 2 +- website/docs/r/glue_workflow.html.markdown | 2 +- .../docs/r/guardduty_detector.html.markdown | 2 +- website/docs/r/guardduty_filter.html.markdown | 2 +- .../r/guardduty_invite_accepter.html.markdown | 2 +- website/docs/r/guardduty_ipset.html.markdown | 2 +- website/docs/r/guardduty_member.html.markdown | 2 +- ...y_organization_admin_account.html.markdown | 2 +- ...y_organization_configuration.html.markdown | 2 +- ...dduty_publishing_destination.html.markdown | 2 +- .../r/guardduty_threatintelset.html.markdown | 2 +- website/docs/r/iam_access_key.html.markdown | 4 +- .../docs/r/iam_account_alias.html.markdown | 2 +- .../iam_account_password_policy.html.markdown | 2 +- website/docs/r/iam_group.html.markdown | 2 +- .../docs/r/iam_group_membership.html.markdown | 2 +- website/docs/r/iam_group_policy.html.markdown | 2 +- .../r/iam_group_policy_attachment.markdown | 2 +- .../docs/r/iam_instance_profile.html.markdown | 2 +- .../iam_openid_connect_provider.html.markdown | 2 +- website/docs/r/iam_policy.html.markdown | 2 +- .../r/iam_policy_attachment.html.markdown | 2 +- website/docs/r/iam_role.html.markdown | 12 +- website/docs/r/iam_role_policy.html.markdown | 2 +- .../r/iam_role_policy_attachment.markdown | 2 +- .../docs/r/iam_saml_provider.html.markdown | 2 +- .../r/iam_server_certificate.html.markdown | 6 +- .../r/iam_service_linked_role.html.markdown | 2 +- website/docs/r/iam_user.html.markdown | 2 +- .../r/iam_user_group_membership.html.markdown | 2 +- .../r/iam_user_login_profile.html.markdown | 4 +- website/docs/r/iam_user_policy.html.markdown | 2 +- .../r/iam_user_policy_attachment.markdown | 2 +- website/docs/r/iam_user_ssh_key.html.markdown | 2 +- .../r/imagebuilder_component.html.markdown | 4 +- ...r_distribution_configuration.html.markdown | 2 +- .../docs/r/imagebuilder_image.html.markdown | 2 +- .../imagebuilder_image_pipeline.html.markdown | 2 +- .../r/imagebuilder_image_recipe.html.markdown | 2 +- ...infrastructure_configuration.html.markdown | 2 +- .../inspector_assessment_target.html.markdown | 2 +- ...nspector_assessment_template.html.markdown | 2 +- .../r/inspector_resource_group.html.markdown | 2 +- website/docs/r/instance.html.markdown | 4 +- website/docs/r/internet_gateway.html.markdown | 4 +- website/docs/r/iot_certificate.html.markdown | 4 +- website/docs/r/iot_policy.html.markdown | 2 +- .../r/iot_policy_attachment.html.markdown | 2 +- website/docs/r/iot_role_alias.html.markdown | 2 +- website/docs/r/iot_thing.html.markdown | 2 +- ...t_thing_principal_attachment.html.markdown | 2 +- website/docs/r/iot_thing_type.html.markdown | 2 +- website/docs/r/iot_topic_rule.html.markdown | 2 +- website/docs/r/key_pair.html.markdown | 2 +- ...inesis_analytics_application.html.markdown | 4 +- ...sis_firehose_delivery_stream.html.markdown | 16 +-- website/docs/r/kinesis_stream.html.markdown | 2 +- .../docs/r/kinesis_video_stream.html.markdown | 2 +- ...nesisanalyticsv2_application.html.markdown | 6 +- website/docs/r/kms_alias.html.markdown | 2 +- website/docs/r/kms_ciphertext.html.markdown | 2 +- website/docs/r/kms_external_key.html.markdown | 2 +- website/docs/r/kms_grant.html.markdown | 2 +- website/docs/r/kms_key.html.markdown | 2 +- ...formation_data_lake_settings.html.markdown | 4 +- .../r/lakeformation_permissions.html.markdown | 4 +- .../r/lakeformation_resource.html.markdown | 2 +- website/docs/r/lambda_alias.html.markdown | 2 +- .../lambda_code_signing_config.html.markdown | 2 +- .../lambda_event_source_mapping.html.markdown | 8 +- website/docs/r/lambda_function.html.markdown | 8 +- ...function_event_invoke_config.html.markdown | 10 +- .../docs/r/lambda_layer_version.html.markdown | 2 +- .../docs/r/lambda_permission.html.markdown | 8 +- ...ovisioned_concurrency_config.html.markdown | 4 +- .../docs/r/launch_configuration.html.markdown | 6 +- website/docs/r/launch_template.html.markdown | 2 +- website/docs/r/lb.html.markdown | 8 +- .../lb_cookie_stickiness_policy.html.markdown | 2 +- website/docs/r/lb_listener.html.markdown | 12 +- .../r/lb_listener_certificate.html.markdown | 2 +- website/docs/r/lb_listener_rule.html.markdown | 2 +- .../r/lb_ssl_negotiation_policy.html.markdown | 2 +- website/docs/r/lb_target_group.html.markdown | 6 +- .../lb_target_group_attachment.html.markdown | 4 +- website/docs/r/lex_bot.html.markdown | 2 +- website/docs/r/lex_bot_alias.html.markdown | 2 +- website/docs/r/lex_intent.html.markdown | 2 +- website/docs/r/lex_slot_type.html.markdown | 2 +- .../r/licensemanager_association.markdown | 2 +- ...ensemanager_license_configuration.markdown | 2 +- website/docs/r/lightsail_domain.html.markdown | 2 +- .../docs/r/lightsail_instance.html.markdown | 2 +- .../docs/r/lightsail_key_pair.html.markdown | 6 +- .../docs/r/lightsail_static_ip.html.markdown | 2 +- ...ghtsail_static_ip_attachment.html.markdown | 2 +- ...lancer_backend_server_policy.html.markdown | 2 +- ...oad_balancer_listener_policy.html.markdown | 4 +- .../docs/r/load_balancer_policy.html.markdown | 2 +- ...e_member_account_association.html.markdown | 2 +- .../macie_s3_bucket_association.html.markdown | 2 +- ...main_route_table_association.html.markdown | 2 +- .../docs/r/media_convert_queue.html.markdown | 2 +- .../r/media_package_channel.html.markdown | 2 +- .../r/media_store_container.html.markdown | 2 +- ...media_store_container_policy.html.markdown | 2 +- website/docs/r/mq_broker.html.markdown | 4 +- website/docs/r/mq_configuration.html.markdown | 2 +- website/docs/r/msk_cluster.html.markdown | 2 +- .../docs/r/msk_configuration.html.markdown | 2 +- ...msk_scram_secret_association.html.markdown | 2 +- website/docs/r/nat_gateway.html.markdown | 6 +- website/docs/r/neptune_cluster.html.markdown | 2 +- .../r/neptune_cluster_instance.html.markdown | 2 +- ...tune_cluster_parameter_group.html.markdown | 2 +- .../r/neptune_cluster_snapshot.html.markdown | 2 +- .../neptune_event_subscription.html.markdown | 2 +- .../r/neptune_parameter_group.html.markdown | 2 +- .../docs/r/neptune_subnet_group.html.markdown | 2 +- website/docs/r/network_acl.html.markdown | 2 +- website/docs/r/network_acl_rule.html.markdown | 2 +- website/docs/r/network_interface.markdown | 2 +- ...network_interface_attachment.html.markdown | 2 +- ...work_interface_sg_attachment.html.markdown | 4 +- .../r/networkfirewall_firewall.html.markdown | 2 +- ...workfirewall_firewall_policy.html.markdown | 4 +- ...rewall_logging_configuration.html.markdown | 6 +- ...workfirewall_resource_policy.html.markdown | 4 +- .../networkfirewall_rule_group.html.markdown | 10 +- .../docs/r/opsworks_application.html.markdown | 2 +- .../r/opsworks_custom_layer.html.markdown | 2 +- .../r/opsworks_ganglia_layer.html.markdown | 2 +- .../r/opsworks_haproxy_layer.html.markdown | 2 +- .../docs/r/opsworks_instance.html.markdown | 2 +- .../r/opsworks_java_app_layer.html.markdown | 2 +- .../r/opsworks_memcached_layer.html.markdown | 2 +- .../docs/r/opsworks_mysql_layer.html.markdown | 2 +- .../r/opsworks_nodejs_app_layer.html.markdown | 2 +- .../docs/r/opsworks_permission.html.markdown | 2 +- .../r/opsworks_php_app_layer.html.markdown | 2 +- .../r/opsworks_rails_app_layer.html.markdown | 2 +- .../r/opsworks_rds_db_instance.html.markdown | 2 +- website/docs/r/opsworks_stack.html.markdown | 2 +- .../r/opsworks_static_web_layer.html.markdown | 2 +- .../r/opsworks_user_profile.html.markdown | 2 +- .../r/organizations_account.html.markdown | 4 +- .../organizations_organization.html.markdown | 2 +- ...izations_organizational_unit.html.markdown | 2 +- .../docs/r/organizations_policy.html.markdown | 2 +- ...anizations_policy_attachment.html.markdown | 6 +- website/docs/r/pinpoint_adm_channel.markdown | 2 +- website/docs/r/pinpoint_apns_channel.markdown | 2 +- .../r/pinpoint_apns_sandbox_channel.markdown | 2 +- .../r/pinpoint_apns_voip_channel.markdown | 2 +- ...inpoint_apns_voip_sandbox_channel.markdown | 2 +- website/docs/r/pinpoint_app.markdown | 2 +- .../docs/r/pinpoint_baidu_channel.markdown | 2 +- .../docs/r/pinpoint_email_channel.markdown | 2 +- website/docs/r/pinpoint_event_stream.markdown | 2 +- website/docs/r/pinpoint_gcm_channel.markdown | 2 +- website/docs/r/pinpoint_sms_channel.markdown | 2 +- website/docs/r/placement_group.html.markdown | 2 +- .../docs/r/prometheus_workspace.html.markdown | 2 +- .../r/proxy_protocol_policy.html.markdown | 2 +- website/docs/r/qldb_ledger.html.markdown | 2 +- website/docs/r/quicksight_group.html.markdown | 2 +- website/docs/r/quicksight_user.html.markdown | 2 +- .../docs/r/ram_principal_association.markdown | 4 +- .../r/ram_resource_association.html.markdown | 2 +- website/docs/r/ram_resource_share.markdown | 2 +- .../r/ram_resource_share_accepter.markdown | 2 +- website/docs/r/rds_cluster.html.markdown | 14 +-- .../docs/r/rds_cluster_endpoint.html.markdown | 2 +- .../docs/r/rds_cluster_instance.html.markdown | 2 +- .../r/rds_cluster_parameter_group.markdown | 2 +- .../docs/r/rds_global_cluster.html.markdown | 6 +- website/docs/r/redshift_cluster.html.markdown | 2 +- .../redshift_event_subscription.html.markdown | 2 +- .../r/redshift_parameter_group.html.markdown | 2 +- .../r/redshift_security_group.html.markdown | 2 +- ...redshift_snapshot_copy_grant.html.markdown | 2 +- .../redshift_snapshot_schedule.html.markdown | 2 +- ...napshot_schedule_association.html.markdown | 2 +- .../r/redshift_subnet_group.html.markdown | 2 +- .../docs/r/resourcegroups_group.html.markdown | 2 +- website/docs/r/route.html.markdown | 4 +- .../r/route53_delegation_set.html.markdown | 2 +- .../docs/r/route53_health_check.html.markdown | 8 +- .../route53_hosted_zone_dnssec.html.markdown | 2 +- .../r/route53_key_signing_key.html.markdown | 2 +- .../docs/r/route53_query_log.html.markdown | 2 +- website/docs/r/route53_record.html.markdown | 8 +- ...ute53_resolver_dnssec_config.html.markdown | 2 +- .../r/route53_resolver_endpoint.html.markdown | 2 +- ...53_resolver_query_log_config.html.markdown | 2 +- ...query_log_config_association.html.markdown | 2 +- .../r/route53_resolver_rule.html.markdown | 4 +- ...53_resolver_rule_association.html.markdown | 2 +- ...pc_association_authorization.html.markdown | 2 +- website/docs/r/route53_zone.html.markdown | 6 +- .../r/route53_zone_association.html.markdown | 2 +- website/docs/r/route_table.html.markdown | 2 +- .../r/route_table_association.html.markdown | 4 +- website/docs/r/s3_access_point.html.markdown | 4 +- ..._account_public_access_block.html.markdown | 2 +- website/docs/r/s3_bucket.html.markdown | 18 +-- ...cket_analytics_configuration.html.markdown | 4 +- .../docs/r/s3_bucket_inventory.html.markdown | 4 +- website/docs/r/s3_bucket_metric.html.markdown | 4 +- .../r/s3_bucket_notification.html.markdown | 10 +- website/docs/r/s3_bucket_object.html.markdown | 10 +- ...s3_bucket_ownership_controls.html.markdown | 2 +- website/docs/r/s3_bucket_policy.html.markdown | 2 +- ...3_bucket_public_access_block.html.markdown | 2 +- website/docs/r/s3_object_copy.html.markdown | 2 +- website/docs/r/s3control_bucket.html.markdown | 2 +- ...cket_lifecycle_configuration.html.markdown | 2 +- .../r/s3control_bucket_policy.html.markdown | 2 +- .../docs/r/s3outposts_endpoint.html.markdown | 2 +- website/docs/r/sagemaker_app.html.markdown | 2 +- .../sagemaker_app_image_config.html.markdown | 4 +- .../r/sagemaker_code_repository.html.markdown | 4 +- website/docs/r/sagemaker_domain.html.markdown | 4 +- .../docs/r/sagemaker_endpoint.html.markdown | 2 +- ...maker_endpoint_configuration.html.markdown | 2 +- .../r/sagemaker_feature_group.html.markdown | 2 +- website/docs/r/sagemaker_image.html.markdown | 2 +- .../r/sagemaker_image_version.html.markdown | 2 +- website/docs/r/sagemaker_model.html.markdown | 2 +- ...agemaker_model_package_group.html.markdown | 2 +- .../sagemaker_notebook_instance.html.markdown | 4 +- ...ance_lifecycle_configuration.html.markdown | 2 +- .../r/sagemaker_user_profile.html.markdown | 2 +- .../r/secretsmanager_secret.html.markdown | 4 +- ...secretsmanager_secret_policy.html.markdown | 2 +- ...cretsmanager_secret_rotation.html.markdown | 2 +- ...ecretsmanager_secret_version.html.markdown | 6 +- website/docs/r/security_group.html.markdown | 6 +- .../docs/r/security_group_rule.html.markdown | 4 +- website/docs/r/securityhub_account.markdown | 2 +- .../r/securityhub_action_target.html.markdown | 2 +- .../r/securityhub_invite_accepter.markdown | 2 +- website/docs/r/securityhub_member.markdown | 2 +- ...b_organization_admin_account.html.markdown | 2 +- .../securityhub_product_subscription.markdown | 2 +- ...ecurityhub_standards_subscription.markdown | 2 +- ...ository_cloudformation_stack.html.markdown | 2 +- ...ice_discovery_http_namespace.html.markdown | 2 +- ...covery_private_dns_namespace.html.markdown | 2 +- ...scovery_public_dns_namespace.html.markdown | 2 +- .../r/service_discovery_service.html.markdown | 4 +- .../r/servicecatalog_portfolio.html.markdown | 2 +- .../servicequotas_service_quota.html.markdown | 2 +- .../ses_active_receipt_rule_set.html.markdown | 2 +- .../r/ses_configuration_set.html.markdown | 4 +- website/docs/r/ses_domain_dkim.html.markdown | 2 +- .../docs/r/ses_domain_identity.html.markdown | 2 +- ...domain_identity_verification.html.markdown | 2 +- .../docs/r/ses_domain_mail_from.html.markdown | 2 +- .../docs/r/ses_email_identity.html.markdown | 2 +- .../r/ses_event_destination.html.markdown | 6 +- .../ses_identity_notification_topic.markdown | 2 +- .../docs/r/ses_identity_policy.html.markdown | 2 +- .../docs/r/ses_receipt_filter.html.markdown | 2 +- website/docs/r/ses_receipt_rule.html.markdown | 2 +- .../docs/r/ses_receipt_rule_set.html.markdown | 2 +- website/docs/r/ses_template.html.markdown | 2 +- website/docs/r/sfn_activity.html.markdown | 2 +- .../docs/r/sfn_state_machine.html.markdown | 6 +- .../docs/r/shield_protection.html.markdown | 2 +- .../docs/r/signer_signing_job.html.markdown | 2 +- .../r/signer_signing_profile.html.markdown | 2 +- ...r_signing_profile_permission.html.markdown | 2 +- website/docs/r/simpledb_domain.html.markdown | 2 +- ...hot_create_volume_permission.html.markdown | 2 +- .../r/sns_platform_application.html.markdown | 4 +- .../docs/r/sns_sms_preferences.html.markdown | 2 +- website/docs/r/sns_topic.html.markdown | 4 +- website/docs/r/sns_topic_policy.html.markdown | 2 +- .../r/sns_topic_subscription.html.markdown | 6 +- .../spot_datafeed_subscription.html.markdown | 2 +- .../docs/r/spot_fleet_request.html.markdown | 8 +- .../r/spot_instance_request.html.markdown | 2 +- website/docs/r/sqs_queue.html.markdown | 6 +- website/docs/r/sqs_queue_policy.html.markdown | 2 +- website/docs/r/ssm_activation.html.markdown | 2 +- website/docs/r/ssm_association.html.markdown | 2 +- website/docs/r/ssm_document.html.markdown | 4 +- .../r/ssm_maintenance_window.html.markdown | 2 +- ...sm_maintenance_window_target.html.markdown | 4 +- .../ssm_maintenance_window_task.html.markdown | 8 +- website/docs/r/ssm_parameter.html.markdown | 4 +- .../docs/r/ssm_patch_baseline.html.markdown | 8 +- website/docs/r/ssm_patch_group.html.markdown | 2 +- .../r/ssm_resource_data_sync.html.markdown | 2 +- .../ssoadmin_account_assignment.html.markdown | 2 +- ...in_managed_policy_attachment.html.markdown | 2 +- .../r/ssoadmin_permission_set.html.markdown | 2 +- ...permission_set_inline_policy.html.markdown | 2 +- .../docs/r/storagegateway_cache.html.markdown | 2 +- ...egateway_cached_iscsi_volume.html.markdown | 6 +- .../r/storagegateway_gateway.html.markdown | 10 +- ...toragegateway_nfs_file_share.html.markdown | 2 +- ...toragegateway_smb_file_share.html.markdown | 4 +- ...egateway_stored_iscsi_volume.html.markdown | 4 +- .../r/storagegateway_tape_pool.html.markdown | 2 +- ...storagegateway_upload_buffer.html.markdown | 2 +- ...oragegateway_working_storage.html.markdown | 2 +- website/docs/r/subnet.html.markdown | 4 +- website/docs/r/swf_domain.html.markdown | 2 +- .../docs/r/synthetics_canary.html.markdown | 2 +- website/docs/r/transfer_server.html.markdown | 2 +- website/docs/r/transfer_ssh_key.html.markdown | 2 +- website/docs/r/transfer_user.html.markdown | 2 +- .../docs/r/volume_attachment.html.markdown | 2 +- website/docs/r/vpc.html.markdown | 4 +- website/docs/r/vpc_dhcp_options.html.markdown | 4 +- ...vpc_dhcp_options_association.html.markdown | 2 +- website/docs/r/vpc_endpoint.html.markdown | 10 +- ...oint_connection_notification.html.markdown | 2 +- ...oint_route_table_association.html.markdown | 2 +- .../docs/r/vpc_endpoint_service.html.markdown | 4 +- ...nt_service_allowed_principal.html.markdown | 2 +- ..._endpoint_subnet_association.html.markdown | 2 +- ..._ipv4_cidr_block_association.html.markdown | 2 +- .../r/vpc_peering_connection.html.markdown | 8 +- ..._peering_connection_accepter.html.markdown | 4 +- ...c_peering_connection_options.html.markdown | 4 +- website/docs/r/vpn_connection.html.markdown | 4 +- .../docs/r/vpn_connection_route.html.markdown | 2 +- website/docs/r/vpn_gateway.html.markdown | 2 +- .../r/vpn_gateway_attachment.html.markdown | 2 +- ...pn_gateway_route_propagation.html.markdown | 2 +- .../docs/r/waf_byte_match_set.html.markdown | 2 +- .../docs/r/waf_geo_match_set.html.markdown | 2 +- website/docs/r/waf_ipset.html.markdown | 2 +- .../docs/r/waf_rate_based_rule.html.markdown | 2 +- .../docs/r/waf_regex_match_set.html.markdown | 2 +- .../r/waf_regex_pattern_set.html.markdown | 2 +- website/docs/r/waf_rule.html.markdown | 2 +- website/docs/r/waf_rule_group.html.markdown | 2 +- .../r/waf_size_constraint_set.html.markdown | 2 +- .../waf_sql_injection_match_set.html.markdown | 2 +- website/docs/r/waf_web_acl.html.markdown | 4 +- .../docs/r/waf_xss_match_set.html.markdown | 2 +- .../wafregional_byte_match_set.html.markdown | 2 +- .../r/wafregional_geo_match_set.html.markdown | 2 +- .../docs/r/wafregional_ipset.html.markdown | 2 +- .../wafregional_rate_based_rule.html.markdown | 2 +- .../wafregional_regex_match_set.html.markdown | 2 +- ...afregional_regex_pattern_set.html.markdown | 2 +- website/docs/r/wafregional_rule.html.markdown | 2 +- .../r/wafregional_rule_group.html.markdown | 2 +- ...regional_size_constraint_set.html.markdown | 2 +- ...onal_sql_injection_match_set.html.markdown | 2 +- .../docs/r/wafregional_web_acl.html.markdown | 6 +- ...regional_web_acl_association.html.markdown | 4 +- .../r/wafregional_xss_match_set.html.markdown | 2 +- website/docs/r/wafv2_ip_set.html.markdown | 2 +- .../r/wafv2_regex_pattern_set.html.markdown | 2 +- website/docs/r/wafv2_rule_group.html.markdown | 4 +- website/docs/r/wafv2_web_acl.html.markdown | 6 +- .../r/wafv2_web_acl_association.html.markdown | 2 +- ...eb_acl_logging_configuration.html.markdown | 2 +- website/docs/r/worklink_fleet.html.markdown | 6 +- ...ficate_authority_association.html.markdown | 2 +- .../docs/r/workspaces_directory.html.markdown | 4 +- .../docs/r/workspaces_ip_group.html.markdown | 2 +- .../docs/r/workspaces_workspace.html.markdown | 2 +- .../r/xray_encryption_config.html.markdown | 4 +- website/docs/r/xray_group.html.markdown | 2 +- .../docs/r/xray_sampling_rule.html.markdown | 2 +- 920 files changed, 1424 insertions(+), 1424 deletions(-) diff --git a/website/docs/d/acm_certificate.html.markdown b/website/docs/d/acm_certificate.html.markdown index 6d455ba6c04..e95cc816cb6 100644 --- a/website/docs/d/acm_certificate.html.markdown +++ b/website/docs/d/acm_certificate.html.markdown @@ -14,7 +14,7 @@ it by domain without having to hard code the ARNs as input. ## Example Usage -```hcl +```terraform # Find a certificate that is issued data "aws_acm_certificate" "issued" { domain = "tf.example.com" diff --git a/website/docs/d/acmpca_certificate_authority.html.markdown b/website/docs/d/acmpca_certificate_authority.html.markdown index b721c3dabd5..1b456f10e1e 100644 --- a/website/docs/d/acmpca_certificate_authority.html.markdown +++ b/website/docs/d/acmpca_certificate_authority.html.markdown @@ -12,7 +12,7 @@ Get information on a AWS Certificate Manager Private Certificate Authority (ACM ## Example Usage -```hcl +```terraform data "aws_acmpca_certificate_authority" "example" { arn = "arn:aws:acm-pca:us-east-1:123456789012:certificate-authority/12345678-1234-1234-1234-123456789012" } diff --git a/website/docs/d/ami.html.markdown b/website/docs/d/ami.html.markdown index aa6f0717b0f..42f655dc11c 100644 --- a/website/docs/d/ami.html.markdown +++ b/website/docs/d/ami.html.markdown @@ -13,7 +13,7 @@ resources. ## Example Usage -```hcl +```terraform data "aws_ami" "example" { executable_users = ["self"] most_recent = true diff --git a/website/docs/d/ami_ids.html.markdown b/website/docs/d/ami_ids.html.markdown index 6721321473e..39609196c37 100644 --- a/website/docs/d/ami_ids.html.markdown +++ b/website/docs/d/ami_ids.html.markdown @@ -12,7 +12,7 @@ Use this data source to get a list of AMI IDs matching the specified criteria. ## Example Usage -```hcl +```terraform data "aws_ami_ids" "ubuntu" { owners = ["099720109477"] diff --git a/website/docs/d/api_gateway_api_key.html.markdown b/website/docs/d/api_gateway_api_key.html.markdown index b4a737ca23a..fe53bbe3371 100644 --- a/website/docs/d/api_gateway_api_key.html.markdown +++ b/website/docs/d/api_gateway_api_key.html.markdown @@ -13,7 +13,7 @@ example to supply credentials for a dependency microservice. ## Example Usage -```hcl +```terraform data "aws_api_gateway_api_key" "my_api_key" { id = "ru3mpjgse6" } diff --git a/website/docs/d/api_gateway_domain_name.html.markdown b/website/docs/d/api_gateway_domain_name.html.markdown index 0530a87c3ae..73c6f919509 100644 --- a/website/docs/d/api_gateway_domain_name.html.markdown +++ b/website/docs/d/api_gateway_domain_name.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the custom domain name for use with AWS API Gateway. ## Example Usage -```hcl +```terraform data "aws_api_gateway_domain_name" "example" { domain_name = "api.example.com" } diff --git a/website/docs/d/api_gateway_resource.html.markdown b/website/docs/d/api_gateway_resource.html.markdown index c2cd51eaa53..7d77e726862 100644 --- a/website/docs/d/api_gateway_resource.html.markdown +++ b/website/docs/d/api_gateway_resource.html.markdown @@ -13,7 +13,7 @@ To fetch the Resource, you must provide the REST API id as well as the full path ## Example Usage -```hcl +```terraform data "aws_api_gateway_rest_api" "my_rest_api" { name = "my-rest-api" } diff --git a/website/docs/d/api_gateway_rest_api.html.markdown b/website/docs/d/api_gateway_rest_api.html.markdown index 1ad21fb0921..327038f45c5 100644 --- a/website/docs/d/api_gateway_rest_api.html.markdown +++ b/website/docs/d/api_gateway_rest_api.html.markdown @@ -15,7 +15,7 @@ error if there is more than one match. ## Example Usage -```hcl +```terraform data "aws_api_gateway_rest_api" "my_rest_api" { name = "my-rest-api" } diff --git a/website/docs/d/api_gateway_vpc_link.html.markdown b/website/docs/d/api_gateway_vpc_link.html.markdown index 822c0084cc5..176622fef9a 100644 --- a/website/docs/d/api_gateway_vpc_link.html.markdown +++ b/website/docs/d/api_gateway_vpc_link.html.markdown @@ -15,7 +15,7 @@ error if there is more than one match. ## Example Usage -```hcl +```terraform data "aws_api_gateway_vpc_link" "my_api_gateway_vpc_link" { name = "my-vpc-link" } diff --git a/website/docs/d/apigatewayv2_api.html.markdown b/website/docs/d/apigatewayv2_api.html.markdown index 7818255388c..33ed77d7057 100644 --- a/website/docs/d/apigatewayv2_api.html.markdown +++ b/website/docs/d/apigatewayv2_api.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Amazon API Gateway Version 2 API. ## Example Usage -```hcl +```terraform data "aws_apigatewayv2_api" "example" { api_id = "aabbccddee" } diff --git a/website/docs/d/apigatewayv2_apis.html.markdown b/website/docs/d/apigatewayv2_apis.html.markdown index 0ca93231276..ca63ed38621 100644 --- a/website/docs/d/apigatewayv2_apis.html.markdown +++ b/website/docs/d/apigatewayv2_apis.html.markdown @@ -12,7 +12,7 @@ Provides details about multiple Amazon API Gateway Version 2 APIs. ## Example Usage -```hcl +```terraform data "aws_apigatewayv2_apis" "example" { protocol_type = "HTTP" } diff --git a/website/docs/d/arn.html.markdown b/website/docs/d/arn.html.markdown index 5c65d38c8ee..9f0eb646646 100644 --- a/website/docs/d/arn.html.markdown +++ b/website/docs/d/arn.html.markdown @@ -12,7 +12,7 @@ Parses an Amazon Resource Name (ARN) into its constituent parts. ## Example Usage -```hcl +```terraform data "aws_arn" "db_instance" { arn = "arn:aws:rds:eu-west-1:123456789012:db:mysql-db" } diff --git a/website/docs/d/autoscaling_group.html.markdown b/website/docs/d/autoscaling_group.html.markdown index 5a73164fef0..dacafe63e71 100644 --- a/website/docs/d/autoscaling_group.html.markdown +++ b/website/docs/d/autoscaling_group.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information on an existing autoscaling group. ## Example Usage -```hcl +```terraform data "aws_autoscaling_group" "foo" { name = "foo" } diff --git a/website/docs/d/autoscaling_groups.html.markdown b/website/docs/d/autoscaling_groups.html.markdown index bf88ea9987f..d5591d1c8a5 100644 --- a/website/docs/d/autoscaling_groups.html.markdown +++ b/website/docs/d/autoscaling_groups.html.markdown @@ -13,7 +13,7 @@ ASGs within a specific region. This will allow you to pass a list of AutoScaling ## Example Usage -```hcl +```terraform data "aws_autoscaling_groups" "groups" { filter { name = "key" diff --git a/website/docs/d/availability_zone.html.markdown b/website/docs/d/availability_zone.html.markdown index 58b160b1074..0d3c62e41d9 100644 --- a/website/docs/d/availability_zone.html.markdown +++ b/website/docs/d/availability_zone.html.markdown @@ -25,7 +25,7 @@ which provides a list of the available zones. The following example shows how this data source might be used to derive VPC and subnet CIDR prefixes systematically for an availability zone. -```hcl +```terraform variable "region_number" { # Arbitrary mapping of region name to number to use in # a VPC's CIDR prefix. diff --git a/website/docs/d/availability_zones.html.markdown b/website/docs/d/availability_zones.html.markdown index 98c64bf9d82..3453115952d 100644 --- a/website/docs/d/availability_zones.html.markdown +++ b/website/docs/d/availability_zones.html.markdown @@ -21,7 +21,7 @@ which provides some details about a specific availability zone. ### By State -```hcl +```terraform # Declare the data source data "aws_availability_zones" "available" { state = "available" @@ -46,7 +46,7 @@ resource "aws_subnet" "secondary" { All Local Zones (regardless of opt-in status): -```hcl +```terraform data "aws_availability_zones" "example" { all_availability_zones = true diff --git a/website/docs/d/backup_plan.html.markdown b/website/docs/d/backup_plan.html.markdown index 636a84eb0cc..59940e4e2aa 100644 --- a/website/docs/d/backup_plan.html.markdown +++ b/website/docs/d/backup_plan.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information on an existing backup plan. ## Example Usage -```hcl +```terraform data "aws_backup_plan" "example" { plan_id = "tf_example_backup_plan_id" } diff --git a/website/docs/d/backup_selection.html.markdown b/website/docs/d/backup_selection.html.markdown index cf5e36397d9..53631ecb43d 100644 --- a/website/docs/d/backup_selection.html.markdown +++ b/website/docs/d/backup_selection.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information on an existing backup selection. ## Example Usage -```hcl +```terraform data "aws_backup_selection" "example" { plan_id = data.aws_backup_plan.example.id selection_id = "selection-id-example" diff --git a/website/docs/d/backup_vault.html.markdown b/website/docs/d/backup_vault.html.markdown index 37eafcc0b78..51d974ea5ce 100644 --- a/website/docs/d/backup_vault.html.markdown +++ b/website/docs/d/backup_vault.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information on an existing backup vault. ## Example Usage -```hcl +```terraform data "aws_backup_vault" "example" { name = "example_backup_vault" } diff --git a/website/docs/d/batch_compute_environment.html.markdown b/website/docs/d/batch_compute_environment.html.markdown index 05bc3cc07d9..b4c7cd60372 100644 --- a/website/docs/d/batch_compute_environment.html.markdown +++ b/website/docs/d/batch_compute_environment.html.markdown @@ -13,7 +13,7 @@ compute environment within AWS Batch. ## Example Usage -```hcl +```terraform data "aws_batch_compute_environment" "batch-mongo" { compute_environment_name = "batch-mongo-production" } diff --git a/website/docs/d/batch_job_queue.html.markdown b/website/docs/d/batch_job_queue.html.markdown index 3ad13c12883..5c6a44df99a 100644 --- a/website/docs/d/batch_job_queue.html.markdown +++ b/website/docs/d/batch_job_queue.html.markdown @@ -13,7 +13,7 @@ job queue within AWS Batch. ## Example Usage -```hcl +```terraform data "aws_batch_job_queue" "test-queue" { name = "tf-test-batch-job-queue" } diff --git a/website/docs/d/billing_service_account.html.markdown b/website/docs/d/billing_service_account.html.markdown index 5680f0c9ace..ca0ea5b979d 100644 --- a/website/docs/d/billing_service_account.html.markdown +++ b/website/docs/d/billing_service_account.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the Account ID of the [AWS Billing and Cost Manageme ## Example Usage -```hcl +```terraform data "aws_billing_service_account" "main" {} resource "aws_s3_bucket" "billing_logs" { diff --git a/website/docs/d/caller_identity.html.markdown b/website/docs/d/caller_identity.html.markdown index 2507ead90c1..d349ef137ef 100644 --- a/website/docs/d/caller_identity.html.markdown +++ b/website/docs/d/caller_identity.html.markdown @@ -14,7 +14,7 @@ which Terraform is authorized. ## Example Usage -```hcl +```terraform data "aws_caller_identity" "current" {} output "account_id" { diff --git a/website/docs/d/canonical_user_id.html.markdown b/website/docs/d/canonical_user_id.html.markdown index 6bb82140cb2..683d7f048d7 100644 --- a/website/docs/d/canonical_user_id.html.markdown +++ b/website/docs/d/canonical_user_id.html.markdown @@ -14,7 +14,7 @@ for the effective account in which Terraform is working. ## Example Usage -```hcl +```terraform data "aws_canonical_user_id" "current" {} output "canonical_user_id" { diff --git a/website/docs/d/cloudformation_export.html.markdown b/website/docs/d/cloudformation_export.html.markdown index 18e13622f47..53734939d8f 100644 --- a/website/docs/d/cloudformation_export.html.markdown +++ b/website/docs/d/cloudformation_export.html.markdown @@ -15,7 +15,7 @@ exports specified in the [Output](http://docs.aws.amazon.com/AWSCloudFormation/l ## Example Usage -```hcl +```terraform data "aws_cloudformation_export" "subnet_id" { name = "mySubnetIdExportName" } diff --git a/website/docs/d/cloudformation_stack.html.markdown b/website/docs/d/cloudformation_stack.html.markdown index 5e429001548..2afa17a69a8 100644 --- a/website/docs/d/cloudformation_stack.html.markdown +++ b/website/docs/d/cloudformation_stack.html.markdown @@ -13,7 +13,7 @@ outputs and other useful data including the template body. ## Example Usage -```hcl +```terraform data "aws_cloudformation_stack" "network" { name = "my-network-stack" } diff --git a/website/docs/d/cloudfront_cache_policy.html.markdown b/website/docs/d/cloudfront_cache_policy.html.markdown index 007bf54878f..cbbc79f3f86 100644 --- a/website/docs/d/cloudfront_cache_policy.html.markdown +++ b/website/docs/d/cloudfront_cache_policy.html.markdown @@ -12,7 +12,7 @@ description: |- The following example below creates a CloudFront cache policy. -```hcl +```terraform data "aws_cloudfront_cache_policy" "example" { name = "example-policy" } diff --git a/website/docs/d/cloudfront_distribution.html.markdown b/website/docs/d/cloudfront_distribution.html.markdown index d7cde052318..e8472cc9811 100644 --- a/website/docs/d/cloudfront_distribution.html.markdown +++ b/website/docs/d/cloudfront_distribution.html.markdown @@ -12,7 +12,7 @@ Use this data source to retrieve information about a CloudFront distribution. ## Example Usage -```hcl +```terraform data "aws_cloudfront_distribution" "test" { id = "EDFDVBD632BHDS5" } diff --git a/website/docs/d/cloudfront_origin_request_policy.html.markdown b/website/docs/d/cloudfront_origin_request_policy.html.markdown index 4e25a4ea5a1..576bb6bf6c0 100644 --- a/website/docs/d/cloudfront_origin_request_policy.html.markdown +++ b/website/docs/d/cloudfront_origin_request_policy.html.markdown @@ -12,7 +12,7 @@ description: |- The following example below creates a CloudFront origin request policy. -```hcl +```terraform data "aws_cloudfront_origin_request_policy" "example" { name = "example-policy" } diff --git a/website/docs/d/cloudhsm_v2_cluster.html.markdown b/website/docs/d/cloudhsm_v2_cluster.html.markdown index dd5ea96b69f..89760b959d8 100644 --- a/website/docs/d/cloudhsm_v2_cluster.html.markdown +++ b/website/docs/d/cloudhsm_v2_cluster.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about a CloudHSM v2 cluster ## Example Usage -```hcl +```terraform data "aws_cloudhsm_v2_cluster" "cluster" { cluster_id = "cluster-testclusterid" } diff --git a/website/docs/d/cloudtrail_service_account.html.markdown b/website/docs/d/cloudtrail_service_account.html.markdown index 163b7f44006..19a5b57587e 100644 --- a/website/docs/d/cloudtrail_service_account.html.markdown +++ b/website/docs/d/cloudtrail_service_account.html.markdown @@ -13,7 +13,7 @@ in a given region for the purpose of allowing CloudTrail to store trail data in ## Example Usage -```hcl +```terraform data "aws_cloudtrail_service_account" "main" {} resource "aws_s3_bucket" "bucket" { diff --git a/website/docs/d/cloudwatch_log_group.html.markdown b/website/docs/d/cloudwatch_log_group.html.markdown index ddfafb76044..9d5e4d00f75 100644 --- a/website/docs/d/cloudwatch_log_group.html.markdown +++ b/website/docs/d/cloudwatch_log_group.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an AWS Cloudwatch Log Group ## Example Usage -```hcl +```terraform data "aws_cloudwatch_log_group" "example" { name = "MyImportantLogs" } diff --git a/website/docs/d/codeartifact_authorization_token.html.markdown b/website/docs/d/codeartifact_authorization_token.html.markdown index e19e7e76852..47f481307cd 100644 --- a/website/docs/d/codeartifact_authorization_token.html.markdown +++ b/website/docs/d/codeartifact_authorization_token.html.markdown @@ -12,7 +12,7 @@ The CodeArtifact Authorization Token data source generates a temporary authentic ## Example Usage -```hcl +```terraform data "aws_codeartifact_authorization_token" "test" { domain = aws_codeartifact_domain.test.domain } diff --git a/website/docs/d/codeartifact_repository_endpoint.html.markdown b/website/docs/d/codeartifact_repository_endpoint.html.markdown index 19f90135004..fc34d9cd076 100644 --- a/website/docs/d/codeartifact_repository_endpoint.html.markdown +++ b/website/docs/d/codeartifact_repository_endpoint.html.markdown @@ -12,7 +12,7 @@ The CodeArtifact Repository Endpoint data source returns the endpoint of a repos ## Example Usage -```hcl +```terraform data "aws_codeartifact_repository_endpoint" "test" { domain = aws_codeartifact_domain.test.domain repository = aws_codeartifact_repository.test.repository diff --git a/website/docs/d/codecommit_repository.html.markdown b/website/docs/d/codecommit_repository.html.markdown index 783af21f8bd..e8bd0614f5e 100644 --- a/website/docs/d/codecommit_repository.html.markdown +++ b/website/docs/d/codecommit_repository.html.markdown @@ -12,7 +12,7 @@ The CodeCommit Repository data source allows the ARN, Repository ID, Repository ## Example Usage -```hcl +```terraform data "aws_codecommit_repository" "test" { repository_name = "MyTestRepository" } diff --git a/website/docs/d/cognito_user_pools.markdown b/website/docs/d/cognito_user_pools.markdown index ee325efbabb..fae71154807 100644 --- a/website/docs/d/cognito_user_pools.markdown +++ b/website/docs/d/cognito_user_pools.markdown @@ -12,7 +12,7 @@ Use this data source to get a list of cognito user pools. ## Example Usage -```hcl +```terraform data "aws_api_gateway_rest_api" "selected" { name = var.api_gateway_name } diff --git a/website/docs/d/cur_report_definition.html.markdown b/website/docs/d/cur_report_definition.html.markdown index 5fb104db166..721b7bfce70 100644 --- a/website/docs/d/cur_report_definition.html.markdown +++ b/website/docs/d/cur_report_definition.html.markdown @@ -16,7 +16,7 @@ Use this data source to get information on an AWS Cost and Usage Report Definiti ## Example Usage -```hcl +```terraform data "aws_cur_report_definition" "report_definition" { report_name = "example" } diff --git a/website/docs/d/customer_gateway.html.markdown b/website/docs/d/customer_gateway.html.markdown index 5b7cc5c08f5..66dd18c0570 100644 --- a/website/docs/d/customer_gateway.html.markdown +++ b/website/docs/d/customer_gateway.html.markdown @@ -12,7 +12,7 @@ Get an existing AWS Customer Gateway. ## Example Usage -```hcl +```terraform data "aws_customer_gateway" "foo" { filter { name = "tag:Name" diff --git a/website/docs/d/db_cluster_snapshot.html.markdown b/website/docs/d/db_cluster_snapshot.html.markdown index c7138d3b062..b5c036508ae 100644 --- a/website/docs/d/db_cluster_snapshot.html.markdown +++ b/website/docs/d/db_cluster_snapshot.html.markdown @@ -15,7 +15,7 @@ See the [`aws_db_snapshot` data source](/docs/providers/aws/d/db_snapshot.html) ## Example Usage -```hcl +```terraform data "aws_db_cluster_snapshot" "development_final_snapshot" { db_cluster_identifier = "development_cluster" most_recent = true diff --git a/website/docs/d/db_event_categories.html.markdown b/website/docs/d/db_event_categories.html.markdown index c3abe0fe671..b31c7863863 100644 --- a/website/docs/d/db_event_categories.html.markdown +++ b/website/docs/d/db_event_categories.html.markdown @@ -12,7 +12,7 @@ description: |- List the event categories of all the RDS resources. -```hcl +```terraform data "aws_db_event_categories" "example" {} output "example" { @@ -22,7 +22,7 @@ output "example" { List the event categories specific to the RDS resource `db-snapshot`. -```hcl +```terraform data "aws_db_event_categories" "example" { source_type = "db-snapshot" } diff --git a/website/docs/d/db_instance.html.markdown b/website/docs/d/db_instance.html.markdown index e2bc7b42dba..3afcbe1ef91 100644 --- a/website/docs/d/db_instance.html.markdown +++ b/website/docs/d/db_instance.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an RDS instance ## Example Usage -```hcl +```terraform data "aws_db_instance" "database" { db_instance_identifier = "my-test-database" } diff --git a/website/docs/d/db_snapshot.html.markdown b/website/docs/d/db_snapshot.html.markdown index cecda33f7ac..7e2e99dc27a 100644 --- a/website/docs/d/db_snapshot.html.markdown +++ b/website/docs/d/db_snapshot.html.markdown @@ -15,7 +15,7 @@ See the [`aws_db_cluster_snapshot` data source](/docs/providers/aws/d/db_cluster ## Example Usage -```hcl +```terraform resource "aws_db_instance" "prod" { allocated_storage = 10 engine = "mysql" diff --git a/website/docs/d/db_subnet_group.html.markdown b/website/docs/d/db_subnet_group.html.markdown index b41cbaabb37..f2a956b658a 100644 --- a/website/docs/d/db_subnet_group.html.markdown +++ b/website/docs/d/db_subnet_group.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an RDS subnet group. ## Example Usage -```hcl +```terraform data "aws_db_subnet_group" "database" { name = "my-test-database-subnet-group" } diff --git a/website/docs/d/directory_service_directory.html.markdown b/website/docs/d/directory_service_directory.html.markdown index e960f57f22d..93ca929f94a 100644 --- a/website/docs/d/directory_service_directory.html.markdown +++ b/website/docs/d/directory_service_directory.html.markdown @@ -12,7 +12,7 @@ Get attributes of AWS Directory Service directory (SimpleAD, Managed AD, AD Conn ## Example Usage -```hcl +```terraform data "aws_directory_service_directory" "example" { directory_id = aws_directory_service_directory.main.id } diff --git a/website/docs/d/docdb_engine_version.markdown b/website/docs/d/docdb_engine_version.markdown index dd62749f29f..d81abdad7e0 100644 --- a/website/docs/d/docdb_engine_version.markdown +++ b/website/docs/d/docdb_engine_version.markdown @@ -12,7 +12,7 @@ Information about a DocumentDB engine version. ## Example Usage -```hcl +```terraform data "aws_docdb_engine_version" "test" { version = "3.6.0" } diff --git a/website/docs/d/docdb_orderable_db_instance.markdown b/website/docs/d/docdb_orderable_db_instance.markdown index ce33cfc5673..bceba226f92 100644 --- a/website/docs/d/docdb_orderable_db_instance.markdown +++ b/website/docs/d/docdb_orderable_db_instance.markdown @@ -12,7 +12,7 @@ Information about DocumentDB orderable DB instances. ## Example Usage -```hcl +```terraform data "aws_docdb_orderable_db_instance" "test" { engine = "docdb" engine_version = "3.6.0" diff --git a/website/docs/d/dx_gateway.html.markdown b/website/docs/d/dx_gateway.html.markdown index f6bb7eff9fe..5f05db67598 100644 --- a/website/docs/d/dx_gateway.html.markdown +++ b/website/docs/d/dx_gateway.html.markdown @@ -12,7 +12,7 @@ Retrieve information about a Direct Connect Gateway. ## Example Usage -```hcl +```terraform data "aws_dx_gateway" "example" { name = "example" } diff --git a/website/docs/d/dynamodb_table.html.markdown b/website/docs/d/dynamodb_table.html.markdown index b79d147d22d..81e8821496c 100644 --- a/website/docs/d/dynamodb_table.html.markdown +++ b/website/docs/d/dynamodb_table.html.markdown @@ -12,7 +12,7 @@ Provides information about a DynamoDB table. ## Example Usage -```hcl +```terraform data "aws_dynamodb_table" "tableName" { name = "tableName" } diff --git a/website/docs/d/ebs_default_kms_key.html.markdown b/website/docs/d/ebs_default_kms_key.html.markdown index ad882d8104f..6b55f389e7c 100644 --- a/website/docs/d/ebs_default_kms_key.html.markdown +++ b/website/docs/d/ebs_default_kms_key.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the default EBS encryption KMS key in the current re ## Example Usage -```hcl +```terraform data "aws_ebs_default_kms_key" "current" {} resource "aws_ebs_volume" "example" { diff --git a/website/docs/d/ebs_encryption_by_default.html.markdown b/website/docs/d/ebs_encryption_by_default.html.markdown index 433ea86eeea..f83b1603231 100644 --- a/website/docs/d/ebs_encryption_by_default.html.markdown +++ b/website/docs/d/ebs_encryption_by_default.html.markdown @@ -12,7 +12,7 @@ Provides a way to check whether default EBS encryption is enabled for your AWS a ## Example Usage -```hcl +```terraform data "aws_ebs_encryption_by_default" "current" {} ``` diff --git a/website/docs/d/ebs_snapshot.html.markdown b/website/docs/d/ebs_snapshot.html.markdown index f0a7ea1c110..b139275062f 100644 --- a/website/docs/d/ebs_snapshot.html.markdown +++ b/website/docs/d/ebs_snapshot.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an EBS Snapshot for use when provi ## Example Usage -```hcl +```terraform data "aws_ebs_snapshot" "ebs_volume" { most_recent = true owners = ["self"] diff --git a/website/docs/d/ebs_snapshot_ids.html.markdown b/website/docs/d/ebs_snapshot_ids.html.markdown index f5bcf0e48f6..c758c05160a 100644 --- a/website/docs/d/ebs_snapshot_ids.html.markdown +++ b/website/docs/d/ebs_snapshot_ids.html.markdown @@ -13,7 +13,7 @@ criteria. ## Example Usage -```hcl +```terraform data "aws_ebs_snapshot_ids" "ebs_volumes" { owners = ["self"] diff --git a/website/docs/d/ebs_volume.html.markdown b/website/docs/d/ebs_volume.html.markdown index a3d74495dc7..3f094d448b0 100644 --- a/website/docs/d/ebs_volume.html.markdown +++ b/website/docs/d/ebs_volume.html.markdown @@ -13,7 +13,7 @@ resources. ## Example Usage -```hcl +```terraform data "aws_ebs_volume" "ebs_volume" { most_recent = true diff --git a/website/docs/d/ebs_volumes.html.markdown b/website/docs/d/ebs_volumes.html.markdown index 65e6d8f6136..60bc178a605 100644 --- a/website/docs/d/ebs_volumes.html.markdown +++ b/website/docs/d/ebs_volumes.html.markdown @@ -16,7 +16,7 @@ This data source can be useful for getting a list of volume IDs with (for exampl The following demonstrates obtaining a map of availability zone to EBS volume ID for volumes with a given tag value. -```hcl +```terraform data "aws_ebs_volumes" "example" { tags = { VolumeSet = "TestVolumeSet" @@ -50,7 +50,7 @@ which take the following arguments: [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVolumes.html). For example, if matching against the `size` filter, use: -```hcl +```terraform data "aws_ebs_volumes" "ten_or_twenty_gb_volumes" { filter { name = "size" diff --git a/website/docs/d/ec2_coip_pool.html.markdown b/website/docs/d/ec2_coip_pool.html.markdown index 0114b780009..ed5bcb6d977 100644 --- a/website/docs/d/ec2_coip_pool.html.markdown +++ b/website/docs/d/ec2_coip_pool.html.markdown @@ -18,7 +18,7 @@ COIP Pool. The following example returns a specific coip pool ID -```hcl +```terraform variable "coip_pool_id" {} data "aws_ec2_coip_pool" "selected" { diff --git a/website/docs/d/ec2_coip_pools.html.markdown b/website/docs/d/ec2_coip_pools.html.markdown index 1a0f24d3c5e..723e30d2519 100644 --- a/website/docs/d/ec2_coip_pools.html.markdown +++ b/website/docs/d/ec2_coip_pools.html.markdown @@ -14,7 +14,7 @@ Provides information for multiple EC2 Customer-Owned IP Pools, such as their ide The following shows outputing all COIP Pool Ids. -```hcl +```terraform data "aws_ec2_coip_pools" "foo" {} output "foo" { diff --git a/website/docs/d/ec2_instance_type.html.markdown b/website/docs/d/ec2_instance_type.html.markdown index 7ec4a7a3bbf..c76665a69e3 100644 --- a/website/docs/d/ec2_instance_type.html.markdown +++ b/website/docs/d/ec2_instance_type.html.markdown @@ -13,7 +13,7 @@ Get characteristics for a single EC2 Instance Type. ## Example Usage -```hcl +```terraform data "aws_ec2_instance_type" "example" { instance_type = "t2.micro" } diff --git a/website/docs/d/ec2_instance_type_offering.html.markdown b/website/docs/d/ec2_instance_type_offering.html.markdown index 56b52924be6..c6839964aeb 100644 --- a/website/docs/d/ec2_instance_type_offering.html.markdown +++ b/website/docs/d/ec2_instance_type_offering.html.markdown @@ -12,7 +12,7 @@ Information about single EC2 Instance Type Offering. ## Example Usage -```hcl +```terraform data "aws_ec2_instance_type_offering" "example" { filter { name = "instance-type" diff --git a/website/docs/d/ec2_instance_type_offerings.html.markdown b/website/docs/d/ec2_instance_type_offerings.html.markdown index ef8f5f7c13b..e65360ae077 100644 --- a/website/docs/d/ec2_instance_type_offerings.html.markdown +++ b/website/docs/d/ec2_instance_type_offerings.html.markdown @@ -12,7 +12,7 @@ Information about EC2 Instance Type Offerings. ## Example Usage -```hcl +```terraform data "aws_ec2_instance_type_offerings" "example" { filter { name = "instance-type" diff --git a/website/docs/d/ec2_local_gateway.html.markdown b/website/docs/d/ec2_local_gateway.html.markdown index ba1347cb3bd..d4e4afa5ef9 100644 --- a/website/docs/d/ec2_local_gateway.html.markdown +++ b/website/docs/d/ec2_local_gateway.html.markdown @@ -14,7 +14,7 @@ Provides details about an EC2 Local Gateway. The following example shows how one might accept a local gateway id as a variable. -```hcl +```terraform variable "local_gateway_id" {} data "aws_ec2_local_gateway" "selected" { diff --git a/website/docs/d/ec2_local_gateway_route_table.html.markdown b/website/docs/d/ec2_local_gateway_route_table.html.markdown index a884015773e..5e07470ca78 100644 --- a/website/docs/d/ec2_local_gateway_route_table.html.markdown +++ b/website/docs/d/ec2_local_gateway_route_table.html.markdown @@ -17,7 +17,7 @@ an input variable and needs to, for example, find the associated Outpost or Loca The following example returns a specific local gateway route table ID -```hcl +```terraform variable "aws_ec2_local_gateway_route_table" {} data "aws_ec2_local_gateway_route_table" "selected" { diff --git a/website/docs/d/ec2_local_gateway_route_tables.html.markdown b/website/docs/d/ec2_local_gateway_route_tables.html.markdown index 7df320c3918..37fefa8d4ec 100644 --- a/website/docs/d/ec2_local_gateway_route_tables.html.markdown +++ b/website/docs/d/ec2_local_gateway_route_tables.html.markdown @@ -14,7 +14,7 @@ Provides information for multiple EC2 Local Gateway Route Tables, such as their The following shows outputing all Local Gateway Route Table Ids. -```hcl +```terraform data "aws_ec2_local_gateway_route_table" "foo" {} output "foo" { diff --git a/website/docs/d/ec2_local_gateway_virtual_interface.html.markdown b/website/docs/d/ec2_local_gateway_virtual_interface.html.markdown index 2a9edab0739..091419ad841 100644 --- a/website/docs/d/ec2_local_gateway_virtual_interface.html.markdown +++ b/website/docs/d/ec2_local_gateway_virtual_interface.html.markdown @@ -12,7 +12,7 @@ Provides details about an EC2 Local Gateway Virtual Interface. More information ## Example Usage -```hcl +```terraform data "aws_ec2_local_gateway_virtual_interface" "example" { for_each = data.aws_ec2_local_gateway_virtual_interface_group.example.local_gateway_virtual_interface_ids diff --git a/website/docs/d/ec2_local_gateway_virtual_interface_group.html.markdown b/website/docs/d/ec2_local_gateway_virtual_interface_group.html.markdown index 4616ea320de..ae713865a8b 100644 --- a/website/docs/d/ec2_local_gateway_virtual_interface_group.html.markdown +++ b/website/docs/d/ec2_local_gateway_virtual_interface_group.html.markdown @@ -12,7 +12,7 @@ Provides details about an EC2 Local Gateway Virtual Interface Group. More inform ## Example Usage -```hcl +```terraform data "aws_ec2_local_gateway_virtual_interface_group" "example" { local_gateway_id = data.aws_ec2_local_gateway.example.id } diff --git a/website/docs/d/ec2_local_gateway_virtual_interface_groups.html.markdown b/website/docs/d/ec2_local_gateway_virtual_interface_groups.html.markdown index 9dfe7df2473..1b43af65b7e 100644 --- a/website/docs/d/ec2_local_gateway_virtual_interface_groups.html.markdown +++ b/website/docs/d/ec2_local_gateway_virtual_interface_groups.html.markdown @@ -12,7 +12,7 @@ Provides details about multiple EC2 Local Gateway Virtual Interface Groups, such ## Example Usage -```hcl +```terraform data "aws_ec2_local_gateway_virtual_interface_groups" "all" {} ``` diff --git a/website/docs/d/ec2_local_gateways.html.markdown b/website/docs/d/ec2_local_gateways.html.markdown index 194d832c36b..11ad1b34831 100644 --- a/website/docs/d/ec2_local_gateways.html.markdown +++ b/website/docs/d/ec2_local_gateways.html.markdown @@ -14,7 +14,7 @@ Provides information for multiple EC2 Local Gateways, such as their identifiers. The following example retrieves Local Gateways with a resource tag of `service` set to `production`. -```hcl +```terraform data "aws_ec2_local_gateways" "foo" { tags = { service = "production" diff --git a/website/docs/d/ec2_managed_prefix_list.html.markdown b/website/docs/d/ec2_managed_prefix_list.html.markdown index 63986d99d47..edce53c4401 100644 --- a/website/docs/d/ec2_managed_prefix_list.html.markdown +++ b/website/docs/d/ec2_managed_prefix_list.html.markdown @@ -15,7 +15,7 @@ customer-managed prefix list in the current region. ### Find the regional DynamoDB prefix list -```hcl +```terraform data "aws_region" "current" {} data "aws_ec2_managed_prefix_list" "example" { @@ -25,7 +25,7 @@ data "aws_ec2_managed_prefix_list" "example" { ### Find a managed prefix list using filters -```hcl +```terraform data "aws_ec2_managed_prefix_list" "example" { filter { name = "prefix-list-name" diff --git a/website/docs/d/ec2_spot_price.html.markdown b/website/docs/d/ec2_spot_price.html.markdown index 95736419d7d..c1701e74f63 100644 --- a/website/docs/d/ec2_spot_price.html.markdown +++ b/website/docs/d/ec2_spot_price.html.markdown @@ -12,7 +12,7 @@ Information about most recent Spot Price for a given EC2 instance. ## Example Usage -```hcl +```terraform data "aws_ec2_spot_price" "example" { instance_type = "t3.medium" availability_zone = "us-west-2a" diff --git a/website/docs/d/ec2_transit_gateway.html.markdown b/website/docs/d/ec2_transit_gateway.html.markdown index 96ce4a5e409..72b19e5bdce 100644 --- a/website/docs/d/ec2_transit_gateway.html.markdown +++ b/website/docs/d/ec2_transit_gateway.html.markdown @@ -14,7 +14,7 @@ Get information on an EC2 Transit Gateway. ### By Filter -```hcl +```terraform data "aws_ec2_transit_gateway" "example" { filter { name = "options.amazon-side-asn" @@ -25,7 +25,7 @@ data "aws_ec2_transit_gateway" "example" { ### By Identifier -```hcl +```terraform data "aws_ec2_transit_gateway" "example" { id = "tgw-12345678" } diff --git a/website/docs/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown index ffa6c6d18b8..9a0b4fd6a55 100644 --- a/website/docs/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_dx_gateway_attachment.html.markdown @@ -14,7 +14,7 @@ Get information on an EC2 Transit Gateway's attachment to a Direct Connect Gatew ### By Transit Gateway and Direct Connect Gateway Identifiers -```hcl +```terraform data "aws_ec2_transit_gateway_dx_gateway_attachment" "example" { transit_gateway_id = aws_ec2_transit_gateway.example.id dx_gateway_id = aws_dx_gateway.example.id diff --git a/website/docs/d/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_peering_attachment.html.markdown index 729d3214f57..8be0a80961f 100644 --- a/website/docs/d/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_peering_attachment.html.markdown @@ -14,7 +14,7 @@ Get information on an EC2 Transit Gateway Peering Attachment. ### By Filter -```hcl +```terraform data "aws_ec2_transit_gateway_peering_attachment" "example" { filter { name = "transit-gateway-attachment-id" @@ -25,7 +25,7 @@ data "aws_ec2_transit_gateway_peering_attachment" "example" { ### By Identifier -```hcl +```terraform data "aws_ec2_transit_gateway_peering_attachment" "attachment" { id = "tgw-attach-12345678" } diff --git a/website/docs/d/ec2_transit_gateway_route_table.html.markdown b/website/docs/d/ec2_transit_gateway_route_table.html.markdown index 4768deb0769..5e069b514d5 100644 --- a/website/docs/d/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/d/ec2_transit_gateway_route_table.html.markdown @@ -14,7 +14,7 @@ Get information on an EC2 Transit Gateway Route Table. ### By Filter -```hcl +```terraform data "aws_ec2_transit_gateway_route_table" "example" { filter { name = "default-association-route-table" @@ -30,7 +30,7 @@ data "aws_ec2_transit_gateway_route_table" "example" { ### By Identifier -```hcl +```terraform data "aws_ec2_transit_gateway_route_table" "example" { id = "tgw-rtb-12345678" } diff --git a/website/docs/d/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_vpc_attachment.html.markdown index 914ed2a68d6..6c995f22fdf 100644 --- a/website/docs/d/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_vpc_attachment.html.markdown @@ -14,7 +14,7 @@ Get information on an EC2 Transit Gateway VPC Attachment. ### By Filter -```hcl +```terraform data "aws_ec2_transit_gateway_vpc_attachment" "example" { filter { name = "vpc-id" @@ -25,7 +25,7 @@ data "aws_ec2_transit_gateway_vpc_attachment" "example" { ### By Identifier -```hcl +```terraform data "aws_ec2_transit_gateway_vpc_attachment" "example" { id = "tgw-attach-12345678" } diff --git a/website/docs/d/ec2_transit_gateway_vpn_attachment.html.markdown b/website/docs/d/ec2_transit_gateway_vpn_attachment.html.markdown index 1400d72fbee..404b719a1aa 100644 --- a/website/docs/d/ec2_transit_gateway_vpn_attachment.html.markdown +++ b/website/docs/d/ec2_transit_gateway_vpn_attachment.html.markdown @@ -16,7 +16,7 @@ Get information on an EC2 Transit Gateway VPN Attachment. ### By Transit Gateway and VPN Connection Identifiers -```hcl +```terraform data "aws_ec2_transit_gateway_vpn_attachment" "example" { transit_gateway_id = aws_ec2_transit_gateway.example.id vpn_connection_id = aws_vpn_connection.example.id @@ -25,7 +25,7 @@ data "aws_ec2_transit_gateway_vpn_attachment" "example" { ### Filter -```hcl +```terraform data "aws_ec2_transit_gateway_vpn_attachment" "test" { filter { name = "resource-id" diff --git a/website/docs/d/ecr_authorization_token.html.markdown b/website/docs/d/ecr_authorization_token.html.markdown index 9a21db713e0..39805477be3 100644 --- a/website/docs/d/ecr_authorization_token.html.markdown +++ b/website/docs/d/ecr_authorization_token.html.markdown @@ -12,7 +12,7 @@ The ECR Authorization Token data source allows the authorization token, proxy en ## Example Usage -```hcl +```terraform data "aws_ecr_authorization_token" "token" { } ``` diff --git a/website/docs/d/ecr_image.html.markdown b/website/docs/d/ecr_image.html.markdown index d42f76ddd3c..fba0d7f8c35 100644 --- a/website/docs/d/ecr_image.html.markdown +++ b/website/docs/d/ecr_image.html.markdown @@ -12,7 +12,7 @@ The ECR Image data source allows the details of an image with a particular tag o ## Example Usage -```hcl +```terraform data "aws_ecr_image" "service_image" { repository_name = "my/service" image_tag = "latest" diff --git a/website/docs/d/ecr_repository.html.markdown b/website/docs/d/ecr_repository.html.markdown index f58000af725..33db11b4e55 100644 --- a/website/docs/d/ecr_repository.html.markdown +++ b/website/docs/d/ecr_repository.html.markdown @@ -12,7 +12,7 @@ The ECR Repository data source allows the ARN, Repository URI and Registry ID to ## Example Usage -```hcl +```terraform data "aws_ecr_repository" "service" { name = "ecr-repository" } diff --git a/website/docs/d/ecs_cluster.html.markdown b/website/docs/d/ecs_cluster.html.markdown index 87d13275e25..abed422dcb4 100644 --- a/website/docs/d/ecs_cluster.html.markdown +++ b/website/docs/d/ecs_cluster.html.markdown @@ -13,7 +13,7 @@ cluster within an AWS ECS service. ## Example Usage -```hcl +```terraform data "aws_ecs_cluster" "ecs-mongo" { cluster_name = "ecs-mongo-production" } diff --git a/website/docs/d/ecs_container_definition.html.markdown b/website/docs/d/ecs_container_definition.html.markdown index d67ed4cf728..794626ecfdd 100644 --- a/website/docs/d/ecs_container_definition.html.markdown +++ b/website/docs/d/ecs_container_definition.html.markdown @@ -13,7 +13,7 @@ a specific container within an AWS ECS service. ## Example Usage -```hcl +```terraform data "aws_ecs_container_definition" "ecs-mongo" { task_definition = aws_ecs_task_definition.mongo.id container_name = "mongodb" diff --git a/website/docs/d/ecs_service.html.markdown b/website/docs/d/ecs_service.html.markdown index 65c95a84913..e12115e7ad2 100644 --- a/website/docs/d/ecs_service.html.markdown +++ b/website/docs/d/ecs_service.html.markdown @@ -13,7 +13,7 @@ Service within a AWS ECS Cluster. ## Example Usage -```hcl +```terraform data "aws_ecs_service" "example" { service_name = "example" cluster_arn = data.aws_ecs_cluster.example.arn diff --git a/website/docs/d/ecs_task_definition.html.markdown b/website/docs/d/ecs_task_definition.html.markdown index 8e7a93a48cb..6ff3f5e263f 100644 --- a/website/docs/d/ecs_task_definition.html.markdown +++ b/website/docs/d/ecs_task_definition.html.markdown @@ -14,7 +14,7 @@ a specific AWS ECS task definition. ## Example Usage -```hcl +```terraform # Simply specify the family to find the latest ACTIVE revision in that family. data "aws_ecs_task_definition" "mongo" { task_definition = aws_ecs_task_definition.mongo.family diff --git a/website/docs/d/efs_access_point.html.markdown b/website/docs/d/efs_access_point.html.markdown index ad83ad94d4e..2a3d8e53f9c 100644 --- a/website/docs/d/efs_access_point.html.markdown +++ b/website/docs/d/efs_access_point.html.markdown @@ -12,7 +12,7 @@ Provides information about an Elastic File System (EFS) Access Point. ## Example Usage -```hcl +```terraform data "aws_efs_access_point" "test" { access_point_id = "fsap-12345678" } diff --git a/website/docs/d/efs_access_points.html.markdown b/website/docs/d/efs_access_points.html.markdown index 3f8482e432d..01d5855e1f9 100644 --- a/website/docs/d/efs_access_points.html.markdown +++ b/website/docs/d/efs_access_points.html.markdown @@ -12,7 +12,7 @@ Provides information about multiple Elastic File System (EFS) Access Points. ## Example Usage -```hcl +```terraform data "aws_efs_access_points" "test" { file_system_id = "fs-12345678" } diff --git a/website/docs/d/efs_file_system.html.markdown b/website/docs/d/efs_file_system.html.markdown index 9e8b0c12c57..0aef0be8548 100644 --- a/website/docs/d/efs_file_system.html.markdown +++ b/website/docs/d/efs_file_system.html.markdown @@ -12,7 +12,7 @@ Provides information about an Elastic File System (EFS) File System. ## Example Usage -```hcl +```terraform variable "file_system_id" { type = string default = "" diff --git a/website/docs/d/efs_mount_target.html.markdown b/website/docs/d/efs_mount_target.html.markdown index ca42eb248b8..b982715e42c 100644 --- a/website/docs/d/efs_mount_target.html.markdown +++ b/website/docs/d/efs_mount_target.html.markdown @@ -12,7 +12,7 @@ Provides information about an Elastic File System Mount Target (EFS). ## Example Usage -```hcl +```terraform variable "mount_target_id" { type = string default = "" diff --git a/website/docs/d/eip.html.markdown b/website/docs/d/eip.html.markdown index 074e6c0a409..639c296fe0d 100644 --- a/website/docs/d/eip.html.markdown +++ b/website/docs/d/eip.html.markdown @@ -14,7 +14,7 @@ description: |- ### Search By Allocation ID (VPC only) -```hcl +```terraform data "aws_eip" "by_allocation_id" { id = "eipalloc-12345678" } @@ -22,7 +22,7 @@ data "aws_eip" "by_allocation_id" { ### Search By Filters (EC2-Classic or VPC) -```hcl +```terraform data "aws_eip" "by_filter" { filter { name = "tag:Name" @@ -33,7 +33,7 @@ data "aws_eip" "by_filter" { ### Search By Public IP (EC2-Classic or VPC) -```hcl +```terraform data "aws_eip" "by_public_ip" { public_ip = "1.2.3.4" } @@ -41,7 +41,7 @@ data "aws_eip" "by_public_ip" { ### Search By Tags (EC2-Classic or VPC) -```hcl +```terraform data "aws_eip" "by_tags" { tags = { Name = "exampleNameTagValue" diff --git a/website/docs/d/eks_cluster.html.markdown b/website/docs/d/eks_cluster.html.markdown index 73cd492245e..d01b573e2a0 100644 --- a/website/docs/d/eks_cluster.html.markdown +++ b/website/docs/d/eks_cluster.html.markdown @@ -12,7 +12,7 @@ Retrieve information about an EKS Cluster. ## Example Usage -```hcl +```terraform data "aws_eks_cluster" "example" { name = "example" } diff --git a/website/docs/d/eks_cluster_auth.html.markdown b/website/docs/d/eks_cluster_auth.html.markdown index 33e8393868a..88ba9f45189 100644 --- a/website/docs/d/eks_cluster_auth.html.markdown +++ b/website/docs/d/eks_cluster_auth.html.markdown @@ -19,7 +19,7 @@ server configured. ## Example Usage -```hcl +```terraform data "aws_eks_cluster" "example" { name = "example" } diff --git a/website/docs/d/elastic_beanstalk_application.html.markdown b/website/docs/d/elastic_beanstalk_application.html.markdown index 5006099f8e0..ee1186f0e57 100644 --- a/website/docs/d/elastic_beanstalk_application.html.markdown +++ b/website/docs/d/elastic_beanstalk_application.html.markdown @@ -12,7 +12,7 @@ Retrieve information about an Elastic Beanstalk Application. ## Example Usage -```hcl +```terraform data "aws_elastic_beanstalk_application" "example" { name = "example" } diff --git a/website/docs/d/elastic_beanstalk_hosted_zone.html.markdown b/website/docs/d/elastic_beanstalk_hosted_zone.html.markdown index 90622dda362..a3e7251d6ae 100644 --- a/website/docs/d/elastic_beanstalk_hosted_zone.html.markdown +++ b/website/docs/d/elastic_beanstalk_hosted_zone.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the ID of an [elastic beanstalk hosted zone](http:// ## Example Usage -```hcl +```terraform data "aws_elastic_beanstalk_hosted_zone" "current" {} ``` diff --git a/website/docs/d/elastic_beanstalk_solution_stack.html.markdown b/website/docs/d/elastic_beanstalk_solution_stack.html.markdown index b1e64f942b9..f0f6d7ae205 100644 --- a/website/docs/d/elastic_beanstalk_solution_stack.html.markdown +++ b/website/docs/d/elastic_beanstalk_solution_stack.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the name of a elastic beanstalk solution stack. ## Example Usage -```hcl +```terraform data "aws_elastic_beanstalk_solution_stack" "multi_docker" { most_recent = true diff --git a/website/docs/d/elasticache_cluster.html.markdown b/website/docs/d/elasticache_cluster.html.markdown index fb85f465755..a828e553fe7 100644 --- a/website/docs/d/elasticache_cluster.html.markdown +++ b/website/docs/d/elasticache_cluster.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an Elasticache Cluster ## Example Usage -```hcl +```terraform data "aws_elasticache_cluster" "my_cluster" { cluster_id = "my-cluster-id" } diff --git a/website/docs/d/elasticache_replication_group.html.markdown b/website/docs/d/elasticache_replication_group.html.markdown index e7bbee50949..04506f170de 100644 --- a/website/docs/d/elasticache_replication_group.html.markdown +++ b/website/docs/d/elasticache_replication_group.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an Elasticache Replication Group. ## Example Usage -```hcl +```terraform data "aws_elasticache_replication_group" "bar" { replication_group_id = "example" } diff --git a/website/docs/d/elasticsearch_domain.html.markdown b/website/docs/d/elasticsearch_domain.html.markdown index b89efdf06b9..39ee83d88d4 100644 --- a/website/docs/d/elasticsearch_domain.html.markdown +++ b/website/docs/d/elasticsearch_domain.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an Elasticsearch Domain ## Example Usage -```hcl +```terraform data "aws_elasticsearch_domain" "my_domain" { domain_name = "my-domain-name" } diff --git a/website/docs/d/elb.html.markdown b/website/docs/d/elb.html.markdown index e68e1db0204..125a10843af 100644 --- a/website/docs/d/elb.html.markdown +++ b/website/docs/d/elb.html.markdown @@ -18,7 +18,7 @@ with it, etc. ## Example Usage -```hcl +```terraform variable "lb_name" { type = string default = "" diff --git a/website/docs/d/elb_hosted_zone_id.html.markdown b/website/docs/d/elb_hosted_zone_id.html.markdown index 51207333a75..bbcb6a80425 100644 --- a/website/docs/d/elb_hosted_zone_id.html.markdown +++ b/website/docs/d/elb_hosted_zone_id.html.markdown @@ -13,7 +13,7 @@ in a given region for the purpose of using in an AWS Route53 Alias. ## Example Usage -```hcl +```terraform data "aws_elb_hosted_zone_id" "main" {} resource "aws_route53_record" "www" { diff --git a/website/docs/d/elb_service_account.html.markdown b/website/docs/d/elb_service_account.html.markdown index b1c1f87443f..1495e8729a4 100644 --- a/website/docs/d/elb_service_account.html.markdown +++ b/website/docs/d/elb_service_account.html.markdown @@ -13,7 +13,7 @@ in a given region for the purpose of permitting in S3 bucket policy. ## Example Usage -```hcl +```terraform data "aws_elb_service_account" "main" {} resource "aws_s3_bucket" "elb_logs" { diff --git a/website/docs/d/glue_script.html.markdown b/website/docs/d/glue_script.html.markdown index ed8839695bc..63fbdc8ca94 100644 --- a/website/docs/d/glue_script.html.markdown +++ b/website/docs/d/glue_script.html.markdown @@ -14,7 +14,7 @@ Use this data source to generate a Glue script from a Directed Acyclic Graph (DA ### Generate Python Script -```hcl +```terraform data "aws_glue_script" "example" { language = "PYTHON" @@ -116,7 +116,7 @@ output "python_script" { ### Generate Scala Code -```hcl +```terraform data "aws_glue_script" "example" { language = "SCALA" diff --git a/website/docs/d/guardduty_detector.html.markdown b/website/docs/d/guardduty_detector.html.markdown index 3b4a3013297..bdffbdbda4e 100644 --- a/website/docs/d/guardduty_detector.html.markdown +++ b/website/docs/d/guardduty_detector.html.markdown @@ -12,7 +12,7 @@ Retrieve information about a GuardDuty detector. ## Example Usage -```hcl +```terraform data "aws_guardduty_detector" "example" {} ``` diff --git a/website/docs/d/iam_account_alias.html.markdown b/website/docs/d/iam_account_alias.html.markdown index 53a1aba0cff..181a98e8d65 100644 --- a/website/docs/d/iam_account_alias.html.markdown +++ b/website/docs/d/iam_account_alias.html.markdown @@ -14,7 +14,7 @@ for the effective account in which Terraform is working. ## Example Usage -```hcl +```terraform data "aws_iam_account_alias" "current" {} output "account_id" { diff --git a/website/docs/d/iam_group.html.markdown b/website/docs/d/iam_group.html.markdown index 7f4085df90a..7cfb6168f73 100644 --- a/website/docs/d/iam_group.html.markdown +++ b/website/docs/d/iam_group.html.markdown @@ -14,7 +14,7 @@ properties without having to hard code ARNs as input. ## Example Usage -```hcl +```terraform data "aws_iam_group" "example" { group_name = "an_example_group_name" } diff --git a/website/docs/d/iam_instance_profile.html.markdown b/website/docs/d/iam_instance_profile.html.markdown index 25c51eb1cf4..962c28794a4 100644 --- a/website/docs/d/iam_instance_profile.html.markdown +++ b/website/docs/d/iam_instance_profile.html.markdown @@ -14,7 +14,7 @@ instance profile properties without having to hard code ARNs as input. ## Example Usage -```hcl +```terraform data "aws_iam_instance_profile" "example" { name = "an_example_instance_profile_name" } diff --git a/website/docs/d/iam_policy.html.markdown b/website/docs/d/iam_policy.html.markdown index e4023ab4813..8014258bb36 100644 --- a/website/docs/d/iam_policy.html.markdown +++ b/website/docs/d/iam_policy.html.markdown @@ -13,7 +13,7 @@ IAM policy. ## Example Usage -```hcl +```terraform data "aws_iam_policy" "example" { arn = "arn:aws:iam::123456789012:policy/UsersManageOwnCredentials" } diff --git a/website/docs/d/iam_policy_document.html.markdown b/website/docs/d/iam_policy_document.html.markdown index dc815f5b799..10f57f9537c 100644 --- a/website/docs/d/iam_policy_document.html.markdown +++ b/website/docs/d/iam_policy_document.html.markdown @@ -20,7 +20,7 @@ Using this data source to generate policy documents is *optional*. It is also va ### Basic Example -```hcl +```terraform data "aws_iam_policy_document" "example" { statement { sid = "1" @@ -79,7 +79,7 @@ resource "aws_iam_policy" "example" { You can specify multiple principal blocks with different types. You can also use this data source to generate an assume-role policy. -```hcl +```terraform data "aws_iam_policy_document" "event_stream_bucket_role_assume_role_policy" { statement { actions = ["sts:AssumeRole"] @@ -104,7 +104,7 @@ data "aws_iam_policy_document" "event_stream_bucket_role_assume_role_policy" { ### Example Using A Source Document -```hcl +```terraform data "aws_iam_policy_document" "source" { statement { actions = ["ec2:*"] @@ -162,7 +162,7 @@ data "aws_iam_policy_document" "source_json_example" { ### Example Using An Override Document -```hcl +```terraform data "aws_iam_policy_document" "override" { statement { sid = "SidToOverride" @@ -219,7 +219,7 @@ data "aws_iam_policy_document" "override_json_example" { You can also combine `source_json` and `override_json` in the same document. -```hcl +```terraform data "aws_iam_policy_document" "source" { statement { sid = "OverridePlaceholder" @@ -262,7 +262,7 @@ data "aws_iam_policy_document" "politik" { Multiple documents can be combined using the `source_policy_documents` or `override_policy_documents` attributes. `source_policy_documents` requires that all documents have unique Sids, while `override_policy_documents` will iteratively override matching Sids. -```hcl +```terraform data "aws_iam_policy_document" "source_one" { statement { actions = ["ec2:*"] @@ -335,7 +335,7 @@ data "aws_iam_policy_document" "combined" { ### Example of Merging Override Documents -```hcl +```terraform data "aws_iam_policy_document" "policy_one" { statement { sid = "OverridePlaceHolderOne" diff --git a/website/docs/d/iam_role.html.markdown b/website/docs/d/iam_role.html.markdown index cccb6126893..7a960aec697 100644 --- a/website/docs/d/iam_role.html.markdown +++ b/website/docs/d/iam_role.html.markdown @@ -14,7 +14,7 @@ properties without having to hard code ARNs as input. ## Example Usage -```hcl +```terraform data "aws_iam_role" "example" { name = "an_example_role_name" } diff --git a/website/docs/d/iam_server_certificate.html.markdown b/website/docs/d/iam_server_certificate.html.markdown index 9de287cbfac..806c302bdd2 100644 --- a/website/docs/d/iam_server_certificate.html.markdown +++ b/website/docs/d/iam_server_certificate.html.markdown @@ -12,7 +12,7 @@ Use this data source to lookup information about IAM Server Certificates. ## Example Usage -```hcl +```terraform data "aws_iam_server_certificate" "my-domain" { name_prefix = "my-domain.org" latest = true diff --git a/website/docs/d/iam_user.html.markdown b/website/docs/d/iam_user.html.markdown index 803020737bb..62ee28b0b03 100644 --- a/website/docs/d/iam_user.html.markdown +++ b/website/docs/d/iam_user.html.markdown @@ -14,7 +14,7 @@ properties without having to hard code ARNs or unique IDs as input. ## Example Usage -```hcl +```terraform data "aws_iam_user" "example" { user_name = "an_example_user_name" } diff --git a/website/docs/d/identitystore_group.html.markdown b/website/docs/d/identitystore_group.html.markdown index 274e2606504..2e00896d504 100644 --- a/website/docs/d/identitystore_group.html.markdown +++ b/website/docs/d/identitystore_group.html.markdown @@ -12,7 +12,7 @@ Use this data source to get an Identity Store Group. ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} data "aws_identitystore_group" "example" { diff --git a/website/docs/d/identitystore_user.html.markdown b/website/docs/d/identitystore_user.html.markdown index f5275130e0a..b558d9c70b0 100644 --- a/website/docs/d/identitystore_user.html.markdown +++ b/website/docs/d/identitystore_user.html.markdown @@ -12,7 +12,7 @@ Use this data source to get an Identity Store User. ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} data "aws_identitystore_user" "example" { diff --git a/website/docs/d/imagebuilder_component.html.markdown b/website/docs/d/imagebuilder_component.html.markdown index 13c903cb3bf..7dd2fbec63e 100644 --- a/website/docs/d/imagebuilder_component.html.markdown +++ b/website/docs/d/imagebuilder_component.html.markdown @@ -12,7 +12,7 @@ Provides details about an Image Builder Component. ## Example Usage -```hcl +```terraform data "aws_imagebuilder_component" "example" { arn = "arn:aws:imagebuilder:us-west-2:aws:component/amazon-cloudwatch-agent-linux/1.0.0" } diff --git a/website/docs/d/imagebuilder_distribution_configuration.html.markdown b/website/docs/d/imagebuilder_distribution_configuration.html.markdown index 335a8d6a74d..7064f4acea2 100644 --- a/website/docs/d/imagebuilder_distribution_configuration.html.markdown +++ b/website/docs/d/imagebuilder_distribution_configuration.html.markdown @@ -12,7 +12,7 @@ Provides details about an Image Builder Distribution Configuration. ## Example Usage -```hcl +```terraform data "aws_imagebuilder_distribution_configuration" "example" { arn = "arn:aws:imagebuilder:us-west-2:aws:distribution-configuration/example" } diff --git a/website/docs/d/imagebuilder_image.html.markdown b/website/docs/d/imagebuilder_image.html.markdown index 81d871924d0..72043b2ea6b 100644 --- a/website/docs/d/imagebuilder_image.html.markdown +++ b/website/docs/d/imagebuilder_image.html.markdown @@ -14,7 +14,7 @@ Provides details about an Image Builder Image. ### Latest -```hcl +```terraform data "aws_imagebuilder_image" "example" { arn = "arn:aws:imagebuilder:us-west-2:aws:image/amazon-linux-2-x86/x.x.x" } diff --git a/website/docs/d/imagebuilder_image_pipeline.html.markdown b/website/docs/d/imagebuilder_image_pipeline.html.markdown index 76d976e40ea..2e63d07fad7 100644 --- a/website/docs/d/imagebuilder_image_pipeline.html.markdown +++ b/website/docs/d/imagebuilder_image_pipeline.html.markdown @@ -12,7 +12,7 @@ Provides details about an Image Builder Image Pipeline. ## Example Usage -```hcl +```terraform data "aws_imagebuilder_image_pipeline" "example" { arn = "arn:aws:imagebuilder:us-west-2:aws:image-pipeline/example" } diff --git a/website/docs/d/imagebuilder_image_recipe.html.markdown b/website/docs/d/imagebuilder_image_recipe.html.markdown index a4d753fd380..dbd0ef09342 100644 --- a/website/docs/d/imagebuilder_image_recipe.html.markdown +++ b/website/docs/d/imagebuilder_image_recipe.html.markdown @@ -12,7 +12,7 @@ Provides details about an Image Builder Image Recipe. ## Example Usage -```hcl +```terraform data "aws_imagebuilder_image_recipe" "example" { arn = "arn:aws:imagebuilder:us-east-1:aws:image-recipe/example/1.0.0" } diff --git a/website/docs/d/imagebuilder_infrastructure_configuration.html.markdown b/website/docs/d/imagebuilder_infrastructure_configuration.html.markdown index a7e81dbd3c0..6b40dcccc12 100644 --- a/website/docs/d/imagebuilder_infrastructure_configuration.html.markdown +++ b/website/docs/d/imagebuilder_infrastructure_configuration.html.markdown @@ -12,7 +12,7 @@ Provides details about an Image Builder Infrastructure Configuration. ## Example Usage -```hcl +```terraform data "aws_imagebuilder_infrastructure_configuration" "example" { arn = "arn:aws:imagebuilder:us-west-2:aws:infrastructure-configuration/example" } diff --git a/website/docs/d/inspector_rules_packages.html.markdown b/website/docs/d/inspector_rules_packages.html.markdown index ba2889c4e84..808f39be72e 100644 --- a/website/docs/d/inspector_rules_packages.html.markdown +++ b/website/docs/d/inspector_rules_packages.html.markdown @@ -14,7 +14,7 @@ configured in the provider. ## Example Usage -```hcl +```terraform # Declare the data source data "aws_inspector_rules_packages" "rules" {} diff --git a/website/docs/d/instance.html.markdown b/website/docs/d/instance.html.markdown index 11e83a511fc..911a7f06071 100644 --- a/website/docs/d/instance.html.markdown +++ b/website/docs/d/instance.html.markdown @@ -13,7 +13,7 @@ resources. ## Example Usage -```hcl +```terraform data "aws_instance" "foo" { instance_id = "i-instanceid" diff --git a/website/docs/d/instances.html.markdown b/website/docs/d/instances.html.markdown index 04c8ffb108f..633ed28b8af 100644 --- a/website/docs/d/instances.html.markdown +++ b/website/docs/d/instances.html.markdown @@ -23,7 +23,7 @@ and you'd need to re-run `apply` every time an instance comes up or dies. ## Example Usage -```hcl +```terraform data "aws_instances" "test" { instance_tags = { Role = "HardWorker" diff --git a/website/docs/d/internet_gateway.html.markdown b/website/docs/d/internet_gateway.html.markdown index efe81ced4d8..b311c816f6a 100644 --- a/website/docs/d/internet_gateway.html.markdown +++ b/website/docs/d/internet_gateway.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform variable "vpc_id" {} data "aws_internet_gateway" "default" { diff --git a/website/docs/d/iot_endpoint.html.markdown b/website/docs/d/iot_endpoint.html.markdown index ac93ae1d09a..e38e7ed2613 100644 --- a/website/docs/d/iot_endpoint.html.markdown +++ b/website/docs/d/iot_endpoint.html.markdown @@ -12,7 +12,7 @@ Returns a unique endpoint specific to the AWS account making the call. ## Example Usage -```hcl +```terraform data "aws_iot_endpoint" "example" {} resource "kubernetes_pod" "agent" { diff --git a/website/docs/d/ip_ranges.html.markdown b/website/docs/d/ip_ranges.html.markdown index a1d124215c4..a7d4d57b882 100644 --- a/website/docs/d/ip_ranges.html.markdown +++ b/website/docs/d/ip_ranges.html.markdown @@ -12,7 +12,7 @@ Use this data source to get the IP ranges of various AWS products and services. ## Example Usage -```hcl +```terraform data "aws_ip_ranges" "european_ec2" { regions = ["eu-west-1", "eu-central-1"] services = ["ec2"] diff --git a/website/docs/d/kinesis_stream.html.markdown b/website/docs/d/kinesis_stream.html.markdown index 6613e8e84ce..b6679da1d36 100644 --- a/website/docs/d/kinesis_stream.html.markdown +++ b/website/docs/d/kinesis_stream.html.markdown @@ -15,7 +15,7 @@ For more details, see the [Amazon Kinesis Documentation][1]. ## Example Usage -```hcl +```terraform data "aws_kinesis_stream" "stream" { name = "stream-name" } diff --git a/website/docs/d/kms_alias.html.markdown b/website/docs/d/kms_alias.html.markdown index 3a3fdbcc6f7..fcc65697801 100644 --- a/website/docs/d/kms_alias.html.markdown +++ b/website/docs/d/kms_alias.html.markdown @@ -14,7 +14,7 @@ without having to hard code the ARN as input. ## Example Usage -```hcl +```terraform data "aws_kms_alias" "s3" { name = "alias/aws/s3" } diff --git a/website/docs/d/kms_ciphertext.html.markdown b/website/docs/d/kms_ciphertext.html.markdown index 5f02b4fb020..8c8c8746b33 100644 --- a/website/docs/d/kms_ciphertext.html.markdown +++ b/website/docs/d/kms_ciphertext.html.markdown @@ -18,7 +18,7 @@ resource](/docs/providers/aws/r/kms_ciphertext.html). ## Example Usage -```hcl +```terraform resource "aws_kms_key" "oauth_config" { description = "oauth config" is_enabled = true diff --git a/website/docs/d/kms_key.html.markdown b/website/docs/d/kms_key.html.markdown index 450d397cdd3..c4b17293e14 100644 --- a/website/docs/d/kms_key.html.markdown +++ b/website/docs/d/kms_key.html.markdown @@ -15,7 +15,7 @@ without having to hard code the ARN as input. ## Example Usage -```hcl +```terraform data "aws_kms_key" "by_alias" { key_id = "alias/my-key" } diff --git a/website/docs/d/kms_secrets.html.markdown b/website/docs/d/kms_secrets.html.markdown index e3d0ca93557..a0d3077a9a7 100644 --- a/website/docs/d/kms_secrets.html.markdown +++ b/website/docs/d/kms_secrets.html.markdown @@ -26,7 +26,7 @@ AQECAHgaPa0J8WadplGCqqVAr4HNvDaFSQ+NaiwIBhmm6qDSFwAAAGIwYAYJKoZIhvcNAQcGoFMwUQIB That encrypted output can now be inserted into Terraform configurations without exposing the plaintext secret directly. -```hcl +```terraform data "aws_kms_secrets" "example" { secret { # ... potentially other configuration ... diff --git a/website/docs/d/lakeformation_data_lake_settings.html.markdown b/website/docs/d/lakeformation_data_lake_settings.html.markdown index 7babecaeacc..bb60ade6b6c 100644 --- a/website/docs/d/lakeformation_data_lake_settings.html.markdown +++ b/website/docs/d/lakeformation_data_lake_settings.html.markdown @@ -12,7 +12,7 @@ Get Lake Formation principals designated as data lake administrators and lists o ## Example Usage -```hcl +```terraform data "aws_lakeformation_data_lake_settings" "example" { catalog_id = "14916253649" } diff --git a/website/docs/d/lakeformation_permissions.html.markdown b/website/docs/d/lakeformation_permissions.html.markdown index 69872f971a2..05b943ddc4e 100644 --- a/website/docs/d/lakeformation_permissions.html.markdown +++ b/website/docs/d/lakeformation_permissions.html.markdown @@ -16,7 +16,7 @@ Get permissions for a principal to access metadata in the Data Catalog and data ### Permissions For A Lake Formation S3 Resource -```hcl +```terraform data "aws_lakeformation_permissions" "test" { principal = aws_iam_role.workflow_role.arn @@ -28,7 +28,7 @@ data "aws_lakeformation_permissions" "test" { ### Permissions For A Glue Catalog Database -```hcl +```terraform data "aws_lakeformation_permissions" "test" { principal = aws_iam_role.workflow_role.arn diff --git a/website/docs/d/lakeformation_resource.html.markdown b/website/docs/d/lakeformation_resource.html.markdown index 70285dc5019..6fe72805b73 100644 --- a/website/docs/d/lakeformation_resource.html.markdown +++ b/website/docs/d/lakeformation_resource.html.markdown @@ -12,7 +12,7 @@ Provides details about a Lake Formation resource. ## Example Usage -```hcl +```terraform data "aws_lakeformation_resource" "example" { arn = "arn:aws:s3:::tf-acc-test-9151654063908211878" } diff --git a/website/docs/d/lambda_alias.html.markdown b/website/docs/d/lambda_alias.html.markdown index b47756b6a46..72aa409d403 100644 --- a/website/docs/d/lambda_alias.html.markdown +++ b/website/docs/d/lambda_alias.html.markdown @@ -12,7 +12,7 @@ Provides information about a Lambda Alias. ## Example Usage -```hcl +```terraform data "aws_lambda_alias" "production" { function_name = "my-lambda-func" name = "production" diff --git a/website/docs/d/lambda_code_signing_config.html.markdown b/website/docs/d/lambda_code_signing_config.html.markdown index bc6da053030..1c15d128041 100644 --- a/website/docs/d/lambda_code_signing_config.html.markdown +++ b/website/docs/d/lambda_code_signing_config.html.markdown @@ -14,7 +14,7 @@ For information about Lambda code signing configurations and how to use them, se ## Example Usage -```hcl +```terraform data "aws_lambda_code_signing_config" "existing_csc" { arn = "arn:aws:lambda:${var.aws_region}:${var.aws_account}:code-signing-config:csc-0f6c334abcdea4d8b" } diff --git a/website/docs/d/lambda_function.html.markdown b/website/docs/d/lambda_function.html.markdown index 1e49d8b2980..a419a22c097 100644 --- a/website/docs/d/lambda_function.html.markdown +++ b/website/docs/d/lambda_function.html.markdown @@ -12,7 +12,7 @@ Provides information about a Lambda Function. ## Example Usage -```hcl +```terraform variable "function_name" { type = string } diff --git a/website/docs/d/lambda_invocation.html.markdown b/website/docs/d/lambda_invocation.html.markdown index 5d1c713a64a..cea394a446c 100644 --- a/website/docs/d/lambda_invocation.html.markdown +++ b/website/docs/d/lambda_invocation.html.markdown @@ -14,7 +14,7 @@ invocation type. ## Example Usage -```hcl +```terraform data "aws_lambda_invocation" "example" { function_name = aws_lambda_function.lambda_function_test.function_name diff --git a/website/docs/d/lambda_layer_version.html.markdown b/website/docs/d/lambda_layer_version.html.markdown index cedbf3831bf..dad69104d14 100644 --- a/website/docs/d/lambda_layer_version.html.markdown +++ b/website/docs/d/lambda_layer_version.html.markdown @@ -12,7 +12,7 @@ Provides information about a Lambda Layer Version. ## Example Usage -```hcl +```terraform variable "layer_name" { type = string } diff --git a/website/docs/d/launch_configuration.html.markdown b/website/docs/d/launch_configuration.html.markdown index 68702126a22..1fb1edfa3cf 100644 --- a/website/docs/d/launch_configuration.html.markdown +++ b/website/docs/d/launch_configuration.html.markdown @@ -12,7 +12,7 @@ Provides information about a Launch Configuration. ## Example Usage -```hcl +```terraform data "aws_launch_configuration" "ubuntu" { name = "test-launch-config" } diff --git a/website/docs/d/launch_template.html.markdown b/website/docs/d/launch_template.html.markdown index d84ba31afae..8e060dea818 100644 --- a/website/docs/d/launch_template.html.markdown +++ b/website/docs/d/launch_template.html.markdown @@ -12,7 +12,7 @@ Provides information about a Launch Template. ## Example Usage -```hcl +```terraform data "aws_launch_template" "default" { name = "my-launch-template" } @@ -20,7 +20,7 @@ data "aws_launch_template" "default" { ### Filter -```hcl +```terraform data "aws_launch_template" "test" { filter { name = "launch-template-name" diff --git a/website/docs/d/lb.html.markdown b/website/docs/d/lb.html.markdown index d7d7747b8d3..341506f05aa 100644 --- a/website/docs/d/lb.html.markdown +++ b/website/docs/d/lb.html.markdown @@ -18,7 +18,7 @@ with it, etc. ## Example Usage -```hcl +```terraform variable "lb_arn" { type = string default = "" diff --git a/website/docs/d/lb_listener.html.markdown b/website/docs/d/lb_listener.html.markdown index c4a3318ad55..f4750f7a9ca 100644 --- a/website/docs/d/lb_listener.html.markdown +++ b/website/docs/d/lb_listener.html.markdown @@ -18,7 +18,7 @@ information specific to the listener in question. ## Example Usage -```hcl +```terraform # get listener from listener arn variable "listener_arn" { diff --git a/website/docs/d/lb_target_group.html.markdown b/website/docs/d/lb_target_group.html.markdown index 4455a346d0c..1eb2af9588c 100644 --- a/website/docs/d/lb_target_group.html.markdown +++ b/website/docs/d/lb_target_group.html.markdown @@ -18,7 +18,7 @@ an LB Target Group for use in other resources, given LB Target Group name. ## Example Usage -```hcl +```terraform variable "lb_tg_arn" { type = string default = "" diff --git a/website/docs/d/lex_bot.html.markdown b/website/docs/d/lex_bot.html.markdown index d90aa5149d2..f32ec10a705 100644 --- a/website/docs/d/lex_bot.html.markdown +++ b/website/docs/d/lex_bot.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Amazon Lex Bot. ## Example Usage -```hcl +```terraform data "aws_lex_bot" "order_flowers_bot" { name = "OrderFlowers" version = "$LATEST" diff --git a/website/docs/d/lex_bot_alias.html.markdown b/website/docs/d/lex_bot_alias.html.markdown index 4669fc501b5..2821c412c5d 100644 --- a/website/docs/d/lex_bot_alias.html.markdown +++ b/website/docs/d/lex_bot_alias.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Amazon Lex Bot Alias. ## Example Usage -```hcl +```terraform data "aws_lex_bot_alias" "order_flowers_prod" { bot_name = "OrderFlowers" name = "OrderFlowersProd" diff --git a/website/docs/d/lex_intent.html.markdown b/website/docs/d/lex_intent.html.markdown index dc2c2d4233b..fa49c4427a5 100644 --- a/website/docs/d/lex_intent.html.markdown +++ b/website/docs/d/lex_intent.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Amazon Lex Intent. ## Example Usage -```hcl +```terraform data "aws_lex_intent" "order_flowers" { name = "OrderFlowers" version = "$LATEST" diff --git a/website/docs/d/lex_slot_type.html.markdown b/website/docs/d/lex_slot_type.html.markdown index 9a424c07c54..143335b8368 100644 --- a/website/docs/d/lex_slot_type.html.markdown +++ b/website/docs/d/lex_slot_type.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Amazon Lex Slot Type. ## Example Usage -```hcl +```terraform data "aws_lex_slot_type" "flower_types" { name = "FlowerTypes" version = "1" diff --git a/website/docs/d/mq_broker.html.markdown b/website/docs/d/mq_broker.html.markdown index afb5d3ae903..6b456c775c4 100644 --- a/website/docs/d/mq_broker.html.markdown +++ b/website/docs/d/mq_broker.html.markdown @@ -12,7 +12,7 @@ Provides information about a MQ Broker. ## Example Usage -```hcl +```terraform variable "broker_id" { type = string default = "" diff --git a/website/docs/d/msk_cluster.html.markdown b/website/docs/d/msk_cluster.html.markdown index 48785c6adf6..a5ac3e56b3c 100644 --- a/website/docs/d/msk_cluster.html.markdown +++ b/website/docs/d/msk_cluster.html.markdown @@ -12,7 +12,7 @@ Get information on an Amazon MSK Cluster. ## Example Usage -```hcl +```terraform data "aws_msk_cluster" "example" { cluster_name = "example" } diff --git a/website/docs/d/msk_configuration.html.markdown b/website/docs/d/msk_configuration.html.markdown index 378c7e83db2..355b09f3b37 100644 --- a/website/docs/d/msk_configuration.html.markdown +++ b/website/docs/d/msk_configuration.html.markdown @@ -12,7 +12,7 @@ Get information on an Amazon MSK Configuration. ## Example Usage -```hcl +```terraform data "aws_msk_configuration" "example" { name = "example" } diff --git a/website/docs/d/nat_gateway.html.markdown b/website/docs/d/nat_gateway.html.markdown index 405839fe4a7..ab46bb1c75f 100644 --- a/website/docs/d/nat_gateway.html.markdown +++ b/website/docs/d/nat_gateway.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific Nat Gateway. ## Example Usage -```hcl +```terraform variable "subnet_id" {} data "aws_nat_gateway" "default" { @@ -22,7 +22,7 @@ data "aws_nat_gateway" "default" { Usage with tags: -```hcl +```terraform data "aws_nat_gateway" "default" { subnet_id = aws_subnet.public.id diff --git a/website/docs/d/neptune_engine_version.markdown b/website/docs/d/neptune_engine_version.markdown index dcfba421856..7f091376850 100644 --- a/website/docs/d/neptune_engine_version.markdown +++ b/website/docs/d/neptune_engine_version.markdown @@ -12,7 +12,7 @@ Information about a Neptune engine version. ## Example Usage -```hcl +```terraform data "aws_neptune_engine_version" "test" { preferred_versions = ["1.0.3.0", "1.0.2.2", "1.0.2.1"] } diff --git a/website/docs/d/neptune_orderable_db_instance.markdown b/website/docs/d/neptune_orderable_db_instance.markdown index f08da2b2784..65582a35180 100644 --- a/website/docs/d/neptune_orderable_db_instance.markdown +++ b/website/docs/d/neptune_orderable_db_instance.markdown @@ -12,7 +12,7 @@ Information about Neptune orderable DB instances. ## Example Usage -```hcl +```terraform data "aws_neptune_orderable_db_instance" "test" { engine_version = "1.0.3.0" preferred_instance_classes = ["db.r5.large", "db.r4.large", "db.t3.medium"] diff --git a/website/docs/d/network_acls.html.markdown b/website/docs/d/network_acls.html.markdown index dfd9d09153e..5a0d21ce824 100644 --- a/website/docs/d/network_acls.html.markdown +++ b/website/docs/d/network_acls.html.markdown @@ -12,7 +12,7 @@ description: |- The following shows outputing all network ACL ids in a vpc. -```hcl +```terraform data "aws_network_acls" "example" { vpc_id = var.vpc_id } @@ -25,7 +25,7 @@ output "example" { The following example retrieves a list of all network ACL ids in a VPC with a custom tag of `Tier` set to a value of "Private". -```hcl +```terraform data "aws_network_acls" "example" { vpc_id = var.vpc_id @@ -38,7 +38,7 @@ data "aws_network_acls" "example" { The following example retrieves a network ACL id in a VPC which associated with specific subnet. -```hcl +```terraform data "aws_network_acls" "example" { vpc_id = var.vpc_id diff --git a/website/docs/d/network_interface.html.markdown b/website/docs/d/network_interface.html.markdown index d1436d78831..05c8168804c 100644 --- a/website/docs/d/network_interface.html.markdown +++ b/website/docs/d/network_interface.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about a Network Interface. ## Example Usage -```hcl +```terraform data "aws_network_interface" "bar" { id = "eni-01234567" } diff --git a/website/docs/d/network_interfaces.html.markdown b/website/docs/d/network_interfaces.html.markdown index ebc3e3bad7b..0a5a6ec6c6b 100644 --- a/website/docs/d/network_interfaces.html.markdown +++ b/website/docs/d/network_interfaces.html.markdown @@ -12,7 +12,7 @@ description: |- The following shows outputing all network interface ids in a region. -```hcl +```terraform data "aws_network_interfaces" "example" {} output "example" { @@ -22,7 +22,7 @@ output "example" { The following example retrieves a list of all network interface ids with a custom tag of `Name` set to a value of `test`. -```hcl +```terraform data "aws_network_interfaces" "example" { tags = { Name = "test" @@ -37,7 +37,7 @@ output "example1" { The following example retrieves a network interface ids which associated with specific subnet. -```hcl +```terraform data "aws_network_interfaces" "example" { filter { name = "subnet-id" diff --git a/website/docs/d/organizations_organization.html.markdown b/website/docs/d/organizations_organization.html.markdown index b40f4f9c8a8..65a80e77172 100644 --- a/website/docs/d/organizations_organization.html.markdown +++ b/website/docs/d/organizations_organization.html.markdown @@ -14,7 +14,7 @@ Get information about the organization that the user's account belongs to ### List all account IDs for the organization -```hcl +```terraform data "aws_organizations_organization" "example" {} output "account_ids" { @@ -24,7 +24,7 @@ output "account_ids" { ### SNS topic that can be interacted by the organization only -```hcl +```terraform data "aws_organizations_organization" "example" {} resource "aws_sns_topic" "sns_topic" { diff --git a/website/docs/d/organizations_organizational_units.html.markdown b/website/docs/d/organizations_organizational_units.html.markdown index 4994ff7830c..fc1e1711cab 100644 --- a/website/docs/d/organizations_organizational_units.html.markdown +++ b/website/docs/d/organizations_organizational_units.html.markdown @@ -11,7 +11,7 @@ Get all direct child organizational units under a parent organizational unit. Th ## Example Usage -```hcl +```terraform data "aws_organizations_organization" "org" {} data "aws_organizations_organizational_units" "ou" { diff --git a/website/docs/d/outposts_outpost.html.markdown b/website/docs/d/outposts_outpost.html.markdown index 82c2ea1d47b..7b0de38d456 100644 --- a/website/docs/d/outposts_outpost.html.markdown +++ b/website/docs/d/outposts_outpost.html.markdown @@ -12,7 +12,7 @@ Provides details about an Outposts Outpost. ## Example Usage -```hcl +```terraform data "aws_outposts_outpost" "example" { name = "example" } diff --git a/website/docs/d/outposts_outpost_instance_type.html.markdown b/website/docs/d/outposts_outpost_instance_type.html.markdown index 9e148437068..0d75851c0d3 100644 --- a/website/docs/d/outposts_outpost_instance_type.html.markdown +++ b/website/docs/d/outposts_outpost_instance_type.html.markdown @@ -12,7 +12,7 @@ Information about single Outpost Instance Type. ## Example Usage -```hcl +```terraform data "aws_outposts_outpost_instance_type" "example" { arn = data.aws_outposts_outpost.example.arn preferred_instance_types = ["m5.large", "m5.4xlarge"] diff --git a/website/docs/d/outposts_outpost_instance_types.html.markdown b/website/docs/d/outposts_outpost_instance_types.html.markdown index 87303d1178f..ba36cf5eaf9 100644 --- a/website/docs/d/outposts_outpost_instance_types.html.markdown +++ b/website/docs/d/outposts_outpost_instance_types.html.markdown @@ -12,7 +12,7 @@ Information about Outposts Instance Types. ## Example Usage -```hcl +```terraform data "aws_outposts_outpost_instance_types" "example" { arn = data.aws_outposts_outpost.example.arn } diff --git a/website/docs/d/outposts_outposts.html.markdown b/website/docs/d/outposts_outposts.html.markdown index 9dddab04518..3ffb782bad2 100644 --- a/website/docs/d/outposts_outposts.html.markdown +++ b/website/docs/d/outposts_outposts.html.markdown @@ -12,7 +12,7 @@ Provides details about multiple Outposts. ## Example Usage -```hcl +```terraform data "aws_outposts_outposts" "example" { site_id = data.aws_outposts_site.id } diff --git a/website/docs/d/outposts_site.html.markdown b/website/docs/d/outposts_site.html.markdown index 91f366ab7e4..778e6ece86d 100644 --- a/website/docs/d/outposts_site.html.markdown +++ b/website/docs/d/outposts_site.html.markdown @@ -12,7 +12,7 @@ Provides details about an Outposts Site. ## Example Usage -```hcl +```terraform data "aws_outposts_site" "example" { name = "example" } diff --git a/website/docs/d/outposts_sites.html.markdown b/website/docs/d/outposts_sites.html.markdown index e749b32308f..c9e623578ab 100644 --- a/website/docs/d/outposts_sites.html.markdown +++ b/website/docs/d/outposts_sites.html.markdown @@ -12,7 +12,7 @@ Provides details about multiple Outposts Sites. ## Example Usage -```hcl +```terraform data "aws_outposts_sites" "all" {} ``` diff --git a/website/docs/d/partition.html.markdown b/website/docs/d/partition.html.markdown index 741ffd1b9b8..112e13d8df7 100644 --- a/website/docs/d/partition.html.markdown +++ b/website/docs/d/partition.html.markdown @@ -13,7 +13,7 @@ which Terraform is working. ## Example Usage -```hcl +```terraform data "aws_partition" "current" {} data "aws_iam_policy_document" "s3_policy" { diff --git a/website/docs/d/prefix_list.html.markdown b/website/docs/d/prefix_list.html.markdown index 0a0bc0fc04d..553d958e038 100644 --- a/website/docs/d/prefix_list.html.markdown +++ b/website/docs/d/prefix_list.html.markdown @@ -18,7 +18,7 @@ rules. ## Example Usage -```hcl +```terraform resource "aws_vpc_endpoint" "private_s3" { vpc_id = aws_vpc.foo.id service_name = "com.amazonaws.us-west-2.s3" @@ -46,7 +46,7 @@ resource "aws_network_acl_rule" "private_s3" { ### Filter -```hcl +```terraform data "aws_prefix_list" "test" { filter { name = "prefix-list-id" diff --git a/website/docs/d/pricing_product.html.markdown b/website/docs/d/pricing_product.html.markdown index 9fff6063410..d4337b1de12 100644 --- a/website/docs/d/pricing_product.html.markdown +++ b/website/docs/d/pricing_product.html.markdown @@ -13,7 +13,7 @@ This data source is only available in a us-east-1 or ap-south-1 provider. ## Example Usage -```hcl +```terraform data "aws_pricing_product" "example" { service_code = "AmazonEC2" @@ -54,7 +54,7 @@ data "aws_pricing_product" "example" { } ``` -```hcl +```terraform data "aws_pricing_product" "example" { service_code = "AmazonRedshift" diff --git a/website/docs/d/qldb_ledger.html.markdown b/website/docs/d/qldb_ledger.html.markdown index 874e26926b3..804abe17c9f 100644 --- a/website/docs/d/qldb_ledger.html.markdown +++ b/website/docs/d/qldb_ledger.html.markdown @@ -12,7 +12,7 @@ Use this data source to fetch information about a Quantum Ledger Database. ## Example Usage -```hcl +```terraform data "aws_qldb_ledger" "example" { name = "an_example_ledger" } diff --git a/website/docs/d/ram_resource_share.html.markdown b/website/docs/d/ram_resource_share.html.markdown index 28d4647ba92..b4433a6049e 100644 --- a/website/docs/d/ram_resource_share.html.markdown +++ b/website/docs/d/ram_resource_share.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_ram_resource_share" "example" { name = "example" resource_owner = "SELF" @@ -21,7 +21,7 @@ data "aws_ram_resource_share" "example" { ## Search by filters -```hcl +```terraform data "aws_ram_resource_share" "tag_filter" { name = "MyResourceName" resource_owner = "SELF" diff --git a/website/docs/d/rds_certificate.html.markdown b/website/docs/d/rds_certificate.html.markdown index e4a11beb31b..05ad0a8950a 100644 --- a/website/docs/d/rds_certificate.html.markdown +++ b/website/docs/d/rds_certificate.html.markdown @@ -12,7 +12,7 @@ Information about an RDS Certificate. ## Example Usage -```hcl +```terraform data "aws_rds_certificate" "example" { latest_valid_till = true } diff --git a/website/docs/d/rds_cluster.html.markdown b/website/docs/d/rds_cluster.html.markdown index 82fcd66693e..c8e78751d0e 100644 --- a/website/docs/d/rds_cluster.html.markdown +++ b/website/docs/d/rds_cluster.html.markdown @@ -12,7 +12,7 @@ Provides information about an RDS cluster. ## Example Usage -```hcl +```terraform data "aws_rds_cluster" "clusterName" { cluster_identifier = "clusterName" } diff --git a/website/docs/d/rds_engine_version.markdown b/website/docs/d/rds_engine_version.markdown index 5b2caa7c590..fa31a175a2f 100644 --- a/website/docs/d/rds_engine_version.markdown +++ b/website/docs/d/rds_engine_version.markdown @@ -12,7 +12,7 @@ Information about an RDS engine version. ## Example Usage -```hcl +```terraform data "aws_rds_engine_version" "test" { engine = "mysql" preferred_versions = ["5.7.42", "5.7.19", "5.7.17"] diff --git a/website/docs/d/rds_orderable_db_instance.markdown b/website/docs/d/rds_orderable_db_instance.markdown index ec9884bbdc1..7635e9928a4 100644 --- a/website/docs/d/rds_orderable_db_instance.markdown +++ b/website/docs/d/rds_orderable_db_instance.markdown @@ -12,7 +12,7 @@ Information about RDS orderable DB instances and valid parameter combinations. ## Example Usage -```hcl +```terraform data "aws_rds_orderable_db_instance" "test" { engine = "mysql" engine_version = "5.7.22" @@ -25,7 +25,7 @@ data "aws_rds_orderable_db_instance" "test" { Valid parameter combinations can also be found with `preferred_engine_versions` and/or `preferred_instance_classes`. -```hcl +```terraform data "aws_rds_orderable_db_instance" "test" { engine = "mysql" license_model = "general-public-license" diff --git a/website/docs/d/redshift_cluster.html.markdown b/website/docs/d/redshift_cluster.html.markdown index 15a6f21719a..f4be77cf712 100644 --- a/website/docs/d/redshift_cluster.html.markdown +++ b/website/docs/d/redshift_cluster.html.markdown @@ -12,7 +12,7 @@ Provides details about a specific redshift cluster. ## Example Usage -```hcl +```terraform data "aws_redshift_cluster" "test_cluster" { cluster_identifier = "test-cluster" } diff --git a/website/docs/d/redshift_orderable_cluster.html.markdown b/website/docs/d/redshift_orderable_cluster.html.markdown index b22dd82f8df..4cf7fdd9e38 100644 --- a/website/docs/d/redshift_orderable_cluster.html.markdown +++ b/website/docs/d/redshift_orderable_cluster.html.markdown @@ -12,7 +12,7 @@ Information about Redshift Orderable Clusters and valid parameter combinations. ## Example Usage -```hcl +```terraform data "aws_redshift_orderable_cluster" "test" { cluster_type = "multi-node" preferred_node_types = ["dc2.large", "ds2.xlarge"] diff --git a/website/docs/d/redshift_service_account.html.markdown b/website/docs/d/redshift_service_account.html.markdown index 75a7658aa31..3716f6213d9 100644 --- a/website/docs/d/redshift_service_account.html.markdown +++ b/website/docs/d/redshift_service_account.html.markdown @@ -13,7 +13,7 @@ in a given region for the purpose of allowing Redshift to store audit data in S3 ## Example Usage -```hcl +```terraform data "aws_redshift_service_account" "main" {} resource "aws_s3_bucket" "bucket" { diff --git a/website/docs/d/region.html.markdown b/website/docs/d/region.html.markdown index 5a2de0f9ffd..a1014c0564e 100644 --- a/website/docs/d/region.html.markdown +++ b/website/docs/d/region.html.markdown @@ -20,7 +20,7 @@ configuration from its parent module. The following example shows how the resource might be used to obtain the name of the AWS region configured on the provider. -```hcl +```terraform data "aws_region" "current" {} ``` diff --git a/website/docs/d/regions.html.markdown b/website/docs/d/regions.html.markdown index b34b171dd10..bc597a62fe9 100644 --- a/website/docs/d/regions.html.markdown +++ b/website/docs/d/regions.html.markdown @@ -14,13 +14,13 @@ Provides information about AWS Regions. Can be used to filter regions i.e. by Op Enabled AWS Regions: -```hcl +```terraform data "aws_regions" "current" {} ``` All the regions regardless of the availability -```hcl +```terraform data "aws_regions" "current" { all_regions = true } @@ -28,7 +28,7 @@ data "aws_regions" "current" { To see regions that are filtered by `"not-opted-in"`, the `all_regions` argument needs to be set to `true` or no results will be returned. -```hcl +```terraform data "aws_regions" "current" { all_regions = true diff --git a/website/docs/d/route.html.markdown b/website/docs/d/route.html.markdown index 9ce2b8fedb9..af334618969 100644 --- a/website/docs/d/route.html.markdown +++ b/website/docs/d/route.html.markdown @@ -19,7 +19,7 @@ connection associated with a CIDR value. The following example shows how one might use a CIDR value to find a network interface id and use this to create a data source of that network interface. -```hcl +```terraform variable "subnet_id" {} data "aws_route_table" "selected" { diff --git a/website/docs/d/route53_delegation_set.html.markdown b/website/docs/d/route53_delegation_set.html.markdown index 0b262490fef..8e1c9b8591d 100644 --- a/website/docs/d/route53_delegation_set.html.markdown +++ b/website/docs/d/route53_delegation_set.html.markdown @@ -16,7 +16,7 @@ This data source allows to find a list of name servers associated with a specifi The following example shows how to get a delegation set from its id. -```hcl +```terraform data "aws_route53_delegation_set" "dset" { id = "MQWGHCBFAKEID" } diff --git a/website/docs/d/route53_resolver_endpoint.html.markdown b/website/docs/d/route53_resolver_endpoint.html.markdown index f6a112ce300..f6dc2fc2374 100644 --- a/website/docs/d/route53_resolver_endpoint.html.markdown +++ b/website/docs/d/route53_resolver_endpoint.html.markdown @@ -14,13 +14,13 @@ This data source allows to find a list of IPaddresses associated with a specific ## Example Usage -```hcl +```terraform data "aws_route53_resolver_endpoint" "example" { resolver_endpoint_id = "rslvr-in-1abc2345ef678g91h" } ``` -```hcl +```terraform data "aws_route53_resolver_endpoint" "example" { filter { name = "NAME" diff --git a/website/docs/d/route53_resolver_rule.html.markdown b/website/docs/d/route53_resolver_rule.html.markdown index dff5a5b1e64..3b408cfc032 100644 --- a/website/docs/d/route53_resolver_rule.html.markdown +++ b/website/docs/d/route53_resolver_rule.html.markdown @@ -14,7 +14,7 @@ description: |- The following example shows how to get a Route53 Resolver rule based on its associated domain name and rule type. -```hcl +```terraform data "aws_route53_resolver_rule" "example" { domain_name = "subdomain.example.com" rule_type = "SYSTEM" diff --git a/website/docs/d/route53_resolver_rules.html.markdown b/website/docs/d/route53_resolver_rules.html.markdown index dde2f13b699..232f072f9b2 100644 --- a/website/docs/d/route53_resolver_rules.html.markdown +++ b/website/docs/d/route53_resolver_rules.html.markdown @@ -14,7 +14,7 @@ description: |- Retrieving the default resolver rule. -```hcl +```terraform data "aws_route53_resolver_rules" "example" { owner_id = "Route 53 Resolver" rule_type = "RECURSIVE" @@ -22,7 +22,7 @@ data "aws_route53_resolver_rules" "example" { } ``` -```hcl +```terraform data "aws_route53_resolver_rules" "example" { rule_type = "FORWARD" share_status = "SHARED_WITH_ME" diff --git a/website/docs/d/route53_zone.html.markdown b/website/docs/d/route53_zone.html.markdown index bcf14106c03..d5074f708f2 100644 --- a/website/docs/d/route53_zone.html.markdown +++ b/website/docs/d/route53_zone.html.markdown @@ -17,7 +17,7 @@ This data source allows to find a Hosted Zone ID given Hosted Zone name and cert The following example shows how to get a Hosted Zone from its name and from this data how to create a Record Set. -```hcl +```terraform data "aws_route53_zone" "selected" { name = "test.com." private_zone = true diff --git a/website/docs/d/route_table.html.markdown b/website/docs/d/route_table.html.markdown index b2f8caefd46..d88999387fd 100644 --- a/website/docs/d/route_table.html.markdown +++ b/website/docs/d/route_table.html.markdown @@ -16,7 +16,7 @@ This resource can prove useful when a module accepts a Subnet ID as an input var The following example shows how one might accept a Route Table ID as a variable and use this data source to obtain the data necessary to create a route. -```hcl +```terraform variable "subnet_id" {} data "aws_route_table" "selected" { diff --git a/website/docs/d/route_tables.html.markdown b/website/docs/d/route_tables.html.markdown index bb66ba77c0c..98733cad730 100644 --- a/website/docs/d/route_tables.html.markdown +++ b/website/docs/d/route_tables.html.markdown @@ -16,7 +16,7 @@ The following adds a route for a particular cidr block to every (private kops) route table in a specified vpc to use a particular vpc peering connection. -```hcl +```terraform data "aws_route_tables" "rts" { vpc_id = var.vpc_id diff --git a/website/docs/d/s3_bucket.html.markdown b/website/docs/d/s3_bucket.html.markdown index 17bf0742c32..f7f717a160b 100644 --- a/website/docs/d/s3_bucket.html.markdown +++ b/website/docs/d/s3_bucket.html.markdown @@ -17,7 +17,7 @@ Distribution. ### Route53 Record -```hcl +```terraform data "aws_s3_bucket" "selected" { bucket = "bucket.test.com" } @@ -40,7 +40,7 @@ resource "aws_route53_record" "example" { ### CloudFront Origin -```hcl +```terraform data "aws_s3_bucket" "selected" { bucket = "a-test-bucket" } diff --git a/website/docs/d/s3_bucket_object.html.markdown b/website/docs/d/s3_bucket_object.html.markdown index dd305c107cb..494f0217ca2 100644 --- a/website/docs/d/s3_bucket_object.html.markdown +++ b/website/docs/d/s3_bucket_object.html.markdown @@ -18,7 +18,7 @@ _optionally_ (see below) content of an object stored inside S3 bucket. The following example retrieves a text object (which must have a `Content-Type` value starting with `text/`) and uses it as the `user_data` for an EC2 instance: -```hcl +```terraform data "aws_s3_bucket_object" "bootstrap_script" { bucket = "ourcorp-deploy-config" key = "ec2-bootstrap-script.sh" @@ -37,7 +37,7 @@ to AWS Lambda for use as a function implementation. More information about Lambda functions is available in the documentation for [`aws_lambda_function`](/docs/providers/aws/r/lambda_function.html). -```hcl +```terraform data "aws_s3_bucket_object" "lambda" { bucket = "ourcorp-lambda-functions" key = "hello-world.zip" diff --git a/website/docs/d/s3_bucket_objects.html.markdown b/website/docs/d/s3_bucket_objects.html.markdown index eb467392e5f..8e246023c1f 100644 --- a/website/docs/d/s3_bucket_objects.html.markdown +++ b/website/docs/d/s3_bucket_objects.html.markdown @@ -16,7 +16,7 @@ The bucket-objects data source returns keys (i.e., file names) and other metadat The following example retrieves a list of all object keys in an S3 bucket and creates corresponding Terraform object data sources: -```hcl +```terraform data "aws_s3_bucket_objects" "my_objects" { bucket = "ourcorp" } diff --git a/website/docs/d/sagemaker_prebuilt_ecr_image.html.markdown b/website/docs/d/sagemaker_prebuilt_ecr_image.html.markdown index 229d47bf490..39b057083fe 100644 --- a/website/docs/d/sagemaker_prebuilt_ecr_image.html.markdown +++ b/website/docs/d/sagemaker_prebuilt_ecr_image.html.markdown @@ -16,7 +16,7 @@ Get information about prebuilt Amazon SageMaker Docker images. Basic usage: -```hcl +```terraform data "aws_sagemaker_prebuilt_ecr_image" "test" { repository_name = "sagemaker-scikit-learn" image_tag = "2.2-1.0.11.0" diff --git a/website/docs/d/secretsmanager_secret.html.markdown b/website/docs/d/secretsmanager_secret.html.markdown index eb886f19209..d7f064d6277 100644 --- a/website/docs/d/secretsmanager_secret.html.markdown +++ b/website/docs/d/secretsmanager_secret.html.markdown @@ -14,7 +14,7 @@ Retrieve metadata information about a Secrets Manager secret. To retrieve a secr ### ARN -```hcl +```terraform data "aws_secretsmanager_secret" "by-arn" { arn = "arn:aws:secretsmanager:us-east-1:123456789012:secret:example-123456" } @@ -22,7 +22,7 @@ data "aws_secretsmanager_secret" "by-arn" { ### Name -```hcl +```terraform data "aws_secretsmanager_secret" "by-name" { name = "example" } diff --git a/website/docs/d/secretsmanager_secret_rotation.html.markdown b/website/docs/d/secretsmanager_secret_rotation.html.markdown index 23f641920bd..7f155187d89 100644 --- a/website/docs/d/secretsmanager_secret_rotation.html.markdown +++ b/website/docs/d/secretsmanager_secret_rotation.html.markdown @@ -14,7 +14,7 @@ Retrieve information about a Secrets Manager secret rotation. To retrieve secret ### Retrieve Secret Rotation Configuration -```hcl +```terraform data "aws_secretsmanager_secret_rotation" "example" { secret_id = data.aws_secretsmanager_secret.example.id } diff --git a/website/docs/d/secretsmanager_secret_version.html.markdown b/website/docs/d/secretsmanager_secret_version.html.markdown index 6cd6e930ef7..c3c21861247 100644 --- a/website/docs/d/secretsmanager_secret_version.html.markdown +++ b/website/docs/d/secretsmanager_secret_version.html.markdown @@ -16,7 +16,7 @@ Retrieve information about a Secrets Manager secret version, including its secre By default, this data sources retrieves information based on the `AWSCURRENT` staging label. -```hcl +```terraform data "aws_secretsmanager_secret_version" "example" { secret_id = data.aws_secretsmanager_secret.example.id } @@ -24,7 +24,7 @@ data "aws_secretsmanager_secret_version" "example" { ### Retrieve Specific Secret Version -```hcl +```terraform data "aws_secretsmanager_secret_version" "by-version-stage" { secret_id = data.aws_secretsmanager_secret.example.id version_stage = "example" @@ -35,7 +35,7 @@ data "aws_secretsmanager_secret_version" "by-version-stage" { Reading key-value pairs from JSON back into a native Terraform map can be accomplished in Terraform 0.12 and later with the [`jsondecode()` function](https://www.terraform.io/docs/configuration/functions/jsondecode.html): -```hcl +```terraform output "example" { value = jsondecode(data.aws_secretsmanager_secret_version.example.secret_string)["key1"] } diff --git a/website/docs/d/security_group.html.markdown b/website/docs/d/security_group.html.markdown index 181a2e51799..c9efe9aa0f2 100644 --- a/website/docs/d/security_group.html.markdown +++ b/website/docs/d/security_group.html.markdown @@ -19,7 +19,7 @@ VPC that the security group belongs to. The following example shows how one might accept a Security Group id as a variable and use this data source to obtain the data necessary to create a subnet. -```hcl +```terraform variable "security_group_id" {} data "aws_security_group" "selected" { diff --git a/website/docs/d/security_groups.html.markdown b/website/docs/d/security_groups.html.markdown index 07c6f259133..28aa0ee99e9 100644 --- a/website/docs/d/security_groups.html.markdown +++ b/website/docs/d/security_groups.html.markdown @@ -12,7 +12,7 @@ Use this data source to get IDs and VPC membership of Security Groups that are c ## Example Usage -```hcl +```terraform data "aws_security_groups" "test" { tags = { Application = "k8s" @@ -21,7 +21,7 @@ data "aws_security_groups" "test" { } ``` -```hcl +```terraform data "aws_security_groups" "test" { filter { name = "group-name" diff --git a/website/docs/d/serverlessapplicationrepository_application.html.markdown b/website/docs/d/serverlessapplicationrepository_application.html.markdown index 939c006e781..7c45c8d3ac3 100644 --- a/website/docs/d/serverlessapplicationrepository_application.html.markdown +++ b/website/docs/d/serverlessapplicationrepository_application.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about an AWS Serverless Application Repo ## Example Usage -```hcl +```terraform data "aws_serverlessapplicationrepository_application" "example" { application_id = "arn:aws:serverlessrepo:us-east-1:123456789012:applications/ExampleApplication" } diff --git a/website/docs/d/servicequotas_service.html.markdown b/website/docs/d/servicequotas_service.html.markdown index c0716465c36..a3d593d833e 100644 --- a/website/docs/d/servicequotas_service.html.markdown +++ b/website/docs/d/servicequotas_service.html.markdown @@ -12,7 +12,7 @@ Retrieve information about a Service Quotas Service. ## Example Usage -```hcl +```terraform data "aws_servicequotas_service" "example" { service_name = "Amazon Virtual Private Cloud (Amazon VPC)" } diff --git a/website/docs/d/servicequotas_service_quota.html.markdown b/website/docs/d/servicequotas_service_quota.html.markdown index 928ef0d5f58..a92ce39eebc 100644 --- a/website/docs/d/servicequotas_service_quota.html.markdown +++ b/website/docs/d/servicequotas_service_quota.html.markdown @@ -12,7 +12,7 @@ Retrieve information about a Service Quota. ## Example Usage -```hcl +```terraform data "aws_servicequotas_service_quota" "by_quota_code" { quota_code = "L-F678F1CE" service_code = "vpc" diff --git a/website/docs/d/sfn_activity.html.markdown b/website/docs/d/sfn_activity.html.markdown index 365c576c63c..99311462731 100644 --- a/website/docs/d/sfn_activity.html.markdown +++ b/website/docs/d/sfn_activity.html.markdown @@ -12,7 +12,7 @@ Provides a Step Functions Activity data source ## Example Usage -```hcl +```terraform data "aws_sfn_activity" "sfn_activity" { name = "my-activity" } diff --git a/website/docs/d/sfn_state_machine.html.markdown b/website/docs/d/sfn_state_machine.html.markdown index f418cbea419..386f202646d 100644 --- a/website/docs/d/sfn_state_machine.html.markdown +++ b/website/docs/d/sfn_state_machine.html.markdown @@ -14,7 +14,7 @@ state machine without having to hard code the ARNs as input. ## Example Usage -```hcl +```terraform data "aws_sfn_state_machine" "example" { name = "an_example_sfn_name" } diff --git a/website/docs/d/signer_signing_job.html.markdown b/website/docs/d/signer_signing_job.html.markdown index f85077e0724..672f46e7b59 100644 --- a/website/docs/d/signer_signing_job.html.markdown +++ b/website/docs/d/signer_signing_job.html.markdown @@ -12,7 +12,7 @@ Provides information about a Signer Signing Job. ## Example Usage -```hcl +```terraform data "aws_signer_signing_job" "build_signing_job" { job_id = "9ed7e5c3-b8d4-4da0-8459-44e0b068f7ee" } diff --git a/website/docs/d/signer_signing_profile.html.markdown b/website/docs/d/signer_signing_profile.html.markdown index 7f3787b3893..878124b3651 100644 --- a/website/docs/d/signer_signing_profile.html.markdown +++ b/website/docs/d/signer_signing_profile.html.markdown @@ -12,7 +12,7 @@ Provides information about a Signer Signing Profile. ## Example Usage -```hcl +```terraform data "aws_signer_signing_profile" "production_signing_profile" { name = "prod_profile_DdW3Mk1foYL88fajut4mTVFGpuwfd4ACO6ANL0D1uIj7lrn8adK" } diff --git a/website/docs/d/sns_topic.html.markdown b/website/docs/d/sns_topic.html.markdown index c7a92d1447b..793c204401b 100644 --- a/website/docs/d/sns_topic.html.markdown +++ b/website/docs/d/sns_topic.html.markdown @@ -14,7 +14,7 @@ without having to hard code the ARNs as input. ## Example Usage -```hcl +```terraform data "aws_sns_topic" "example" { name = "an_example_topic" } diff --git a/website/docs/d/sqs_queue.html.markdown b/website/docs/d/sqs_queue.html.markdown index dbf846b0528..67e2779afb5 100644 --- a/website/docs/d/sqs_queue.html.markdown +++ b/website/docs/d/sqs_queue.html.markdown @@ -14,7 +14,7 @@ the ARNs as input. ## Example Usage -```hcl +```terraform data "aws_sqs_queue" "example" { name = "queue" } diff --git a/website/docs/d/ssm_document.html.markdown b/website/docs/d/ssm_document.html.markdown index 697afdd700e..b467a0d78ab 100644 --- a/website/docs/d/ssm_document.html.markdown +++ b/website/docs/d/ssm_document.html.markdown @@ -14,7 +14,7 @@ Gets the contents of the specified Systems Manager document. To get the contents of the document owned by AWS. -```hcl +```terraform data "aws_ssm_document" "foo" { name = "AWS-GatherSoftwareInventory" document_format = "YAML" @@ -27,7 +27,7 @@ output "content" { To get the contents of the custom document. -```hcl +```terraform data "aws_ssm_document" "test" { name = aws_ssm_document.test.name document_format = "JSON" diff --git a/website/docs/d/ssm_parameter.html.markdown b/website/docs/d/ssm_parameter.html.markdown index 44ea48185dd..1508f99b6c1 100644 --- a/website/docs/d/ssm_parameter.html.markdown +++ b/website/docs/d/ssm_parameter.html.markdown @@ -12,7 +12,7 @@ Provides an SSM Parameter data source. ## Example Usage -```hcl +```terraform data "aws_ssm_parameter" "foo" { name = "foo" } diff --git a/website/docs/d/ssm_patch_baseline.html.markdown b/website/docs/d/ssm_patch_baseline.html.markdown index a1dc49dc2f3..bf1ba81979b 100644 --- a/website/docs/d/ssm_patch_baseline.html.markdown +++ b/website/docs/d/ssm_patch_baseline.html.markdown @@ -14,7 +14,7 @@ Provides an SSM Patch Baseline data source. Useful if you wish to reuse the defa To retrieve a baseline provided by AWS: -```hcl +```terraform data "aws_ssm_patch_baseline" "centos" { owner = "AWS" name_prefix = "AWS-" @@ -24,7 +24,7 @@ data "aws_ssm_patch_baseline" "centos" { To retrieve a baseline on your account: -```hcl +```terraform data "aws_ssm_patch_baseline" "default_custom" { owner = "Self" name_prefix = "MyCustomBaseline" diff --git a/website/docs/d/ssoadmin_instances.html.markdown b/website/docs/d/ssoadmin_instances.html.markdown index b8d55b5e1cb..951c470706e 100644 --- a/website/docs/d/ssoadmin_instances.html.markdown +++ b/website/docs/d/ssoadmin_instances.html.markdown @@ -12,7 +12,7 @@ Use this data source to get ARNs and Identity Store IDs of Single Sign-On (SSO) ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} output "arn" { diff --git a/website/docs/d/ssoadmin_permission_set.html.markdown b/website/docs/d/ssoadmin_permission_set.html.markdown index 18d34fde390..3b74a41b826 100644 --- a/website/docs/d/ssoadmin_permission_set.html.markdown +++ b/website/docs/d/ssoadmin_permission_set.html.markdown @@ -12,7 +12,7 @@ Use this data source to get a Single Sign-On (SSO) Permission Set. ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} data "aws_ssoadmin_permission_set" "example" { diff --git a/website/docs/d/storagegateway_local_disk.html.markdown b/website/docs/d/storagegateway_local_disk.html.markdown index 34b107d2d10..d9ecb852be3 100644 --- a/website/docs/d/storagegateway_local_disk.html.markdown +++ b/website/docs/d/storagegateway_local_disk.html.markdown @@ -12,7 +12,7 @@ Retrieve information about a Storage Gateway local disk. The disk identifier is ## Example Usage -```hcl +```terraform data "aws_storagegateway_local_disk" "test" { disk_path = aws_volume_attachment.test.device_name gateway_arn = aws_storagegateway_gateway.test.arn diff --git a/website/docs/d/subnet.html.markdown b/website/docs/d/subnet.html.markdown index 4fe5e29b0f4..f9335a75a30 100644 --- a/website/docs/d/subnet.html.markdown +++ b/website/docs/d/subnet.html.markdown @@ -16,7 +16,7 @@ This resource can prove useful when a module accepts a subnet ID as an input var The following example shows how one might accept a subnet ID as a variable and use this data source to obtain the data necessary to create a security group that allows connections from hosts in that subnet. -```hcl +```terraform variable "subnet_id" {} data "aws_subnet" "selected" { @@ -39,7 +39,7 @@ resource "aws_security_group" "subnet" { If you want to match against tag `Name`, use: -```hcl +```terraform data "aws_subnet" "selected" { filter { name = "tag:Name" diff --git a/website/docs/d/subnet_ids.html.markdown b/website/docs/d/subnet_ids.html.markdown index 1be3a96df84..a69a6323fa9 100644 --- a/website/docs/d/subnet_ids.html.markdown +++ b/website/docs/d/subnet_ids.html.markdown @@ -16,7 +16,7 @@ This resource can be useful for getting back a set of subnet ids for a vpc. The following shows outputing all cidr blocks for every subnet id in a vpc. -```hcl +```terraform data "aws_subnet_ids" "example" { vpc_id = var.vpc_id } @@ -35,7 +35,7 @@ The following example retrieves a set of all subnets in a VPC with a custom tag of `Tier` set to a value of "Private" so that the `aws_instance` resource can loop through the subnets, putting instances across availability zones. -```hcl +```terraform data "aws_subnet_ids" "private" { vpc_id = var.vpc_id @@ -68,7 +68,7 @@ which take the following arguments: [the underlying AWS API](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSubnets.html). For example, if matching against tag `Name`, use: -```hcl +```terraform data "aws_subnet_ids" "selected" { filter { name = "tag:Name" diff --git a/website/docs/d/transfer_server.html.markdown b/website/docs/d/transfer_server.html.markdown index c2f1116a2b5..40d0e8d4819 100644 --- a/website/docs/d/transfer_server.html.markdown +++ b/website/docs/d/transfer_server.html.markdown @@ -13,7 +13,7 @@ resources. ## Example Usage -```hcl +```terraform data "aws_transfer_server" "example" { server_id = "s-1234567" } diff --git a/website/docs/d/vpc.html.markdown b/website/docs/d/vpc.html.markdown index d90b2b6f957..d121ae32184 100644 --- a/website/docs/d/vpc.html.markdown +++ b/website/docs/d/vpc.html.markdown @@ -20,7 +20,7 @@ The following example shows how one might accept a VPC id as a variable and use this data source to obtain the data necessary to create a subnet within it. -```hcl +```terraform variable "vpc_id" {} data "aws_vpc" "selected" { diff --git a/website/docs/d/vpc_dhcp_options.html.markdown b/website/docs/d/vpc_dhcp_options.html.markdown index f3942d9d7ea..cce98124771 100644 --- a/website/docs/d/vpc_dhcp_options.html.markdown +++ b/website/docs/d/vpc_dhcp_options.html.markdown @@ -14,7 +14,7 @@ Retrieve information about an EC2 DHCP Options configuration. ### Lookup by DHCP Options ID -```hcl +```terraform data "aws_vpc_dhcp_options" "example" { dhcp_options_id = "dopts-12345678" } @@ -22,7 +22,7 @@ data "aws_vpc_dhcp_options" "example" { ### Lookup by Filter -```hcl +```terraform data "aws_vpc_dhcp_options" "example" { filter { name = "key" diff --git a/website/docs/d/vpc_endpoint.html.markdown b/website/docs/d/vpc_endpoint.html.markdown index ef9d3a032e7..b43aa2f73d8 100644 --- a/website/docs/d/vpc_endpoint.html.markdown +++ b/website/docs/d/vpc_endpoint.html.markdown @@ -13,7 +13,7 @@ a specific VPC endpoint. ## Example Usage -```hcl +```terraform # Declare the data source data "aws_vpc_endpoint" "s3" { vpc_id = aws_vpc.foo.id diff --git a/website/docs/d/vpc_endpoint_service.html.markdown b/website/docs/d/vpc_endpoint_service.html.markdown index 201da1070cd..30be4a50987 100644 --- a/website/docs/d/vpc_endpoint_service.html.markdown +++ b/website/docs/d/vpc_endpoint_service.html.markdown @@ -15,7 +15,7 @@ can be specified when creating a VPC endpoint within the region configured in th ### AWS Service -```hcl +```terraform # Declare the data source data "aws_vpc_endpoint_service" "s3" { service = "s3" @@ -36,7 +36,7 @@ resource "aws_vpc_endpoint" "ep" { ### Non-AWS Service -```hcl +```terraform data "aws_vpc_endpoint_service" "custome" { service_name = "com.amazonaws.vpce.us-west-2.vpce-svc-0e87519c997c63cd8" } @@ -44,7 +44,7 @@ data "aws_vpc_endpoint_service" "custome" { ### Filter -```hcl +```terraform data "aws_vpc_endpoint_service" "test" { filter { name = "service-name" diff --git a/website/docs/d/vpc_peering_connection.html.markdown b/website/docs/d/vpc_peering_connection.html.markdown index 568e6095685..f185329d586 100644 --- a/website/docs/d/vpc_peering_connection.html.markdown +++ b/website/docs/d/vpc_peering_connection.html.markdown @@ -13,7 +13,7 @@ a specific VPC peering connection. ## Example Usage -```hcl +```terraform # Declare the data source data "aws_vpc_peering_connection" "pc" { vpc_id = aws_vpc.foo.id diff --git a/website/docs/d/vpc_peering_connections.html.markdown b/website/docs/d/vpc_peering_connections.html.markdown index 5942ba9cf90..8b7fa6db4aa 100644 --- a/website/docs/d/vpc_peering_connections.html.markdown +++ b/website/docs/d/vpc_peering_connections.html.markdown @@ -16,7 +16,7 @@ the data source, as noted in [issue 4149](https://github.com/hashicorp/terraform ## Example Usage -```hcl +```terraform # Declare the data source data "aws_vpc_peering_connections" "pcs" { filter { diff --git a/website/docs/d/vpcs.html.markdown b/website/docs/d/vpcs.html.markdown index c0f0e99619c..56b26fcc18a 100644 --- a/website/docs/d/vpcs.html.markdown +++ b/website/docs/d/vpcs.html.markdown @@ -16,7 +16,7 @@ The following example retrieves a list of VPC Ids with a custom tag of `service` The following shows outputing all VPC Ids. -```hcl +```terraform data "aws_vpcs" "foo" { tags = { service = "production" @@ -30,7 +30,7 @@ output "foo" { An example use case would be interpolate the `aws_vpcs` output into `count` of an aws_flow_log resource. -```hcl +```terraform data "aws_vpcs" "foo" {} data "aws_vpc" "foo" { diff --git a/website/docs/d/vpn_gateway.html.markdown b/website/docs/d/vpn_gateway.html.markdown index 22bf5783676..b9460ec2119 100644 --- a/website/docs/d/vpn_gateway.html.markdown +++ b/website/docs/d/vpn_gateway.html.markdown @@ -13,7 +13,7 @@ a specific VPN gateway. ## Example Usage -```hcl +```terraform data "aws_vpn_gateway" "selected" { filter { name = "tag:Name" diff --git a/website/docs/d/waf_ipset.html.markdown b/website/docs/d/waf_ipset.html.markdown index 11af5b0ced5..c27cac214e2 100644 --- a/website/docs/d/waf_ipset.html.markdown +++ b/website/docs/d/waf_ipset.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_waf_ipset" "example" { name = "tfWAFIPSet" } diff --git a/website/docs/d/waf_rate_based_rule.html.markdown b/website/docs/d/waf_rate_based_rule.html.markdown index b9d7ecac66e..e3df4121648 100644 --- a/website/docs/d/waf_rate_based_rule.html.markdown +++ b/website/docs/d/waf_rate_based_rule.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_waf_rate_based_rule" "example" { name = "tfWAFRateBasedRule" } diff --git a/website/docs/d/waf_rule.html.markdown b/website/docs/d/waf_rule.html.markdown index 6e440fa8002..32681f694e8 100644 --- a/website/docs/d/waf_rule.html.markdown +++ b/website/docs/d/waf_rule.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_waf_rule" "example" { name = "tfWAFRule" } diff --git a/website/docs/d/waf_web_acl.html.markdown b/website/docs/d/waf_web_acl.html.markdown index ee2b962cc33..69cc53baef2 100644 --- a/website/docs/d/waf_web_acl.html.markdown +++ b/website/docs/d/waf_web_acl.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_waf_web_acl" "example" { name = "tfWAFWebACL" } diff --git a/website/docs/d/wafregional_ipset.html.markdown b/website/docs/d/wafregional_ipset.html.markdown index 503900da75a..9814ed711fc 100644 --- a/website/docs/d/wafregional_ipset.html.markdown +++ b/website/docs/d/wafregional_ipset.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_wafregional_ipset" "example" { name = "tfWAFRegionalIPSet" } diff --git a/website/docs/d/wafregional_rate_based_rule.html.markdown b/website/docs/d/wafregional_rate_based_rule.html.markdown index 53328e9407d..15665626ec7 100644 --- a/website/docs/d/wafregional_rate_based_rule.html.markdown +++ b/website/docs/d/wafregional_rate_based_rule.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_wafregional_rate_based_rule" "example" { name = "tfWAFRegionalRateBasedRule" } diff --git a/website/docs/d/wafregional_rule.html.markdown b/website/docs/d/wafregional_rule.html.markdown index 089619ec1f2..5f9861dd069 100644 --- a/website/docs/d/wafregional_rule.html.markdown +++ b/website/docs/d/wafregional_rule.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_wafregional_rule" "example" { name = "tfWAFRegionalRule" } diff --git a/website/docs/d/wafregional_web_acl.html.markdown b/website/docs/d/wafregional_web_acl.html.markdown index fc80483cb33..2b5370511a2 100644 --- a/website/docs/d/wafregional_web_acl.html.markdown +++ b/website/docs/d/wafregional_web_acl.html.markdown @@ -12,7 +12,7 @@ description: |- ## Example Usage -```hcl +```terraform data "aws_wafregional_web_acl" "example" { name = "tfWAFRegionalWebACL" } diff --git a/website/docs/d/wafv2_ip_set.html.markdown b/website/docs/d/wafv2_ip_set.html.markdown index 7991878ddea..d24e5a67154 100644 --- a/website/docs/d/wafv2_ip_set.html.markdown +++ b/website/docs/d/wafv2_ip_set.html.markdown @@ -12,7 +12,7 @@ Retrieves the summary of a WAFv2 IP Set. ## Example Usage -```hcl +```terraform data "aws_wafv2_ip_set" "example" { name = "some-ip-set" scope = "REGIONAL" diff --git a/website/docs/d/wafv2_regex_pattern_set.html.markdown b/website/docs/d/wafv2_regex_pattern_set.html.markdown index 43c4db2bfec..ce4a1119392 100644 --- a/website/docs/d/wafv2_regex_pattern_set.html.markdown +++ b/website/docs/d/wafv2_regex_pattern_set.html.markdown @@ -12,7 +12,7 @@ Retrieves the summary of a WAFv2 Regex Pattern Set. ## Example Usage -```hcl +```terraform data "aws_wafv2_regex_pattern_set" "example" { name = "some-regex-pattern-set" scope = "REGIONAL" diff --git a/website/docs/d/wafv2_rule_group.html.markdown b/website/docs/d/wafv2_rule_group.html.markdown index a3a72a9e3c4..aaa48143065 100644 --- a/website/docs/d/wafv2_rule_group.html.markdown +++ b/website/docs/d/wafv2_rule_group.html.markdown @@ -12,7 +12,7 @@ Retrieves the summary of a WAFv2 Rule Group. ## Example Usage -```hcl +```terraform data "aws_wafv2_rule_group" "example" { name = "some-rule-group" scope = "REGIONAL" diff --git a/website/docs/d/wafv2_web_acl.html.markdown b/website/docs/d/wafv2_web_acl.html.markdown index caaa3b6aa7c..77522675a1a 100644 --- a/website/docs/d/wafv2_web_acl.html.markdown +++ b/website/docs/d/wafv2_web_acl.html.markdown @@ -12,7 +12,7 @@ Retrieves the summary of a WAFv2 Web ACL. ## Example Usage -```hcl +```terraform data "aws_wafv2_web_acl" "example" { name = "some-web-acl" scope = "REGIONAL" diff --git a/website/docs/d/workspaces_bundle.html.markdown b/website/docs/d/workspaces_bundle.html.markdown index 349874b98d2..cfe032e65f6 100644 --- a/website/docs/d/workspaces_bundle.html.markdown +++ b/website/docs/d/workspaces_bundle.html.markdown @@ -14,7 +14,7 @@ Retrieve information about an AWS WorkSpaces bundle. ### By ID -```hcl +```terraform data "aws_workspaces_bundle" "example" { bundle_id = "wsb-b0s22j3d7" } @@ -22,7 +22,7 @@ data "aws_workspaces_bundle" "example" { ### By Owner & Name -```hcl +```terraform data "aws_workspaces_bundle" "example" { owner = "AMAZON" name = "Value with Windows 10 and Office 2016" diff --git a/website/docs/d/workspaces_directory.html.markdown b/website/docs/d/workspaces_directory.html.markdown index 0ed407e3e17..dc0bddb356a 100644 --- a/website/docs/d/workspaces_directory.html.markdown +++ b/website/docs/d/workspaces_directory.html.markdown @@ -12,7 +12,7 @@ Retrieve information about an AWS WorkSpaces directory. ## Example Usage -```hcl +```terraform data "aws_workspaces_directory" "example" { directory_id = "d-9067783251" } diff --git a/website/docs/d/workspaces_image.html.markdown b/website/docs/d/workspaces_image.html.markdown index 107a80eb463..38d00ae5c2e 100644 --- a/website/docs/d/workspaces_image.html.markdown +++ b/website/docs/d/workspaces_image.html.markdown @@ -12,7 +12,7 @@ Use this data source to get information about a Workspaces image. ## Example Usage -```hcl +```terraform data aws_workspaces_image example { image_id = "wsi-ten5h0y19" } diff --git a/website/docs/d/workspaces_workspace.html.markdown b/website/docs/d/workspaces_workspace.html.markdown index eb49085ded0..df923bd0e10 100644 --- a/website/docs/d/workspaces_workspace.html.markdown +++ b/website/docs/d/workspaces_workspace.html.markdown @@ -14,7 +14,7 @@ Use this data source to get information about a workspace in [AWS Workspaces](ht ### Filter By Workspace ID -```hcl +```terraform data "aws_workspaces_workspace" "example" { workspace_id = "ws-cj5xcxsz5" } @@ -22,7 +22,7 @@ data "aws_workspaces_workspace" "example" { ### Filter By Directory ID & User Name -```hcl +```terraform data "aws_workspaces_workspace" "example" { directory_id = "d-9967252f57" user_name = "Example" diff --git a/website/docs/guides/custom-service-endpoints.html.md b/website/docs/guides/custom-service-endpoints.html.md index c63f6e17e38..5dbefb8ff78 100644 --- a/website/docs/guides/custom-service-endpoints.html.md +++ b/website/docs/guides/custom-service-endpoints.html.md @@ -28,7 +28,7 @@ This guide outlines how to get started with customizing endpoints, the available To configure the Terraform AWS Provider to use customized endpoints, it can be done within `provider` declarations using the `endpoints` configuration block, e.g. -```hcl +```terraform provider "aws" { # ... potentially other provider configuration ... @@ -222,7 +222,7 @@ The Amazon DynamoDB service offers a downloadable version for writing and testin An example provider configuration: -```hcl +```terraform provider "aws" { access_key = "mock_access_key" region = "us-east-1" @@ -243,7 +243,7 @@ provider "aws" { An example provider configuration: -```hcl +```terraform provider "aws" { access_key = "mock_access_key" region = "us-east-1" diff --git a/website/docs/guides/resource-tagging.html.md b/website/docs/guides/resource-tagging.html.md index f28afb7186c..84412895c86 100644 --- a/website/docs/guides/resource-tagging.html.md +++ b/website/docs/guides/resource-tagging.html.md @@ -26,7 +26,7 @@ Many AWS services implement [resource tags](https://docs.aws.amazon.com/general/ Terraform AWS Provider resources that support resource tags implement a consistent argument named `tags` which accepts a key-value map, e.g. -```hcl +```terraform resource "aws_vpc" "example" { # ... other configuration ... @@ -40,7 +40,7 @@ The tags for the resource are wholly managed by Terraform except tag keys beginn For most environments and use cases, this is the typical implementation pattern, whether it be in a standalone Terraform configuration or within a [Terraform Module](https://www.terraform.io/docs/modules/). The Terraform configuration language also enables less repetitive configurations via [variables](https://www.terraform.io/docs/configuration/variables.html), [locals](https://www.terraform.io/docs/configuration/locals.html), or potentially a combination of these, e.g. -```hcl +```terraform # Terraform 0.12 and later syntax variable "additional_tags" { default = {} @@ -71,7 +71,7 @@ All Terraform resources support the [`lifecycle` configuration block `ignore_cha In this example, the `Name` tag will be added to the VPC on resource creation, however any external changes to the `Name` tag value or the addition/removal of any tag (including the `Name` tag) will be ignored: -```hcl +```terraform # Terraform 0.12 and later syntax resource "aws_vpc" "example" { # ... other configuration ... @@ -88,7 +88,7 @@ resource "aws_vpc" "example" { In this example, the `Name` and `Owner` tags will be added to the VPC on resource creation, however any external changes to the value of the `Name` tag will be ignored while any changes to other tags (including the `Owner` tag and any additions) will still be proposed: -```hcl +```terraform # Terraform 0.12 and later syntax resource "aws_vpc" "example" { # ... other configuration ... @@ -110,7 +110,7 @@ As of version 2.60.0 of the Terraform AWS Provider, there is support for ignorin In this example, all resources will ignore any addition of the `LastScanned` tag: -```hcl +```terraform provider "aws" { # ... potentially other configuration ... @@ -122,7 +122,7 @@ provider "aws" { In this example, all resources will ignore any addition of tags with the `kubernetes.io/` prefix, such as `kubernetes.io/cluster/name` or `kubernetes.io/role/elb`: -```hcl +```terraform provider "aws" { # ... potentially other configuration ... @@ -144,7 +144,7 @@ Certain Terraform AWS Provider services support a special resource for managing -> Not all services supported by the Terraform AWS Provider implement these resources. Browse the Terraform AWS Provider resource documentation pages for a resource with a type ending in `_tag`. If there is a use case where this type of resource is missing, a [feature request](https://github.com/hashicorp/terraform-provider-aws/issues/new?labels=enhancement&template=Feature_Request.md) can be submitted. -```hcl +```terraform # Terraform 0.12 and later syntax # ... other configuration ... @@ -157,7 +157,7 @@ resource "aws_ec2_tag" "example" { To manage multiple tags for a resource in this scenario, [`for_each`](https://www.terraform.io/docs/configuration/meta-arguments/for_each.html) can be used: -```hcl +```terraform # Terraform 0.12 and later syntax # ... other configuration ... diff --git a/website/docs/guides/version-2-upgrade.html.md b/website/docs/guides/version-2-upgrade.html.md index 090f198a800..51d654a7b26 100644 --- a/website/docs/guides/version-2-upgrade.html.md +++ b/website/docs/guides/version-2-upgrade.html.md @@ -59,7 +59,7 @@ It is recommended to use [version constraints when configuring Terraform provide Update to latest 1.X version: -```hcl +```terraform provider "aws" { # ... other configuration ... @@ -69,7 +69,7 @@ provider "aws" { Update to latest 2.X version: -```hcl +```terraform provider "aws" { # ... other configuration ... @@ -87,7 +87,7 @@ The provider will now return an error to ensure operators understand the implica If necessary, the AWS account ID lookup logic can be skipped via: -```hcl +```terraform provider "aws" { # ... other configuration ... @@ -134,7 +134,7 @@ Terraform configuration migration steps: As an example, lets take the below sample configuration and migrate it. -```hcl +```terraform # Below example configuration will not be supported in Terraform AWS provider version 2.0.0 data "aws_kms_secret" "example" { @@ -162,7 +162,7 @@ Notice that the `aws_kms_secret` data source previously was taking the two `secr Updating the sample configuration from above: -```hcl +```terraform data "aws_kms_secrets" "example" { secret { # ... potentially other configuration ... @@ -207,7 +207,7 @@ Since the API Gateway usage plans feature was launched on August 11, 2016, usage For example, given this previous configuration: -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { name = "example" } @@ -229,7 +229,7 @@ resource "aws_api_gateway_api_key" "example" { An updated configuration: -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { name = "example" } @@ -267,7 +267,7 @@ Switch your Terraform configuration to the `request_parameters` argument instead For example, given this previous configuration: -```hcl +```terraform resource "aws_api_gateway_integration" "example" { # ... other configuration ... @@ -281,7 +281,7 @@ PARAMS An updated configuration: -```hcl +```terraform resource "aws_api_gateway_integration" "example" { # ... other configuration ... @@ -299,7 +299,7 @@ Switch your Terraform configuration to the `response_parameters` argument instea For example, given this previous configuration: -```hcl +```terraform resource "aws_api_gateway_integration_response" "example" { # ... other configuration ... @@ -313,7 +313,7 @@ PARAMS An updated configuration: -```hcl +```terraform resource "aws_api_gateway_integration_response" "example" { # ... other configuration ... @@ -331,7 +331,7 @@ Switch your Terraform configuration to the `request_parameters` argument instead For example, given this previous configuration: -```hcl +```terraform resource "aws_api_gateway_method" "example" { # ... other configuration ... @@ -346,7 +346,7 @@ PARAMS An updated configuration: -```hcl +```terraform resource "aws_api_gateway_method" "example" { # ... other configuration ... @@ -365,7 +365,7 @@ Switch your Terraform configuration to the `response_parameters` argument instea For example, given this previous configuration: -```hcl +```terraform resource "aws_api_gateway_method_response" "example" { # ... other configuration ... @@ -379,7 +379,7 @@ PARAMS An updated configuration: -```hcl +```terraform resource "aws_api_gateway_method_response" "example" { # ... other configuration ... @@ -403,7 +403,7 @@ The following arguments have been moved into a nested argument named `step_scali For example, given this previous configuration: -```hcl +```terraform resource "aws_appautoscaling_policy" "example" { # ... other configuration ... @@ -420,7 +420,7 @@ resource "aws_appautoscaling_policy" "example" { An updated configuration: -```hcl +```terraform resource "aws_appautoscaling_policy" "example" { # ... other configuration ... @@ -445,7 +445,7 @@ Switch your Terraform configuration to the `min_adjustment_magnitude` argument i For example, given this previous configuration: -```hcl +```terraform resource "aws_autoscaling_policy" "example" { # ... other configuration ... @@ -455,7 +455,7 @@ resource "aws_autoscaling_policy" "example" { An updated configuration: -```hcl +```terraform resource "aws_autoscaling_policy" "example" { # ... other configuration ... @@ -477,7 +477,7 @@ Switch your Terraform configuration to the `ordered_cache_behavior` argument ins For example, given this previous configuration: -```hcl +```terraform resource "aws_cloudfront_distribution" "example" { # ... other configuration ... @@ -493,7 +493,7 @@ resource "aws_cloudfront_distribution" "example" { An updated configuration: -```hcl +```terraform resource "aws_cloudfront_distribution" "example" { # ... other configuration ... @@ -532,7 +532,7 @@ Default connections have been removed as part of LAG creation. To migrate your T For example, given this previous configuration: -```hcl +```terraform resource "aws_dx_lag" "example" { name = "example" connections_bandwidth = "1Gbps" @@ -543,7 +543,7 @@ resource "aws_dx_lag" "example" { An updated configuration: -```hcl +```terraform resource "aws_dx_connection" "example" { name = "example" bandwidth = "1Gbps" @@ -570,7 +570,7 @@ Switch your Terraform configuration to the `ordered_placement_strategy` argument For example, given this previous configuration: -```hcl +```terraform resource "aws_ecs_service" "example" { # ... other configuration ... @@ -586,7 +586,7 @@ resource "aws_ecs_service" "example" { An updated configuration: -```hcl +```terraform resource "aws_ecs_service" "example" { # ... other configuration ... @@ -608,7 +608,7 @@ Switch your Terraform configuration to the `creation_token` argument instead. For example, given this previous configuration: -```hcl +```terraform resource "aws_efs_file_system" "example" { # ... other configuration ... @@ -618,7 +618,7 @@ resource "aws_efs_file_system" "example" { An updated configuration: -```hcl +```terraform resource "aws_efs_file_system" "example" { # ... other configuration ... @@ -634,7 +634,7 @@ Switch your Terraform configuration to the `preferred_availability_zones` argume For example, given this previous configuration: -```hcl +```terraform resource "aws_elasticache_cluster" "example" { # ... other configuration ... @@ -644,7 +644,7 @@ resource "aws_elasticache_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_elasticache_cluster" "example" { # ... other configuration ... @@ -688,7 +688,7 @@ Switch your Terraform configuration to the `subnet_ids` argument instead. For example, given this previous configuration: -```hcl +```terraform resource "aws_network_acl" "example" { # ... other configuration ... @@ -698,7 +698,7 @@ resource "aws_network_acl" "example" { An updated configuration: -```hcl +```terraform resource "aws_network_acl" "example" { # ... other configuration ... @@ -718,7 +718,7 @@ The following arguments have been moved into a nested argument named `logging`: For example, given this previous configuration: -```hcl +```terraform resource "aws_redshift_cluster" "example" { # ... other configuration ... @@ -730,7 +730,7 @@ resource "aws_redshift_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_redshift_cluster" "example" { # ... other configuration ... @@ -758,7 +758,7 @@ The resource now requires existing Route 53 Records to be imported into the Terr For example, if the `www.example.com` Route 53 Record in the `example.com` Route 53 Hosted Zone existed previously and this new Terraform configuration was introduced: -```hcl +```terraform resource "aws_route53_record" "www" { # ... other configuration ... name = "www.example.com" @@ -783,7 +783,7 @@ Switch your Terraform configuration to `vpc` configuration block(s) instead. For example, given this previous configuration: -```hcl +```terraform resource "aws_route53_zone" "example" { # ... other configuration ... @@ -793,7 +793,7 @@ resource "aws_route53_zone" "example" { An updated configuration: -```hcl +```terraform resource "aws_route53_zone" "example" { # ... other configuration ... @@ -811,7 +811,7 @@ Switch your Terraform configuration to the `byte_match_tuples` argument instead. For example, given this previous configuration: -```hcl +```terraform resource "aws_wafregional_byte_match_set" "example" { # ... other configuration ... @@ -827,7 +827,7 @@ resource "aws_wafregional_byte_match_set" "example" { An updated configuration: -```hcl +```terraform resource "aws_wafregional_byte_match_set" "example" { # ... other configuration ... diff --git a/website/docs/guides/version-3-upgrade.html.md b/website/docs/guides/version-3-upgrade.html.md index 435c5ccd0fe..4fb62166d49 100644 --- a/website/docs/guides/version-3-upgrade.html.md +++ b/website/docs/guides/version-3-upgrade.html.md @@ -67,7 +67,7 @@ It is recommended to use [version constraints when configuring Terraform provide For example, given this previous configuration: -```hcl +```terraform provider "aws" { # ... other configuration ... @@ -77,7 +77,7 @@ provider "aws" { Update to latest 3.X version: -```hcl +```terraform provider "aws" { # ... other configuration ... @@ -122,7 +122,7 @@ The [custom service endpoints](custom-service-endpoints.html) for Kinesis Analyt For example, given this previous configuration: -```hcl +```terraform provider "aws" { # ... potentially other configuration ... @@ -137,7 +137,7 @@ provider "aws" { An updated configuration: -```hcl +```terraform provider "aws" { # ... potentially other configuration ... @@ -158,7 +158,7 @@ Switch your Terraform configuration to the `exclude_names` attribute instead. For example, given this previous configuration: -```hcl +```terraform data "aws_availability_zones" "example" { blacklisted_names = ["us-west-2d"] } @@ -166,7 +166,7 @@ data "aws_availability_zones" "example" { An updated configuration: -```hcl +```terraform data "aws_availability_zones" "example" { exclude_names = ["us-west-2d"] } @@ -178,7 +178,7 @@ Switch your Terraform configuration to the `exclude_zone_ids` attribute instead. For example, given this previous configuration: -```hcl +```terraform data "aws_availability_zones" "example" { blacklisted_zone_ids = ["usw2-az4"] } @@ -186,7 +186,7 @@ data "aws_availability_zones" "example" { An updated configuration: -```hcl +```terraform data "aws_availability_zones" "example" { exclude_zone_ids = ["usw2-az4"] } @@ -200,7 +200,7 @@ Switch your Terraform configuration to the `result` attribute with the [`jsondec For example, given this previous configuration: -```hcl +```terraform # In Terraform 0.11 and earlier, the result_map attribute can be used # to convert a result JSON string to a map of string keys to string values. output "lambda_result" { @@ -210,7 +210,7 @@ output "lambda_result" { An updated configuration: -```hcl +```terraform # In Terraform 0.12 and later, the jsondecode() function can be used # to convert a result JSON string to native Terraform types. output "lambda_result" { @@ -271,7 +271,7 @@ Configuration references to this attribute will likely require updates since set For example, given this previous configuration using a `count` based resource approach that may have been used in certain environments: -```hcl +```terraform data "aws_route53_zone" "public_root_domain" { name = var.public_root_domain } @@ -320,7 +320,7 @@ This value does not have any indices. Since the `domain_validation_options` attribute changed from a list to a set and sets cannot be indexed in Terraform, the recommendation is to update the configuration to use the more stable [resource `for_each` support](https://www.terraform.io/docs/configuration/meta-arguments/for_each.html) instead of [`count`](https://www.terraform.io/docs/configuration/meta-arguments/count.html). Note the slight change in the `validation_record_fqdns` syntax as well. -```hcl +```terraform resource "aws_route53_record" "existing" { for_each = { for dvo in aws_acm_certificate.existing.domain_validation_options : dvo.domain_name => { @@ -606,7 +606,7 @@ If you previously set one of these arguments to an empty list to enable drift de For example, given this previous configuration: -```hcl +```terraform resource "aws_autoscaling_group" "example" { # ... other configuration ... load_balancers = [] @@ -616,7 +616,7 @@ resource "aws_autoscaling_group" "example" { An updated configuration: -```hcl +```terraform resource "aws_autoscaling_group" "example" { # ... other configuration ... target_group_arns = [aws_lb_target_group.example.arn] @@ -627,7 +627,7 @@ If `aws_autoscaling_attachment` resources reference your ASG configurations, you For example, given this previous configuration: -```hcl +```terraform resource "aws_autoscaling_attachment" "example" { autoscaling_group_name = aws_autoscaling_group.example.id elb = aws_elb.example.id @@ -640,7 +640,7 @@ resource "aws_autoscaling_group" "example" { An updated configuration: -```hcl +```terraform resource "aws_autoscaling_attachment" "example" { autoscaling_group_name = aws_autoscaling_group.example.id elb = aws_elb.example.id @@ -686,7 +686,7 @@ Previously, the resource returned the Amazon Resource Name (ARN) directly from t Workarounds, such as using `replace()` as shown below, should be removed: -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "example" } @@ -698,7 +698,7 @@ resource "aws_datasync_task" "example" { Removing the `:*` suffix is a breaking change for some configurations. Fix these configurations using string interpolations as demonstrated below. For example, this configuration is now broken: -```hcl +```terraform data "aws_iam_policy_document" "ad-log-policy" { statement { actions = [ @@ -717,7 +717,7 @@ data "aws_iam_policy_document" "ad-log-policy" { An updated configuration: -```hcl +```terraform data "aws_iam_policy_document" "ad-log-policy" { statement { actions = [ @@ -746,7 +746,7 @@ For example, given this previous configuration: $ GITHUB_TOKEN= terraform apply ``` -```hcl +```terraform resource "aws_codepipeline" "example" { # ... other configuration ... @@ -777,7 +777,7 @@ The configuration could be updated as follows: $ TF_VAR_github_token= terraform apply ``` -```hcl +```terraform variable "github_token" {} resource "aws_codepipeline" "example" { @@ -813,7 +813,7 @@ The Cognito API previously deprecated the `admin_create_user_config` configurati For example, given this previous configuration: -```hcl +```terraform resource "aws_cognito_user_pool" "example" { # ... other configuration ... @@ -827,7 +827,7 @@ resource "aws_cognito_user_pool" "example" { An updated configuration: -```hcl +```terraform resource "aws_cognito_user_pool" "example" { # ... other configuration ... @@ -853,7 +853,7 @@ Switch your Terraform configuration to the `associated_gateway_id` argument inst For example, given this previous configuration: -```hcl +```terraform resource "aws_dx_gateway_association" "example" { # ... other configuration ... vpn_gateway_id = aws_vpn_gateway.example.id @@ -862,7 +862,7 @@ resource "aws_dx_gateway_association" "example" { An updated configuration: -```hcl +```terraform resource "aws_dx_gateway_association" "example" { # ... other configuration ... associated_gateway_id = aws_vpn_gateway.example.id @@ -877,7 +877,7 @@ Switch your Terraform configuration to the `associated_gateway_id` argument inst For example, given this previous configuration: -```hcl +```terraform resource "aws_dx_gateway_association_proposal" "example" { # ... other configuration ... vpn_gateway_id = aws_vpn_gateway.example.id @@ -886,7 +886,7 @@ resource "aws_dx_gateway_association_proposal" "example" { An updated configuration: -```hcl +```terraform resource "aws_dx_gateway_association_proposal" "example" { # ... other configuration ... associated_gateway_id = aws_vpn_gateway.example.id @@ -914,7 +914,7 @@ Switch your Terraform configuration to the `core_instance_group` configuration b For example, given this previous configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -924,7 +924,7 @@ resource "aws_emr_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -942,7 +942,7 @@ Switch your Terraform configuration to the `core_instance_group` configuration b For example, given this previous configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -952,7 +952,7 @@ resource "aws_emr_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -968,7 +968,7 @@ Switch your Terraform configuration to the `master_instance_group` and `core_ins For example, given this previous configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -993,7 +993,7 @@ resource "aws_emr_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -1020,7 +1020,7 @@ Switch your Terraform configuration to the `master_instance_group` configuration For example, given this previous configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -1030,7 +1030,7 @@ resource "aws_emr_cluster" "example" { An updated configuration: -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -1048,7 +1048,7 @@ The Glue API has deprecated the `allocated_capacity` argument. Switch your Terra For example, given this previous configuration: -```hcl +```terraform resource "aws_glue_job" "example" { # ... other configuration ... @@ -1058,7 +1058,7 @@ resource "aws_glue_job" "example" { An updated configuration: -```hcl +```terraform resource "aws_glue_job" "example" { # ... other configuration ... @@ -1080,7 +1080,7 @@ Switch your Terraform configuration to the `role` argument instead. For example, given this previous configuration: -```hcl +```terraform resource "aws_iam_instance_profile" "example" { # ... other configuration ... @@ -1090,7 +1090,7 @@ resource "aws_iam_instance_profile" "example" { An updated configuration: -```hcl +```terraform resource "aws_iam_instance_profile" "example" { # ... other configuration ... @@ -1125,7 +1125,7 @@ The `network_interfaces.delete_on_termination` argument is now of type `string`, For example, given this previous configuration: -```hcl +```terraform resource "aws_launch_template" "example" { # ... other configuration ... @@ -1139,7 +1139,7 @@ resource "aws_launch_template" "example" { An updated configuration: -```hcl +```terraform resource "aws_launch_template" "example" { # ... other configuration ... @@ -1159,7 +1159,7 @@ Switch your Terraform configuration to use the `host_header` or `path_pattern` c For example, given this previous configuration: -```hcl +```terraform resource "aws_lb_listener_rule" "example" { # ... other configuration ... @@ -1172,7 +1172,7 @@ resource "aws_lb_listener_rule" "example" { An updated configuration: -```hcl +```terraform resource "aws_lb_listener_rule" "example" { # ... other configuration ... @@ -1192,7 +1192,7 @@ A few weeks after general availability launch and initial release of the `aws_ms To continue using the old default when it was previously not configured, add or modify this configuration: -```hcl +```terraform resource "aws_msk_cluster" "example" { # ... other configuration ... @@ -1240,7 +1240,7 @@ The `region` attribute is no longer configurable, but it remains as a read-only For example, given this previous configuration: -```hcl +```terraform resource "aws_s3_bucket" "example" { # ... other configuration ... @@ -1250,7 +1250,7 @@ resource "aws_s3_bucket" "example" { An updated configuration: -```hcl +```terraform resource "aws_s3_bucket" "example" { # ... other configuration ... } @@ -1264,7 +1264,7 @@ The `filter` configuration block no longer supports the empty block `{}` and req For example, given this previous configuration: -```hcl +```terraform resource "aws_s3_bucket_metric" "example" { # ... other configuration ... @@ -1274,7 +1274,7 @@ resource "aws_s3_bucket_metric" "example" { An updated configuration: -```hcl +```terraform resource "aws_s3_bucket_metric" "example" { # ... other configuration ... } @@ -1306,7 +1306,7 @@ Switch your Terraform configuration to the `task_invocation_parameters` configur For example, given this previous configuration: -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { # ... other configuration ... @@ -1319,7 +1319,7 @@ resource "aws_ssm_maintenance_window_task" "example" { An updated configuration: -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { # ... other configuration ... @@ -1342,7 +1342,7 @@ Switch your Terraform configuration to the `task_invocation_parameters` configur For example, given this previous configuration: -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { # ... other configuration ... @@ -1355,7 +1355,7 @@ resource "aws_ssm_maintenance_window_task" "example" { An updated configuration: -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { # ... other configuration ... diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index ee1f9fed757..6ad7c2e74a8 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -17,7 +17,7 @@ Use the navigation to the left to read about the available resources. Terraform 0.13 and later: -```hcl +```terraform terraform { required_providers { aws = { @@ -40,7 +40,7 @@ resource "aws_vpc" "example" { Terraform 0.12 and earlier: -```hcl +```terraform # Configure the AWS Provider provider "aws" { version = "~> 3.0" @@ -76,7 +76,7 @@ in-line in the AWS provider block: Usage: -```hcl +```terraform provider "aws" { region = "us-west-2" access_key = "my-access-key" @@ -94,7 +94,7 @@ will override the use of `AWS_SHARED_CREDENTIALS_FILE` and `AWS_PROFILE`. The `AWS_DEFAULT_REGION` and `AWS_SESSION_TOKEN` environment variables are also used, if applicable: -```hcl +```terraform provider "aws" {} ``` @@ -113,7 +113,7 @@ You can use an [AWS credentials or configuration file](https://docs.aws.amazon.c Usage: -```hcl +```terraform provider "aws" { region = "us-west-2" shared_credentials_file = "/Users/tf_user/.aws/creds" @@ -158,7 +158,7 @@ using the supplied credentials. Usage: -```hcl +```terraform provider "aws" { assume_role { role_arn = "arn:aws:iam::ACCOUNT_ID:role/ROLE_NAME" @@ -386,7 +386,7 @@ The `assume_role` configuration block supports the following optional arguments: Example: -```hcl +```terraform provider "aws" { ignore_tags { keys = ["TagKey1"] diff --git a/website/docs/r/accessanalyzer_analyzer.html.markdown b/website/docs/r/accessanalyzer_analyzer.html.markdown index 82cef7d93f5..df0b7ae0e92 100644 --- a/website/docs/r/accessanalyzer_analyzer.html.markdown +++ b/website/docs/r/accessanalyzer_analyzer.html.markdown @@ -14,7 +14,7 @@ Manages an Access Analyzer Analyzer. More information can be found in the [Acces ### Account Analyzer -```hcl +```terraform resource "aws_accessanalyzer_analyzer" "example" { analyzer_name = "example" } @@ -22,7 +22,7 @@ resource "aws_accessanalyzer_analyzer" "example" { ### Organization Analyzer -```hcl +```terraform resource "aws_organizations_organization" "example" { aws_service_access_principals = ["access-analyzer.amazonaws.com"] } diff --git a/website/docs/r/acm_certificate.html.markdown b/website/docs/r/acm_certificate.html.markdown index 533b16ade56..c33ffd1a032 100644 --- a/website/docs/r/acm_certificate.html.markdown +++ b/website/docs/r/acm_certificate.html.markdown @@ -30,7 +30,7 @@ which is currently in use (eg, by [`aws_lb_listener`](lb_listener.html)). ### Create Certificate -```hcl +```terraform resource "aws_acm_certificate" "cert" { domain_name = "example.com" validation_method = "DNS" @@ -47,7 +47,7 @@ resource "aws_acm_certificate" "cert" { ### Existing Certificate Body Import -```hcl +```terraform resource "tls_private_key" "example" { algorithm = "RSA" } @@ -80,7 +80,7 @@ resource "aws_acm_certificate" "cert" { See the [`aws_acm_certificate_validation` resource](acm_certificate_validation.html) for a full example of performing DNS validation. -```hcl +```terraform resource "aws_route53_record" "example" { for_each = { for dvo in aws_acm_certificate.example.domain_validation_options : dvo.domain_name => { diff --git a/website/docs/r/acm_certificate_validation.html.markdown b/website/docs/r/acm_certificate_validation.html.markdown index ea7ddc68acf..822d7c574af 100644 --- a/website/docs/r/acm_certificate_validation.html.markdown +++ b/website/docs/r/acm_certificate_validation.html.markdown @@ -22,7 +22,7 @@ deploy the required validation records and wait for validation to complete. ### DNS Validation with Route 53 -```hcl +```terraform resource "aws_acm_certificate" "example" { domain_name = "example.com" validation_method = "DNS" @@ -64,7 +64,7 @@ resource "aws_lb_listener" "example" { ### Alternative Domains DNS Validation with Route 53 -```hcl +```terraform resource "aws_acm_certificate" "example" { domain_name = "example.com" subject_alternative_names = ["www.example.com", "example.org"] @@ -115,7 +115,7 @@ resource "aws_lb_listener" "example" { In this situation, the resource is simply a waiter for manual email approval of ACM certificates. -```hcl +```terraform resource "aws_acm_certificate" "example" { domain_name = "example.com" validation_method = "EMAIL" diff --git a/website/docs/r/acmpca_certificate_authority.html.markdown b/website/docs/r/acmpca_certificate_authority.html.markdown index 205a6663156..a7c0e3dafdc 100644 --- a/website/docs/r/acmpca_certificate_authority.html.markdown +++ b/website/docs/r/acmpca_certificate_authority.html.markdown @@ -16,7 +16,7 @@ Provides a resource to manage AWS Certificate Manager Private Certificate Author ### Basic -```hcl +```terraform resource "aws_acmpca_certificate_authority" "example" { certificate_authority_configuration { key_algorithm = "RSA_4096" @@ -33,7 +33,7 @@ resource "aws_acmpca_certificate_authority" "example" { ### Enable Certificate Revocation List -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } diff --git a/website/docs/r/ami.html.markdown b/website/docs/r/ami.html.markdown index 9edb3b972d5..351992968aa 100644 --- a/website/docs/r/ami.html.markdown +++ b/website/docs/r/ami.html.markdown @@ -19,7 +19,7 @@ it's better to use `aws_ami_launch_permission` instead. ## Example Usage -```hcl +```terraform # Create an AMI that will start a machine whose root device is backed by # an EBS volume populated from a snapshot. It is assumed that such a snapshot # already exists with the id "snap-xxxxxxxx". diff --git a/website/docs/r/ami_copy.html.markdown b/website/docs/r/ami_copy.html.markdown index fe7244fcf8b..c5df365c33d 100644 --- a/website/docs/r/ami_copy.html.markdown +++ b/website/docs/r/ami_copy.html.markdown @@ -22,7 +22,7 @@ block until the new AMI is available for use on new instances. ## Example Usage -```hcl +```terraform resource "aws_ami_copy" "example" { name = "terraform-example" description = "A copy of ami-xxxxxxxx" diff --git a/website/docs/r/ami_from_instance.html.markdown b/website/docs/r/ami_from_instance.html.markdown index a4bd2a6c6b7..d7fffe3dd21 100644 --- a/website/docs/r/ami_from_instance.html.markdown +++ b/website/docs/r/ami_from_instance.html.markdown @@ -28,7 +28,7 @@ to produce a fresh snapshot. ## Example Usage -```hcl +```terraform resource "aws_ami_from_instance" "example" { name = "terraform-example" source_instance_id = "i-xxxxxxxx" diff --git a/website/docs/r/ami_launch_permission.html.markdown b/website/docs/r/ami_launch_permission.html.markdown index a55d9a87e0c..8c9aec85fed 100644 --- a/website/docs/r/ami_launch_permission.html.markdown +++ b/website/docs/r/ami_launch_permission.html.markdown @@ -12,7 +12,7 @@ Adds launch permission to Amazon Machine Image (AMI) from another AWS account. ## Example Usage -```hcl +```terraform resource "aws_ami_launch_permission" "example" { image_id = "ami-12345678" account_id = "123456789012" diff --git a/website/docs/r/api_gateway_account.html.markdown b/website/docs/r/api_gateway_account.html.markdown index 45ea5de6b37..fafd8dc44d8 100644 --- a/website/docs/r/api_gateway_account.html.markdown +++ b/website/docs/r/api_gateway_account.html.markdown @@ -14,7 +14,7 @@ Provides a settings of an API Gateway Account. Settings is applied region-wide p ## Example Usage -```hcl +```terraform resource "aws_api_gateway_account" "demo" { cloudwatch_role_arn = aws_iam_role.cloudwatch.arn } diff --git a/website/docs/r/api_gateway_api_key.html.markdown b/website/docs/r/api_gateway_api_key.html.markdown index ef122139d8f..da6b3bf482e 100644 --- a/website/docs/r/api_gateway_api_key.html.markdown +++ b/website/docs/r/api_gateway_api_key.html.markdown @@ -14,7 +14,7 @@ Provides an API Gateway API Key. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_api_key" "MyDemoApiKey" { name = "demo" } diff --git a/website/docs/r/api_gateway_authorizer.html.markdown b/website/docs/r/api_gateway_authorizer.html.markdown index 5422d686bac..4e6b004f525 100644 --- a/website/docs/r/api_gateway_authorizer.html.markdown +++ b/website/docs/r/api_gateway_authorizer.html.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Authorizer. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_authorizer" "demo" { name = "demo" rest_api_id = aws_api_gateway_rest_api.demo.id diff --git a/website/docs/r/api_gateway_base_path_mapping.html.markdown b/website/docs/r/api_gateway_base_path_mapping.html.markdown index 1485d02a829..4e85fa78b47 100644 --- a/website/docs/r/api_gateway_base_path_mapping.html.markdown +++ b/website/docs/r/api_gateway_base_path_mapping.html.markdown @@ -16,7 +16,7 @@ custom domain name. An end-to-end example of a REST API configured with OpenAPI can be found in the [`/examples/api-gateway-rest-api-openapi` directory within the GitHub repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/api-gateway-rest-api-openapi). -```hcl +```terraform resource "aws_api_gateway_stage" "example" { deployment_id = aws_api_gateway_deployment.example.id rest_api_id = aws_api_gateway_rest_api.example.id diff --git a/website/docs/r/api_gateway_client_certificate.html.markdown b/website/docs/r/api_gateway_client_certificate.html.markdown index 77e71ff9a23..a52811b9226 100644 --- a/website/docs/r/api_gateway_client_certificate.html.markdown +++ b/website/docs/r/api_gateway_client_certificate.html.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Client Certificate. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_client_certificate" "demo" { description = "My client certificate" } diff --git a/website/docs/r/api_gateway_deployment.html.markdown b/website/docs/r/api_gateway_deployment.html.markdown index 731cf240013..2674590f4f5 100644 --- a/website/docs/r/api_gateway_deployment.html.markdown +++ b/website/docs/r/api_gateway_deployment.html.markdown @@ -25,7 +25,7 @@ To properly capture all REST API configuration in a deployment, this resource mu An end-to-end example of a REST API configured with OpenAPI can be found in the [`/examples/api-gateway-rest-api-openapi` directory within the GitHub repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/api-gateway-rest-api-openapi). -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" @@ -71,7 +71,7 @@ resource "aws_api_gateway_stage" "example" { ### Terraform Resources -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { name = "example" } diff --git a/website/docs/r/api_gateway_documentation_part.html.markdown b/website/docs/r/api_gateway_documentation_part.html.markdown index f9b8eeae12a..de4d372f606 100644 --- a/website/docs/r/api_gateway_documentation_part.html.markdown +++ b/website/docs/r/api_gateway_documentation_part.html.markdown @@ -12,7 +12,7 @@ Provides a settings of an API Gateway Documentation Part. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_documentation_part" "example" { location { type = "METHOD" diff --git a/website/docs/r/api_gateway_documentation_version.html.markdown b/website/docs/r/api_gateway_documentation_version.html.markdown index 7a54109b861..dfe8e9e55d9 100644 --- a/website/docs/r/api_gateway_documentation_version.html.markdown +++ b/website/docs/r/api_gateway_documentation_version.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage an API Gateway Documentation Version. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_documentation_version" "example" { version = "example_version" rest_api_id = aws_api_gateway_rest_api.example.id diff --git a/website/docs/r/api_gateway_domain_name.html.markdown b/website/docs/r/api_gateway_domain_name.html.markdown index 3eefe3b2bdc..eaae7711161 100644 --- a/website/docs/r/api_gateway_domain_name.html.markdown +++ b/website/docs/r/api_gateway_domain_name.html.markdown @@ -44,7 +44,7 @@ An end-to-end example of a REST API configured with OpenAPI can be found in the ### Edge Optimized (ACM Certificate) -```hcl +```terraform resource "aws_api_gateway_domain_name" "example" { certificate_arn = aws_acm_certificate_validation.example.certificate_arn domain_name = "api.example.com" @@ -67,7 +67,7 @@ resource "aws_route53_record" "example" { ### Edge Optimized (IAM Certificate) -```hcl +```terraform resource "aws_api_gateway_domain_name" "example" { domain_name = "api.example.com" @@ -95,7 +95,7 @@ resource "aws_route53_record" "example" { ### Regional (ACM Certificate) -```hcl +```terraform resource "aws_api_gateway_domain_name" "example" { domain_name = "api.example.com" regional_certificate_arn = aws_acm_certificate_validation.example.certificate_arn @@ -122,7 +122,7 @@ resource "aws_route53_record" "example" { ### Regional (IAM Certificate) -```hcl +```terraform resource "aws_api_gateway_domain_name" "example" { certificate_body = file("${path.module}/example.com/example.crt") certificate_chain = file("${path.module}/example.com/ca.crt") diff --git a/website/docs/r/api_gateway_gateway_response.markdown b/website/docs/r/api_gateway_gateway_response.markdown index f34202f4778..3a8c0866649 100644 --- a/website/docs/r/api_gateway_gateway_response.markdown +++ b/website/docs/r/api_gateway_gateway_response.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Gateway Response for a REST API Gateway. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "main" { name = "MyDemoAPI" } diff --git a/website/docs/r/api_gateway_integration.html.markdown b/website/docs/r/api_gateway_integration.html.markdown index e6561fb25d0..fc87991a249 100644 --- a/website/docs/r/api_gateway_integration.html.markdown +++ b/website/docs/r/api_gateway_integration.html.markdown @@ -12,7 +12,7 @@ Provides an HTTP Method Integration for an API Gateway Integration. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" @@ -57,7 +57,7 @@ EOF ## Lambda integration -```hcl +```terraform # Variables variable "myregion" {} @@ -138,7 +138,7 @@ POLICY ## VPC Link -```hcl +```terraform variable "name" {} variable "subnet_id" {} diff --git a/website/docs/r/api_gateway_integration_response.html.markdown b/website/docs/r/api_gateway_integration_response.html.markdown index 16c74e1632c..c02e9bde277 100644 --- a/website/docs/r/api_gateway_integration_response.html.markdown +++ b/website/docs/r/api_gateway_integration_response.html.markdown @@ -15,7 +15,7 @@ you might need to add an explicit `depends_on` for clean runs. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" diff --git a/website/docs/r/api_gateway_method.html.markdown b/website/docs/r/api_gateway_method.html.markdown index 3964bc39c3b..405ae9f1d32 100644 --- a/website/docs/r/api_gateway_method.html.markdown +++ b/website/docs/r/api_gateway_method.html.markdown @@ -12,7 +12,7 @@ Provides a HTTP Method for an API Gateway Resource. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" @@ -34,7 +34,7 @@ resource "aws_api_gateway_method" "MyDemoMethod" { ## Usage with Cognito User Pool Authorizer -```hcl +```terraform variable "cognito_user_pool_name" {} data "aws_cognito_user_pools" "this" { diff --git a/website/docs/r/api_gateway_method_response.html.markdown b/website/docs/r/api_gateway_method_response.html.markdown index 99cf469365e..fa47c18f698 100644 --- a/website/docs/r/api_gateway_method_response.html.markdown +++ b/website/docs/r/api_gateway_method_response.html.markdown @@ -12,7 +12,7 @@ Provides an HTTP Method Response for an API Gateway Resource. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" diff --git a/website/docs/r/api_gateway_method_settings.html.markdown b/website/docs/r/api_gateway_method_settings.html.markdown index 3e60afa16aa..7c829c556a9 100644 --- a/website/docs/r/api_gateway_method_settings.html.markdown +++ b/website/docs/r/api_gateway_method_settings.html.markdown @@ -16,7 +16,7 @@ Manages API Gateway Stage Method Settings. For example, CloudWatch logging and m An end-to-end example of a REST API configured with OpenAPI can be found in the [`/examples/api-gateway-rest-api-openapi` directory within the GitHub repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/api-gateway-rest-api-openapi). -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" diff --git a/website/docs/r/api_gateway_model.html.markdown b/website/docs/r/api_gateway_model.html.markdown index 0df3eb6de70..ba95c6d03f4 100644 --- a/website/docs/r/api_gateway_model.html.markdown +++ b/website/docs/r/api_gateway_model.html.markdown @@ -12,7 +12,7 @@ Provides a Model for a REST API Gateway. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" diff --git a/website/docs/r/api_gateway_request_validator.html.markdown b/website/docs/r/api_gateway_request_validator.html.markdown index 3641b216878..ea823cee207 100644 --- a/website/docs/r/api_gateway_request_validator.html.markdown +++ b/website/docs/r/api_gateway_request_validator.html.markdown @@ -12,7 +12,7 @@ Manages an API Gateway Request Validator. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_request_validator" "example" { name = "example" rest_api_id = aws_api_gateway_rest_api.example.id diff --git a/website/docs/r/api_gateway_resource.html.markdown b/website/docs/r/api_gateway_resource.html.markdown index fc64b4a06a2..d69b8769399 100644 --- a/website/docs/r/api_gateway_resource.html.markdown +++ b/website/docs/r/api_gateway_resource.html.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Resource. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" diff --git a/website/docs/r/api_gateway_rest_api.html.markdown b/website/docs/r/api_gateway_rest_api.html.markdown index def040b490a..e83f089f652 100644 --- a/website/docs/r/api_gateway_rest_api.html.markdown +++ b/website/docs/r/api_gateway_rest_api.html.markdown @@ -18,7 +18,7 @@ Manages an API Gateway REST API. The REST API can be configured via [importing a An end-to-end example of a REST API configured with OpenAPI can be found in the [`/examples/api-gateway-rest-api-openapi` directory within the GitHub repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/api-gateway-rest-api-openapi). -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" @@ -68,7 +68,7 @@ resource "aws_api_gateway_stage" "example" { ### Terraform Resources -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { name = "example" } diff --git a/website/docs/r/api_gateway_rest_api_policy.html.markdown b/website/docs/r/api_gateway_rest_api_policy.html.markdown index ffdad097ec3..cb4886fa25d 100644 --- a/website/docs/r/api_gateway_rest_api_policy.html.markdown +++ b/website/docs/r/api_gateway_rest_api_policy.html.markdown @@ -16,7 +16,7 @@ Provides an API Gateway REST API Policy. ### Basic -```hcl +```terraform resource "aws_api_gateway_rest_api" "test" { name = "example-rest-api" } diff --git a/website/docs/r/api_gateway_stage.html.markdown b/website/docs/r/api_gateway_stage.html.markdown index de7286e1e2d..0d9740045b3 100644 --- a/website/docs/r/api_gateway_stage.html.markdown +++ b/website/docs/r/api_gateway_stage.html.markdown @@ -14,7 +14,7 @@ Manages an API Gateway Stage. A stage is a named reference to a deployment, whic An end-to-end example of a REST API configured with OpenAPI can be found in the [`/examples/api-gateway-rest-api-openapi` directory within the GitHub repository](https://github.com/hashicorp/terraform-provider-aws/tree/main/examples/api-gateway-rest-api-openapi). -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" @@ -75,7 +75,7 @@ API Gateway provides the ability to [enable CloudWatch API logging](https://docs -> The below configuration uses [`depends_on`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) to prevent ordering issues with API Gateway automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment. -```hcl +```terraform variable "stage_name" { default = "example" type = string diff --git a/website/docs/r/api_gateway_usage_plan.html.markdown b/website/docs/r/api_gateway_usage_plan.html.markdown index 877ec197133..abf20ee150e 100644 --- a/website/docs/r/api_gateway_usage_plan.html.markdown +++ b/website/docs/r/api_gateway_usage_plan.html.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Usage Plan. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" diff --git a/website/docs/r/api_gateway_usage_plan_key.html.markdown b/website/docs/r/api_gateway_usage_plan_key.html.markdown index f4b96e3727d..84db6d1b58c 100644 --- a/website/docs/r/api_gateway_usage_plan_key.html.markdown +++ b/website/docs/r/api_gateway_usage_plan_key.html.markdown @@ -12,7 +12,7 @@ Provides an API Gateway Usage Plan Key. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "test" { name = "MyDemoAPI" } diff --git a/website/docs/r/api_gateway_vpc_link.html.markdown b/website/docs/r/api_gateway_vpc_link.html.markdown index 7bf9d0990ba..21a766a484c 100644 --- a/website/docs/r/api_gateway_vpc_link.html.markdown +++ b/website/docs/r/api_gateway_vpc_link.html.markdown @@ -15,7 +15,7 @@ To enable private integration for HTTP APIs, use the Amazon API Gateway Version ## Example Usage -```hcl +```terraform resource "aws_lb" "example" { name = "example" internal = true diff --git a/website/docs/r/apigatewayv2_api.html.markdown b/website/docs/r/apigatewayv2_api.html.markdown index eada23d6271..b73950ecb16 100644 --- a/website/docs/r/apigatewayv2_api.html.markdown +++ b/website/docs/r/apigatewayv2_api.html.markdown @@ -16,7 +16,7 @@ Manages an Amazon API Gateway Version 2 API. ### Basic WebSocket API -```hcl +```terraform resource "aws_apigatewayv2_api" "example" { name = "example-websocket-api" protocol_type = "WEBSOCKET" @@ -26,7 +26,7 @@ resource "aws_apigatewayv2_api" "example" { ### Basic HTTP API -```hcl +```terraform resource "aws_apigatewayv2_api" "example" { name = "example-http-api" protocol_type = "HTTP" diff --git a/website/docs/r/apigatewayv2_api_mapping.html.markdown b/website/docs/r/apigatewayv2_api_mapping.html.markdown index d3b0a484bbd..f71a7d365c5 100644 --- a/website/docs/r/apigatewayv2_api_mapping.html.markdown +++ b/website/docs/r/apigatewayv2_api_mapping.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_api_mapping" "example" { api_id = aws_apigatewayv2_api.example.id domain_name = aws_apigatewayv2_domain_name.example.id diff --git a/website/docs/r/apigatewayv2_authorizer.html.markdown b/website/docs/r/apigatewayv2_authorizer.html.markdown index ab64754a615..35265d0344d 100644 --- a/website/docs/r/apigatewayv2_authorizer.html.markdown +++ b/website/docs/r/apigatewayv2_authorizer.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic WebSocket API -```hcl +```terraform resource "aws_apigatewayv2_authorizer" "example" { api_id = aws_apigatewayv2_api.example.id authorizer_type = "REQUEST" @@ -27,7 +27,7 @@ resource "aws_apigatewayv2_authorizer" "example" { ### Basic HTTP API -```hcl +```terraform resource "aws_apigatewayv2_authorizer" "example" { api_id = aws_apigatewayv2_api.example.id authorizer_type = "JWT" diff --git a/website/docs/r/apigatewayv2_deployment.html.markdown b/website/docs/r/apigatewayv2_deployment.html.markdown index 181de827201..ba6789caa7b 100644 --- a/website/docs/r/apigatewayv2_deployment.html.markdown +++ b/website/docs/r/apigatewayv2_deployment.html.markdown @@ -19,7 +19,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_deployment" "example" { api_id = aws_apigatewayv2_route.example.api_id description = "Example deployment" @@ -34,7 +34,7 @@ resource "aws_apigatewayv2_deployment" "example" { -> **NOTE:** This is an optional and Terraform 0.12 (or later) advanced configuration that shows calculating a hash of the API's Terraform resources to determine changes that should trigger a new deployment. This value will change after the first Terraform apply of new resources, triggering an immediate redeployment, however it will stabilize afterwards except for resource changes. The `triggers` map can also be configured in other, more complex ways to fit the environment, avoiding the immediate redeployment issue. -```hcl +```terraform resource "aws_apigatewayv2_deployment" "example" { api_id = aws_apigatewayv2_api.example.id description = "Example deployment" diff --git a/website/docs/r/apigatewayv2_domain_name.html.markdown b/website/docs/r/apigatewayv2_domain_name.html.markdown index c28383ab6dc..b122f7578a8 100644 --- a/website/docs/r/apigatewayv2_domain_name.html.markdown +++ b/website/docs/r/apigatewayv2_domain_name.html.markdown @@ -18,7 +18,7 @@ a particular domain name. An API stage can be associated with the domain name us ### Basic -```hcl +```terraform resource "aws_apigatewayv2_domain_name" "example" { domain_name = "ws-api.example.com" @@ -32,7 +32,7 @@ resource "aws_apigatewayv2_domain_name" "example" { ### Associated Route 53 Resource Record -```hcl +```terraform resource "aws_apigatewayv2_domain_name" "example" { domain_name = "http-api.example.com" diff --git a/website/docs/r/apigatewayv2_integration.html.markdown b/website/docs/r/apigatewayv2_integration.html.markdown index e7d89fa05dd..d0925af9100 100644 --- a/website/docs/r/apigatewayv2_integration.html.markdown +++ b/website/docs/r/apigatewayv2_integration.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_integration" "example" { api_id = aws_apigatewayv2_api.example.id integration_type = "MOCK" @@ -24,7 +24,7 @@ resource "aws_apigatewayv2_integration" "example" { ### Lambda Integration -```hcl +```terraform resource "aws_lambda_function" "example" { filename = "example.zip" function_name = "Example" @@ -48,7 +48,7 @@ resource "aws_apigatewayv2_integration" "example" { ### AWS Service Integration -```hcl +```terraform resource "aws_apigatewayv2_integration" "example" { api_id = aws_apigatewayv2_api.example.id credentials_arn = aws_iam_role.example.arn @@ -65,7 +65,7 @@ resource "aws_apigatewayv2_integration" "example" { ### Private Integration -```hcl +```terraform resource "aws_apigatewayv2_integration" "example" { api_id = aws_apigatewayv2_api.example.id credentials_arn = aws_iam_role.example.arn diff --git a/website/docs/r/apigatewayv2_integration_response.html.markdown b/website/docs/r/apigatewayv2_integration_response.html.markdown index eabdaec005d..05ab9fd92c7 100644 --- a/website/docs/r/apigatewayv2_integration_response.html.markdown +++ b/website/docs/r/apigatewayv2_integration_response.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_integration_response" "example" { api_id = aws_apigatewayv2_api.example.id integration_id = aws_apigatewayv2_integration.example.id diff --git a/website/docs/r/apigatewayv2_model.html.markdown b/website/docs/r/apigatewayv2_model.html.markdown index b707e0bc062..107a15164ec 100644 --- a/website/docs/r/apigatewayv2_model.html.markdown +++ b/website/docs/r/apigatewayv2_model.html.markdown @@ -14,7 +14,7 @@ Manages an Amazon API Gateway Version 2 [model](https://docs.aws.amazon.com/apig ### Basic -```hcl +```terraform resource "aws_apigatewayv2_model" "example" { api_id = aws_apigatewayv2_api.example.id content_type = "application/json" diff --git a/website/docs/r/apigatewayv2_route.html.markdown b/website/docs/r/apigatewayv2_route.html.markdown index e45a982ef5d..11d9a7463d2 100644 --- a/website/docs/r/apigatewayv2_route.html.markdown +++ b/website/docs/r/apigatewayv2_route.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_api" "example" { name = "example-websocket-api" protocol_type = "WEBSOCKET" @@ -30,7 +30,7 @@ resource "aws_apigatewayv2_route" "example" { ### HTTP Proxy Integration -```hcl +```terraform resource "aws_apigatewayv2_api" "example" { name = "example-http-api" protocol_type = "HTTP" diff --git a/website/docs/r/apigatewayv2_route_response.html.markdown b/website/docs/r/apigatewayv2_route_response.html.markdown index ec8e6277526..38b494adf77 100644 --- a/website/docs/r/apigatewayv2_route_response.html.markdown +++ b/website/docs/r/apigatewayv2_route_response.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_route_response" "example" { api_id = aws_apigatewayv2_api.example.id route_id = aws_apigatewayv2_route.example.id diff --git a/website/docs/r/apigatewayv2_stage.html.markdown b/website/docs/r/apigatewayv2_stage.html.markdown index 38958ea4dab..33e736aea00 100644 --- a/website/docs/r/apigatewayv2_stage.html.markdown +++ b/website/docs/r/apigatewayv2_stage.html.markdown @@ -15,7 +15,7 @@ More information can be found in the [Amazon API Gateway Developer Guide](https: ### Basic -```hcl +```terraform resource "aws_apigatewayv2_stage" "example" { api_id = aws_apigatewayv2_api.example.id name = "example-stage" diff --git a/website/docs/r/apigatewayv2_vpc_link.html.markdown b/website/docs/r/apigatewayv2_vpc_link.html.markdown index dcaa94baf4d..0d3e6677722 100644 --- a/website/docs/r/apigatewayv2_vpc_link.html.markdown +++ b/website/docs/r/apigatewayv2_vpc_link.html.markdown @@ -15,7 +15,7 @@ To enable private integration for REST APIs, use the Amazon API Gateway Version ## Example Usage -```hcl +```terraform resource "aws_apigatewayv2_vpc_link" "example" { name = "example" security_group_ids = [data.aws_security_group.example.id] diff --git a/website/docs/r/app_cookie_stickiness_policy.html.markdown b/website/docs/r/app_cookie_stickiness_policy.html.markdown index fd3a9e535f3..a5087e39a4c 100644 --- a/website/docs/r/app_cookie_stickiness_policy.html.markdown +++ b/website/docs/r/app_cookie_stickiness_policy.html.markdown @@ -12,7 +12,7 @@ Provides an application cookie stickiness policy, which allows an ELB to wed its ## Example Usage -```hcl +```terraform resource "aws_elb" "lb" { name = "test-lb" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/appautoscaling_policy.html.markdown b/website/docs/r/appautoscaling_policy.html.markdown index ff7d6034bdb..9b4fe1ea036 100644 --- a/website/docs/r/appautoscaling_policy.html.markdown +++ b/website/docs/r/appautoscaling_policy.html.markdown @@ -14,7 +14,7 @@ Provides an Application AutoScaling Policy resource. ### DynamoDB Table Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "dynamodb_table_read_target" { max_capacity = 100 min_capacity = 5 @@ -42,7 +42,7 @@ resource "aws_appautoscaling_policy" "dynamodb_table_read_policy" { ### ECS Service Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "ecs_target" { max_capacity = 4 min_capacity = 1 @@ -73,7 +73,7 @@ resource "aws_appautoscaling_policy" "ecs_policy" { ### Preserve desired count when updating an autoscaled ECS Service -```hcl +```terraform resource "aws_ecs_service" "ecs_service" { name = "serviceName" cluster = "clusterName" @@ -88,7 +88,7 @@ resource "aws_ecs_service" "ecs_service" { ### Aurora Read Replica Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "replicas" { service_namespace = "rds" scalable_dimension = "rds:cluster:ReadReplicaCount" @@ -138,7 +138,7 @@ The `step_scaling_policy_configuration` configuration block supports the followi * `min_adjustment_magnitude` - (Optional) The minimum number to adjust your scalable dimension as a result of a scaling activity. If the adjustment type is PercentChangeInCapacity, the scaling policy changes the scalable dimension of the scalable target by this amount. * `step_adjustment` - (Optional) A set of adjustments that manage scaling. These have the following structure: - ```hcl + ```terraform resource "aws_appautoscaling_policy" "ecs_policy" { # ... @@ -179,7 +179,7 @@ The `target_tracking_scaling_policy_configuration` configuration block supports Example usage: -```hcl +```terraform resource "aws_appautoscaling_policy" "example" { policy_type = "TargetTrackingScaling" diff --git a/website/docs/r/appautoscaling_scheduled_action.html.markdown b/website/docs/r/appautoscaling_scheduled_action.html.markdown index 8f7c8b60eb1..7170188f391 100644 --- a/website/docs/r/appautoscaling_scheduled_action.html.markdown +++ b/website/docs/r/appautoscaling_scheduled_action.html.markdown @@ -14,7 +14,7 @@ Provides an Application AutoScaling ScheduledAction resource. ### DynamoDB Table Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "dynamodb" { max_capacity = 100 min_capacity = 5 @@ -39,7 +39,7 @@ resource "aws_appautoscaling_scheduled_action" "dynamodb" { ### ECS Service Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "ecs" { max_capacity = 4 min_capacity = 1 diff --git a/website/docs/r/appautoscaling_target.html.markdown b/website/docs/r/appautoscaling_target.html.markdown index 2eda533698c..83f670bb956 100644 --- a/website/docs/r/appautoscaling_target.html.markdown +++ b/website/docs/r/appautoscaling_target.html.markdown @@ -16,7 +16,7 @@ Provides an Application AutoScaling ScalableTarget resource. To manage policies ### DynamoDB Table Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "dynamodb_table_read_target" { max_capacity = 100 min_capacity = 5 @@ -28,7 +28,7 @@ resource "aws_appautoscaling_target" "dynamodb_table_read_target" { ### DynamoDB Index Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "dynamodb_index_read_target" { max_capacity = 100 min_capacity = 5 @@ -40,7 +40,7 @@ resource "aws_appautoscaling_target" "dynamodb_index_read_target" { ### ECS Service Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "ecs_target" { max_capacity = 4 min_capacity = 1 @@ -52,7 +52,7 @@ resource "aws_appautoscaling_target" "ecs_target" { ### Aurora Read Replica Autoscaling -```hcl +```terraform resource "aws_appautoscaling_target" "replicas" { service_namespace = "rds" scalable_dimension = "rds:cluster:ReadReplicaCount" diff --git a/website/docs/r/appmesh_gateway_route.html.markdown b/website/docs/r/appmesh_gateway_route.html.markdown index 350337e3932..730e1a9e589 100644 --- a/website/docs/r/appmesh_gateway_route.html.markdown +++ b/website/docs/r/appmesh_gateway_route.html.markdown @@ -12,7 +12,7 @@ Provides an AWS App Mesh gateway route resource. ## Example Usage -```hcl +```terraform resource "aws_appmesh_gateway_route" "example" { name = "example-gateway-route" mesh_name = "example-service-mesh" diff --git a/website/docs/r/appmesh_mesh.html.markdown b/website/docs/r/appmesh_mesh.html.markdown index b21352f02e6..d633cd16156 100644 --- a/website/docs/r/appmesh_mesh.html.markdown +++ b/website/docs/r/appmesh_mesh.html.markdown @@ -14,7 +14,7 @@ Provides an AWS App Mesh service mesh resource. ### Basic -```hcl +```terraform resource "aws_appmesh_mesh" "simple" { name = "simpleapp" } @@ -22,7 +22,7 @@ resource "aws_appmesh_mesh" "simple" { ### Egress Filter -```hcl +```terraform resource "aws_appmesh_mesh" "simple" { name = "simpleapp" diff --git a/website/docs/r/appmesh_route.html.markdown b/website/docs/r/appmesh_route.html.markdown index b7891b6c596..688a8215ff2 100644 --- a/website/docs/r/appmesh_route.html.markdown +++ b/website/docs/r/appmesh_route.html.markdown @@ -14,7 +14,7 @@ Provides an AWS App Mesh route resource. ### HTTP Routing -```hcl +```terraform resource "aws_appmesh_route" "serviceb" { name = "serviceB-route" mesh_name = aws_appmesh_mesh.simple.id @@ -44,7 +44,7 @@ resource "aws_appmesh_route" "serviceb" { ### HTTP Header Routing -```hcl +```terraform resource "aws_appmesh_route" "serviceb" { name = "serviceB-route" mesh_name = aws_appmesh_mesh.simple.id @@ -79,7 +79,7 @@ resource "aws_appmesh_route" "serviceb" { ### Retry Policy -```hcl +```terraform resource "aws_appmesh_route" "serviceb" { name = "serviceB-route" mesh_name = aws_appmesh_mesh.simple.id @@ -116,7 +116,7 @@ resource "aws_appmesh_route" "serviceb" { ### TCP Routing -```hcl +```terraform resource "aws_appmesh_route" "serviceb" { name = "serviceB-route" mesh_name = aws_appmesh_mesh.simple.id diff --git a/website/docs/r/appmesh_virtual_gateway.html.markdown b/website/docs/r/appmesh_virtual_gateway.html.markdown index 604342c7eed..12a7b1c8b4e 100644 --- a/website/docs/r/appmesh_virtual_gateway.html.markdown +++ b/website/docs/r/appmesh_virtual_gateway.html.markdown @@ -14,7 +14,7 @@ Provides an AWS App Mesh virtual gateway resource. ### Basic -```hcl +```terraform resource "aws_appmesh_virtual_gateway" "example" { name = "example-virtual-gateway" mesh_name = "example-service-mesh" @@ -36,7 +36,7 @@ resource "aws_appmesh_virtual_gateway" "example" { ### Access Logs and TLS -```hcl +```terraform resource "aws_appmesh_virtual_gateway" "example" { name = "example-virtual-gateway" mesh_name = "example-service-mesh" diff --git a/website/docs/r/appmesh_virtual_node.html.markdown b/website/docs/r/appmesh_virtual_node.html.markdown index 76d251dca77..ba03b9ee10e 100644 --- a/website/docs/r/appmesh_virtual_node.html.markdown +++ b/website/docs/r/appmesh_virtual_node.html.markdown @@ -25,7 +25,7 @@ The Terraform state associated with existing resources will automatically be mig ### Basic -```hcl +```terraform resource "aws_appmesh_virtual_node" "serviceb1" { name = "serviceBv1" mesh_name = aws_appmesh_mesh.simple.id @@ -55,7 +55,7 @@ resource "aws_appmesh_virtual_node" "serviceb1" { ### AWS Cloud Map Service Discovery -```hcl +```terraform resource "aws_service_discovery_http_namespace" "example" { name = "example-ns" } @@ -94,7 +94,7 @@ resource "aws_appmesh_virtual_node" "serviceb1" { ### Listener Health Check -```hcl +```terraform resource "aws_appmesh_virtual_node" "serviceb1" { name = "serviceBv1" mesh_name = aws_appmesh_mesh.simple.id @@ -133,7 +133,7 @@ resource "aws_appmesh_virtual_node" "serviceb1" { ### Logging -```hcl +```terraform resource "aws_appmesh_virtual_node" "serviceb1" { name = "serviceBv1" mesh_name = aws_appmesh_mesh.simple.id diff --git a/website/docs/r/appmesh_virtual_router.html.markdown b/website/docs/r/appmesh_virtual_router.html.markdown index 50631ab31bb..13b05463ffd 100644 --- a/website/docs/r/appmesh_virtual_router.html.markdown +++ b/website/docs/r/appmesh_virtual_router.html.markdown @@ -24,7 +24,7 @@ The Terraform state associated with existing resources will automatically be mig ## Example Usage -```hcl +```terraform resource "aws_appmesh_virtual_router" "serviceb" { name = "serviceB" mesh_name = aws_appmesh_mesh.simple.id diff --git a/website/docs/r/appmesh_virtual_service.html.markdown b/website/docs/r/appmesh_virtual_service.html.markdown index 9c5d3fb0584..a803fd538e0 100644 --- a/website/docs/r/appmesh_virtual_service.html.markdown +++ b/website/docs/r/appmesh_virtual_service.html.markdown @@ -14,7 +14,7 @@ Provides an AWS App Mesh virtual service resource. ### Virtual Node Provider -```hcl +```terraform resource "aws_appmesh_virtual_service" "servicea" { name = "servicea.simpleapp.local" mesh_name = aws_appmesh_mesh.simple.id @@ -31,7 +31,7 @@ resource "aws_appmesh_virtual_service" "servicea" { ### Virtual Router Provider -```hcl +```terraform resource "aws_appmesh_virtual_service" "servicea" { name = "servicea.simpleapp.local" mesh_name = aws_appmesh_mesh.simple.id diff --git a/website/docs/r/appsync_api_key.html.markdown b/website/docs/r/appsync_api_key.html.markdown index a6c913367c9..3d5b2dace46 100644 --- a/website/docs/r/appsync_api_key.html.markdown +++ b/website/docs/r/appsync_api_key.html.markdown @@ -12,7 +12,7 @@ Provides an AppSync API Key. ## Example Usage -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "API_KEY" name = "example" diff --git a/website/docs/r/appsync_datasource.html.markdown b/website/docs/r/appsync_datasource.html.markdown index e13af7858b3..3f0eba9798a 100644 --- a/website/docs/r/appsync_datasource.html.markdown +++ b/website/docs/r/appsync_datasource.html.markdown @@ -12,7 +12,7 @@ Provides an AppSync DataSource. ## Example Usage -```hcl +```terraform resource "aws_dynamodb_table" "example" { name = "example" read_capacity = 1 diff --git a/website/docs/r/appsync_function.html.markdown b/website/docs/r/appsync_function.html.markdown index 120ca8771d2..7df8ee88b47 100644 --- a/website/docs/r/appsync_function.html.markdown +++ b/website/docs/r/appsync_function.html.markdown @@ -12,7 +12,7 @@ Provides an AppSync Function. ## Example Usage -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "API_KEY" name = "example" diff --git a/website/docs/r/appsync_graphql_api.html.markdown b/website/docs/r/appsync_graphql_api.html.markdown index 73ea4a92a10..b69b1dc48e4 100644 --- a/website/docs/r/appsync_graphql_api.html.markdown +++ b/website/docs/r/appsync_graphql_api.html.markdown @@ -14,7 +14,7 @@ Provides an AppSync GraphQL API. ### API Key Authentication -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "API_KEY" name = "example" @@ -23,7 +23,7 @@ resource "aws_appsync_graphql_api" "example" { ### AWS Cognito User Pool Authentication -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "AMAZON_COGNITO_USER_POOLS" name = "example" @@ -38,7 +38,7 @@ resource "aws_appsync_graphql_api" "example" { ### AWS IAM Authentication -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "AWS_IAM" name = "example" @@ -47,7 +47,7 @@ resource "aws_appsync_graphql_api" "example" { ### With Schema -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "AWS_IAM" name = "example" @@ -65,7 +65,7 @@ EOF ### OpenID Connect Authentication -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "OPENID_CONNECT" name = "example" @@ -78,7 +78,7 @@ resource "aws_appsync_graphql_api" "example" { ### With Multiple Authentication Providers -```hcl +```terraform resource "aws_appsync_graphql_api" "example" { authentication_type = "API_KEY" name = "example" @@ -91,7 +91,7 @@ resource "aws_appsync_graphql_api" "example" { ### Enabling Logging -```hcl +```terraform resource "aws_iam_role" "example" { name = "example" diff --git a/website/docs/r/appsync_resolver.html.markdown b/website/docs/r/appsync_resolver.html.markdown index 56373c351e3..516fa22ddc5 100644 --- a/website/docs/r/appsync_resolver.html.markdown +++ b/website/docs/r/appsync_resolver.html.markdown @@ -12,7 +12,7 @@ Provides an AppSync Resolver. ## Example Usage -```hcl +```terraform resource "aws_appsync_graphql_api" "test" { authentication_type = "API_KEY" name = "tf-example" diff --git a/website/docs/r/athena_database.html.markdown b/website/docs/r/athena_database.html.markdown index edb85238d16..53ee0b6d92b 100644 --- a/website/docs/r/athena_database.html.markdown +++ b/website/docs/r/athena_database.html.markdown @@ -12,7 +12,7 @@ Provides an Athena database. ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "hoge" { bucket = "hoge" } diff --git a/website/docs/r/athena_named_query.html.markdown b/website/docs/r/athena_named_query.html.markdown index 49d57b32f77..c6442aba437 100644 --- a/website/docs/r/athena_named_query.html.markdown +++ b/website/docs/r/athena_named_query.html.markdown @@ -12,7 +12,7 @@ Provides an Athena Named Query resource. ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "hoge" { bucket = "tf-test" } diff --git a/website/docs/r/athena_workgroup.html.markdown b/website/docs/r/athena_workgroup.html.markdown index 7b3ea2312f9..1cffc581aa8 100644 --- a/website/docs/r/athena_workgroup.html.markdown +++ b/website/docs/r/athena_workgroup.html.markdown @@ -12,7 +12,7 @@ Provides an Athena Workgroup. ## Example Usage -```hcl +```terraform resource "aws_athena_workgroup" "example" { name = "example" diff --git a/website/docs/r/autoscaling_attachment.html.markdown b/website/docs/r/autoscaling_attachment.html.markdown index 8e898bc4569..41c5497589f 100644 --- a/website/docs/r/autoscaling_attachment.html.markdown +++ b/website/docs/r/autoscaling_attachment.html.markdown @@ -21,7 +21,7 @@ to ignore changes to the `load_balancers` and `target_group_arns` arguments with ## Example Usage -```hcl +```terraform # Create a new load balancer attachment resource "aws_autoscaling_attachment" "asg_attachment_bar" { autoscaling_group_name = aws_autoscaling_group.asg.id @@ -29,7 +29,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_bar" { } ``` -```hcl +```terraform # Create a new ALB Target Group attachment resource "aws_autoscaling_attachment" "asg_attachment_bar" { autoscaling_group_name = aws_autoscaling_group.asg.id @@ -39,7 +39,7 @@ resource "aws_autoscaling_attachment" "asg_attachment_bar" { ## With An AutoScaling Group Resource -```hcl +```terraform resource "aws_autoscaling_group" "asg" { # ... other configuration ... diff --git a/website/docs/r/autoscaling_group.html.markdown b/website/docs/r/autoscaling_group.html.markdown index d9bd775984b..8571f7884f1 100644 --- a/website/docs/r/autoscaling_group.html.markdown +++ b/website/docs/r/autoscaling_group.html.markdown @@ -23,7 +23,7 @@ to ignore changes to the `load_balancers` and `target_group_arns` arguments with ## Example Usage -```hcl +```terraform resource "aws_placement_group" "test" { name = "test" strategy = "cluster" @@ -77,7 +77,7 @@ EOF ### With Latest Version Of Launch Template -```hcl +```terraform resource "aws_launch_template" "foobar" { name_prefix = "foobar" image_id = "ami-1a2b3c" @@ -99,7 +99,7 @@ resource "aws_autoscaling_group" "bar" { ### Mixed Instances Policy -```hcl +```terraform resource "aws_launch_template" "example" { name_prefix = "example" image_id = data.aws_ami.example.id @@ -134,7 +134,7 @@ resource "aws_autoscaling_group" "example" { ### Mixed Instances Policy with Spot Instances and Capacity Rebalance -```hcl +```terraform resource "aws_launch_template" "example" { name_prefix = "example" image_id = data.aws_ami.example.id @@ -178,7 +178,7 @@ resource "aws_autoscaling_group" "example" { When using a diverse instance set, some instance types might require a launch template with configuration values unique to that instance type such as a different AMI (Graviton2), architecture specific user data script, different EBS configuration, or different networking configuration. -```hcl +```terraform resource "aws_launch_template" "example" { name_prefix = "example" image_id = data.aws_ami.example.id @@ -221,7 +221,7 @@ resource "aws_autoscaling_group" "example" { ### Interpolated tags -```hcl +```terraform variable "extra_tags" { default = [ { @@ -264,7 +264,7 @@ resource "aws_autoscaling_group" "bar" { ### Automatically refresh all instances after the group is updated -```hcl +```terraform resource "aws_autoscaling_group" "example" { availability_zones = ["us-east-1a"] desired_capacity = 1 diff --git a/website/docs/r/autoscaling_lifecycle_hook.html.markdown b/website/docs/r/autoscaling_lifecycle_hook.html.markdown index 322616737f9..9c6914bd08f 100644 --- a/website/docs/r/autoscaling_lifecycle_hook.html.markdown +++ b/website/docs/r/autoscaling_lifecycle_hook.html.markdown @@ -24,7 +24,7 @@ but take care to not duplicate those hooks with this resource. ## Example Usage -```hcl +```terraform resource "aws_autoscaling_group" "foobar" { availability_zones = ["us-west-2a"] name = "terraform-test-foobar5" diff --git a/website/docs/r/autoscaling_notification.html.markdown b/website/docs/r/autoscaling_notification.html.markdown index f142a051bb5..e02990ef953 100644 --- a/website/docs/r/autoscaling_notification.html.markdown +++ b/website/docs/r/autoscaling_notification.html.markdown @@ -16,7 +16,7 @@ Services, and are applied to each AutoScaling Group you supply. Basic usage: -```hcl +```terraform resource "aws_autoscaling_notification" "example_notifications" { group_names = [ aws_autoscaling_group.bar.name, diff --git a/website/docs/r/autoscaling_policy.html.markdown b/website/docs/r/autoscaling_policy.html.markdown index 22b347426f2..70c146513dc 100644 --- a/website/docs/r/autoscaling_policy.html.markdown +++ b/website/docs/r/autoscaling_policy.html.markdown @@ -18,7 +18,7 @@ or [dynamic](https://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/as-sc ## Example Usage -```hcl +```terraform resource "aws_autoscaling_policy" "bat" { name = "foobar3-terraform-test" scaling_adjustment = 4 @@ -62,7 +62,7 @@ The following arguments are only available to "StepScaling" type policies: * `step_adjustment` - (Optional) A set of adjustments that manage group scaling. These have the following structure: -```hcl +```terraform resource "aws_autoscaling_policy" "example" { # ... other configuration ... @@ -99,7 +99,7 @@ The following arguments are only available to "TargetTrackingScaling" type polic * `target_tracking_configuration` - (Optional) A target tracking policy. These have the following structure: -```hcl +```terraform resource "aws_autoscaling_policy" "example" { # ... other configuration ... diff --git a/website/docs/r/autoscaling_schedule.html.markdown b/website/docs/r/autoscaling_schedule.html.markdown index 851387d97b0..fef7b6656f0 100644 --- a/website/docs/r/autoscaling_schedule.html.markdown +++ b/website/docs/r/autoscaling_schedule.html.markdown @@ -12,7 +12,7 @@ Provides an AutoScaling Schedule resource. ## Example Usage -```hcl +```terraform resource "aws_autoscaling_group" "foobar" { availability_zones = ["us-west-2a"] name = "terraform-test-foobar5" diff --git a/website/docs/r/autoscalingplans_scaling_plan.html.markdown b/website/docs/r/autoscalingplans_scaling_plan.html.markdown index 73298f160d9..e28dcaf236f 100644 --- a/website/docs/r/autoscalingplans_scaling_plan.html.markdown +++ b/website/docs/r/autoscalingplans_scaling_plan.html.markdown @@ -19,7 +19,7 @@ See the [AWS documentation](https://docs.aws.amazon.com/autoscaling/plans/usergu ### Basic Dynamic Scaling -```hcl +```terraform data "aws_availability_zones" "available" {} resource "aws_autoscaling_group" "example" { @@ -70,7 +70,7 @@ resource "aws_autoscalingplans_scaling_plan" "example" { ### Basic Predictive Scaling -```hcl +```terraform data "aws_availability_zones" "available" {} resource "aws_autoscaling_group" "example" { diff --git a/website/docs/r/backup_global_settings.html.markdown b/website/docs/r/backup_global_settings.html.markdown index aaac9911e7b..c49517aae27 100644 --- a/website/docs/r/backup_global_settings.html.markdown +++ b/website/docs/r/backup_global_settings.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Backup Global Settings resource. ## Example Usage -```hcl +```terraform resource "aws_backup_global_settings" "test" { global_settings = { "isCrossAccountBackupEnabled" = "true" diff --git a/website/docs/r/backup_plan.html.markdown b/website/docs/r/backup_plan.html.markdown index 9f63eba7172..832e9b29866 100644 --- a/website/docs/r/backup_plan.html.markdown +++ b/website/docs/r/backup_plan.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Backup plan resource. ## Example Usage -```hcl +```terraform resource "aws_backup_plan" "example" { name = "tf_example_backup_plan" diff --git a/website/docs/r/backup_region_settings.html.markdown b/website/docs/r/backup_region_settings.html.markdown index ce08d118775..422840e27f1 100644 --- a/website/docs/r/backup_region_settings.html.markdown +++ b/website/docs/r/backup_region_settings.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Backup Region Settings resource. ## Example Usage -```hcl +```terraform resource "aws_backup_region_settings" "test" { resource_type_opt_in_preference = { "DynamoDB" = true diff --git a/website/docs/r/backup_selection.html.markdown b/website/docs/r/backup_selection.html.markdown index c45e47dc165..c8178bcbe74 100644 --- a/website/docs/r/backup_selection.html.markdown +++ b/website/docs/r/backup_selection.html.markdown @@ -18,7 +18,7 @@ Manages selection conditions for AWS Backup plan resources. The below example creates an IAM role with the default managed IAM Policy for allowing AWS Backup to create backups. -```hcl +```terraform resource "aws_iam_role" "example" { name = "example" assume_role_policy = < **Note:** Further managing the automatically created Bitbucket/GitHub webhook with the `bitbucket_hook`/`github_repository_webhook` resource is only possible with importing that resource after creation of the `aws_codebuild_webhook` resource. The CodeBuild API does not ever provide the `secret` attribute for the `aws_codebuild_webhook` resource in this scenario. -```hcl +```terraform resource "aws_codebuild_webhook" "example" { project_name = aws_codebuild_project.example.name @@ -44,7 +44,7 @@ When working with [GitHub Enterprise](https://enterprise.github.com/) source Cod More information creating webhooks with GitHub Enterprise can be found in the [CodeBuild User Guide](https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-enterprise.html). -```hcl +```terraform resource "aws_codebuild_webhook" "example" { project_name = aws_codebuild_project.example.name } diff --git a/website/docs/r/codecommit_repository.html.markdown b/website/docs/r/codecommit_repository.html.markdown index 30ef0d92ead..295b231b39d 100644 --- a/website/docs/r/codecommit_repository.html.markdown +++ b/website/docs/r/codecommit_repository.html.markdown @@ -12,7 +12,7 @@ Provides a CodeCommit Repository Resource. ## Example Usage -```hcl +```terraform resource "aws_codecommit_repository" "test" { repository_name = "MyTestRepository" description = "This is the Sample App Repository" diff --git a/website/docs/r/codecommit_trigger.html.markdown b/website/docs/r/codecommit_trigger.html.markdown index 945e6240f5d..19bfbddb6a3 100644 --- a/website/docs/r/codecommit_trigger.html.markdown +++ b/website/docs/r/codecommit_trigger.html.markdown @@ -12,7 +12,7 @@ Provides a CodeCommit Trigger Resource. ## Example Usage -```hcl +```terraform resource "aws_codecommit_repository" "test" { repository_name = "test" } diff --git a/website/docs/r/codedeploy_app.html.markdown b/website/docs/r/codedeploy_app.html.markdown index a838fd75553..1003a2d9930 100644 --- a/website/docs/r/codedeploy_app.html.markdown +++ b/website/docs/r/codedeploy_app.html.markdown @@ -14,7 +14,7 @@ Provides a CodeDeploy application to be used as a basis for deployments ### ECS Application -```hcl +```terraform resource "aws_codedeploy_app" "example" { compute_platform = "ECS" name = "example" @@ -23,7 +23,7 @@ resource "aws_codedeploy_app" "example" { ### Lambda Application -```hcl +```terraform resource "aws_codedeploy_app" "example" { compute_platform = "Lambda" name = "example" @@ -32,7 +32,7 @@ resource "aws_codedeploy_app" "example" { ### Server Application -```hcl +```terraform resource "aws_codedeploy_app" "example" { compute_platform = "Server" name = "example" diff --git a/website/docs/r/codedeploy_deployment_config.html.markdown b/website/docs/r/codedeploy_deployment_config.html.markdown index a28f04f8295..a34f99cd77c 100644 --- a/website/docs/r/codedeploy_deployment_config.html.markdown +++ b/website/docs/r/codedeploy_deployment_config.html.markdown @@ -14,7 +14,7 @@ Provides a CodeDeploy deployment config for an application ### Server Usage -```hcl +```terraform resource "aws_codedeploy_deployment_config" "foo" { deployment_config_name = "test-deployment-config" @@ -56,7 +56,7 @@ resource "aws_codedeploy_deployment_group" "foo" { ### Lambda Usage -```hcl +```terraform resource "aws_codedeploy_deployment_config" "foo" { deployment_config_name = "test-deployment-config" compute_platform = "Lambda" diff --git a/website/docs/r/codedeploy_deployment_group.html.markdown b/website/docs/r/codedeploy_deployment_group.html.markdown index 9f69bd4b7f6..fae6fd59634 100644 --- a/website/docs/r/codedeploy_deployment_group.html.markdown +++ b/website/docs/r/codedeploy_deployment_group.html.markdown @@ -14,7 +14,7 @@ Provides a CodeDeploy Deployment Group for a CodeDeploy Application ## Example Usage -```hcl +```terraform resource "aws_iam_role" "example" { name = "example-role" @@ -87,7 +87,7 @@ resource "aws_codedeploy_deployment_group" "example" { ### Blue Green Deployments with ECS -```hcl +```terraform resource "aws_codedeploy_app" "example" { compute_platform = "ECS" name = "example" @@ -145,7 +145,7 @@ resource "aws_codedeploy_deployment_group" "example" { ### Blue Green Deployments with Servers and Classic ELB -```hcl +```terraform resource "aws_codedeploy_app" "example" { name = "example-app" } diff --git a/website/docs/r/codepipeline.markdown b/website/docs/r/codepipeline.markdown index 33ee75b2aa2..eed175db2f5 100644 --- a/website/docs/r/codepipeline.markdown +++ b/website/docs/r/codepipeline.markdown @@ -12,7 +12,7 @@ Provides a CodePipeline. ## Example Usage -```hcl +```terraform resource "aws_codepipeline" "codepipeline" { name = "tf-test-pipeline" role_arn = aws_iam_role.codepipeline_role.arn diff --git a/website/docs/r/codepipeline_webhook.markdown b/website/docs/r/codepipeline_webhook.markdown index 9daf1fc66df..13256408006 100644 --- a/website/docs/r/codepipeline_webhook.markdown +++ b/website/docs/r/codepipeline_webhook.markdown @@ -12,7 +12,7 @@ Provides a CodePipeline Webhook. ## Example Usage -```hcl +```terraform resource "aws_codepipeline" "bar" { name = "tf-test-pipeline" role_arn = aws_iam_role.bar.arn diff --git a/website/docs/r/codestarconnections_connection.markdown b/website/docs/r/codestarconnections_connection.markdown index a64de09c2e3..373b6beaa0c 100644 --- a/website/docs/r/codestarconnections_connection.markdown +++ b/website/docs/r/codestarconnections_connection.markdown @@ -14,7 +14,7 @@ Provides a CodeStar Connection. ## Example Usage -```hcl +```terraform resource "aws_codestarconnections_connection" "example" { name = "example-connection" provider_type = "Bitbucket" diff --git a/website/docs/r/codestarnotifications_notification_rule.markdown b/website/docs/r/codestarnotifications_notification_rule.markdown index 1a61f9bc909..0fcbe934c24 100644 --- a/website/docs/r/codestarnotifications_notification_rule.markdown +++ b/website/docs/r/codestarnotifications_notification_rule.markdown @@ -12,7 +12,7 @@ Provides a CodeStar Notifications Rule. ## Example Usage -```hcl +```terraform resource "aws_codecommit_repository" "code" { repository_name = "example-code-repo" } diff --git a/website/docs/r/cognito_identity_pool.markdown b/website/docs/r/cognito_identity_pool.markdown index db5fc44718c..e4865eb4fb5 100644 --- a/website/docs/r/cognito_identity_pool.markdown +++ b/website/docs/r/cognito_identity_pool.markdown @@ -12,7 +12,7 @@ Provides an AWS Cognito Identity Pool. ## Example Usage -```hcl +```terraform resource "aws_iam_saml_provider" "default" { name = "my-saml-provider" saml_metadata_document = file("saml-metadata.xml") diff --git a/website/docs/r/cognito_identity_pool_roles_attachment.markdown b/website/docs/r/cognito_identity_pool_roles_attachment.markdown index b1e322f9d3b..e2130ddcf31 100644 --- a/website/docs/r/cognito_identity_pool_roles_attachment.markdown +++ b/website/docs/r/cognito_identity_pool_roles_attachment.markdown @@ -12,7 +12,7 @@ Provides an AWS Cognito Identity Pool Roles Attachment. ## Example Usage -```hcl +```terraform resource "aws_cognito_identity_pool" "main" { identity_pool_name = "identity pool" allow_unauthenticated_identities = false diff --git a/website/docs/r/cognito_identity_provider.html.markdown b/website/docs/r/cognito_identity_provider.html.markdown index 3729b95a616..d409b558ad7 100644 --- a/website/docs/r/cognito_identity_provider.html.markdown +++ b/website/docs/r/cognito_identity_provider.html.markdown @@ -13,7 +13,7 @@ Provides a Cognito User Identity Provider resource. ## Example Usage -```hcl +```terraform resource "aws_cognito_user_pool" "example" { name = "example-pool" auto_verified_attributes = ["email"] diff --git a/website/docs/r/cognito_resource_server.markdown b/website/docs/r/cognito_resource_server.markdown index 39577c6a655..a8b62e576e6 100644 --- a/website/docs/r/cognito_resource_server.markdown +++ b/website/docs/r/cognito_resource_server.markdown @@ -15,7 +15,7 @@ Provides a Cognito Resource Server. ### Create a basic resource server -```hcl +```terraform resource "aws_cognito_user_pool" "pool" { name = "pool" } @@ -30,7 +30,7 @@ resource "aws_cognito_resource_server" "resource" { ### Create a resource server with sample-scope -```hcl +```terraform resource "aws_cognito_user_pool" "pool" { name = "pool" } diff --git a/website/docs/r/cognito_user_group.html.markdown b/website/docs/r/cognito_user_group.html.markdown index f4563a1a27f..3961908ab0a 100644 --- a/website/docs/r/cognito_user_group.html.markdown +++ b/website/docs/r/cognito_user_group.html.markdown @@ -12,7 +12,7 @@ Provides a Cognito User Group resource. ## Example Usage -```hcl +```terraform resource "aws_cognito_user_pool" "main" { name = "identity pool" } diff --git a/website/docs/r/cognito_user_pool.markdown b/website/docs/r/cognito_user_pool.markdown index 3fc8ee879e1..1ddb82d6ba8 100644 --- a/website/docs/r/cognito_user_pool.markdown +++ b/website/docs/r/cognito_user_pool.markdown @@ -14,7 +14,7 @@ Provides a Cognito User Pool resource. ### Basic configuration -```hcl +```terraform resource "aws_cognito_user_pool" "pool" { name = "mypool" } @@ -22,7 +22,7 @@ resource "aws_cognito_user_pool" "pool" { ### Enabling SMS and Software Token Multi-Factor Authentication -```hcl +```terraform resource "aws_cognito_user_pool" "example" { # ... other configuration ... @@ -42,7 +42,7 @@ resource "aws_cognito_user_pool" "example" { ### Using Account Recovery Setting -```hcl +```terraform resource "aws_cognito_user_pool" "test" { name = "mypool" @@ -158,7 +158,7 @@ The following arguments are optional: The [standard attributes](https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html#cognito-user-pools-standard-attributes) have the following defaults. Note that attributes which match the default values are not stored in Terraform state when importing. -```hcl +```terraform resource "aws_cognito_user_pool" "example" { # ... other configuration ... diff --git a/website/docs/r/cognito_user_pool_client.markdown b/website/docs/r/cognito_user_pool_client.markdown index 712c4e91ea0..a4fed4fc222 100644 --- a/website/docs/r/cognito_user_pool_client.markdown +++ b/website/docs/r/cognito_user_pool_client.markdown @@ -14,7 +14,7 @@ Provides a Cognito User Pool Client resource. ### Create a basic user pool client -```hcl +```terraform resource "aws_cognito_user_pool" "pool" { name = "pool" } @@ -28,7 +28,7 @@ resource "aws_cognito_user_pool_client" "client" { ### Create a user pool client with no SRP authentication -```hcl +```terraform resource "aws_cognito_user_pool" "pool" { name = "pool" } @@ -45,7 +45,7 @@ resource "aws_cognito_user_pool_client" "client" { ### Create a user pool client with pinpoint analytics -```hcl +```terraform data "aws_caller_identity" "current" {} resource "aws_cognito_user_pool" "test" { diff --git a/website/docs/r/cognito_user_pool_domain.markdown b/website/docs/r/cognito_user_pool_domain.markdown index c3f48487dd5..bdd9cd00767 100644 --- a/website/docs/r/cognito_user_pool_domain.markdown +++ b/website/docs/r/cognito_user_pool_domain.markdown @@ -14,7 +14,7 @@ Provides a Cognito User Pool Domain resource. ### Amazon Cognito domain -```hcl +```terraform resource "aws_cognito_user_pool_domain" "main" { domain = "example-domain" user_pool_id = aws_cognito_user_pool.example.id @@ -27,7 +27,7 @@ resource "aws_cognito_user_pool" "example" { ### Custom Cognito domain -```hcl +```terraform resource "aws_cognito_user_pool_domain" "main" { domain = "example-domain.example.com" certificate_arn = aws_acm_certificate.cert.arn diff --git a/website/docs/r/cognito_user_pool_ui_customization.html.markdown b/website/docs/r/cognito_user_pool_ui_customization.html.markdown index 2aff7abc2f9..e0a25352588 100644 --- a/website/docs/r/cognito_user_pool_ui_customization.html.markdown +++ b/website/docs/r/cognito_user_pool_ui_customization.html.markdown @@ -16,7 +16,7 @@ Provides a Cognito User Pool UI Customization resource. ### UI customization settings for a single client -```hcl +```terraform resource "aws_cognito_user_pool" "example" { name = "example" } @@ -45,7 +45,7 @@ resource "aws_cognito_user_pool_ui_customization" "example" { ### UI customization settings for all clients -```hcl +```terraform resource "aws_cognito_user_pool" "example" { name = "example" } diff --git a/website/docs/r/config_aggregate_authorization.markdown b/website/docs/r/config_aggregate_authorization.markdown index 87fdf32a48e..6f6c8e65f66 100644 --- a/website/docs/r/config_aggregate_authorization.markdown +++ b/website/docs/r/config_aggregate_authorization.markdown @@ -12,7 +12,7 @@ Manages an AWS Config Aggregate Authorization ## Example Usage -```hcl +```terraform resource "aws_config_aggregate_authorization" "example" { account_id = "123456789012" region = "eu-west-2" diff --git a/website/docs/r/config_config_rule.html.markdown b/website/docs/r/config_config_rule.html.markdown index 59414d768f1..a830efce5a3 100644 --- a/website/docs/r/config_config_rule.html.markdown +++ b/website/docs/r/config_config_rule.html.markdown @@ -18,7 +18,7 @@ Provides an AWS Config Rule. AWS managed rules can be used by setting the source owner to `AWS` and the source identifier to the name of the managed rule. More information about AWS managed rules can be found in the [AWS Config Developer Guide](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). -```hcl +```terraform resource "aws_config_config_rule" "r" { name = "example" @@ -79,7 +79,7 @@ POLICY Custom rules can be used by setting the source owner to `CUSTOM_LAMBDA` and the source identifier to the Amazon Resource Name (ARN) of the Lambda Function. The AWS Config service must have permissions to invoke the Lambda Function, e.g. via the [`aws_lambda_permission` resource](/docs/providers/aws/r/lambda_permission.html). More information about custom rules can be found in the [AWS Config Developer Guide](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_develop-rules.html). -```hcl +```terraform resource "aws_config_configuration_recorder" "example" { # ... other configuration ... } diff --git a/website/docs/r/config_configuration_aggregator.html.markdown b/website/docs/r/config_configuration_aggregator.html.markdown index e9ed6be2419..bd91080600b 100644 --- a/website/docs/r/config_configuration_aggregator.html.markdown +++ b/website/docs/r/config_configuration_aggregator.html.markdown @@ -14,7 +14,7 @@ Manages an AWS Config Configuration Aggregator ### Account Based Aggregation -```hcl +```terraform resource "aws_config_configuration_aggregator" "account" { name = "example" @@ -27,7 +27,7 @@ resource "aws_config_configuration_aggregator" "account" { ### Organization Based Aggregation -```hcl +```terraform resource "aws_config_configuration_aggregator" "organization" { depends_on = [aws_iam_role_policy_attachment.organization] diff --git a/website/docs/r/config_configuration_recorder.html.markdown b/website/docs/r/config_configuration_recorder.html.markdown index 9557b27bfa8..5b36ce0aeb6 100644 --- a/website/docs/r/config_configuration_recorder.html.markdown +++ b/website/docs/r/config_configuration_recorder.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Config Configuration Recorder. Please note that this resource ** ## Example Usage -```hcl +```terraform resource "aws_config_configuration_recorder" "foo" { name = "example" role_arn = aws_iam_role.r.arn diff --git a/website/docs/r/config_configuration_recorder_status.html.markdown b/website/docs/r/config_configuration_recorder_status.html.markdown index 4ce7f8a2472..08c22b3331c 100644 --- a/website/docs/r/config_configuration_recorder_status.html.markdown +++ b/website/docs/r/config_configuration_recorder_status.html.markdown @@ -14,7 +14,7 @@ Manages status (recording / stopped) of an AWS Config Configuration Recorder. ## Example Usage -```hcl +```terraform resource "aws_config_configuration_recorder_status" "foo" { name = aws_config_configuration_recorder.foo.name is_enabled = true diff --git a/website/docs/r/config_conformance_pack.html.markdown b/website/docs/r/config_conformance_pack.html.markdown index 8a60c517cfc..190094aeb0e 100644 --- a/website/docs/r/config_conformance_pack.html.markdown +++ b/website/docs/r/config_conformance_pack.html.markdown @@ -21,7 +21,7 @@ successfully create or update. See also the ### Template Body -```hcl +```terraform resource "aws_config_conformance_pack" "example" { name = "example" @@ -50,7 +50,7 @@ EOT ### Template S3 URI -```hcl +```terraform resource "aws_config_conformance_pack" "example" { name = "example" template_s3_uri = "s3://${aws_s3_bucket.example.bucket}/${aws_s3_bucket_object.example.key}" diff --git a/website/docs/r/config_delivery_channel.html.markdown b/website/docs/r/config_delivery_channel.html.markdown index 75c6eabc229..673821cb679 100644 --- a/website/docs/r/config_delivery_channel.html.markdown +++ b/website/docs/r/config_delivery_channel.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Config Delivery Channel. ## Example Usage -```hcl +```terraform resource "aws_config_delivery_channel" "foo" { name = "example" s3_bucket_name = aws_s3_bucket.b.bucket diff --git a/website/docs/r/config_organization_custom_rule.html.markdown b/website/docs/r/config_organization_custom_rule.html.markdown index b3b21b39db0..169a199be3e 100644 --- a/website/docs/r/config_organization_custom_rule.html.markdown +++ b/website/docs/r/config_organization_custom_rule.html.markdown @@ -16,7 +16,7 @@ Manages a Config Organization Custom Rule. More information about these rules ca ## Example Usage -```hcl +```terraform resource "aws_lambda_permission" "example" { action = "lambda:InvokeFunction" function_name = aws_lambda_function.example.arn diff --git a/website/docs/r/config_organization_managed_rule.html.markdown b/website/docs/r/config_organization_managed_rule.html.markdown index bf6cf84c072..243d1680cde 100644 --- a/website/docs/r/config_organization_managed_rule.html.markdown +++ b/website/docs/r/config_organization_managed_rule.html.markdown @@ -16,7 +16,7 @@ Manages a Config Organization Managed Rule. More information about these rules c ## Example Usage -```hcl +```terraform resource "aws_organizations_organization" "example" { aws_service_access_principals = ["config-multiaccountsetup.amazonaws.com"] feature_set = "ALL" diff --git a/website/docs/r/config_remediation_configuration.html.markdown b/website/docs/r/config_remediation_configuration.html.markdown index cb93481e60c..f9d5fa71dab 100644 --- a/website/docs/r/config_remediation_configuration.html.markdown +++ b/website/docs/r/config_remediation_configuration.html.markdown @@ -16,7 +16,7 @@ Provides an AWS Config Remediation Configuration. AWS managed rules can be used by setting the source owner to `AWS` and the source identifier to the name of the managed rule. More information about AWS managed rules can be found in the [AWS Config Developer Guide](https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config_use-managed-rules.html). -```hcl +```terraform resource "aws_config_config_rule" "this" { name = "example" diff --git a/website/docs/r/cur_report_definition.html.markdown b/website/docs/r/cur_report_definition.html.markdown index e7e8544e866..eb89dea79e7 100644 --- a/website/docs/r/cur_report_definition.html.markdown +++ b/website/docs/r/cur_report_definition.html.markdown @@ -16,7 +16,7 @@ Manages Cost and Usage Report Definitions. ## Example Usage -```hcl +```terraform resource "aws_cur_report_definition" "example_cur_report_definition" { report_name = "example-cur-report-definition" time_unit = "HOURLY" diff --git a/website/docs/r/customer_gateway.html.markdown b/website/docs/r/customer_gateway.html.markdown index b1804ea5c55..0660af1c091 100644 --- a/website/docs/r/customer_gateway.html.markdown +++ b/website/docs/r/customer_gateway.html.markdown @@ -14,7 +14,7 @@ Provides a customer gateway inside a VPC. These objects can be connected to VPN ## Example Usage -```hcl +```terraform resource "aws_customer_gateway" "main" { bgp_asn = 65000 ip_address = "172.83.124.10" diff --git a/website/docs/r/datapipeline_pipeline.html.markdown b/website/docs/r/datapipeline_pipeline.html.markdown index 013d2919a7e..1be26a3e65b 100644 --- a/website/docs/r/datapipeline_pipeline.html.markdown +++ b/website/docs/r/datapipeline_pipeline.html.markdown @@ -12,7 +12,7 @@ Provides a Data Pipeline resource. ## Example Usage -```hcl +```terraform resource "aws_datapipeline_pipeline" "default" { name = "tf-pipeline-default" } diff --git a/website/docs/r/datasync_agent.html.markdown b/website/docs/r/datasync_agent.html.markdown index e4d5415eb04..11646cbe1e1 100644 --- a/website/docs/r/datasync_agent.html.markdown +++ b/website/docs/r/datasync_agent.html.markdown @@ -14,7 +14,7 @@ Manages an AWS DataSync Agent deployed on premises. ## Example Usage -```hcl +```terraform resource "aws_datasync_agent" "example" { ip_address = "1.2.3.4" name = "example" diff --git a/website/docs/r/datasync_location_efs.html.markdown b/website/docs/r/datasync_location_efs.html.markdown index abdf1bb8c27..1e816e52644 100644 --- a/website/docs/r/datasync_location_efs.html.markdown +++ b/website/docs/r/datasync_location_efs.html.markdown @@ -14,7 +14,7 @@ Manages an AWS DataSync EFS Location. ## Example Usage -```hcl +```terraform resource "aws_datasync_location_efs" "example" { # The below example uses aws_efs_mount_target as a reference to ensure a mount target already exists when resource creation occurs. # You can accomplish the same behavior with depends_on or an aws_efs_mount_target data source reference. diff --git a/website/docs/r/datasync_location_fsx_windows_file_system.html.markdown b/website/docs/r/datasync_location_fsx_windows_file_system.html.markdown index 838998fb237..9bab3cafac1 100644 --- a/website/docs/r/datasync_location_fsx_windows_file_system.html.markdown +++ b/website/docs/r/datasync_location_fsx_windows_file_system.html.markdown @@ -12,7 +12,7 @@ Manages an AWS DataSync FSx Windows Location. ## Example Usage -```hcl +```terraform resource "aws_datasync_location_fsx_windows_file_system" "example" { fsx_filesystem_arn = aws_fsx_windows_file_system.example.arn user = "SomeUser" diff --git a/website/docs/r/datasync_location_nfs.html.markdown b/website/docs/r/datasync_location_nfs.html.markdown index 850bb53df15..dc91763895a 100644 --- a/website/docs/r/datasync_location_nfs.html.markdown +++ b/website/docs/r/datasync_location_nfs.html.markdown @@ -14,7 +14,7 @@ Manages an NFS Location within AWS DataSync. ## Example Usage -```hcl +```terraform resource "aws_datasync_location_nfs" "example" { server_hostname = "nfs.example.com" subdirectory = "/exported/path" diff --git a/website/docs/r/datasync_location_s3.html.markdown b/website/docs/r/datasync_location_s3.html.markdown index cff58134272..3e4a50ebba1 100644 --- a/website/docs/r/datasync_location_s3.html.markdown +++ b/website/docs/r/datasync_location_s3.html.markdown @@ -12,7 +12,7 @@ Manages an S3 Location within AWS DataSync. ## Example Usage -```hcl +```terraform resource "aws_datasync_location_s3" "example" { s3_bucket_arn = aws_s3_bucket.example.arn subdirectory = "/example/prefix" diff --git a/website/docs/r/datasync_location_smb.html.markdown b/website/docs/r/datasync_location_smb.html.markdown index 2766dd15b33..298a8e4690c 100644 --- a/website/docs/r/datasync_location_smb.html.markdown +++ b/website/docs/r/datasync_location_smb.html.markdown @@ -14,7 +14,7 @@ Manages a SMB Location within AWS DataSync. ## Example Usage -```hcl +```terraform resource "aws_datasync_location_smb" "example" { server_hostname = "smb.example.com" subdirectory = "/exported/path" diff --git a/website/docs/r/datasync_task.html.markdown b/website/docs/r/datasync_task.html.markdown index e16ef80e904..3bbdf693228 100644 --- a/website/docs/r/datasync_task.html.markdown +++ b/website/docs/r/datasync_task.html.markdown @@ -12,7 +12,7 @@ Manages an AWS DataSync Task, which represents a configuration for synchronizati ## Example Usage -```hcl +```terraform resource "aws_datasync_task" "example" { destination_location_arn = aws_datasync_location_s3.destination.arn name = "example" diff --git a/website/docs/r/dax_cluster.html.markdown b/website/docs/r/dax_cluster.html.markdown index d77981acbb2..c49ff1b550b 100644 --- a/website/docs/r/dax_cluster.html.markdown +++ b/website/docs/r/dax_cluster.html.markdown @@ -12,7 +12,7 @@ Provides a DAX Cluster resource. ## Example Usage -```hcl +```terraform resource "aws_dax_cluster" "bar" { cluster_name = "cluster-example" iam_role_arn = data.aws_iam_role.example.arn diff --git a/website/docs/r/dax_parameter_group.html.markdown b/website/docs/r/dax_parameter_group.html.markdown index b8a05770a81..0ee9101d618 100644 --- a/website/docs/r/dax_parameter_group.html.markdown +++ b/website/docs/r/dax_parameter_group.html.markdown @@ -12,7 +12,7 @@ Provides a DAX Parameter Group resource. ## Example Usage -```hcl +```terraform resource "aws_dax_parameter_group" "example" { name = "example" diff --git a/website/docs/r/dax_subnet_group.html.markdown b/website/docs/r/dax_subnet_group.html.markdown index 186c8fca9ca..e1f2ec59f2a 100644 --- a/website/docs/r/dax_subnet_group.html.markdown +++ b/website/docs/r/dax_subnet_group.html.markdown @@ -12,7 +12,7 @@ Provides a DAX Subnet Group resource. ## Example Usage -```hcl +```terraform resource "aws_dax_subnet_group" "example" { name = "example" subnet_ids = [aws_subnet.example1.id, aws_subnet.example2.id] diff --git a/website/docs/r/db_cluster_snapshot.html.markdown b/website/docs/r/db_cluster_snapshot.html.markdown index 955c252dce4..4723271772a 100644 --- a/website/docs/r/db_cluster_snapshot.html.markdown +++ b/website/docs/r/db_cluster_snapshot.html.markdown @@ -12,7 +12,7 @@ Manages an RDS database cluster snapshot for Aurora clusters. For managing RDS d ## Example Usage -```hcl +```terraform resource "aws_db_cluster_snapshot" "example" { db_cluster_identifier = aws_rds_cluster.example.id db_cluster_snapshot_identifier = "resourcetestsnapshot1234" diff --git a/website/docs/r/db_event_subscription.html.markdown b/website/docs/r/db_event_subscription.html.markdown index 1384b3d0eb6..3a19d2553ed 100644 --- a/website/docs/r/db_event_subscription.html.markdown +++ b/website/docs/r/db_event_subscription.html.markdown @@ -12,7 +12,7 @@ Provides a DB event subscription resource. ## Example Usage -```hcl +```terraform resource "aws_db_instance" "default" { allocated_storage = 10 engine = "mysql" diff --git a/website/docs/r/db_instance.html.markdown b/website/docs/r/db_instance.html.markdown index 594284368d9..61189b9d937 100644 --- a/website/docs/r/db_instance.html.markdown +++ b/website/docs/r/db_instance.html.markdown @@ -38,7 +38,7 @@ about [DB Instance Class Types](https://docs.aws.amazon.com/AmazonRDS/latest/Use ### Basic Usage -```hcl +```terraform resource "aws_db_instance" "default" { allocated_storage = 10 engine = "mysql" @@ -56,7 +56,7 @@ resource "aws_db_instance" "default" { To enable Storage Autoscaling with instances that support the feature, define the `max_allocated_storage` argument higher than the `allocated_storage` argument. Terraform will automatically hide differences with the `allocated_storage` argument value if autoscaling occurs. -```hcl +```terraform resource "aws_db_instance" "example" { # ... other configuration ... @@ -225,7 +225,7 @@ The `restore_to_point_in_time` block supports the following arguments: Full details on the core parameters and impacts are in the API Docs: [RestoreDBInstanceFromS3](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_RestoreDBInstanceFromS3.html). Sample -```hcl +```terraform resource "aws_db_instance" "db" { s3_import { source_engine = "mysql" diff --git a/website/docs/r/db_instance_role_association.html.markdown b/website/docs/r/db_instance_role_association.html.markdown index 219f83990f0..e10eae0a686 100644 --- a/website/docs/r/db_instance_role_association.html.markdown +++ b/website/docs/r/db_instance_role_association.html.markdown @@ -17,7 +17,7 @@ Manages an RDS DB Instance association with an IAM Role. Example use cases: ## Example Usage -```hcl +```terraform resource "aws_db_instance_role_association" "example" { db_instance_identifier = aws_db_instance.example.id feature_name = "S3_INTEGRATION" diff --git a/website/docs/r/db_option_group.html.markdown b/website/docs/r/db_option_group.html.markdown index 428241cd265..dc2057fb192 100644 --- a/website/docs/r/db_option_group.html.markdown +++ b/website/docs/r/db_option_group.html.markdown @@ -17,7 +17,7 @@ Provides an RDS DB option group resource. Documentation of the available options ## Example Usage -```hcl +```terraform resource "aws_db_option_group" "example" { name = "option-group-test-terraform" option_group_description = "Terraform Option Group" diff --git a/website/docs/r/db_parameter_group.html.markdown b/website/docs/r/db_parameter_group.html.markdown index b6a583f92ca..fe49f530b79 100644 --- a/website/docs/r/db_parameter_group.html.markdown +++ b/website/docs/r/db_parameter_group.html.markdown @@ -18,7 +18,7 @@ Provides an RDS DB parameter group resource .Documentation of the available para ## Example Usage -```hcl +```terraform resource "aws_db_parameter_group" "default" { name = "rds-pg" family = "mysql5.6" diff --git a/website/docs/r/db_proxy.html.markdown b/website/docs/r/db_proxy.html.markdown index 1aac841c7c9..f7b8ed6a42e 100644 --- a/website/docs/r/db_proxy.html.markdown +++ b/website/docs/r/db_proxy.html.markdown @@ -12,7 +12,7 @@ Provides an RDS DB proxy resource. For additional information, see the [RDS User ## Example Usage -```hcl +```terraform resource "aws_db_proxy" "example" { name = "example" debug_logging = false diff --git a/website/docs/r/db_proxy_default_target_group.html.markdown b/website/docs/r/db_proxy_default_target_group.html.markdown index c5aec6ce920..117cac1cf37 100644 --- a/website/docs/r/db_proxy_default_target_group.html.markdown +++ b/website/docs/r/db_proxy_default_target_group.html.markdown @@ -14,7 +14,7 @@ The `aws_db_proxy_default_target_group` behaves differently from normal resource ## Example Usage -```hcl +```terraform resource "aws_db_proxy" "example" { name = "example" debug_logging = false diff --git a/website/docs/r/db_proxy_target.html.markdown b/website/docs/r/db_proxy_target.html.markdown index 017d55bf983..d4c1caff434 100644 --- a/website/docs/r/db_proxy_target.html.markdown +++ b/website/docs/r/db_proxy_target.html.markdown @@ -12,7 +12,7 @@ Provides an RDS DB proxy target resource. ## Example Usage -```hcl +```terraform resource "aws_db_proxy" "example" { name = "example" debug_logging = false diff --git a/website/docs/r/db_security_group.html.markdown b/website/docs/r/db_security_group.html.markdown index 95c57f9fbca..c8af799f62e 100644 --- a/website/docs/r/db_security_group.html.markdown +++ b/website/docs/r/db_security_group.html.markdown @@ -15,7 +15,7 @@ attribute instead. ## Example Usage -```hcl +```terraform resource "aws_db_security_group" "default" { name = "rds_sg" diff --git a/website/docs/r/db_snapshot.html.markdown b/website/docs/r/db_snapshot.html.markdown index 384d2b4347a..fb9132d82ef 100644 --- a/website/docs/r/db_snapshot.html.markdown +++ b/website/docs/r/db_snapshot.html.markdown @@ -12,7 +12,7 @@ Manages an RDS database instance snapshot. For managing RDS database cluster sna ## Example Usage -```hcl +```terraform resource "aws_db_instance" "bar" { allocated_storage = 10 engine = "MySQL" diff --git a/website/docs/r/db_subnet_group.html.markdown b/website/docs/r/db_subnet_group.html.markdown index c17bed69653..7b4d1251c05 100644 --- a/website/docs/r/db_subnet_group.html.markdown +++ b/website/docs/r/db_subnet_group.html.markdown @@ -12,7 +12,7 @@ Provides an RDS DB subnet group resource. ## Example Usage -```hcl +```terraform resource "aws_db_subnet_group" "default" { name = "main" subnet_ids = [aws_subnet.frontend.id, aws_subnet.backend.id] diff --git a/website/docs/r/default_network_acl.html.markdown b/website/docs/r/default_network_acl.html.markdown index b164d40d208..eca4fe266bb 100644 --- a/website/docs/r/default_network_acl.html.markdown +++ b/website/docs/r/default_network_acl.html.markdown @@ -24,7 +24,7 @@ For more information about Network ACLs, see the AWS Documentation on [Network A The following config gives the Default Network ACL the same rules that AWS includes but pulls the resource under management by Terraform. This means that any ACL rules added or changed will be detected as drift. -```hcl +```terraform resource "aws_vpc" "mainvpc" { cidr_block = "10.1.0.0/16" } @@ -56,7 +56,7 @@ resource "aws_default_network_acl" "default" { The following denies all Egress traffic by omitting any `egress` rules, while including the default `ingress` rule to allow all traffic. -```hcl +```terraform resource "aws_vpc" "mainvpc" { cidr_block = "10.1.0.0/16" } @@ -79,7 +79,7 @@ resource "aws_default_network_acl" "default" { This config denies all traffic in the Default ACL. This can be useful if you want to lock down the VPC to force all resources to assign a non-default ACL. -```hcl +```terraform resource "aws_vpc" "mainvpc" { cidr_block = "10.1.0.0/16" } @@ -101,7 +101,7 @@ Because Subnets are by default associated with the Default Network ACL, any non- As an alternative to the above, you can also specify the following lifecycle configuration in your `aws_default_network_acl` resource: -```hcl +```terraform resource "aws_default_network_acl" "default" { # ... other configuration ... diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 003d7ad777a..964fab1286e 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -18,7 +18,7 @@ For more information, see the Amazon VPC User Guide on [Route Tables](https://do ## Example Usage -```hcl +```terraform resource "aws_default_route_table" "r" { default_route_table_id = aws_vpc.foo.default_route_table_id diff --git a/website/docs/r/default_security_group.html.markdown b/website/docs/r/default_security_group.html.markdown index a9a6b620b00..13557964dec 100644 --- a/website/docs/r/default_security_group.html.markdown +++ b/website/docs/r/default_security_group.html.markdown @@ -24,7 +24,7 @@ For more information about default security groups, see the AWS documentation on The following config gives the default security group the same rules that AWS provides by default but under management by Terraform. This means that any ingress or egress rules added or changed will be detected as drift. -```hcl +```terraform resource "aws_vpc" "mainvpc" { cidr_block = "10.1.0.0/16" } @@ -52,7 +52,7 @@ resource "aws_default_security_group" "default" { The following denies all Egress traffic by omitting any `egress` rules, while including the default `ingress` rule to allow all traffic. -```hcl +```terraform resource "aws_vpc" "mainvpc" { cidr_block = "10.1.0.0/16" } diff --git a/website/docs/r/default_subnet.html.markdown b/website/docs/r/default_subnet.html.markdown index eaf0fe853a3..b5785ed4fe6 100644 --- a/website/docs/r/default_subnet.html.markdown +++ b/website/docs/r/default_subnet.html.markdown @@ -16,7 +16,7 @@ The `aws_default_subnet` resource allows you to manage a region's default VPC su ## Example Usage -```hcl +```terraform resource "aws_default_subnet" "default_az1" { availability_zone = "us-west-2a" diff --git a/website/docs/r/default_vpc.html.markdown b/website/docs/r/default_vpc.html.markdown index f0ec2cd9f62..f113ad7f228 100644 --- a/website/docs/r/default_vpc.html.markdown +++ b/website/docs/r/default_vpc.html.markdown @@ -23,7 +23,7 @@ into management. Basic usage with tags: -```hcl +```terraform resource "aws_default_vpc" "default" { tags = { Name = "Default VPC" diff --git a/website/docs/r/default_vpc_dhcp_options.html.markdown b/website/docs/r/default_vpc_dhcp_options.html.markdown index 826b5ee26e1..9c46ffe3ef4 100644 --- a/website/docs/r/default_vpc_dhcp_options.html.markdown +++ b/website/docs/r/default_vpc_dhcp_options.html.markdown @@ -23,7 +23,7 @@ into management. Basic usage with tags: -```hcl +```terraform resource "aws_default_vpc_dhcp_options" "default" { tags = { Name = "Default DHCP Option Set" diff --git a/website/docs/r/devicefarm_project.html.markdown b/website/docs/r/devicefarm_project.html.markdown index 002f0ecfbe5..725f073618c 100644 --- a/website/docs/r/devicefarm_project.html.markdown +++ b/website/docs/r/devicefarm_project.html.markdown @@ -18,7 +18,7 @@ For more information about Device Farm Projects, see the AWS Documentation on ## Example Usage -```hcl +```terraform resource "aws_devicefarm_project" "awesome_devices" { name = "my-device-farm" } diff --git a/website/docs/r/directory_service_conditional_forwarder.html.markdown b/website/docs/r/directory_service_conditional_forwarder.html.markdown index 936849caf2f..1fd58889b5f 100644 --- a/website/docs/r/directory_service_conditional_forwarder.html.markdown +++ b/website/docs/r/directory_service_conditional_forwarder.html.markdown @@ -12,7 +12,7 @@ Provides a conditional forwarder for managed Microsoft AD in AWS Directory Servi ## Example Usage -```hcl +```terraform resource "aws_directory_service_conditional_forwarder" "example" { directory_id = aws_directory_service_directory.ad.id remote_domain_name = "example.com" diff --git a/website/docs/r/directory_service_directory.html.markdown b/website/docs/r/directory_service_directory.html.markdown index fddf2014434..af971f81748 100644 --- a/website/docs/r/directory_service_directory.html.markdown +++ b/website/docs/r/directory_service_directory.html.markdown @@ -17,7 +17,7 @@ Provides a Simple or Managed Microsoft directory in AWS Directory Service. ### SimpleAD -```hcl +```terraform resource "aws_directory_service_directory" "bar" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" @@ -52,7 +52,7 @@ resource "aws_subnet" "bar" { ### Microsoft Active Directory (MicrosoftAD) -```hcl +```terraform resource "aws_directory_service_directory" "bar" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" @@ -88,7 +88,7 @@ resource "aws_subnet" "bar" { ### Microsoft Active Directory Connector (ADConnector) -```hcl +```terraform resource "aws_directory_service_directory" "connector" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" diff --git a/website/docs/r/directory_service_log_subscription.html.markdown b/website/docs/r/directory_service_log_subscription.html.markdown index d74976af0d3..355b122dc2e 100644 --- a/website/docs/r/directory_service_log_subscription.html.markdown +++ b/website/docs/r/directory_service_log_subscription.html.markdown @@ -12,7 +12,7 @@ Provides a Log subscription for AWS Directory Service that pushes logs to cloudw ## Example Usage -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "/aws/directoryservice/${aws_directory_service_directory.example.id}" retention_in_days = 14 diff --git a/website/docs/r/dlm_lifecycle_policy.markdown b/website/docs/r/dlm_lifecycle_policy.markdown index 98efb542d01..ee494757d03 100644 --- a/website/docs/r/dlm_lifecycle_policy.markdown +++ b/website/docs/r/dlm_lifecycle_policy.markdown @@ -12,7 +12,7 @@ Provides a [Data Lifecycle Manager (DLM) lifecycle policy](https://docs.aws.amaz ## Example Usage -```hcl +```terraform resource "aws_iam_role" "dlm_lifecycle_role" { name = "dlm-lifecycle-role" diff --git a/website/docs/r/dms_certificate.html.markdown b/website/docs/r/dms_certificate.html.markdown index 03eeab39011..2a40eca204a 100644 --- a/website/docs/r/dms_certificate.html.markdown +++ b/website/docs/r/dms_certificate.html.markdown @@ -15,7 +15,7 @@ Provides a DMS (Data Migration Service) certificate resource. DMS certificates c ## Example Usage -```hcl +```terraform # Create a new certificate resource "aws_dms_certificate" "test" { certificate_id = "test-dms-certificate-tf" diff --git a/website/docs/r/dms_endpoint.html.markdown b/website/docs/r/dms_endpoint.html.markdown index 46d0dcffe5e..f9d964913f3 100644 --- a/website/docs/r/dms_endpoint.html.markdown +++ b/website/docs/r/dms_endpoint.html.markdown @@ -15,7 +15,7 @@ Provides a DMS (Data Migration Service) endpoint resource. DMS endpoints can be ## Example Usage -```hcl +```terraform # Create a new endpoint resource "aws_dms_endpoint" "test" { certificate_arn = "arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012" diff --git a/website/docs/r/dms_event_subscription.html.markdown b/website/docs/r/dms_event_subscription.html.markdown index c0707ca37c3..72907fe7a1b 100644 --- a/website/docs/r/dms_event_subscription.html.markdown +++ b/website/docs/r/dms_event_subscription.html.markdown @@ -12,7 +12,7 @@ Provides a DMS (Data Migration Service) event subscription resource. ## Example Usage -```hcl +```terraform resource "aws_dms_event_subscription" "example" { enabled = true event_categories = ["creation", "failure"] diff --git a/website/docs/r/dms_replication_instance.html.markdown b/website/docs/r/dms_replication_instance.html.markdown index b40204af91b..efacf1bb933 100644 --- a/website/docs/r/dms_replication_instance.html.markdown +++ b/website/docs/r/dms_replication_instance.html.markdown @@ -12,7 +12,7 @@ Provides a DMS (Data Migration Service) replication instance resource. DMS repli ## Example Usage -```hcl +```terraform # Database Migration Service requires the below IAM Roles to be created before # replication instances can be created. See the DMS Documentation for # additional information: https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#CHAP_Security.APIRole diff --git a/website/docs/r/dms_replication_subnet_group.html.markdown b/website/docs/r/dms_replication_subnet_group.html.markdown index 730caba70ea..d3f7746530b 100644 --- a/website/docs/r/dms_replication_subnet_group.html.markdown +++ b/website/docs/r/dms_replication_subnet_group.html.markdown @@ -12,7 +12,7 @@ Provides a DMS (Data Migration Service) replication subnet group resource. DMS r ## Example Usage -```hcl +```terraform # Create a new replication subnet group resource "aws_dms_replication_subnet_group" "test" { replication_subnet_group_description = "Test replication subnet group" diff --git a/website/docs/r/dms_replication_task.html.markdown b/website/docs/r/dms_replication_task.html.markdown index 075e2aed5a5..a648dc10789 100644 --- a/website/docs/r/dms_replication_task.html.markdown +++ b/website/docs/r/dms_replication_task.html.markdown @@ -12,7 +12,7 @@ Provides a DMS (Data Migration Service) replication task resource. DMS replicati ## Example Usage -```hcl +```terraform # Create a new replication task resource "aws_dms_replication_task" "test" { cdc_start_time = 1484346880 diff --git a/website/docs/r/docdb_cluster.html.markdown b/website/docs/r/docdb_cluster.html.markdown index 928c12978ea..bc4d549ba5e 100644 --- a/website/docs/r/docdb_cluster.html.markdown +++ b/website/docs/r/docdb_cluster.html.markdown @@ -23,7 +23,7 @@ phase because a modification has not yet taken place. You can use the ## Example Usage -```hcl +```terraform resource "aws_docdb_cluster" "docdb" { cluster_identifier = "my-docdb-cluster" engine = "docdb" diff --git a/website/docs/r/docdb_cluster_instance.html.markdown b/website/docs/r/docdb_cluster_instance.html.markdown index f3a43ada558..bf7b97a2ec8 100644 --- a/website/docs/r/docdb_cluster_instance.html.markdown +++ b/website/docs/r/docdb_cluster_instance.html.markdown @@ -19,7 +19,7 @@ Cluster, or you may specify different Cluster Instance resources with various ## Example Usage -```hcl +```terraform resource "aws_docdb_cluster_instance" "cluster_instances" { count = 2 identifier = "docdb-cluster-demo-${count.index}" diff --git a/website/docs/r/docdb_cluster_parameter_group.html.markdown b/website/docs/r/docdb_cluster_parameter_group.html.markdown index 8c5000b3be4..8063d8ba366 100644 --- a/website/docs/r/docdb_cluster_parameter_group.html.markdown +++ b/website/docs/r/docdb_cluster_parameter_group.html.markdown @@ -12,7 +12,7 @@ Manages a DocumentDB Cluster Parameter Group ## Example Usage -```hcl +```terraform resource "aws_docdb_cluster_parameter_group" "example" { family = "docdb3.6" name = "example" diff --git a/website/docs/r/docdb_cluster_snapshot.html.markdown b/website/docs/r/docdb_cluster_snapshot.html.markdown index 84dfd2099a1..6e20930482f 100644 --- a/website/docs/r/docdb_cluster_snapshot.html.markdown +++ b/website/docs/r/docdb_cluster_snapshot.html.markdown @@ -12,7 +12,7 @@ Manages a DocDB database cluster snapshot for DocDB clusters. ## Example Usage -```hcl +```terraform resource "aws_docdb_cluster_snapshot" "example" { db_cluster_identifier = aws_docdb_cluster.example.id db_cluster_snapshot_identifier = "resourcetestsnapshot1234" diff --git a/website/docs/r/docdb_subnet_group.html.markdown b/website/docs/r/docdb_subnet_group.html.markdown index 404df33b22e..a6a4a906f49 100644 --- a/website/docs/r/docdb_subnet_group.html.markdown +++ b/website/docs/r/docdb_subnet_group.html.markdown @@ -12,7 +12,7 @@ Provides an DocumentDB subnet group resource. ## Example Usage -```hcl +```terraform resource "aws_docdb_subnet_group" "default" { name = "main" subnet_ids = [aws_subnet.frontend.id, aws_subnet.backend.id] diff --git a/website/docs/r/dx_bgp_peer.html.markdown b/website/docs/r/dx_bgp_peer.html.markdown index 39aa635099d..cb0c0add701 100644 --- a/website/docs/r/dx_bgp_peer.html.markdown +++ b/website/docs/r/dx_bgp_peer.html.markdown @@ -12,7 +12,7 @@ Provides a Direct Connect BGP peer resource. ## Example Usage -```hcl +```terraform resource "aws_dx_bgp_peer" "peer" { virtual_interface_id = aws_dx_private_virtual_interface.foo.id address_family = "ipv6" diff --git a/website/docs/r/dx_connection.html.markdown b/website/docs/r/dx_connection.html.markdown index 5882af86ae5..ce0192570a9 100644 --- a/website/docs/r/dx_connection.html.markdown +++ b/website/docs/r/dx_connection.html.markdown @@ -12,7 +12,7 @@ Provides a Connection of Direct Connect. ## Example Usage -```hcl +```terraform resource "aws_dx_connection" "hoge" { name = "tf-dx-connection" bandwidth = "1Gbps" diff --git a/website/docs/r/dx_connection_association.html.markdown b/website/docs/r/dx_connection_association.html.markdown index 5602befd3f9..3ffdd34fde7 100644 --- a/website/docs/r/dx_connection_association.html.markdown +++ b/website/docs/r/dx_connection_association.html.markdown @@ -12,7 +12,7 @@ Associates a Direct Connect Connection with a LAG. ## Example Usage -```hcl +```terraform resource "aws_dx_connection" "example" { name = "example" bandwidth = "1Gbps" diff --git a/website/docs/r/dx_gateway.html.markdown b/website/docs/r/dx_gateway.html.markdown index a0ef2722e35..89a8e071342 100644 --- a/website/docs/r/dx_gateway.html.markdown +++ b/website/docs/r/dx_gateway.html.markdown @@ -12,7 +12,7 @@ Provides a Direct Connect Gateway. ## Example Usage -```hcl +```terraform resource "aws_dx_gateway" "example" { name = "tf-dxg-example" amazon_side_asn = "64512" diff --git a/website/docs/r/dx_gateway_association.html.markdown b/website/docs/r/dx_gateway_association.html.markdown index bd8811c6884..a64944f1dd6 100644 --- a/website/docs/r/dx_gateway_association.html.markdown +++ b/website/docs/r/dx_gateway_association.html.markdown @@ -18,7 +18,7 @@ by creating an `aws_dx_gateway_association` resource with the `proposal_id` and ### VPN Gateway Association -```hcl +```terraform resource "aws_dx_gateway" "example" { name = "example" amazon_side_asn = "64512" @@ -40,7 +40,7 @@ resource "aws_dx_gateway_association" "example" { ### Transit Gateway Association -```hcl +```terraform resource "aws_dx_gateway" "example" { name = "example" amazon_side_asn = "64512" @@ -62,7 +62,7 @@ resource "aws_dx_gateway_association" "example" { ### Allowed Prefixes -```hcl +```terraform resource "aws_dx_gateway" "example" { name = "example" amazon_side_asn = "64512" diff --git a/website/docs/r/dx_gateway_association_proposal.html.markdown b/website/docs/r/dx_gateway_association_proposal.html.markdown index 4fae6c595fa..c0d44155067 100644 --- a/website/docs/r/dx_gateway_association_proposal.html.markdown +++ b/website/docs/r/dx_gateway_association_proposal.html.markdown @@ -12,7 +12,7 @@ Manages a Direct Connect Gateway Association Proposal, typically for enabling cr ## Example Usage -```hcl +```terraform resource "aws_dx_gateway_association_proposal" "example" { dx_gateway_id = aws_dx_gateway.example.id dx_gateway_owner_account_id = aws_dx_gateway.example.owner_account_id diff --git a/website/docs/r/dx_hosted_private_virtual_interface.html.markdown b/website/docs/r/dx_hosted_private_virtual_interface.html.markdown index 1c36e486cb4..913c02ac747 100644 --- a/website/docs/r/dx_hosted_private_virtual_interface.html.markdown +++ b/website/docs/r/dx_hosted_private_virtual_interface.html.markdown @@ -13,7 +13,7 @@ A hosted virtual interface is a virtual interface that is owned by another AWS a ## Example Usage -```hcl +```terraform resource "aws_dx_hosted_private_virtual_interface" "foo" { connection_id = "dxcon-zzzzzzzz" diff --git a/website/docs/r/dx_hosted_private_virtual_interface_accepter.html.markdown b/website/docs/r/dx_hosted_private_virtual_interface_accepter.html.markdown index 97c7597eb66..00730b61c20 100644 --- a/website/docs/r/dx_hosted_private_virtual_interface_accepter.html.markdown +++ b/website/docs/r/dx_hosted_private_virtual_interface_accepter.html.markdown @@ -13,7 +13,7 @@ This resource accepts ownership of a private virtual interface created by anothe ## Example Usage -```hcl +```terraform provider "aws" { # Creator's credentials. } diff --git a/website/docs/r/dx_hosted_public_virtual_interface.html.markdown b/website/docs/r/dx_hosted_public_virtual_interface.html.markdown index 233f63a17f5..a09430e4f20 100644 --- a/website/docs/r/dx_hosted_public_virtual_interface.html.markdown +++ b/website/docs/r/dx_hosted_public_virtual_interface.html.markdown @@ -13,7 +13,7 @@ A hosted virtual interface is a virtual interface that is owned by another AWS a ## Example Usage -```hcl +```terraform resource "aws_dx_hosted_public_virtual_interface" "foo" { connection_id = "dxcon-zzzzzzzz" diff --git a/website/docs/r/dx_hosted_public_virtual_interface_accepter.html.markdown b/website/docs/r/dx_hosted_public_virtual_interface_accepter.html.markdown index 26d74d6c734..1ddb6722349 100644 --- a/website/docs/r/dx_hosted_public_virtual_interface_accepter.html.markdown +++ b/website/docs/r/dx_hosted_public_virtual_interface_accepter.html.markdown @@ -13,7 +13,7 @@ This resource accepts ownership of a public virtual interface created by another ## Example Usage -```hcl +```terraform provider "aws" { # Creator's credentials. } diff --git a/website/docs/r/dx_hosted_transit_virtual_interface.html.markdown b/website/docs/r/dx_hosted_transit_virtual_interface.html.markdown index 5a38a6ecdcd..3f4bb3a9b19 100644 --- a/website/docs/r/dx_hosted_transit_virtual_interface.html.markdown +++ b/website/docs/r/dx_hosted_transit_virtual_interface.html.markdown @@ -14,7 +14,7 @@ A hosted virtual interface is a virtual interface that is owned by another AWS a ## Example Usage -```hcl +```terraform resource "aws_dx_hosted_transit_virtual_interface" "example" { connection_id = aws_dx_connection.example.id diff --git a/website/docs/r/dx_hosted_transit_virtual_interface_accepter.html.markdown b/website/docs/r/dx_hosted_transit_virtual_interface_accepter.html.markdown index ec73c108d88..eac517290ae 100644 --- a/website/docs/r/dx_hosted_transit_virtual_interface_accepter.html.markdown +++ b/website/docs/r/dx_hosted_transit_virtual_interface_accepter.html.markdown @@ -15,7 +15,7 @@ This resource accepts ownership of a transit virtual interface created by anothe ## Example Usage -```hcl +```terraform provider "aws" { # Creator's credentials. } diff --git a/website/docs/r/dx_lag.html.markdown b/website/docs/r/dx_lag.html.markdown index b4930e403ec..5a299088458 100644 --- a/website/docs/r/dx_lag.html.markdown +++ b/website/docs/r/dx_lag.html.markdown @@ -14,7 +14,7 @@ Provides a Direct Connect LAG. Connections can be added to the LAG via the [`aws ## Example Usage -```hcl +```terraform resource "aws_dx_lag" "hoge" { name = "tf-dx-lag" connections_bandwidth = "1Gbps" diff --git a/website/docs/r/dx_private_virtual_interface.html.markdown b/website/docs/r/dx_private_virtual_interface.html.markdown index 278e6d13839..4a6d521ad93 100644 --- a/website/docs/r/dx_private_virtual_interface.html.markdown +++ b/website/docs/r/dx_private_virtual_interface.html.markdown @@ -12,7 +12,7 @@ Provides a Direct Connect private virtual interface resource. ## Example Usage -```hcl +```terraform resource "aws_dx_private_virtual_interface" "foo" { connection_id = "dxcon-zzzzzzzz" diff --git a/website/docs/r/dx_public_virtual_interface.html.markdown b/website/docs/r/dx_public_virtual_interface.html.markdown index ca88dafefac..0b093788a53 100644 --- a/website/docs/r/dx_public_virtual_interface.html.markdown +++ b/website/docs/r/dx_public_virtual_interface.html.markdown @@ -12,7 +12,7 @@ Provides a Direct Connect public virtual interface resource. ## Example Usage -```hcl +```terraform resource "aws_dx_public_virtual_interface" "foo" { connection_id = "dxcon-zzzzzzzz" diff --git a/website/docs/r/dx_transit_virtual_interface.html.markdown b/website/docs/r/dx_transit_virtual_interface.html.markdown index 230783776ce..8ab1a308421 100644 --- a/website/docs/r/dx_transit_virtual_interface.html.markdown +++ b/website/docs/r/dx_transit_virtual_interface.html.markdown @@ -13,7 +13,7 @@ A transit virtual interface is a VLAN that transports traffic from a [Direct Con ## Example Usage -```hcl +```terraform resource "aws_dx_gateway" "example" { name = "tf-dxg-example" amazon_side_asn = 64512 diff --git a/website/docs/r/dynamodb_global_table.html.markdown b/website/docs/r/dynamodb_global_table.html.markdown index 4e7b93ec503..95e55830464 100644 --- a/website/docs/r/dynamodb_global_table.html.markdown +++ b/website/docs/r/dynamodb_global_table.html.markdown @@ -16,7 +16,7 @@ Manages [DynamoDB Global Tables V1 (version 2017.11.29)](https://docs.aws.amazon ## Example Usage -```hcl +```terraform provider "aws" { alias = "us-east-1" region = "us-east-1" diff --git a/website/docs/r/dynamodb_table.html.markdown b/website/docs/r/dynamodb_table.html.markdown index d93972c0c09..cf88fc894e2 100644 --- a/website/docs/r/dynamodb_table.html.markdown +++ b/website/docs/r/dynamodb_table.html.markdown @@ -17,7 +17,7 @@ Provides a DynamoDB table resource The following dynamodb table description models the table and GSI shown in the [AWS SDK example documentation](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.html) -```hcl +```terraform resource "aws_dynamodb_table" "basic-dynamodb-table" { name = "GameScores" billing_mode = "PROVISIONED" @@ -67,7 +67,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { This resource implements support for [DynamoDB Global Tables V2 (version 2019.11.21)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html) via `replica` configuration blocks. For working with [DynamoDB Global Tables V1 (version 2017.11.29)](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html), see the [`aws_dynamodb_global_table` resource](/docs/providers/aws/r/dynamodb_global_table.html). -```hcl +```terraform resource "aws_dynamodb_table" "example" { name = "example" hash_key = "TestTableHashKey" diff --git a/website/docs/r/dynamodb_table_item.html.markdown b/website/docs/r/dynamodb_table_item.html.markdown index 6083feb73f7..803e2d8c5fb 100644 --- a/website/docs/r/dynamodb_table_item.html.markdown +++ b/website/docs/r/dynamodb_table_item.html.markdown @@ -15,7 +15,7 @@ Provides a DynamoDB table item resource ## Example Usage -```hcl +```terraform resource "aws_dynamodb_table_item" "example" { table_name = aws_dynamodb_table.example.name hash_key = aws_dynamodb_table.example.hash_key diff --git a/website/docs/r/ebs_default_kms_key.html.markdown b/website/docs/r/ebs_default_kms_key.html.markdown index c211e09534e..85691038b7d 100644 --- a/website/docs/r/ebs_default_kms_key.html.markdown +++ b/website/docs/r/ebs_default_kms_key.html.markdown @@ -19,7 +19,7 @@ By using the `aws_ebs_default_kms_key` resource, you can specify a customer-mana ## Example Usage -```hcl +```terraform resource "aws_ebs_default_kms_key" "example" { key_arn = aws_kms_key.example.arn } diff --git a/website/docs/r/ebs_encryption_by_default.html.markdown b/website/docs/r/ebs_encryption_by_default.html.markdown index b25c662d4cb..ebe1b074ee4 100644 --- a/website/docs/r/ebs_encryption_by_default.html.markdown +++ b/website/docs/r/ebs_encryption_by_default.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage whether default EBS encryption is enabled for your ## Example Usage -```hcl +```terraform resource "aws_ebs_encryption_by_default" "example" { enabled = true } diff --git a/website/docs/r/ebs_snapshot.html.markdown b/website/docs/r/ebs_snapshot.html.markdown index 190630ff90c..254ba3b8b55 100644 --- a/website/docs/r/ebs_snapshot.html.markdown +++ b/website/docs/r/ebs_snapshot.html.markdown @@ -12,7 +12,7 @@ Creates a Snapshot of an EBS Volume. ## Example Usage -```hcl +```terraform resource "aws_ebs_volume" "example" { availability_zone = "us-west-2a" size = 40 diff --git a/website/docs/r/ebs_snapshot_copy.html.markdown b/website/docs/r/ebs_snapshot_copy.html.markdown index 42c0c65b474..f6afda85f11 100644 --- a/website/docs/r/ebs_snapshot_copy.html.markdown +++ b/website/docs/r/ebs_snapshot_copy.html.markdown @@ -12,7 +12,7 @@ Creates a Snapshot of a snapshot. ## Example Usage -```hcl +```terraform resource "aws_ebs_volume" "example" { availability_zone = "us-west-2a" size = 40 diff --git a/website/docs/r/ebs_volume.html.markdown b/website/docs/r/ebs_volume.html.markdown index f5746c4142d..687a7b8941e 100644 --- a/website/docs/r/ebs_volume.html.markdown +++ b/website/docs/r/ebs_volume.html.markdown @@ -12,7 +12,7 @@ Manages a single EBS volume. ## Example Usage -```hcl +```terraform resource "aws_ebs_volume" "example" { availability_zone = "us-west-2a" size = 40 diff --git a/website/docs/r/ec2_availability_zone_group.html.markdown b/website/docs/r/ec2_availability_zone_group.html.markdown index 76b9e2dd27d..5870bd61d80 100644 --- a/website/docs/r/ec2_availability_zone_group.html.markdown +++ b/website/docs/r/ec2_availability_zone_group.html.markdown @@ -14,7 +14,7 @@ Manages an EC2 Availability Zone Group, such as updating its opt-in status. ## Example Usage -```hcl +```terraform resource "aws_ec2_availability_zone_group" "example" { group_name = "us-west-2-lax-1" opt_in_status = "opted-in" diff --git a/website/docs/r/ec2_capacity_reservation.html.markdown b/website/docs/r/ec2_capacity_reservation.html.markdown index 7ebd333c696..00cf6a7f037 100644 --- a/website/docs/r/ec2_capacity_reservation.html.markdown +++ b/website/docs/r/ec2_capacity_reservation.html.markdown @@ -12,7 +12,7 @@ Provides an EC2 Capacity Reservation. This allows you to reserve capacity for yo ## Example Usage -```hcl +```terraform resource "aws_ec2_capacity_reservation" "default" { instance_type = "t2.micro" instance_platform = "Linux/UNIX" diff --git a/website/docs/r/ec2_carrier_gateway.html.markdown b/website/docs/r/ec2_carrier_gateway.html.markdown index 805b29f21c3..b64ef31ef54 100644 --- a/website/docs/r/ec2_carrier_gateway.html.markdown +++ b/website/docs/r/ec2_carrier_gateway.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Carrier Gateway. See the AWS [documentation](https://docs.aws.ama ## Example Usage -```hcl +```terraform resource "aws_ec2_carrier_gateway" "example" { vpc_id = aws_vpc.example.id diff --git a/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown b/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown index e08c91a364f..9e9cf11d500 100644 --- a/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown +++ b/website/docs/r/ec2_client_vpn_authorization_rule.html.markdown @@ -13,7 +13,7 @@ Provides authorization rules for AWS Client VPN endpoints. For more information ## Example Usage -```hcl +```terraform resource "aws_ec2_client_vpn_authorization_rule" "example" { client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id target_network_cidr = aws_subnet.example.cidr_block diff --git a/website/docs/r/ec2_client_vpn_endpoint.html.markdown b/website/docs/r/ec2_client_vpn_endpoint.html.markdown index 83f12c245f4..e06290ba2ca 100644 --- a/website/docs/r/ec2_client_vpn_endpoint.html.markdown +++ b/website/docs/r/ec2_client_vpn_endpoint.html.markdown @@ -13,7 +13,7 @@ Provides an AWS Client VPN endpoint for OpenVPN clients. For more information on ## Example Usage -```hcl +```terraform resource "aws_ec2_client_vpn_endpoint" "example" { description = "terraform-clientvpn-example" server_certificate_arn = aws_acm_certificate.cert.arn diff --git a/website/docs/r/ec2_client_vpn_network_association.html.markdown b/website/docs/r/ec2_client_vpn_network_association.html.markdown index c8c694e3582..6f8d23558c0 100644 --- a/website/docs/r/ec2_client_vpn_network_association.html.markdown +++ b/website/docs/r/ec2_client_vpn_network_association.html.markdown @@ -15,7 +15,7 @@ Provides network associations for AWS Client VPN endpoints. For more information ### Using default security group -```hcl +```terraform resource "aws_ec2_client_vpn_network_association" "example" { client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id subnet_id = aws_subnet.example.id @@ -24,7 +24,7 @@ resource "aws_ec2_client_vpn_network_association" "example" { ### Using custom security groups -```hcl +```terraform resource "aws_ec2_client_vpn_network_association" "example" { client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id subnet_id = aws_subnet.example.id diff --git a/website/docs/r/ec2_client_vpn_route.html.markdown b/website/docs/r/ec2_client_vpn_route.html.markdown index 036c5f481a2..3effe220809 100644 --- a/website/docs/r/ec2_client_vpn_route.html.markdown +++ b/website/docs/r/ec2_client_vpn_route.html.markdown @@ -13,7 +13,7 @@ Provides additional routes for AWS Client VPN endpoints. For more information on ## Example Usage -```hcl +```terraform resource "aws_ec2_client_vpn_route" "example" { client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.example.id destination_cidr_block = "0.0.0.0/0" diff --git a/website/docs/r/ec2_fleet.html.markdown b/website/docs/r/ec2_fleet.html.markdown index 9a0f06c01a6..17e5cb2c422 100644 --- a/website/docs/r/ec2_fleet.html.markdown +++ b/website/docs/r/ec2_fleet.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage EC2 Fleets. ## Example Usage -```hcl +```terraform resource "aws_ec2_fleet" "example" { launch_template_config { launch_template_specification { @@ -60,7 +60,7 @@ The following arguments are supported: Example: -```hcl +```terraform resource "aws_ec2_fleet" "example" { # ... other configuration ... diff --git a/website/docs/r/ec2_local_gateway_route.html.markdown b/website/docs/r/ec2_local_gateway_route.html.markdown index ef94eed3517..d21931e4148 100644 --- a/website/docs/r/ec2_local_gateway_route.html.markdown +++ b/website/docs/r/ec2_local_gateway_route.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Local Gateway Route. More information can be found in the [Outpos ## Example Usage -```hcl +```terraform resource "aws_ec2_local_gateway_route" "example" { destination_cidr_block = "172.16.0.0/16" local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.example.id diff --git a/website/docs/r/ec2_local_gateway_route_table_vpc_association.html.markdown b/website/docs/r/ec2_local_gateway_route_table_vpc_association.html.markdown index c9e5d11f6d8..bbd3173684d 100644 --- a/website/docs/r/ec2_local_gateway_route_table_vpc_association.html.markdown +++ b/website/docs/r/ec2_local_gateway_route_table_vpc_association.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Local Gateway Route Table VPC Association. More information can b ## Example Usage -```hcl +```terraform data "aws_ec2_local_gateway_route_table" "example" { outpost_arn = "arn:aws:outposts:us-west-2:123456789012:outpost/op-1234567890abcdef" } diff --git a/website/docs/r/ec2_managed_prefix_list.html.markdown b/website/docs/r/ec2_managed_prefix_list.html.markdown index 98c480a4e45..66fb791bc2f 100644 --- a/website/docs/r/ec2_managed_prefix_list.html.markdown +++ b/website/docs/r/ec2_managed_prefix_list.html.markdown @@ -20,7 +20,7 @@ as 20 rules for the security group. Basic usage -```hcl +```terraform resource "aws_ec2_managed_prefix_list" "example" { name = "All VPC CIDR-s" address_family = "IPv4" diff --git a/website/docs/r/ec2_tag.html.markdown b/website/docs/r/ec2_tag.html.markdown index 3eef93e294c..09fca91185f 100644 --- a/website/docs/r/ec2_tag.html.markdown +++ b/website/docs/r/ec2_tag.html.markdown @@ -16,7 +16,7 @@ Manages an individual EC2 resource tag. This resource should only be used in cas ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway" "example" {} resource "aws_customer_gateway" "example" { diff --git a/website/docs/r/ec2_traffic_mirror_filter.html.markdown b/website/docs/r/ec2_traffic_mirror_filter.html.markdown index d4fb95cb685..7e044c6dc55 100644 --- a/website/docs/r/ec2_traffic_mirror_filter.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_filter.html.markdown @@ -15,7 +15,7 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror filter -```hcl +```terraform resource "aws_ec2_traffic_mirror_filter" "foo" { description = "traffic mirror filter - terraform example" network_services = ["amazon-dns"] diff --git a/website/docs/r/ec2_traffic_mirror_filter_rule.html.markdown b/website/docs/r/ec2_traffic_mirror_filter_rule.html.markdown index f5fd1340ac9..5acc90fb1f7 100644 --- a/website/docs/r/ec2_traffic_mirror_filter_rule.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_filter_rule.html.markdown @@ -15,7 +15,7 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```hcl +```terraform resource "aws_ec2_traffic_mirror_filter" "filter" { description = "traffic mirror filter - terraform example" network_services = ["amazon-dns"] diff --git a/website/docs/r/ec2_traffic_mirror_session.html.markdown b/website/docs/r/ec2_traffic_mirror_session.html.markdown index 4f609b32c5b..6a2179ec6c2 100644 --- a/website/docs/r/ec2_traffic_mirror_session.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_session.html.markdown @@ -15,7 +15,7 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```hcl +```terraform resource "aws_ec2_traffic_mirror_filter" "filter" { description = "traffic mirror filter - terraform example" network_services = ["amazon-dns"] diff --git a/website/docs/r/ec2_traffic_mirror_target.html.markdown b/website/docs/r/ec2_traffic_mirror_target.html.markdown index cc185772723..9c499d89f3b 100644 --- a/website/docs/r/ec2_traffic_mirror_target.html.markdown +++ b/website/docs/r/ec2_traffic_mirror_target.html.markdown @@ -15,7 +15,7 @@ Read [limits and considerations](https://docs.aws.amazon.com/vpc/latest/mirrorin To create a basic traffic mirror session -```hcl +```terraform resource "aws_ec2_traffic_mirror_target" "nlb" { description = "NLB target" network_load_balancer_arn = aws_lb.lb.arn diff --git a/website/docs/r/ec2_transit_gateway.html.markdown b/website/docs/r/ec2_transit_gateway.html.markdown index 4832b4f3933..bf6e983c917 100644 --- a/website/docs/r/ec2_transit_gateway.html.markdown +++ b/website/docs/r/ec2_transit_gateway.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Transit Gateway. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway" "example" { description = "example" } diff --git a/website/docs/r/ec2_transit_gateway_peering_attachment.html.markdown b/website/docs/r/ec2_transit_gateway_peering_attachment.html.markdown index acac16792fb..c4e64f2141f 100644 --- a/website/docs/r/ec2_transit_gateway_peering_attachment.html.markdown +++ b/website/docs/r/ec2_transit_gateway_peering_attachment.html.markdown @@ -13,7 +13,7 @@ For examples of custom route table association and propagation, see the [EC2 Tra ## Example Usage -```hcl +```terraform provider "aws" { alias = "local" region = "us-east-1" diff --git a/website/docs/r/ec2_transit_gateway_peering_attachment_accepter.markdown b/website/docs/r/ec2_transit_gateway_peering_attachment_accepter.markdown index 971c88616ba..73b926a6f40 100644 --- a/website/docs/r/ec2_transit_gateway_peering_attachment_accepter.markdown +++ b/website/docs/r/ec2_transit_gateway_peering_attachment_accepter.markdown @@ -12,7 +12,7 @@ Manages the accepter's side of an EC2 Transit Gateway Peering Attachment. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_peering_attachment_accepter" "example" { transit_gateway_attachment_id = aws_ec2_transit_gateway_peering_attachment.example.id diff --git a/website/docs/r/ec2_transit_gateway_prefix_list_reference.html.markdown b/website/docs/r/ec2_transit_gateway_prefix_list_reference.html.markdown index f6d884e8837..01acdc26ce5 100644 --- a/website/docs/r/ec2_transit_gateway_prefix_list_reference.html.markdown +++ b/website/docs/r/ec2_transit_gateway_prefix_list_reference.html.markdown @@ -14,7 +14,7 @@ Manages an EC2 Transit Gateway Prefix List Reference. ### Attachment Routing -```hcl +```terraform resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { prefix_list_id = aws_ec2_managed_prefix_list.example.id transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id @@ -24,7 +24,7 @@ resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { ### Blackhole Routing -```hcl +```terraform resource "aws_ec2_transit_gateway_prefix_list_reference" "example" { blackhole = true prefix_list_id = aws_ec2_managed_prefix_list.example.id diff --git a/website/docs/r/ec2_transit_gateway_route.html.markdown b/website/docs/r/ec2_transit_gateway_route.html.markdown index 2140ce706ac..58dff7dbbb8 100644 --- a/website/docs/r/ec2_transit_gateway_route.html.markdown +++ b/website/docs/r/ec2_transit_gateway_route.html.markdown @@ -14,7 +14,7 @@ Manages an EC2 Transit Gateway Route. ### Standard usage -```hcl +```terraform resource "aws_ec2_transit_gateway_route" "example" { destination_cidr_block = "0.0.0.0/0" transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id @@ -24,7 +24,7 @@ resource "aws_ec2_transit_gateway_route" "example" { ### Blackhole route -```hcl +```terraform resource "aws_ec2_transit_gateway_route" "example" { destination_cidr_block = "0.0.0.0/0" blackhole = true diff --git a/website/docs/r/ec2_transit_gateway_route_table.html.markdown b/website/docs/r/ec2_transit_gateway_route_table.html.markdown index e92d770d23e..bfb7ef64837 100644 --- a/website/docs/r/ec2_transit_gateway_route_table.html.markdown +++ b/website/docs/r/ec2_transit_gateway_route_table.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Transit Gateway Route Table. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_route_table" "example" { transit_gateway_id = aws_ec2_transit_gateway.example.id } diff --git a/website/docs/r/ec2_transit_gateway_route_table_association.html.markdown b/website/docs/r/ec2_transit_gateway_route_table_association.html.markdown index c80377d7855..29bccf1d758 100644 --- a/website/docs/r/ec2_transit_gateway_route_table_association.html.markdown +++ b/website/docs/r/ec2_transit_gateway_route_table_association.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Transit Gateway Route Table association. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_route_table_association" "example" { transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id diff --git a/website/docs/r/ec2_transit_gateway_route_table_propagation.html.markdown b/website/docs/r/ec2_transit_gateway_route_table_propagation.html.markdown index 2be0ca4d2af..a5050798360 100644 --- a/website/docs/r/ec2_transit_gateway_route_table_propagation.html.markdown +++ b/website/docs/r/ec2_transit_gateway_route_table_propagation.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Transit Gateway Route Table propagation. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_route_table_propagation" "example" { transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id transit_gateway_route_table_id = aws_ec2_transit_gateway_route_table.example.id diff --git a/website/docs/r/ec2_transit_gateway_vpc_attachment.html.markdown b/website/docs/r/ec2_transit_gateway_vpc_attachment.html.markdown index 18a39409679..4ff12d864ef 100644 --- a/website/docs/r/ec2_transit_gateway_vpc_attachment.html.markdown +++ b/website/docs/r/ec2_transit_gateway_vpc_attachment.html.markdown @@ -12,7 +12,7 @@ Manages an EC2 Transit Gateway VPC Attachment. For examples of custom route tabl ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_vpc_attachment" "example" { subnet_ids = [aws_subnet.example.id] transit_gateway_id = aws_ec2_transit_gateway.example.id diff --git a/website/docs/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown b/website/docs/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown index bba56d0c9ed..9890fc3c4ed 100644 --- a/website/docs/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown +++ b/website/docs/r/ec2_transit_gateway_vpc_attachment_accepter.html.markdown @@ -18,7 +18,7 @@ connection into management. ## Example Usage -```hcl +```terraform resource "aws_ec2_transit_gateway_vpc_attachment_accepter" "example" { transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.example.id diff --git a/website/docs/r/ecr_lifecycle_policy.html.markdown b/website/docs/r/ecr_lifecycle_policy.html.markdown index 4db3efe103c..35412f0ad81 100644 --- a/website/docs/r/ecr_lifecycle_policy.html.markdown +++ b/website/docs/r/ecr_lifecycle_policy.html.markdown @@ -18,7 +18,7 @@ Manages an ECR repository lifecycle policy. ### Policy on untagged image -```hcl +```terraform resource "aws_ecr_repository" "foo" { name = "bar" } @@ -50,7 +50,7 @@ EOF ### Policy on tagged image -```hcl +```terraform resource "aws_ecr_repository" "foo" { name = "bar" } diff --git a/website/docs/r/ecr_repository.html.markdown b/website/docs/r/ecr_repository.html.markdown index 20f9d7d57d1..7814383a8ae 100644 --- a/website/docs/r/ecr_repository.html.markdown +++ b/website/docs/r/ecr_repository.html.markdown @@ -12,7 +12,7 @@ Provides an Elastic Container Registry Repository. ## Example Usage -```hcl +```terraform resource "aws_ecr_repository" "foo" { name = "bar" image_tag_mutability = "MUTABLE" diff --git a/website/docs/r/ecr_repository_policy.html.markdown b/website/docs/r/ecr_repository_policy.html.markdown index 4ed0b9daad5..59b2fe974b8 100644 --- a/website/docs/r/ecr_repository_policy.html.markdown +++ b/website/docs/r/ecr_repository_policy.html.markdown @@ -14,7 +14,7 @@ Note that currently only one policy may be applied to a repository. ## Example Usage -```hcl +```terraform resource "aws_ecr_repository" "foo" { name = "bar" } diff --git a/website/docs/r/ecrpublic_repository.html.markdown b/website/docs/r/ecrpublic_repository.html.markdown index a83cff9ad2a..ab50ef3514a 100644 --- a/website/docs/r/ecrpublic_repository.html.markdown +++ b/website/docs/r/ecrpublic_repository.html.markdown @@ -12,7 +12,7 @@ Provides a Public Elastic Container Registry Repository. ## Example Usage -```hcl +```terraform resource "aws_ecrpublic_repository" "foo" { repository_name = "bar" diff --git a/website/docs/r/ecs_capacity_provider.html.markdown b/website/docs/r/ecs_capacity_provider.html.markdown index c80d69eaf98..d024cadbbf2 100644 --- a/website/docs/r/ecs_capacity_provider.html.markdown +++ b/website/docs/r/ecs_capacity_provider.html.markdown @@ -14,7 +14,7 @@ Provides an ECS cluster capacity provider. More information can be found on the ## Example Usage -```hcl +```terraform resource "aws_autoscaling_group" "test" { # ... other configuration, including potentially other tags ... diff --git a/website/docs/r/ecs_cluster.html.markdown b/website/docs/r/ecs_cluster.html.markdown index 15e5c8f5cad..d0c9892040f 100644 --- a/website/docs/r/ecs_cluster.html.markdown +++ b/website/docs/r/ecs_cluster.html.markdown @@ -12,7 +12,7 @@ Provides an ECS cluster. ## Example Usage -```hcl +```terraform resource "aws_ecs_cluster" "foo" { name = "white-hart" } diff --git a/website/docs/r/ecs_service.html.markdown b/website/docs/r/ecs_service.html.markdown index 73e43562fc7..1efce9f3520 100644 --- a/website/docs/r/ecs_service.html.markdown +++ b/website/docs/r/ecs_service.html.markdown @@ -16,7 +16,7 @@ See [ECS Services section in AWS developer guide](https://docs.aws.amazon.com/Am ## Example Usage -```hcl +```terraform resource "aws_ecs_service" "mongo" { name = "mongodb" cluster = aws_ecs_cluster.foo.id @@ -47,7 +47,7 @@ resource "aws_ecs_service" "mongo" { You can utilize the generic Terraform resource [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignore_changes` to create an ECS service with an initial count of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling). -```hcl +```terraform resource "aws_ecs_service" "example" { # ... other configurations ... @@ -63,7 +63,7 @@ resource "aws_ecs_service" "example" { ### Daemon Scheduling Strategy -```hcl +```terraform resource "aws_ecs_service" "bar" { name = "bar" cluster = aws_ecs_cluster.foo.id @@ -74,7 +74,7 @@ resource "aws_ecs_service" "bar" { ### External Deployment Controller -```hcl +```terraform resource "aws_ecs_service" "example" { name = "example" cluster = aws_ecs_cluster.example.id diff --git a/website/docs/r/ecs_task_definition.html.markdown b/website/docs/r/ecs_task_definition.html.markdown index b78f311b1a6..7ee5583ca47 100644 --- a/website/docs/r/ecs_task_definition.html.markdown +++ b/website/docs/r/ecs_task_definition.html.markdown @@ -58,7 +58,7 @@ resource "aws_ecs_task_definition" "service" { ### With AppMesh Proxy -```hcl +```terraform resource "aws_ecs_task_definition" "service" { family = "service" container_definitions = file("task-definitions/service.json") @@ -126,7 +126,7 @@ For more information, see [Specifying a Docker volume in your Task Definition De ##### Example Usage -```hcl +```terraform resource "aws_ecs_task_definition" "service" { family = "service" container_definitions = file("task-definitions/service.json") @@ -163,7 +163,7 @@ For more information, see [Specifying an EFS volume in your Task Definition Deve ##### Example Usage -```hcl +```terraform resource "aws_ecs_task_definition" "service" { family = "service" container_definitions = file("task-definitions/service.json") @@ -208,7 +208,7 @@ Guide](http://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query- ##### Example Usage -```hcl +```terraform resource "aws_ecs_task_definition" "test" { family = "test" container_definitions = < The below configuration uses [`depends_on`](https://www.terraform.io/docs/configuration/meta-arguments/depends_on.html) to prevent ordering issues with EKS automatically creating the log group first and a variable for naming consistency. Other ordering and naming methodologies may be more appropriate for your environment. -```hcl +```terraform variable "cluster_name" { default = "example" type = string @@ -110,7 +110,7 @@ resource "aws_cloudwatch_log_group" "example" { Only available on Kubernetes version 1.13 and 1.14 clusters created or upgraded on or after September 3, 2019. For more information about this feature, see the [EKS User Guide](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html). -```hcl +```terraform resource "aws_eks_cluster" "example" { # ... other configuration ... } diff --git a/website/docs/r/eks_fargate_profile.html.markdown b/website/docs/r/eks_fargate_profile.html.markdown index 6294a069306..1d46729e3cb 100644 --- a/website/docs/r/eks_fargate_profile.html.markdown +++ b/website/docs/r/eks_fargate_profile.html.markdown @@ -12,7 +12,7 @@ Manages an EKS Fargate Profile. ## Example Usage -```hcl +```terraform resource "aws_eks_fargate_profile" "example" { cluster_name = aws_eks_cluster.example.name fargate_profile_name = "example" @@ -27,7 +27,7 @@ resource "aws_eks_fargate_profile" "example" { ### Example IAM Role for EKS Fargate Profile -```hcl +```terraform resource "aws_iam_role" "example" { name = "eks-fargate-profile-example" diff --git a/website/docs/r/eks_node_group.html.markdown b/website/docs/r/eks_node_group.html.markdown index e22a29131bd..8a937fff17b 100644 --- a/website/docs/r/eks_node_group.html.markdown +++ b/website/docs/r/eks_node_group.html.markdown @@ -12,7 +12,7 @@ Manages an EKS Node Group, which can provision and optionally update an Auto Sca ## Example Usage -```hcl +```terraform resource "aws_eks_node_group" "example" { cluster_name = aws_eks_cluster.example.name node_group_name = "example" @@ -39,7 +39,7 @@ resource "aws_eks_node_group" "example" { You can utilize the generic Terraform resource [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignore_changes` to create an EKS Node Group with an initial size of running instances, then ignore any changes to that count caused externally (e.g. Application Autoscaling). -```hcl +```terraform resource "aws_eks_node_group" "example" { # ... other configurations ... @@ -59,7 +59,7 @@ resource "aws_eks_node_group" "example" { ### Example IAM Role for EKS Node Group -```hcl +```terraform resource "aws_iam_role" "example" { name = "eks-node-group-example" @@ -93,7 +93,7 @@ resource "aws_iam_role_policy_attachment" "example-AmazonEC2ContainerRegistryRea ### Example Subnets for EKS Node Group -```hcl +```terraform data "aws_availability_zones" "available" { state = "available" } diff --git a/website/docs/r/elastic_beanstalk_application.html.markdown b/website/docs/r/elastic_beanstalk_application.html.markdown index 21aafbc78b3..4e325de0a7f 100644 --- a/website/docs/r/elastic_beanstalk_application.html.markdown +++ b/website/docs/r/elastic_beanstalk_application.html.markdown @@ -17,7 +17,7 @@ This resource creates an application that has one configuration template named ## Example Usage -```hcl +```terraform resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" description = "tf-test-desc" diff --git a/website/docs/r/elastic_beanstalk_application_version.html.markdown b/website/docs/r/elastic_beanstalk_application_version.html.markdown index a6be6db3402..d1e3dc9a3b5 100644 --- a/website/docs/r/elastic_beanstalk_application_version.html.markdown +++ b/website/docs/r/elastic_beanstalk_application_version.html.markdown @@ -22,7 +22,7 @@ To work around this you can either create each environment in a separate AWS acc ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "default" { bucket = "tftest.applicationversion.bucket" } diff --git a/website/docs/r/elastic_beanstalk_configuration_template.html.markdown b/website/docs/r/elastic_beanstalk_configuration_template.html.markdown index da4482d2fad..e0c5ad36e13 100644 --- a/website/docs/r/elastic_beanstalk_configuration_template.html.markdown +++ b/website/docs/r/elastic_beanstalk_configuration_template.html.markdown @@ -14,7 +14,7 @@ application with the same configuration settings. ## Example Usage -```hcl +```terraform resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" description = "tf-test-desc" diff --git a/website/docs/r/elastic_beanstalk_environment.html.markdown b/website/docs/r/elastic_beanstalk_environment.html.markdown index 3e96a5c3cd4..63f19fe9d0d 100644 --- a/website/docs/r/elastic_beanstalk_environment.html.markdown +++ b/website/docs/r/elastic_beanstalk_environment.html.markdown @@ -17,7 +17,7 @@ Environments are often things such as `development`, `integration`, or ## Example Usage -```hcl +```terraform resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" description = "tf-test-desc" @@ -79,7 +79,7 @@ The `setting` and `all_settings` mappings support the following format: ### Example With Options -```hcl +```terraform resource "aws_elastic_beanstalk_application" "tftest" { name = "tf-test-name" description = "tf-test-desc" diff --git a/website/docs/r/elasticache_cluster.html.markdown b/website/docs/r/elasticache_cluster.html.markdown index 8b0dcaaee2d..21b57b5ee10 100644 --- a/website/docs/r/elasticache_cluster.html.markdown +++ b/website/docs/r/elasticache_cluster.html.markdown @@ -32,7 +32,7 @@ for more information. ### Memcached Cluster -```hcl +```terraform resource "aws_elasticache_cluster" "example" { cluster_id = "cluster-example" engine = "memcached" @@ -45,7 +45,7 @@ resource "aws_elasticache_cluster" "example" { ### Redis Instance -```hcl +```terraform resource "aws_elasticache_cluster" "example" { cluster_id = "cluster-example" engine = "redis" @@ -61,7 +61,7 @@ resource "aws_elasticache_cluster" "example" { These inherit their settings from the replication group. -```hcl +```terraform resource "aws_elasticache_cluster" "replica" { cluster_id = "cluster-example" replication_group_id = aws_elasticache_replication_group.example.id diff --git a/website/docs/r/elasticache_global_replication_group.html.markdown b/website/docs/r/elasticache_global_replication_group.html.markdown index 39faedad4aa..8a8962b9441 100644 --- a/website/docs/r/elasticache_global_replication_group.html.markdown +++ b/website/docs/r/elasticache_global_replication_group.html.markdown @@ -16,7 +16,7 @@ Provides an ElastiCache Global Replication Group resource, which manages replica The global replication group depends on the primary group existing. Secondary replication groups depend on the global replication group. Terraform dependency management will handle this transparently using resource value references. -```hcl +```terraform resource "aws_elasticache_global_replication_group" "example" { global_replication_group_id_suffix = "example" primary_replication_group_id = aws_elasticache_replication_group.primary.id diff --git a/website/docs/r/elasticache_parameter_group.html.markdown b/website/docs/r/elasticache_parameter_group.html.markdown index f72e1db235d..d3a2effb7f2 100644 --- a/website/docs/r/elasticache_parameter_group.html.markdown +++ b/website/docs/r/elasticache_parameter_group.html.markdown @@ -14,7 +14,7 @@ Provides an ElastiCache parameter group resource. ## Example Usage -```hcl +```terraform resource "aws_elasticache_parameter_group" "default" { name = "cache-params" family = "redis2.8" diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 334557e5b3d..2349b70560a 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -35,7 +35,7 @@ for more information. To create a single shard primary with single read replica: -```hcl +```terraform resource "aws_elasticache_replication_group" "example" { automatic_failover_enabled = true availability_zones = ["us-west-2a", "us-west-2b"] @@ -53,7 +53,7 @@ You have two options for adjusting the number of replicas: * Adjusting `number_cache_clusters` directly. This will attempt to automatically add or remove replicas, but provides no granular control (e.g. preferred availability zone, cache cluster ID) for the added or removed replicas. This also currently expects cache cluster IDs in the form of `replication_group_id-00#`. * Otherwise for fine grained control of the underlying cache clusters, they can be added or removed with the [`aws_elasticache_cluster` resource](/docs/providers/aws/r/elasticache_cluster.html) and its `replication_group_id` attribute. In this situation, you will need to utilize the [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignore_changes` to prevent perpetual differences during Terraform plan with the `number_cache_cluster` attribute. -```hcl +```terraform resource "aws_elasticache_replication_group" "example" { automatic_failover_enabled = true availability_zones = ["us-west-2a", "us-west-2b"] @@ -81,7 +81,7 @@ resource "aws_elasticache_cluster" "replica" { To create two shards with a primary and a single read replica each: -```hcl +```terraform resource "aws_elasticache_replication_group" "baz" { replication_group_id = "tf-redis-cluster" replication_group_description = "test description" diff --git a/website/docs/r/elasticache_security_group.html.markdown b/website/docs/r/elasticache_security_group.html.markdown index 906d0b80cbf..f3f208b7c70 100644 --- a/website/docs/r/elasticache_security_group.html.markdown +++ b/website/docs/r/elasticache_security_group.html.markdown @@ -17,7 +17,7 @@ ElastiCache cluster **outside** of a VPC. If you are using a VPC, see the ## Example Usage -```hcl +```terraform resource "aws_security_group" "bar" { name = "security-group" } diff --git a/website/docs/r/elasticache_subnet_group.html.markdown b/website/docs/r/elasticache_subnet_group.html.markdown index 6d405dc0bf3..4f36a0065a9 100644 --- a/website/docs/r/elasticache_subnet_group.html.markdown +++ b/website/docs/r/elasticache_subnet_group.html.markdown @@ -16,7 +16,7 @@ ElastiCache cluster **inside** of a VPC. If you are on EC2 Classic, see the ## Example Usage -```hcl +```terraform resource "aws_vpc" "foo" { cidr_block = "10.0.0.0/16" diff --git a/website/docs/r/elasticsearch_domain.html.markdown b/website/docs/r/elasticsearch_domain.html.markdown index b8cdc88a62a..6eac002a8bc 100644 --- a/website/docs/r/elasticsearch_domain.html.markdown +++ b/website/docs/r/elasticsearch_domain.html.markdown @@ -14,7 +14,7 @@ Manages an AWS Elasticsearch Domain. ### Basic Usage -```hcl +```terraform resource "aws_elasticsearch_domain" "example" { domain_name = "example" elasticsearch_version = "1.5" @@ -37,7 +37,7 @@ resource "aws_elasticsearch_domain" "example" { -> See also: [`aws_elasticsearch_domain_policy` resource](/docs/providers/aws/r/elasticsearch_domain_policy.html) -```hcl +```terraform variable "domain" { default = "tf-test" } @@ -72,7 +72,7 @@ POLICY ### Log Publishing to CloudWatch Logs -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "example" } @@ -113,7 +113,7 @@ resource "aws_elasticsearch_domain" "example" { ### VPC based ES -```hcl +```terraform variable "vpc" {} variable "domain" { diff --git a/website/docs/r/elasticsearch_domain_policy.html.markdown b/website/docs/r/elasticsearch_domain_policy.html.markdown index 8194695eba8..5e975c91f40 100644 --- a/website/docs/r/elasticsearch_domain_policy.html.markdown +++ b/website/docs/r/elasticsearch_domain_policy.html.markdown @@ -12,7 +12,7 @@ Allows setting policy to an Elasticsearch domain while referencing domain attrib ## Example Usage -```hcl +```terraform resource "aws_elasticsearch_domain" "example" { domain_name = "tf-test" elasticsearch_version = "2.3" diff --git a/website/docs/r/elastictranscoder_pipeline.html.markdown b/website/docs/r/elastictranscoder_pipeline.html.markdown index ab5238b5a3d..644e80358d0 100644 --- a/website/docs/r/elastictranscoder_pipeline.html.markdown +++ b/website/docs/r/elastictranscoder_pipeline.html.markdown @@ -12,7 +12,7 @@ Provides an Elastic Transcoder pipeline resource. ## Example Usage -```hcl +```terraform resource "aws_elastictranscoder_pipeline" "bar" { input_bucket = aws_s3_bucket.input_bucket.bucket name = "aws_elastictranscoder_pipeline_tf_test_" diff --git a/website/docs/r/elastictranscoder_preset.html.markdown b/website/docs/r/elastictranscoder_preset.html.markdown index 4ce4285698f..3831fb27b59 100644 --- a/website/docs/r/elastictranscoder_preset.html.markdown +++ b/website/docs/r/elastictranscoder_preset.html.markdown @@ -12,7 +12,7 @@ Provides an Elastic Transcoder preset resource. ## Example Usage -```hcl +```terraform resource "aws_elastictranscoder_preset" "bar" { container = "mp4" description = "Sample Preset" diff --git a/website/docs/r/elb.html.markdown b/website/docs/r/elb.html.markdown index 1bd7d163ec7..12b5843cd4d 100644 --- a/website/docs/r/elb.html.markdown +++ b/website/docs/r/elb.html.markdown @@ -21,7 +21,7 @@ conflict and will overwrite attachments. ## Example Usage -```hcl +```terraform # Create a new load balancer resource "aws_elb" "bar" { name = "foobar-terraform-elb" diff --git a/website/docs/r/elb_attachment.html.markdown b/website/docs/r/elb_attachment.html.markdown index d932c898138..4822fb46625 100644 --- a/website/docs/r/elb_attachment.html.markdown +++ b/website/docs/r/elb_attachment.html.markdown @@ -19,7 +19,7 @@ conflict and will overwrite attachments. ## Example Usage -```hcl +```terraform # Create a new load balancer attachment resource "aws_elb_attachment" "baz" { elb = aws_elb.bar.id diff --git a/website/docs/r/emr_cluster.html.markdown b/website/docs/r/emr_cluster.html.markdown index 9f33d1193d9..65c9ee04bc6 100644 --- a/website/docs/r/emr_cluster.html.markdown +++ b/website/docs/r/emr_cluster.html.markdown @@ -16,7 +16,7 @@ To configure [Instance Groups](https://docs.aws.amazon.com/emr/latest/Management ## Example Usage -```hcl +```terraform resource "aws_emr_cluster" "cluster" { name = "emr-test-arn" release_label = "emr-4.6.0" @@ -148,7 +148,7 @@ example Terraform configuration at the bottom of this page. ## Instance Fleet -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... master_instance_fleet { @@ -245,7 +245,7 @@ is implemented as a step. It is highly recommended to utilize the [lifecycle configuration block](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html) with `ignore_changes` if other steps are being managed outside of Terraform. -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... @@ -270,7 +270,7 @@ resource "aws_emr_cluster" "example" { Available in EMR version 5.23.0 and later, an EMR Cluster can be launched with three master nodes for high availability. Additional information about this functionality and its requirements can be found in the [EMR Management Guide](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-plan-ha.html). -```hcl +```terraform # This configuration is for illustrative purposes and highlights # only relevant configurations for working with this functionality. @@ -340,7 +340,7 @@ The following arguments are supported: ~> **NOTE on configurations_json:** If the `Configurations` value is empty then you should skip the `Configurations` field instead of providing empty list as value `"Configurations": []`. -```hcl +```terraform resource "aws_emr_cluster" "cluster" { # ... other configuration ... @@ -543,7 +543,7 @@ In addition to all arguments above, the following attributes are exported: boot an example EMR Cluster. It is not meant to display best practices. Please use at your own risk. -```hcl +```terraform resource "aws_emr_cluster" "cluster" { name = "emr-test-arn" release_label = "emr-4.6.0" @@ -852,7 +852,7 @@ $ terraform import aws_emr_cluster.cluster j-123456ABCDEF Since the API does not return the actual values for Kerberos configurations, environments with those Terraform configurations will need to use the [`lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) available to all Terraform resources to prevent perpetual differences, e.g. -```hcl +```terraform resource "aws_emr_cluster" "example" { # ... other configuration ... diff --git a/website/docs/r/emr_instance_fleet.html.markdown b/website/docs/r/emr_instance_fleet.html.markdown index 6c0eda05dc0..8ab5c5a9d59 100644 --- a/website/docs/r/emr_instance_fleet.html.markdown +++ b/website/docs/r/emr_instance_fleet.html.markdown @@ -17,7 +17,7 @@ Terraform will resize any Instance Fleet to zero when destroying the resource. ## Example Usage -```hcl +```terraform resource "aws_emr_instance_fleet" "task" { cluster_id = aws_emr_cluster.cluster.id instance_type_configs { diff --git a/website/docs/r/emr_instance_group.html.markdown b/website/docs/r/emr_instance_group.html.markdown index 00fea7fe528..63942124b48 100644 --- a/website/docs/r/emr_instance_group.html.markdown +++ b/website/docs/r/emr_instance_group.html.markdown @@ -17,7 +17,7 @@ Terraform will resize any Instance Group to zero when destroying the resource. ## Example Usage -```hcl +```terraform resource "aws_emr_instance_group" "task" { cluster_id = aws_emr_cluster.tf-test-cluster.id instance_count = 1 @@ -40,7 +40,7 @@ The following arguments are supported: * `autoscaling_policy` - (Optional) The autoscaling policy document. This is a JSON formatted string. See [EMR Auto Scaling](https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-automatic-scaling.html) * `configurations_json` - (Optional) A JSON string for supplying list of configurations specific to the EMR instance group. Note that this can only be changed when using EMR release 5.21 or later. -```hcl +```terraform resource "aws_emr_instance_group" "task" { # ... other configuration ... diff --git a/website/docs/r/emr_managed_scaling_policy.html.markdown b/website/docs/r/emr_managed_scaling_policy.html.markdown index 13b0025e1f5..76318897b99 100644 --- a/website/docs/r/emr_managed_scaling_policy.html.markdown +++ b/website/docs/r/emr_managed_scaling_policy.html.markdown @@ -12,7 +12,7 @@ Provides a Managed Scaling policy for EMR Cluster. With Amazon EMR versions 5.30 ## Example Usage -```hcl +```terraform resource "aws_emr_cluster" "sample" { name = "emr-sample-cluster" release_label = "emr-5.30.0" diff --git a/website/docs/r/emr_security_configuration.html.markdown b/website/docs/r/emr_security_configuration.html.markdown index 07796e7d57d..e5707e05712 100644 --- a/website/docs/r/emr_security_configuration.html.markdown +++ b/website/docs/r/emr_security_configuration.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage AWS EMR Security Configurations ## Example Usage -```hcl +```terraform resource "aws_emr_security_configuration" "foo" { name = "emrsc_other" diff --git a/website/docs/r/flow_log.html.markdown b/website/docs/r/flow_log.html.markdown index d57ad90c52f..66cd90381ef 100644 --- a/website/docs/r/flow_log.html.markdown +++ b/website/docs/r/flow_log.html.markdown @@ -15,7 +15,7 @@ interface, subnet, or VPC. Logs are sent to a CloudWatch Log Group or a S3 Bucke ### CloudWatch Logging -```hcl +```terraform resource "aws_flow_log" "example" { iam_role_arn = aws_iam_role.example.arn log_destination = aws_cloudwatch_log_group.example.arn @@ -74,7 +74,7 @@ EOF ### S3 Logging -```hcl +```terraform resource "aws_flow_log" "example" { log_destination = aws_s3_bucket.example.arn log_destination_type = "s3" diff --git a/website/docs/r/fms_admin_account.html.markdown b/website/docs/r/fms_admin_account.html.markdown index 3635ce2b10e..4644aa33da4 100644 --- a/website/docs/r/fms_admin_account.html.markdown +++ b/website/docs/r/fms_admin_account.html.markdown @@ -12,7 +12,7 @@ Provides a resource to associate/disassociate an AWS Firewall Manager administra ## Example Usage -```hcl +```terraform resource "aws_fms_admin_account" "example" {} ``` diff --git a/website/docs/r/fms_policy.html.markdown b/website/docs/r/fms_policy.html.markdown index 6b6d886d979..d2a6d162fa3 100644 --- a/website/docs/r/fms_policy.html.markdown +++ b/website/docs/r/fms_policy.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create an AWS Firewall Manager policy. You need to be usi ## Example Usage -```hcl +```terraform resource "aws_fms_policy" "example" { name = "FMS-Policy-Example" exclude_resource_tags = false diff --git a/website/docs/r/fsx_lustre_file_system.html.markdown b/website/docs/r/fsx_lustre_file_system.html.markdown index 2e1ed2bca23..13184b01580 100644 --- a/website/docs/r/fsx_lustre_file_system.html.markdown +++ b/website/docs/r/fsx_lustre_file_system.html.markdown @@ -12,7 +12,7 @@ Manages a FSx Lustre File System. See the [FSx Lustre Guide](https://docs.aws.am ## Example Usage -```hcl +```terraform resource "aws_fsx_lustre_file_system" "example" { import_path = "s3://${aws_s3_bucket.example.bucket}" storage_capacity = 1200 @@ -72,7 +72,7 @@ $ terraform import aws_fsx_lustre_file_system.example fs-543ab12b1ca672f33 Certain resource arguments, like `security_group_ids`, do not have a FSx API method for reading the information after creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_fsx_lustre_file_system" "example" { # ... other configuration ... security_group_ids = [aws_security_group.example.id] diff --git a/website/docs/r/fsx_windows_file_system.html.markdown b/website/docs/r/fsx_windows_file_system.html.markdown index 9a9ccce83cc..9a6c3ad95e6 100644 --- a/website/docs/r/fsx_windows_file_system.html.markdown +++ b/website/docs/r/fsx_windows_file_system.html.markdown @@ -18,7 +18,7 @@ Manages a FSx Windows File System. See the [FSx Windows Guide](https://docs.aws. Additional information for using AWS Directory Service with Windows File Systems can be found in the [FSx Windows Guide](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/fsx-aws-managed-ad.html). -```hcl +```terraform resource "aws_fsx_windows_file_system" "example" { active_directory_id = aws_directory_service_directory.example.id kms_key_id = aws_kms_key.example.arn @@ -32,7 +32,7 @@ resource "aws_fsx_windows_file_system" "example" { Additional information for using AWS Directory Service with Windows File Systems can be found in the [FSx Windows Guide](https://docs.aws.amazon.com/fsx/latest/WindowsGuide/self-managed-AD.html). -```hcl +```terraform resource "aws_fsx_windows_file_system" "example" { kms_key_id = aws_kms_key.example.arn storage_capacity = 300 @@ -112,7 +112,7 @@ $ terraform import aws_fsx_windows_file_system.example fs-543ab12b1ca672f33 Certain resource arguments, like `security_group_ids` and the `self_managed_active_directory` configuation block `password`, do not have a FSx API method for reading the information after creation. If these arguments are set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_fsx_windows_file_system" "example" { # ... other configuration ... diff --git a/website/docs/r/gamelift_alias.html.markdown b/website/docs/r/gamelift_alias.html.markdown index f5caecc050a..e54779145ca 100644 --- a/website/docs/r/gamelift_alias.html.markdown +++ b/website/docs/r/gamelift_alias.html.markdown @@ -12,7 +12,7 @@ Provides a Gamelift Alias resource. ## Example Usage -```hcl +```terraform resource "aws_gamelift_alias" "example" { name = "example-alias" description = "Example Description" diff --git a/website/docs/r/gamelift_build.html.markdown b/website/docs/r/gamelift_build.html.markdown index bf0c05be7d6..2c704c01665 100644 --- a/website/docs/r/gamelift_build.html.markdown +++ b/website/docs/r/gamelift_build.html.markdown @@ -12,7 +12,7 @@ Provides an Gamelift Build resource. ## Example Usage -```hcl +```terraform resource "aws_gamelift_build" "test" { name = "example-build" operating_system = "WINDOWS_2012" diff --git a/website/docs/r/gamelift_fleet.html.markdown b/website/docs/r/gamelift_fleet.html.markdown index d8b85441a16..22ac6cc34e6 100644 --- a/website/docs/r/gamelift_fleet.html.markdown +++ b/website/docs/r/gamelift_fleet.html.markdown @@ -12,7 +12,7 @@ Provides a Gamelift Fleet resource. ## Example Usage -```hcl +```terraform resource "aws_gamelift_fleet" "example" { build_id = aws_gamelift_build.example.id ec2_instance_type = "t2.micro" diff --git a/website/docs/r/gamelift_game_session_queue.html.markdown b/website/docs/r/gamelift_game_session_queue.html.markdown index 5a66afe5368..f2baaae4344 100644 --- a/website/docs/r/gamelift_game_session_queue.html.markdown +++ b/website/docs/r/gamelift_game_session_queue.html.markdown @@ -12,7 +12,7 @@ Provides an Gamelift Game Session Queue resource. ## Example Usage -```hcl +```terraform resource "aws_gamelift_game_session_queue" "test" { name = "example-session-queue" diff --git a/website/docs/r/glacier_vault.html.markdown b/website/docs/r/glacier_vault.html.markdown index 0c8cf19d966..90981966955 100644 --- a/website/docs/r/glacier_vault.html.markdown +++ b/website/docs/r/glacier_vault.html.markdown @@ -14,7 +14,7 @@ Provides a Glacier Vault Resource. You can refer to the [Glacier Developer Guide ## Example Usage -```hcl +```terraform resource "aws_sns_topic" "aws_sns_topic" { name = "glacier-sns-topic" } diff --git a/website/docs/r/glacier_vault_lock.html.markdown b/website/docs/r/glacier_vault_lock.html.markdown index 929d32370ae..240cd1a4ffa 100644 --- a/website/docs/r/glacier_vault_lock.html.markdown +++ b/website/docs/r/glacier_vault_lock.html.markdown @@ -18,7 +18,7 @@ Manages a Glacier Vault Lock. You can refer to the [Glacier Developer Guide](htt ### Testing Glacier Vault Lock Policy -```hcl +```terraform resource "aws_glacier_vault" "example" { name = "example" } @@ -46,7 +46,7 @@ resource "aws_glacier_vault_lock" "example" { ### Permanently Applying Glacier Vault Lock Policy -```hcl +```terraform resource "aws_glacier_vault_lock" "example" { complete_lock = true policy = data.aws_iam_policy_document.example.json diff --git a/website/docs/r/globalaccelerator_accelerator.markdown b/website/docs/r/globalaccelerator_accelerator.markdown index 3e5b4a85113..664978eff95 100644 --- a/website/docs/r/globalaccelerator_accelerator.markdown +++ b/website/docs/r/globalaccelerator_accelerator.markdown @@ -12,7 +12,7 @@ Creates a Global Accelerator accelerator. ## Example Usage -```hcl +```terraform resource "aws_globalaccelerator_accelerator" "example" { name = "Example" ip_address_type = "IPV4" diff --git a/website/docs/r/globalaccelerator_endpoint_group.html.markdown b/website/docs/r/globalaccelerator_endpoint_group.html.markdown index d4bbc011aa8..be74e0fbbda 100644 --- a/website/docs/r/globalaccelerator_endpoint_group.html.markdown +++ b/website/docs/r/globalaccelerator_endpoint_group.html.markdown @@ -12,7 +12,7 @@ Provides a Global Accelerator endpoint group. ## Example Usage -```hcl +```terraform resource "aws_globalaccelerator_endpoint_group" "example" { listener_arn = aws_globalaccelerator_listener.example.id diff --git a/website/docs/r/globalaccelerator_listener.markdown b/website/docs/r/globalaccelerator_listener.markdown index 24b3580c986..1e61ee3e15a 100644 --- a/website/docs/r/globalaccelerator_listener.markdown +++ b/website/docs/r/globalaccelerator_listener.markdown @@ -12,7 +12,7 @@ Provides a Global Accelerator listener. ## Example Usage -```hcl +```terraform resource "aws_globalaccelerator_accelerator" "example" { name = "Example" ip_address_type = "IPV4" diff --git a/website/docs/r/glue_catalog_database.html.markdown b/website/docs/r/glue_catalog_database.html.markdown index 2d967d7587a..57e6f1a8a8f 100644 --- a/website/docs/r/glue_catalog_database.html.markdown +++ b/website/docs/r/glue_catalog_database.html.markdown @@ -12,7 +12,7 @@ Provides a Glue Catalog Database Resource. You can refer to the [Glue Developer ## Example Usage -```hcl +```terraform resource "aws_glue_catalog_database" "aws_glue_catalog_database" { name = "MyCatalogDatabase" } diff --git a/website/docs/r/glue_catalog_table.html.markdown b/website/docs/r/glue_catalog_table.html.markdown index 42f0e11c846..59c9ea5fc51 100644 --- a/website/docs/r/glue_catalog_table.html.markdown +++ b/website/docs/r/glue_catalog_table.html.markdown @@ -14,7 +14,7 @@ Provides a Glue Catalog Table Resource. You can refer to the [Glue Developer Gui ### Basic Table -```hcl +```terraform resource "aws_glue_catalog_table" "aws_glue_catalog_table" { name = "MyCatalogTable" database_name = "MyCatalogDatabase" @@ -23,7 +23,7 @@ resource "aws_glue_catalog_table" "aws_glue_catalog_table" { ### Parquet Table for Athena -```hcl +```terraform resource "aws_glue_catalog_table" "aws_glue_catalog_table" { name = "MyCatalogTable" database_name = "MyCatalogDatabase" diff --git a/website/docs/r/glue_classifier.html.markdown b/website/docs/r/glue_classifier.html.markdown index 783ffce26f9..79356c80f84 100644 --- a/website/docs/r/glue_classifier.html.markdown +++ b/website/docs/r/glue_classifier.html.markdown @@ -16,7 +16,7 @@ Provides a Glue Classifier resource. ### Csv Classifier -```hcl +```terraform resource "aws_glue_classifier" "example" { name = "example" @@ -33,7 +33,7 @@ resource "aws_glue_classifier" "example" { ### Grok Classifier -```hcl +```terraform resource "aws_glue_classifier" "example" { name = "example" @@ -46,7 +46,7 @@ resource "aws_glue_classifier" "example" { ### JSON Classifier -```hcl +```terraform resource "aws_glue_classifier" "example" { name = "example" @@ -58,7 +58,7 @@ resource "aws_glue_classifier" "example" { ### XML Classifier -```hcl +```terraform resource "aws_glue_classifier" "example" { name = "example" diff --git a/website/docs/r/glue_connection.html.markdown b/website/docs/r/glue_connection.html.markdown index 27f7dcb6101..51544bb7b7e 100644 --- a/website/docs/r/glue_connection.html.markdown +++ b/website/docs/r/glue_connection.html.markdown @@ -14,7 +14,7 @@ Provides a Glue Connection resource. ### Non-VPC Connection -```hcl +```terraform resource "aws_glue_connection" "example" { connection_properties = { JDBC_CONNECTION_URL = "jdbc:mysql://example.com/exampledatabase" @@ -30,7 +30,7 @@ resource "aws_glue_connection" "example" { For more information, see the [AWS Documentation](https://docs.aws.amazon.com/glue/latest/dg/populate-add-connection.html#connection-JDBC-VPC). -```hcl +```terraform resource "aws_glue_connection" "example" { connection_properties = { JDBC_CONNECTION_URL = "jdbc:mysql://${aws_rds_cluster.example.endpoint}/exampledatabase" diff --git a/website/docs/r/glue_crawler.html.markdown b/website/docs/r/glue_crawler.html.markdown index cd6dba5b0fa..c893c5da349 100644 --- a/website/docs/r/glue_crawler.html.markdown +++ b/website/docs/r/glue_crawler.html.markdown @@ -14,7 +14,7 @@ Manages a Glue Crawler. More information can be found in the [AWS Glue Developer ### DynamoDB Target Example -```hcl +```terraform resource "aws_glue_crawler" "example" { database_name = aws_glue_catalog_database.example.name name = "example" @@ -28,7 +28,7 @@ resource "aws_glue_crawler" "example" { ### JDBC Target Example -```hcl +```terraform resource "aws_glue_crawler" "example" { database_name = aws_glue_catalog_database.example.name name = "example" @@ -43,7 +43,7 @@ resource "aws_glue_crawler" "example" { ### S3 Target Example -```hcl +```terraform resource "aws_glue_crawler" "example" { database_name = aws_glue_catalog_database.example.name name = "example" @@ -58,7 +58,7 @@ resource "aws_glue_crawler" "example" { ### Catalog Target Example -```hcl +```terraform resource "aws_glue_crawler" "example" { database_name = aws_glue_catalog_database.example.name name = "example" @@ -86,7 +86,7 @@ EOF ### MongoDB Target Example -```hcl +```terraform resource "aws_glue_crawler" "example" { database_name = aws_glue_catalog_database.example.name name = "example" @@ -101,7 +101,7 @@ resource "aws_glue_crawler" "example" { ### Configuration Settings Example -```hcl +```terraform resource "aws_glue_crawler" "events_crawler" { database_name = aws_glue_catalog_database.glue_database.name schedule = "cron(0 1 * * ? *)" diff --git a/website/docs/r/glue_data_catalog_encryption_settings.html.markdown b/website/docs/r/glue_data_catalog_encryption_settings.html.markdown index 61679560f07..c9a751d180b 100644 --- a/website/docs/r/glue_data_catalog_encryption_settings.html.markdown +++ b/website/docs/r/glue_data_catalog_encryption_settings.html.markdown @@ -12,7 +12,7 @@ Provides a Glue Data Catalog Encryption Settings resource. ## Example Usage -```hcl +```terraform resource "aws_glue_data_catalog_encryption_settings" "example" { data_catalog_encryption_settings { connection_password_encryption { diff --git a/website/docs/r/glue_dev_endpoint.markdown b/website/docs/r/glue_dev_endpoint.markdown index 847f62962ba..dc3ab6ddd1c 100644 --- a/website/docs/r/glue_dev_endpoint.markdown +++ b/website/docs/r/glue_dev_endpoint.markdown @@ -14,7 +14,7 @@ Provides a Glue Development Endpoint resource. Basic usage: -```hcl +```terraform resource "aws_glue_dev_endpoint" "example" { name = "foo" role_arn = aws_iam_role.example.arn diff --git a/website/docs/r/glue_job.html.markdown b/website/docs/r/glue_job.html.markdown index 80282051c95..1d4a0ea4c57 100644 --- a/website/docs/r/glue_job.html.markdown +++ b/website/docs/r/glue_job.html.markdown @@ -16,7 +16,7 @@ Provides a Glue Job resource. ### Python Job -```hcl +```terraform resource "aws_glue_job" "example" { name = "example" role_arn = aws_iam_role.example.arn @@ -29,7 +29,7 @@ resource "aws_glue_job" "example" { ### Scala Job -```hcl +```terraform resource "aws_glue_job" "example" { name = "example" role_arn = aws_iam_role.example.arn @@ -46,7 +46,7 @@ resource "aws_glue_job" "example" { ### Enabling CloudWatch Logs and Metrics -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "example" retention_in_days = 14 diff --git a/website/docs/r/glue_ml_transform.html.markdown b/website/docs/r/glue_ml_transform.html.markdown index 8ce6de0f13a..28ce617dc30 100644 --- a/website/docs/r/glue_ml_transform.html.markdown +++ b/website/docs/r/glue_ml_transform.html.markdown @@ -12,7 +12,7 @@ Provides a Glue ML Transform resource. ## Example Usage -```hcl +```terraform resource "aws_glue_ml_transform" "test" { name = "example" role_arn = aws_iam_role.test.arn diff --git a/website/docs/r/glue_partition.html.markdown b/website/docs/r/glue_partition.html.markdown index dbc4631df33..bcfa175da95 100644 --- a/website/docs/r/glue_partition.html.markdown +++ b/website/docs/r/glue_partition.html.markdown @@ -12,7 +12,7 @@ Provides a Glue Partition Resource. ## Example Usage -```hcl +```terraform resource "aws_glue_partition" "example" { database_name = "some-database" table_name = "some-table" diff --git a/website/docs/r/glue_registry.html.markdown b/website/docs/r/glue_registry.html.markdown index 37db026e62b..cee7a2acc1f 100644 --- a/website/docs/r/glue_registry.html.markdown +++ b/website/docs/r/glue_registry.html.markdown @@ -12,7 +12,7 @@ Provides a Glue Registry resource. ## Example Usage -```hcl +```terraform resource "aws_glue_registry" "example" { registry_name = "example" } diff --git a/website/docs/r/glue_resource_policy.html.markdown b/website/docs/r/glue_resource_policy.html.markdown index c59ca268652..ca5f5c7970a 100644 --- a/website/docs/r/glue_resource_policy.html.markdown +++ b/website/docs/r/glue_resource_policy.html.markdown @@ -13,7 +13,7 @@ Provides a Glue resource policy. Only one can exist per region. ## Example Usage -```hcl +```terraform data "aws_caller_identity" "current" {} data "aws_partition" "current" {} diff --git a/website/docs/r/glue_schema.html.markdown b/website/docs/r/glue_schema.html.markdown index f2f53fb1ec6..3e2980d1b07 100644 --- a/website/docs/r/glue_schema.html.markdown +++ b/website/docs/r/glue_schema.html.markdown @@ -12,7 +12,7 @@ Provides a Glue Schema resource. ## Example Usage -```hcl +```terraform resource "aws_glue_schema" "example" { schema_name = "example" registry_arn = aws_glue_registry.test.arn diff --git a/website/docs/r/glue_security_configuration.html.markdown b/website/docs/r/glue_security_configuration.html.markdown index 25b900eb7a0..3b4ad087fd2 100644 --- a/website/docs/r/glue_security_configuration.html.markdown +++ b/website/docs/r/glue_security_configuration.html.markdown @@ -12,7 +12,7 @@ Manages a Glue Security Configuration. ## Example Usage -```hcl +```terraform resource "aws_glue_security_configuration" "example" { name = "example" diff --git a/website/docs/r/glue_trigger.html.markdown b/website/docs/r/glue_trigger.html.markdown index fe690475ca0..a958546c182 100644 --- a/website/docs/r/glue_trigger.html.markdown +++ b/website/docs/r/glue_trigger.html.markdown @@ -14,7 +14,7 @@ Manages a Glue Trigger resource. ### Conditional Trigger -```hcl +```terraform resource "aws_glue_trigger" "example" { name = "example" type = "CONDITIONAL" @@ -34,7 +34,7 @@ resource "aws_glue_trigger" "example" { ### On-Demand Trigger -```hcl +```terraform resource "aws_glue_trigger" "example" { name = "example" type = "ON_DEMAND" @@ -47,7 +47,7 @@ resource "aws_glue_trigger" "example" { ### Scheduled Trigger -```hcl +```terraform resource "aws_glue_trigger" "example" { name = "example" schedule = "cron(15 12 * * ? *)" @@ -63,7 +63,7 @@ resource "aws_glue_trigger" "example" { **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided. -```hcl +```terraform resource "aws_glue_trigger" "example" { name = "example" type = "CONDITIONAL" @@ -85,7 +85,7 @@ resource "aws_glue_trigger" "example" { **Note:** Triggers can have both a crawler action and a crawler condition, just no example provided. -```hcl +```terraform resource "aws_glue_trigger" "example" { name = "example" type = "CONDITIONAL" diff --git a/website/docs/r/glue_user_defined_function.html.markdown b/website/docs/r/glue_user_defined_function.html.markdown index 3421a45ded7..8f0eda3addb 100644 --- a/website/docs/r/glue_user_defined_function.html.markdown +++ b/website/docs/r/glue_user_defined_function.html.markdown @@ -12,7 +12,7 @@ Provides a Glue User Defined Function Resource. ## Example Usage -```hcl +```terraform resource "aws_glue_catalog_database" "example" { name = "my_database" } diff --git a/website/docs/r/glue_workflow.html.markdown b/website/docs/r/glue_workflow.html.markdown index 9be2664fb67..31f3bad7c10 100644 --- a/website/docs/r/glue_workflow.html.markdown +++ b/website/docs/r/glue_workflow.html.markdown @@ -14,7 +14,7 @@ See the example below for creating a graph with four nodes (two triggers and two ## Example Usage -```hcl +```terraform resource "aws_glue_workflow" "example" { name = "example" } diff --git a/website/docs/r/guardduty_detector.html.markdown b/website/docs/r/guardduty_detector.html.markdown index 1719ebc0fe5..38a7b8953c5 100644 --- a/website/docs/r/guardduty_detector.html.markdown +++ b/website/docs/r/guardduty_detector.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage a GuardDuty detector. ## Example Usage -```hcl +```terraform resource "aws_guardduty_detector" "MyDetector" { enable = true } diff --git a/website/docs/r/guardduty_filter.html.markdown b/website/docs/r/guardduty_filter.html.markdown index df58c4f6c87..0e4f16a4a3f 100644 --- a/website/docs/r/guardduty_filter.html.markdown +++ b/website/docs/r/guardduty_filter.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage a GuardDuty filter. ## Example Usage -```hcl +```terraform resource "aws_guardduty_filter" "MyFilter" { name = "MyFilter" action = "ARCHIVE" diff --git a/website/docs/r/guardduty_invite_accepter.html.markdown b/website/docs/r/guardduty_invite_accepter.html.markdown index 4314fdc5eff..6edcae469e6 100644 --- a/website/docs/r/guardduty_invite_accepter.html.markdown +++ b/website/docs/r/guardduty_invite_accepter.html.markdown @@ -12,7 +12,7 @@ Provides a resource to accept a pending GuardDuty invite on creation, ensure the ## Example Usage -```hcl +```terraform provider "aws" { alias = "primary" } diff --git a/website/docs/r/guardduty_ipset.html.markdown b/website/docs/r/guardduty_ipset.html.markdown index 5a780152cd2..41871694f82 100644 --- a/website/docs/r/guardduty_ipset.html.markdown +++ b/website/docs/r/guardduty_ipset.html.markdown @@ -13,7 +13,7 @@ Provides a resource to manage a GuardDuty IPSet. ## Example Usage -```hcl +```terraform resource "aws_guardduty_ipset" "example" { activate = true detector_id = aws_guardduty_detector.primary.id diff --git a/website/docs/r/guardduty_member.html.markdown b/website/docs/r/guardduty_member.html.markdown index 7b692071b36..15c80445d33 100644 --- a/website/docs/r/guardduty_member.html.markdown +++ b/website/docs/r/guardduty_member.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage a GuardDuty member. To accept invitations in membe ## Example Usage -```hcl +```terraform resource "aws_guardduty_detector" "primary" { enable = true } diff --git a/website/docs/r/guardduty_organization_admin_account.html.markdown b/website/docs/r/guardduty_organization_admin_account.html.markdown index 0868654fd0f..100cd30312e 100644 --- a/website/docs/r/guardduty_organization_admin_account.html.markdown +++ b/website/docs/r/guardduty_organization_admin_account.html.markdown @@ -12,7 +12,7 @@ Manages a GuardDuty Organization Admin Account. The AWS account utilizing this r ## Example Usage -```hcl +```terraform resource "aws_organizations_organization" "example" { aws_service_access_principals = ["guardduty.amazonaws.com"] feature_set = "ALL" diff --git a/website/docs/r/guardduty_organization_configuration.html.markdown b/website/docs/r/guardduty_organization_configuration.html.markdown index 25e4b423299..b972f04cddb 100644 --- a/website/docs/r/guardduty_organization_configuration.html.markdown +++ b/website/docs/r/guardduty_organization_configuration.html.markdown @@ -14,7 +14,7 @@ Manages the GuardDuty Organization Configuration in the current AWS Region. The ## Example Usage -```hcl +```terraform resource "aws_guardduty_detector" "example" { enable = true } diff --git a/website/docs/r/guardduty_publishing_destination.html.markdown b/website/docs/r/guardduty_publishing_destination.html.markdown index 24ba172f752..a6f3a7984e6 100644 --- a/website/docs/r/guardduty_publishing_destination.html.markdown +++ b/website/docs/r/guardduty_publishing_destination.html.markdown @@ -11,7 +11,7 @@ Provides a resource to manage a GuardDuty PublishingDestination. Requires an exi ## Example Usage -```hcl +```terraform data "aws_caller_identity" "current" {} data "aws_region" "current" {} diff --git a/website/docs/r/guardduty_threatintelset.html.markdown b/website/docs/r/guardduty_threatintelset.html.markdown index e9d0a13607b..4988c08e79f 100644 --- a/website/docs/r/guardduty_threatintelset.html.markdown +++ b/website/docs/r/guardduty_threatintelset.html.markdown @@ -13,7 +13,7 @@ Provides a resource to manage a GuardDuty ThreatIntelSet. ## Example Usage -```hcl +```terraform resource "aws_guardduty_detector" "primary" { enable = true } diff --git a/website/docs/r/iam_access_key.html.markdown b/website/docs/r/iam_access_key.html.markdown index 32f83bf5009..221d074640f 100644 --- a/website/docs/r/iam_access_key.html.markdown +++ b/website/docs/r/iam_access_key.html.markdown @@ -12,7 +12,7 @@ Provides an IAM access key. This is a set of credentials that allow API requests ## Example Usage -```hcl +```terraform resource "aws_iam_access_key" "lb" { user = aws_iam_user.lb.name pgp_key = "keybase:some_person_that_exists" @@ -48,7 +48,7 @@ output "secret" { } ``` -```hcl +```terraform resource "aws_iam_user" "test" { name = "test" path = "/test/" diff --git a/website/docs/r/iam_account_alias.html.markdown b/website/docs/r/iam_account_alias.html.markdown index 31e880ce2cf..d6f3228cb77 100644 --- a/website/docs/r/iam_account_alias.html.markdown +++ b/website/docs/r/iam_account_alias.html.markdown @@ -14,7 +14,7 @@ Manages the account alias for the AWS Account. ## Example Usage -```hcl +```terraform resource "aws_iam_account_alias" "alias" { account_alias = "my-account-alias" } diff --git a/website/docs/r/iam_account_password_policy.html.markdown b/website/docs/r/iam_account_password_policy.html.markdown index c3de2f31adc..9278474d9c0 100644 --- a/website/docs/r/iam_account_password_policy.html.markdown +++ b/website/docs/r/iam_account_password_policy.html.markdown @@ -16,7 +16,7 @@ in the official AWS docs. ## Example Usage -```hcl +```terraform resource "aws_iam_account_password_policy" "strict" { minimum_password_length = 8 require_lowercase_characters = true diff --git a/website/docs/r/iam_group.html.markdown b/website/docs/r/iam_group.html.markdown index d6e723d091a..c6699756d76 100644 --- a/website/docs/r/iam_group.html.markdown +++ b/website/docs/r/iam_group.html.markdown @@ -12,7 +12,7 @@ Provides an IAM group. ## Example Usage -```hcl +```terraform resource "aws_iam_group" "developers" { name = "developers" path = "/users/" diff --git a/website/docs/r/iam_group_membership.html.markdown b/website/docs/r/iam_group_membership.html.markdown index b57769b417f..03c6f99c743 100644 --- a/website/docs/r/iam_group_membership.html.markdown +++ b/website/docs/r/iam_group_membership.html.markdown @@ -19,7 +19,7 @@ more information on managing IAM Groups or IAM Users, see [IAM Groups][1] or ## Example Usage -```hcl +```terraform resource "aws_iam_group_membership" "team" { name = "tf-testing-group-membership" diff --git a/website/docs/r/iam_group_policy.html.markdown b/website/docs/r/iam_group_policy.html.markdown index b5bd77a1c16..ff94f229c98 100644 --- a/website/docs/r/iam_group_policy.html.markdown +++ b/website/docs/r/iam_group_policy.html.markdown @@ -12,7 +12,7 @@ Provides an IAM policy attached to a group. ## Example Usage -```hcl +```terraform resource "aws_iam_group_policy" "my_developer_policy" { name = "my_developer_policy" group = aws_iam_group.my_developers.name diff --git a/website/docs/r/iam_group_policy_attachment.markdown b/website/docs/r/iam_group_policy_attachment.markdown index 52a460e8e12..5cc0ff1a263 100644 --- a/website/docs/r/iam_group_policy_attachment.markdown +++ b/website/docs/r/iam_group_policy_attachment.markdown @@ -14,7 +14,7 @@ Attaches a Managed IAM Policy to an IAM group ## Example Usage -```hcl +```terraform resource "aws_iam_group" "group" { name = "test-group" } diff --git a/website/docs/r/iam_instance_profile.html.markdown b/website/docs/r/iam_instance_profile.html.markdown index 53c55337fdd..7dece58a9c0 100644 --- a/website/docs/r/iam_instance_profile.html.markdown +++ b/website/docs/r/iam_instance_profile.html.markdown @@ -12,7 +12,7 @@ Provides an IAM instance profile. ## Example Usage -```hcl +```terraform resource "aws_iam_instance_profile" "test_profile" { name = "test_profile" role = aws_iam_role.role.name diff --git a/website/docs/r/iam_openid_connect_provider.html.markdown b/website/docs/r/iam_openid_connect_provider.html.markdown index 1e7989ca21c..7ce78dd022f 100644 --- a/website/docs/r/iam_openid_connect_provider.html.markdown +++ b/website/docs/r/iam_openid_connect_provider.html.markdown @@ -12,7 +12,7 @@ Provides an IAM OpenID Connect provider. ## Example Usage -```hcl +```terraform resource "aws_iam_openid_connect_provider" "default" { url = "https://accounts.google.com" diff --git a/website/docs/r/iam_policy.html.markdown b/website/docs/r/iam_policy.html.markdown index 0c55fc6ae50..4a0d2450716 100644 --- a/website/docs/r/iam_policy.html.markdown +++ b/website/docs/r/iam_policy.html.markdown @@ -12,7 +12,7 @@ Provides an IAM policy. ## Example Usage -```hcl +```terraform resource "aws_iam_policy" "policy" { name = "test_policy" path = "/" diff --git a/website/docs/r/iam_policy_attachment.html.markdown b/website/docs/r/iam_policy_attachment.html.markdown index 0a0b588ea09..71a0f02e56b 100644 --- a/website/docs/r/iam_policy_attachment.html.markdown +++ b/website/docs/r/iam_policy_attachment.html.markdown @@ -18,7 +18,7 @@ Attaches a Managed IAM Policy to user(s), role(s), and/or group(s) ## Example Usage -```hcl +```terraform resource "aws_iam_user" "user" { name = "test-user" } diff --git a/website/docs/r/iam_role.html.markdown b/website/docs/r/iam_role.html.markdown index 12e7bf758cb..98342b3e2d4 100644 --- a/website/docs/r/iam_role.html.markdown +++ b/website/docs/r/iam_role.html.markdown @@ -18,7 +18,7 @@ Provides an IAM role. ### Basic Example -```hcl +```terraform resource "aws_iam_role" "test_role" { name = "test_role" @@ -46,7 +46,7 @@ resource "aws_iam_role" "test_role" { ### Example of Using Data Source for Assume Role Policy -```hcl +```terraform data "aws_iam_policy_document" "instance-assume-role-policy" { statement { actions = ["sts:AssumeRole"] @@ -69,7 +69,7 @@ resource "aws_iam_role" "instance" { This example creates an IAM role with two inline IAM policies. If someone adds another inline policy out-of-band, on the next apply, Terraform will remove that policy. If someone deletes these policies out-of-band, Terraform will recreate them. -```hcl +```terraform resource "aws_iam_role" "example" { name = "yak_role" assume_role_policy = data.aws_iam_policy_document.instance_assume_role_policy.json # (not shown) @@ -108,7 +108,7 @@ data "aws_iam_policy_document" "inline_policy" { This example creates an IAM role with what appears to be empty IAM `inline_policy` argument instead of using `inline_policy` as a configuration block. The result is that if someone were to add an inline policy out-of-band, on the next apply, Terraform will remove that policy. -```hcl +```terraform resource "aws_iam_role" "example" { name = "yak_role" assume_role_policy = data.aws_iam_policy_document.instance_assume_role_policy.json # (not shown) @@ -121,7 +121,7 @@ resource "aws_iam_role" "example" { This example creates an IAM role and attaches two managed IAM policies. If someone attaches another managed policy out-of-band, on the next apply, Terraform will detach that policy. If someone detaches these policies out-of-band, Terraform will attach them again. -```hcl +```terraform resource "aws_iam_role" "example" { name = "yak_role" assume_role_policy = data.aws_iam_policy_document.instance_assume_role_policy.json # (not shown) @@ -163,7 +163,7 @@ resource "aws_iam_policy" "policy_two" { This example creates an IAM role with an empty `managed_policy_arns` argument. If someone attaches a policy out-of-band, on the next apply, Terraform will detach that policy. -```hcl +```terraform resource "aws_iam_role" "example" { name = "yak_role" assume_role_policy = data.aws_iam_policy_document.instance_assume_role_policy.json # (not shown) diff --git a/website/docs/r/iam_role_policy.html.markdown b/website/docs/r/iam_role_policy.html.markdown index 1bec734beba..601f35e91ea 100644 --- a/website/docs/r/iam_role_policy.html.markdown +++ b/website/docs/r/iam_role_policy.html.markdown @@ -14,7 +14,7 @@ Provides an IAM role inline policy. ## Example Usage -```hcl +```terraform resource "aws_iam_role_policy" "test_policy" { name = "test_policy" role = aws_iam_role.test_role.id diff --git a/website/docs/r/iam_role_policy_attachment.markdown b/website/docs/r/iam_role_policy_attachment.markdown index ccae5ba5926..bdb50b64d37 100644 --- a/website/docs/r/iam_role_policy_attachment.markdown +++ b/website/docs/r/iam_role_policy_attachment.markdown @@ -16,7 +16,7 @@ Attaches a Managed IAM Policy to an IAM role ## Example Usage -```hcl +```terraform resource "aws_iam_role" "role" { name = "test-role" diff --git a/website/docs/r/iam_saml_provider.html.markdown b/website/docs/r/iam_saml_provider.html.markdown index 373bc0e4ccb..de064427168 100644 --- a/website/docs/r/iam_saml_provider.html.markdown +++ b/website/docs/r/iam_saml_provider.html.markdown @@ -12,7 +12,7 @@ Provides an IAM SAML provider. ## Example Usage -```hcl +```terraform resource "aws_iam_saml_provider" "default" { name = "myprovider" saml_metadata_document = file("saml-metadata.xml") diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index e6ed655fcfa..778219c57e9 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -26,7 +26,7 @@ Certificates][2] in AWS Documentation. **Using certs on file:** -```hcl +```terraform resource "aws_iam_server_certificate" "test_cert" { name = "some_test_cert" certificate_body = file("self-ca-cert.pem") @@ -36,7 +36,7 @@ resource "aws_iam_server_certificate" "test_cert" { **Example with cert in-line:** -```hcl +```terraform resource "aws_iam_server_certificate" "test_cert_alt" { name = "alt_test_cert" @@ -63,7 +63,7 @@ recommended you utilize the `name_prefix` attribute and enable the to create a new, updated `aws_iam_server_certificate` resource and replace it in dependant resources before attempting to destroy the old version. -```hcl +```terraform resource "aws_iam_server_certificate" "test_cert" { name_prefix = "example-cert" certificate_body = file("self-ca-cert.pem") diff --git a/website/docs/r/iam_service_linked_role.html.markdown b/website/docs/r/iam_service_linked_role.html.markdown index b83ea17a36c..d1fc8f1f764 100644 --- a/website/docs/r/iam_service_linked_role.html.markdown +++ b/website/docs/r/iam_service_linked_role.html.markdown @@ -12,7 +12,7 @@ Provides an [IAM service-linked role](https://docs.aws.amazon.com/IAM/latest/Use ## Example Usage -```hcl +```terraform resource "aws_iam_service_linked_role" "elasticbeanstalk" { aws_service_name = "elasticbeanstalk.amazonaws.com" } diff --git a/website/docs/r/iam_user.html.markdown b/website/docs/r/iam_user.html.markdown index a650f17bba0..dbeeb5027ed 100644 --- a/website/docs/r/iam_user.html.markdown +++ b/website/docs/r/iam_user.html.markdown @@ -14,7 +14,7 @@ Provides an IAM user. ## Example Usage -```hcl +```terraform resource "aws_iam_user" "lb" { name = "loadbalancer" path = "/system/" diff --git a/website/docs/r/iam_user_group_membership.html.markdown b/website/docs/r/iam_user_group_membership.html.markdown index a53e9c4a85d..425dfa095f3 100644 --- a/website/docs/r/iam_user_group_membership.html.markdown +++ b/website/docs/r/iam_user_group_membership.html.markdown @@ -18,7 +18,7 @@ To exclusively manage the users in a group, see the ## Example Usage -```hcl +```terraform resource "aws_iam_user_group_membership" "example1" { user = aws_iam_user.user1.name diff --git a/website/docs/r/iam_user_login_profile.html.markdown b/website/docs/r/iam_user_login_profile.html.markdown index 9749630b733..efcbf126728 100644 --- a/website/docs/r/iam_user_login_profile.html.markdown +++ b/website/docs/r/iam_user_login_profile.html.markdown @@ -14,7 +14,7 @@ Manages an IAM User Login Profile with limited support for password creation dur ## Example Usage -```hcl +```terraform resource "aws_iam_user" "example" { name = "example" path = "/" @@ -60,7 +60,7 @@ $ terraform import aws_iam_user_login_profile.example myusername Since Terraform has no method to read the PGP or password information during import, use the [Terraform resource `lifecycle` configuration block `ignore_changes` argument](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to ignore them unless password recreation is desired. e.g. -```hcl +```terraform resource "aws_iam_user_login_profile" "example" { # ... other configuration ... diff --git a/website/docs/r/iam_user_policy.html.markdown b/website/docs/r/iam_user_policy.html.markdown index e9e3efde3cd..f0cce0bee5f 100644 --- a/website/docs/r/iam_user_policy.html.markdown +++ b/website/docs/r/iam_user_policy.html.markdown @@ -12,7 +12,7 @@ Provides an IAM policy attached to a user. ## Example Usage -```hcl +```terraform resource "aws_iam_user_policy" "lb_ro" { name = "test" user = aws_iam_user.lb.name diff --git a/website/docs/r/iam_user_policy_attachment.markdown b/website/docs/r/iam_user_policy_attachment.markdown index d6dc860e2ff..7b01c1734e6 100644 --- a/website/docs/r/iam_user_policy_attachment.markdown +++ b/website/docs/r/iam_user_policy_attachment.markdown @@ -14,7 +14,7 @@ Attaches a Managed IAM Policy to an IAM user ## Example Usage -```hcl +```terraform resource "aws_iam_user" "user" { name = "test-user" } diff --git a/website/docs/r/iam_user_ssh_key.html.markdown b/website/docs/r/iam_user_ssh_key.html.markdown index 4bbdaa4debc..bb408407ea2 100644 --- a/website/docs/r/iam_user_ssh_key.html.markdown +++ b/website/docs/r/iam_user_ssh_key.html.markdown @@ -12,7 +12,7 @@ Uploads an SSH public key and associates it with the specified IAM user. ## Example Usage -```hcl +```terraform resource "aws_iam_user" "user" { name = "test-user" path = "/" diff --git a/website/docs/r/imagebuilder_component.html.markdown b/website/docs/r/imagebuilder_component.html.markdown index 0f164dc33ab..6d64d61074e 100644 --- a/website/docs/r/imagebuilder_component.html.markdown +++ b/website/docs/r/imagebuilder_component.html.markdown @@ -14,7 +14,7 @@ Manages an Image Builder Component. ### Inline Data Document -```hcl +```terraform resource "aws_imagebuilder_component" "example" { data = yamlencode({ phases = [{ @@ -38,7 +38,7 @@ resource "aws_imagebuilder_component" "example" { ### URI Document -```hcl +```terraform resource "aws_imagebuilder_component" "example" { name = "example" platform = "Linux" diff --git a/website/docs/r/imagebuilder_distribution_configuration.html.markdown b/website/docs/r/imagebuilder_distribution_configuration.html.markdown index cef5821aeb7..b9b91eb4556 100644 --- a/website/docs/r/imagebuilder_distribution_configuration.html.markdown +++ b/website/docs/r/imagebuilder_distribution_configuration.html.markdown @@ -12,7 +12,7 @@ Manages an Image Builder Distribution Configuration. ## Example Usage -```hcl +```terraform resource "aws_imagebuilder_distribution_configuration" "example" { name = "example" diff --git a/website/docs/r/imagebuilder_image.html.markdown b/website/docs/r/imagebuilder_image.html.markdown index ec753e624ca..3c3ce2f5160 100644 --- a/website/docs/r/imagebuilder_image.html.markdown +++ b/website/docs/r/imagebuilder_image.html.markdown @@ -12,7 +12,7 @@ Manages an Image Builder Image. ## Example Usage -```hcl +```terraform resource "aws_imagebuilder_image" "example" { distribution_configuration_arn = aws_imagebuilder_distribution_configuration.example.arn image_recipe_arn = aws_imagebuilder_image_recipe.example.arn diff --git a/website/docs/r/imagebuilder_image_pipeline.html.markdown b/website/docs/r/imagebuilder_image_pipeline.html.markdown index 40ae24f76af..28f914c541a 100644 --- a/website/docs/r/imagebuilder_image_pipeline.html.markdown +++ b/website/docs/r/imagebuilder_image_pipeline.html.markdown @@ -12,7 +12,7 @@ Manages an Image Builder Image Pipeline. ## Example Usage -```hcl +```terraform resource "aws_imagebuilder_image_pipeline" "example" { image_recipe_arn = aws_imagebuilder_image_recipe.example.arn infrastructure_configuration_arn = aws_imagebuilder_infrastructure_configuration.example.arn diff --git a/website/docs/r/imagebuilder_image_recipe.html.markdown b/website/docs/r/imagebuilder_image_recipe.html.markdown index 82f402dec05..7a380d72f40 100644 --- a/website/docs/r/imagebuilder_image_recipe.html.markdown +++ b/website/docs/r/imagebuilder_image_recipe.html.markdown @@ -12,7 +12,7 @@ Manages an Image Builder Image Recipe. ## Example Usage -```hcl +```terraform resource "aws_imagebuilder_image_recipe" "example" { block_device_mapping { device_name = "/dev/xvdb" diff --git a/website/docs/r/imagebuilder_infrastructure_configuration.html.markdown b/website/docs/r/imagebuilder_infrastructure_configuration.html.markdown index b83cdf3979e..7929936ddff 100644 --- a/website/docs/r/imagebuilder_infrastructure_configuration.html.markdown +++ b/website/docs/r/imagebuilder_infrastructure_configuration.html.markdown @@ -12,7 +12,7 @@ Manages an Image Builder Infrastructure Configuration. ## Example Usage -```hcl +```terraform resource "aws_imagebuilder_infrastructure_configuration" "example" { description = "example description" instance_profile_name = aws_iam_instance_profile.example.name diff --git a/website/docs/r/inspector_assessment_target.html.markdown b/website/docs/r/inspector_assessment_target.html.markdown index 599836b6c13..10072cb2735 100644 --- a/website/docs/r/inspector_assessment_target.html.markdown +++ b/website/docs/r/inspector_assessment_target.html.markdown @@ -12,7 +12,7 @@ Provides a Inspector assessment target ## Example Usage -```hcl +```terraform resource "aws_inspector_resource_group" "bar" { tags = { Name = "foo" diff --git a/website/docs/r/inspector_assessment_template.html.markdown b/website/docs/r/inspector_assessment_template.html.markdown index eb904b6254d..84e94dc39f3 100644 --- a/website/docs/r/inspector_assessment_template.html.markdown +++ b/website/docs/r/inspector_assessment_template.html.markdown @@ -12,7 +12,7 @@ Provides a Inspector assessment template ## Example Usage -```hcl +```terraform resource "aws_inspector_assessment_template" "example" { name = "example" target_arn = aws_inspector_assessment_target.example.arn diff --git a/website/docs/r/inspector_resource_group.html.markdown b/website/docs/r/inspector_resource_group.html.markdown index 0497e2239df..a1169fcbc2e 100644 --- a/website/docs/r/inspector_resource_group.html.markdown +++ b/website/docs/r/inspector_resource_group.html.markdown @@ -12,7 +12,7 @@ Provides an Amazon Inspector resource group resource. ## Example Usage -```hcl +```terraform resource "aws_inspector_resource_group" "example" { tags = { Name = "foo" diff --git a/website/docs/r/instance.html.markdown b/website/docs/r/instance.html.markdown index acc8213ab22..debd8e97b5c 100644 --- a/website/docs/r/instance.html.markdown +++ b/website/docs/r/instance.html.markdown @@ -14,7 +14,7 @@ Provides an EC2 instance resource. This allows instances to be created, updated, ### Basic Example Using AMI Lookup -```hcl +```terraform data "aws_ami" "ubuntu" { most_recent = true @@ -43,7 +43,7 @@ resource "aws_instance" "web" { ### Network and Credit Specification Example -```hcl +```terraform resource "aws_vpc" "my_vpc" { cidr_block = "172.16.0.0/16" diff --git a/website/docs/r/internet_gateway.html.markdown b/website/docs/r/internet_gateway.html.markdown index 37cf931a6b7..aa8babb9e2b 100644 --- a/website/docs/r/internet_gateway.html.markdown +++ b/website/docs/r/internet_gateway.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a VPC Internet Gateway. ## Example Usage -```hcl +```terraform resource "aws_internet_gateway" "gw" { vpc_id = aws_vpc.main.id @@ -31,7 +31,7 @@ The following arguments are supported: -> **Note:** It's recommended to denote that the AWS Instance or Elastic IP depends on the Internet Gateway. For example: -```hcl +```terraform resource "aws_internet_gateway" "gw" { vpc_id = aws_vpc.main.id } diff --git a/website/docs/r/iot_certificate.html.markdown b/website/docs/r/iot_certificate.html.markdown index 9b0c98b4308..347a88f5380 100644 --- a/website/docs/r/iot_certificate.html.markdown +++ b/website/docs/r/iot_certificate.html.markdown @@ -14,7 +14,7 @@ Creates and manages an AWS IoT certificate. ### With CSR -```hcl +```terraform resource "aws_iot_certificate" "cert" { csr = file("/my/csr.pem") active = true @@ -23,7 +23,7 @@ resource "aws_iot_certificate" "cert" { ### Without CSR -```hcl +```terraform resource "aws_iot_certificate" "cert" { active = true } diff --git a/website/docs/r/iot_policy.html.markdown b/website/docs/r/iot_policy.html.markdown index 3ed14ddb5fe..204d30dd819 100644 --- a/website/docs/r/iot_policy.html.markdown +++ b/website/docs/r/iot_policy.html.markdown @@ -12,7 +12,7 @@ Provides an IoT policy. ## Example Usage -```hcl +```terraform resource "aws_iot_policy" "pubsub" { name = "PubSubToAnyTopic" diff --git a/website/docs/r/iot_policy_attachment.html.markdown b/website/docs/r/iot_policy_attachment.html.markdown index cae9b503fd7..2525aad65f7 100644 --- a/website/docs/r/iot_policy_attachment.html.markdown +++ b/website/docs/r/iot_policy_attachment.html.markdown @@ -12,7 +12,7 @@ Provides an IoT policy attachment. ## Example Usage -```hcl +```terraform resource "aws_iot_policy" "pubsub" { name = "PubSubToAnyTopic" diff --git a/website/docs/r/iot_role_alias.html.markdown b/website/docs/r/iot_role_alias.html.markdown index 8b2a9f2ea72..bfa76d53ea8 100644 --- a/website/docs/r/iot_role_alias.html.markdown +++ b/website/docs/r/iot_role_alias.html.markdown @@ -12,7 +12,7 @@ Provides an IoT role alias. ## Example Usage -```hcl +```terraform resource "aws_iam_role" "role" { name = "dynamodb-access-role" diff --git a/website/docs/r/iot_thing.html.markdown b/website/docs/r/iot_thing.html.markdown index 29e6263910a..e31555e6d28 100644 --- a/website/docs/r/iot_thing.html.markdown +++ b/website/docs/r/iot_thing.html.markdown @@ -12,7 +12,7 @@ Creates and manages an AWS IoT Thing. ## Example Usage -```hcl +```terraform resource "aws_iot_thing" "example" { name = "example" diff --git a/website/docs/r/iot_thing_principal_attachment.html.markdown b/website/docs/r/iot_thing_principal_attachment.html.markdown index 73a135e0b6f..1007f25e733 100644 --- a/website/docs/r/iot_thing_principal_attachment.html.markdown +++ b/website/docs/r/iot_thing_principal_attachment.html.markdown @@ -12,7 +12,7 @@ Attaches Principal to AWS IoT Thing. ## Example Usage -```hcl +```terraform resource "aws_iot_thing" "example" { name = "example" } diff --git a/website/docs/r/iot_thing_type.html.markdown b/website/docs/r/iot_thing_type.html.markdown index 8d7065b0f73..d11aa4cac45 100644 --- a/website/docs/r/iot_thing_type.html.markdown +++ b/website/docs/r/iot_thing_type.html.markdown @@ -12,7 +12,7 @@ Creates and manages an AWS IoT Thing Type. ## Example Usage -```hcl +```terraform resource "aws_iot_thing_type" "foo" { name = "my_iot_thing" } diff --git a/website/docs/r/iot_topic_rule.html.markdown b/website/docs/r/iot_topic_rule.html.markdown index 221d63ecd0d..d17e2e4584e 100644 --- a/website/docs/r/iot_topic_rule.html.markdown +++ b/website/docs/r/iot_topic_rule.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_iot_topic_rule" "rule" { name = "MyRule" description = "Example rule" diff --git a/website/docs/r/key_pair.html.markdown b/website/docs/r/key_pair.html.markdown index ba170c3f255..19d367e62ad 100644 --- a/website/docs/r/key_pair.html.markdown +++ b/website/docs/r/key_pair.html.markdown @@ -20,7 +20,7 @@ When importing an existing key pair the public key material may be in any format ## Example Usage -```hcl +```terraform resource "aws_key_pair" "deployer" { key_name = "deployer-key" public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 email@example.com" diff --git a/website/docs/r/kinesis_analytics_application.html.markdown b/website/docs/r/kinesis_analytics_application.html.markdown index 0ae26ed8bbb..7a1db0dd4d5 100644 --- a/website/docs/r/kinesis_analytics_application.html.markdown +++ b/website/docs/r/kinesis_analytics_application.html.markdown @@ -19,7 +19,7 @@ For more details, see the [Amazon Kinesis Analytics Documentation][1]. ### Kinesis Stream Input -```hcl +```terraform resource "aws_kinesis_stream" "test_stream" { name = "terraform-kinesis-test" shard_count = 1 @@ -63,7 +63,7 @@ resource "aws_kinesis_analytics_application" "test_application" { ### Starting An Application -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "analytics" } diff --git a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown index 513f605b8be..9c30063bc2e 100644 --- a/website/docs/r/kinesis_firehose_delivery_stream.html.markdown +++ b/website/docs/r/kinesis_firehose_delivery_stream.html.markdown @@ -16,7 +16,7 @@ For more details, see the [Amazon Kinesis Firehose Documentation][1]. ### Extended S3 Destination -```hcl +```terraform resource "aws_kinesis_firehose_delivery_stream" "extended_s3_stream" { name = "terraform-kinesis-firehose-extended-s3-test-stream" destination = "extended_s3" @@ -96,7 +96,7 @@ resource "aws_lambda_function" "lambda_processor" { ### S3 Destination -```hcl +```terraform resource "aws_s3_bucket" "bucket" { bucket = "tf-test-bucket" acl = "private" @@ -135,7 +135,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { ### Redshift Destination -```hcl +```terraform resource "aws_redshift_cluster" "test_cluster" { cluster_identifier = "tf-redshift-cluster" database_name = "test" @@ -180,7 +180,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { ### Elasticsearch Destination -```hcl +```terraform resource "aws_elasticsearch_domain" "test_cluster" { domain_name = "firehose-es-test" } @@ -221,7 +221,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { ### Elasticsearch Destination With VPC -```hcl +```terraform resource "aws_elasticsearch_domain" "test_cluster" { domain_name = "es-test" @@ -306,7 +306,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { ### Splunk Destination -```hcl +```terraform resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "splunk" @@ -331,7 +331,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test_stream" { ### HTTP Endpoint (e.g. New Relic) Destination -```hcl +```terraform resource "aws_kinesis_firehose_delivery_stream" "test_stream" { name = "terraform-kinesis-firehose-test-stream" destination = "http_endpoint" @@ -522,7 +522,7 @@ The `vpc_config` object supports the following: Example: -```hcl +```terraform resource "aws_kinesis_firehose_delivery_stream" "example" { # ... other configuration ... extended_s3_configuration { diff --git a/website/docs/r/kinesis_stream.html.markdown b/website/docs/r/kinesis_stream.html.markdown index 5492ca9e271..c5a987c3b0a 100644 --- a/website/docs/r/kinesis_stream.html.markdown +++ b/website/docs/r/kinesis_stream.html.markdown @@ -15,7 +15,7 @@ For more details, see the [Amazon Kinesis Documentation][1]. ## Example Usage -```hcl +```terraform resource "aws_kinesis_stream" "test_stream" { name = "terraform-kinesis-test" shard_count = 1 diff --git a/website/docs/r/kinesis_video_stream.html.markdown b/website/docs/r/kinesis_video_stream.html.markdown index 9b72933eed1..6b8ab49a474 100644 --- a/website/docs/r/kinesis_video_stream.html.markdown +++ b/website/docs/r/kinesis_video_stream.html.markdown @@ -14,7 +14,7 @@ For more details, see the [Amazon Kinesis Documentation][1]. ## Example Usage -```hcl +```terraform resource "aws_kinesis_video_stream" "default" { name = "terraform-kinesis-video-stream" data_retention_in_hours = 1 diff --git a/website/docs/r/kinesisanalyticsv2_application.html.markdown b/website/docs/r/kinesisanalyticsv2_application.html.markdown index 47582224517..b1b681b351a 100644 --- a/website/docs/r/kinesisanalyticsv2_application.html.markdown +++ b/website/docs/r/kinesisanalyticsv2_application.html.markdown @@ -17,7 +17,7 @@ This resource can be used to manage both Kinesis Data Analytics for SQL applicat ### Apache Flink Application -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example-flink-application" } @@ -92,7 +92,7 @@ resource "aws_kinesisanalyticsv2_application" "example" { ### SQL Application -```hcl +```terraform resource "aws_cloudwatch_log_group" "example" { name = "example-sql-application" } @@ -215,7 +215,7 @@ resource "aws_kinesisanalyticsv2_application" "example" { ### VPC Configuration -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example-flink-application" } diff --git a/website/docs/r/kms_alias.html.markdown b/website/docs/r/kms_alias.html.markdown index cacfe076163..f0b6caa7b8a 100644 --- a/website/docs/r/kms_alias.html.markdown +++ b/website/docs/r/kms_alias.html.markdown @@ -14,7 +14,7 @@ the [account limits](http://docs.aws.amazon.com/kms/latest/developerguide/limits ## Example Usage -```hcl +```terraform resource "aws_kms_key" "a" {} resource "aws_kms_alias" "a" { diff --git a/website/docs/r/kms_ciphertext.html.markdown b/website/docs/r/kms_ciphertext.html.markdown index cf629172a57..2ca7a0a7a9f 100644 --- a/website/docs/r/kms_ciphertext.html.markdown +++ b/website/docs/r/kms_ciphertext.html.markdown @@ -18,7 +18,7 @@ the [`aws_kms_ciphertext` data source](/docs/providers/aws/d/kms_ciphertext.html ## Example Usage -```hcl +```terraform resource "aws_kms_key" "oauth_config" { description = "oauth config" is_enabled = true diff --git a/website/docs/r/kms_external_key.html.markdown b/website/docs/r/kms_external_key.html.markdown index 60f09b2fa37..09a67c12f9e 100644 --- a/website/docs/r/kms_external_key.html.markdown +++ b/website/docs/r/kms_external_key.html.markdown @@ -14,7 +14,7 @@ Manages a KMS Customer Master Key that uses external key material. To instead ma ## Example Usage -```hcl +```terraform resource "aws_kms_external_key" "example" { description = "KMS EXTERNAL for AMI encryption" } diff --git a/website/docs/r/kms_grant.html.markdown b/website/docs/r/kms_grant.html.markdown index 0bd88804e00..7ba68559ac4 100644 --- a/website/docs/r/kms_grant.html.markdown +++ b/website/docs/r/kms_grant.html.markdown @@ -12,7 +12,7 @@ Provides a resource-based access control mechanism for a KMS customer master key ## Example Usage -```hcl +```terraform resource "aws_kms_key" "a" {} resource "aws_iam_role" "a" { diff --git a/website/docs/r/kms_key.html.markdown b/website/docs/r/kms_key.html.markdown index cc36982aee7..e8ecb387136 100644 --- a/website/docs/r/kms_key.html.markdown +++ b/website/docs/r/kms_key.html.markdown @@ -12,7 +12,7 @@ Provides a KMS customer master key. ## Example Usage -```hcl +```terraform resource "aws_kms_key" "a" { description = "KMS key 1" deletion_window_in_days = 10 diff --git a/website/docs/r/lakeformation_data_lake_settings.html.markdown b/website/docs/r/lakeformation_data_lake_settings.html.markdown index 03278b63531..6a6b60e3b9e 100644 --- a/website/docs/r/lakeformation_data_lake_settings.html.markdown +++ b/website/docs/r/lakeformation_data_lake_settings.html.markdown @@ -16,7 +16,7 @@ Manages Lake Formation principals designated as data lake administrators and lis ### Data Lake Admins -```hcl +```terraform resource "aws_lakeformation_data_lake_settings" "example" { admins = [aws_iam_user.test.arn, aws_iam_role.test.arn] } @@ -24,7 +24,7 @@ resource "aws_lakeformation_data_lake_settings" "example" { ### Create Default Permissions -```hcl +```terraform resource "aws_lakeformation_data_lake_settings" "example" { admins = [aws_iam_user.test.arn, aws_iam_role.test.arn] diff --git a/website/docs/r/lakeformation_permissions.html.markdown b/website/docs/r/lakeformation_permissions.html.markdown index 211913593b9..d6ba68aa1aa 100644 --- a/website/docs/r/lakeformation_permissions.html.markdown +++ b/website/docs/r/lakeformation_permissions.html.markdown @@ -16,7 +16,7 @@ Grants permissions to the principal to access metadata in the Data Catalog and d ### Grant Permissions For A Lake Formation S3 Resource -```hcl +```terraform resource "aws_lakeformation_permissions" "test" { principal = aws_iam_role.workflow_role.arn permissions = ["ALL"] @@ -29,7 +29,7 @@ resource "aws_lakeformation_permissions" "test" { ### Grant Permissions For A Glue Catalog Database -```hcl +```terraform resource "aws_lakeformation_permissions" "test" { role = aws_iam_role.workflow_role.arn permissions = ["CREATE_TABLE", "ALTER", "DROP"] diff --git a/website/docs/r/lakeformation_resource.html.markdown b/website/docs/r/lakeformation_resource.html.markdown index 27eb12fc6dc..a6bb36c22a0 100644 --- a/website/docs/r/lakeformation_resource.html.markdown +++ b/website/docs/r/lakeformation_resource.html.markdown @@ -14,7 +14,7 @@ Choose a role that has read/write access to the chosen Amazon S3 path or use the ## Example Usage -```hcl +```terraform data "aws_s3_bucket" "example" { bucket = "an-example-bucket" } diff --git a/website/docs/r/lambda_alias.html.markdown b/website/docs/r/lambda_alias.html.markdown index 81da6e39a70..7a3b4379cf3 100644 --- a/website/docs/r/lambda_alias.html.markdown +++ b/website/docs/r/lambda_alias.html.markdown @@ -15,7 +15,7 @@ For information about function aliases, see [CreateAlias][2] and [AliasRoutingCo ## Example Usage -```hcl +```terraform resource "aws_lambda_alias" "test_lambda_alias" { name = "my_alias" description = "a sample description" diff --git a/website/docs/r/lambda_code_signing_config.html.markdown b/website/docs/r/lambda_code_signing_config.html.markdown index b96ef0667ee..5f45a27116a 100644 --- a/website/docs/r/lambda_code_signing_config.html.markdown +++ b/website/docs/r/lambda_code_signing_config.html.markdown @@ -14,7 +14,7 @@ For information about Lambda code signing configurations and how to use them, se ## Example Usage -```hcl +```terraform resource "aws_lambda_code_signing_config" "new_csc" { allowed_publishers { signing_profile_version_arns = [ diff --git a/website/docs/r/lambda_event_source_mapping.html.markdown b/website/docs/r/lambda_event_source_mapping.html.markdown index 3a273ef5132..829b70abf6f 100644 --- a/website/docs/r/lambda_event_source_mapping.html.markdown +++ b/website/docs/r/lambda_event_source_mapping.html.markdown @@ -17,7 +17,7 @@ For information about event source mappings, see [CreateEventSourceMapping][2] i ### DynamoDB -```hcl +```terraform resource "aws_lambda_event_source_mapping" "example" { event_source_arn = aws_dynamodb_table.example.stream_arn function_name = aws_lambda_function.example.arn @@ -27,7 +27,7 @@ resource "aws_lambda_event_source_mapping" "example" { ### Kinesis -```hcl +```terraform resource "aws_lambda_event_source_mapping" "example" { event_source_arn = aws_kinesis_stream.example.arn function_name = aws_lambda_function.example.arn @@ -37,7 +37,7 @@ resource "aws_lambda_event_source_mapping" "example" { ### Managed Streaming for Kafka (MSK) -```hcl +```terraform resource "aws_lambda_event_source_mapping" "example" { event_source_arn = aws_msk_cluster.example.arn function_name = aws_lambda_function.example.arn @@ -48,7 +48,7 @@ resource "aws_lambda_event_source_mapping" "example" { ### SQS -```hcl +```terraform resource "aws_lambda_event_source_mapping" "example" { event_source_arn = aws_sqs_queue.sqs_queue_test.arn function_name = aws_lambda_function.example.arn diff --git a/website/docs/r/lambda_function.html.markdown b/website/docs/r/lambda_function.html.markdown index 0caad2b51c7..16c79638246 100644 --- a/website/docs/r/lambda_function.html.markdown +++ b/website/docs/r/lambda_function.html.markdown @@ -22,7 +22,7 @@ For a detailed example of setting up Lambda and API Gateway, see [Serverless App ### Basic Example -```hcl +```terraform resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" @@ -68,7 +68,7 @@ resource "aws_lambda_function" "test_lambda" { ~> **NOTE:** The `aws_lambda_layer_version` attribute values for `arn` and `layer_arn` were swapped in version 2.0.0 of the Terraform AWS Provider. For version 1.x, use `layer_arn` references. For version 2.x, use `arn` references. -```hcl +```terraform resource "aws_lambda_layer_version" "example" { # ... other configuration ... } @@ -83,7 +83,7 @@ resource "aws_lambda_function" "example" { Lambda File Systems allow you to connect an Amazon Elastic File System (EFS) file system to a Lambda function to share data across function invocations, access existing data including large files, and save function state. -```hcl +```terraform # A lambda function connected to an EFS file system resource "aws_lambda_function" "example" { # ... other configuration ... @@ -145,7 +145,7 @@ resource "aws_efs_access_point" "access_point_for_lambda" { For more information about CloudWatch Logs for Lambda, see the [Lambda User Guide](https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions-logs.html). -```hcl +```terraform variable "lambda_function_name" { default = "lambda_function_name" } diff --git a/website/docs/r/lambda_function_event_invoke_config.html.markdown b/website/docs/r/lambda_function_event_invoke_config.html.markdown index 38d368c23c0..749148361b3 100644 --- a/website/docs/r/lambda_function_event_invoke_config.html.markdown +++ b/website/docs/r/lambda_function_event_invoke_config.html.markdown @@ -16,7 +16,7 @@ Manages an asynchronous invocation configuration for a Lambda Function or Alias. ~> **NOTE:** Ensure the Lambda Function IAM Role has necessary permissions for the destination, such as `sqs:SendMessage` or `sns:Publish`, otherwise the API will return a generic `InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid.` error. -```hcl +```terraform resource "aws_lambda_function_event_invoke_config" "example" { function_name = aws_lambda_alias.example.function_name @@ -34,7 +34,7 @@ resource "aws_lambda_function_event_invoke_config" "example" { ### Error Handling Configuration -```hcl +```terraform resource "aws_lambda_function_event_invoke_config" "example" { function_name = aws_lambda_alias.example.function_name maximum_event_age_in_seconds = 60 @@ -44,7 +44,7 @@ resource "aws_lambda_function_event_invoke_config" "example" { ### Configuration for Alias Name -```hcl +```terraform resource "aws_lambda_function_event_invoke_config" "example" { function_name = aws_lambda_alias.example.function_name qualifier = aws_lambda_alias.example.name @@ -55,7 +55,7 @@ resource "aws_lambda_function_event_invoke_config" "example" { ### Configuration for Function Latest Unpublished Version -```hcl +```terraform resource "aws_lambda_function_event_invoke_config" "example" { function_name = aws_lambda_function.example.function_name qualifier = "$LATEST" @@ -66,7 +66,7 @@ resource "aws_lambda_function_event_invoke_config" "example" { ### Configuration for Function Published Version -```hcl +```terraform resource "aws_lambda_function_event_invoke_config" "example" { function_name = aws_lambda_function.example.function_name qualifier = aws_lambda_function.example.version diff --git a/website/docs/r/lambda_layer_version.html.markdown b/website/docs/r/lambda_layer_version.html.markdown index 93b9df8f3b1..5737c9327fa 100644 --- a/website/docs/r/lambda_layer_version.html.markdown +++ b/website/docs/r/lambda_layer_version.html.markdown @@ -14,7 +14,7 @@ For information about Lambda Layers and how to use them, see [AWS Lambda Layers] ## Example Usage -```hcl +```terraform resource "aws_lambda_layer_version" "lambda_layer" { filename = "lambda_layer_payload.zip" layer_name = "lambda_layer_name" diff --git a/website/docs/r/lambda_permission.html.markdown b/website/docs/r/lambda_permission.html.markdown index 9f015392b12..7329d771dc9 100644 --- a/website/docs/r/lambda_permission.html.markdown +++ b/website/docs/r/lambda_permission.html.markdown @@ -12,7 +12,7 @@ Gives an external source (like a CloudWatch Event Rule, SNS, or S3) permission t ## Example Usage -```hcl +```terraform resource "aws_lambda_permission" "allow_cloudwatch" { statement_id = "AllowExecutionFromCloudWatch" action = "lambda:InvokeFunction" @@ -60,7 +60,7 @@ resource "aws_iam_role" "iam_for_lambda" { ## Usage with SNS -```hcl +```terraform resource "aws_lambda_permission" "with_sns" { statement_id = "AllowExecutionFromSNS" action = "lambda:InvokeFunction" @@ -110,7 +110,7 @@ resource "aws_iam_role" "default" { ## Specify Lambda permissions for API Gateway REST API -```hcl +```terraform resource "aws_api_gateway_rest_api" "MyDemoAPI" { name = "MyDemoAPI" description = "This is my API for demonstration purposes" @@ -130,7 +130,7 @@ resource "aws_lambda_permission" "lambda_permission" { ## Usage with CloudWatch log group -```hcl +```terraform resource "aws_lambda_permission" "logging" { action = "lambda:InvokeFunction" function_name = aws_lambda_function.logging.function_name diff --git a/website/docs/r/lambda_provisioned_concurrency_config.html.markdown b/website/docs/r/lambda_provisioned_concurrency_config.html.markdown index 4399028be0e..4e0300f6d27 100644 --- a/website/docs/r/lambda_provisioned_concurrency_config.html.markdown +++ b/website/docs/r/lambda_provisioned_concurrency_config.html.markdown @@ -14,7 +14,7 @@ Manages a Lambda Provisioned Concurrency Configuration. ### Alias Name -```hcl +```terraform resource "aws_lambda_provisioned_concurrency_config" "example" { function_name = aws_lambda_alias.example.function_name provisioned_concurrent_executions = 1 @@ -24,7 +24,7 @@ resource "aws_lambda_provisioned_concurrency_config" "example" { ### Function Version -```hcl +```terraform resource "aws_lambda_provisioned_concurrency_config" "example" { function_name = aws_lambda_function.example.function_name provisioned_concurrent_executions = 1 diff --git a/website/docs/r/launch_configuration.html.markdown b/website/docs/r/launch_configuration.html.markdown index dd5395a8d43..f99ce052dba 100644 --- a/website/docs/r/launch_configuration.html.markdown +++ b/website/docs/r/launch_configuration.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a new launch configuration, used for autoscaling g ## Example Usage -```hcl +```terraform data "aws_ami" "ubuntu" { most_recent = true @@ -46,7 +46,7 @@ it's recommended to specify `create_before_destroy` in a [lifecycle][2] block. Either omit the Launch Configuration `name` attribute, or specify a partial name with `name_prefix`. Example: -```hcl +```terraform data "aws_ami" "ubuntu" { most_recent = true @@ -98,7 +98,7 @@ reserve your instances at this price. See the [AWS Spot Instance documentation](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances.html) for more information or how to launch [Spot Instances][3] with Terraform. -```hcl +```terraform data "aws_ami" "ubuntu" { most_recent = true diff --git a/website/docs/r/launch_template.html.markdown b/website/docs/r/launch_template.html.markdown index 32346c46e1f..9db6c7b3496 100644 --- a/website/docs/r/launch_template.html.markdown +++ b/website/docs/r/launch_template.html.markdown @@ -12,7 +12,7 @@ Provides an EC2 launch template resource. Can be used to create instances or aut ## Example Usage -```hcl +```terraform resource "aws_launch_template" "foo" { name = "foo" diff --git a/website/docs/r/lb.html.markdown b/website/docs/r/lb.html.markdown index 0a0573ff792..d8580464027 100644 --- a/website/docs/r/lb.html.markdown +++ b/website/docs/r/lb.html.markdown @@ -16,7 +16,7 @@ Provides a Load Balancer resource. ### Application Load Balancer -```hcl +```terraform resource "aws_lb" "test" { name = "test-lb-tf" internal = false @@ -40,7 +40,7 @@ resource "aws_lb" "test" { ### Network Load Balancer -```hcl +```terraform resource "aws_lb" "test" { name = "test-lb-tf" internal = false @@ -57,7 +57,7 @@ resource "aws_lb" "test" { ### Specifying Elastic IPs -```hcl +```terraform resource "aws_lb" "example" { name = "example" load_balancer_type = "network" @@ -76,7 +76,7 @@ resource "aws_lb" "example" { ### Specifying private IP addresses for an internal-facing load balancer -```hcl +```terraform resource "aws_lb" "example" { name = "example" load_balancer_type = "network" diff --git a/website/docs/r/lb_cookie_stickiness_policy.html.markdown b/website/docs/r/lb_cookie_stickiness_policy.html.markdown index 2ebc3ecf4f5..0234f7d5e83 100644 --- a/website/docs/r/lb_cookie_stickiness_policy.html.markdown +++ b/website/docs/r/lb_cookie_stickiness_policy.html.markdown @@ -12,7 +12,7 @@ Provides a load balancer cookie stickiness policy, which allows an ELB to contro ## Example Usage -```hcl +```terraform resource "aws_elb" "lb" { name = "test-lb" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/lb_listener.html.markdown b/website/docs/r/lb_listener.html.markdown index e34be1304f0..2f233100f49 100644 --- a/website/docs/r/lb_listener.html.markdown +++ b/website/docs/r/lb_listener.html.markdown @@ -16,7 +16,7 @@ Provides a Load Balancer Listener resource. ### Forward Action -```hcl +```terraform resource "aws_lb" "front_end" { # ... } @@ -41,7 +41,7 @@ resource "aws_lb_listener" "front_end" { ### Redirect Action -```hcl +```terraform resource "aws_lb" "front_end" { # ... } @@ -65,7 +65,7 @@ resource "aws_lb_listener" "front_end" { ### Fixed-response Action -```hcl +```terraform resource "aws_lb" "front_end" { # ... } @@ -89,7 +89,7 @@ resource "aws_lb_listener" "front_end" { ### Authenticate-cognito Action -```hcl +```terraform resource "aws_lb" "front_end" { # ... } @@ -134,7 +134,7 @@ resource "aws_lb_listener" "front_end" { ### Authenticate-oidc Action -```hcl +```terraform resource "aws_lb" "front_end" { # ... } @@ -170,7 +170,7 @@ resource "aws_lb_listener" "front_end" { ### Gateway Load Balancer Listener -```hcl +```terraform resource "aws_lb" "example" { load_balancer_type = "gateway" name = "example" diff --git a/website/docs/r/lb_listener_certificate.html.markdown b/website/docs/r/lb_listener_certificate.html.markdown index e3c9babf459..84f16b97ae3 100644 --- a/website/docs/r/lb_listener_certificate.html.markdown +++ b/website/docs/r/lb_listener_certificate.html.markdown @@ -16,7 +16,7 @@ This resource is for additional certificates and does not replace the default ce ## Example Usage -```hcl +```terraform resource "aws_acm_certificate" "example" { # ... } diff --git a/website/docs/r/lb_listener_rule.html.markdown b/website/docs/r/lb_listener_rule.html.markdown index c43a82d264d..602ac379627 100644 --- a/website/docs/r/lb_listener_rule.html.markdown +++ b/website/docs/r/lb_listener_rule.html.markdown @@ -14,7 +14,7 @@ Provides a Load Balancer Listener Rule resource. ## Example Usage -```hcl +```terraform resource "aws_lb" "front_end" { # ... } diff --git a/website/docs/r/lb_ssl_negotiation_policy.html.markdown b/website/docs/r/lb_ssl_negotiation_policy.html.markdown index 57a71859bfb..c1100d656f4 100644 --- a/website/docs/r/lb_ssl_negotiation_policy.html.markdown +++ b/website/docs/r/lb_ssl_negotiation_policy.html.markdown @@ -12,7 +12,7 @@ Provides a load balancer SSL negotiation policy, which allows an ELB to control ## Example Usage -```hcl +```terraform resource "aws_elb" "lb" { name = "test-lb" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/lb_target_group.html.markdown b/website/docs/r/lb_target_group.html.markdown index d7ead675b57..027497f9284 100644 --- a/website/docs/r/lb_target_group.html.markdown +++ b/website/docs/r/lb_target_group.html.markdown @@ -16,7 +16,7 @@ Provides a Target Group resource for use with Load Balancer resources. ### Instance Target Group -```hcl +```terraform resource "aws_lb_target_group" "test" { name = "tf-example-lb-tg" port = 80 @@ -31,7 +31,7 @@ resource "aws_vpc" "main" { ### IP Target Group -```hcl +```terraform resource "aws_lb_target_group" "ip-example" { name = "tf-example-lb-tg" port = 80 @@ -47,7 +47,7 @@ resource "aws_vpc" "main" { ### Lambda Target Group -```hcl +```terraform resource "aws_lb_target_group" "lambda-example" { name = "tf-example-lb-tg" target_type = "lambda" diff --git a/website/docs/r/lb_target_group_attachment.html.markdown b/website/docs/r/lb_target_group_attachment.html.markdown index f47c6590496..1af3a61c71f 100644 --- a/website/docs/r/lb_target_group_attachment.html.markdown +++ b/website/docs/r/lb_target_group_attachment.html.markdown @@ -15,7 +15,7 @@ Provides the ability to register instances and containers with an Application Lo ## Example Usage -```hcl +```terraform resource "aws_lb_target_group_attachment" "test" { target_group_arn = aws_lb_target_group.test.arn target_id = aws_instance.test.id @@ -33,7 +33,7 @@ resource "aws_instance" "test" { ## Usage with lambda -```hcl +```terraform resource "aws_lambda_permission" "with_lb" { statement_id = "AllowExecutionFromlb" action = "lambda:InvokeFunction" diff --git a/website/docs/r/lex_bot.html.markdown b/website/docs/r/lex_bot.html.markdown index a3e0cb99499..ec65a4d2ac1 100644 --- a/website/docs/r/lex_bot.html.markdown +++ b/website/docs/r/lex_bot.html.markdown @@ -13,7 +13,7 @@ Provides an Amazon Lex Bot resource. For more information see ## Example Usage -```hcl +```terraform resource "aws_lex_bot" "order_flowers_bot" { abort_statement { message { diff --git a/website/docs/r/lex_bot_alias.html.markdown b/website/docs/r/lex_bot_alias.html.markdown index 9a4cc1052f7..7e809cad91f 100644 --- a/website/docs/r/lex_bot_alias.html.markdown +++ b/website/docs/r/lex_bot_alias.html.markdown @@ -13,7 +13,7 @@ Provides an Amazon Lex Bot Alias resource. For more information see ## Example Usage -```hcl +```terraform resource "aws_lex_bot_alias" "order_flowers_prod" { bot_name = "OrderFlowers" bot_version = "1" diff --git a/website/docs/r/lex_intent.html.markdown b/website/docs/r/lex_intent.html.markdown index eb233e43c92..07732ca168c 100644 --- a/website/docs/r/lex_intent.html.markdown +++ b/website/docs/r/lex_intent.html.markdown @@ -13,7 +13,7 @@ Provides an Amazon Lex Intent resource. For more information see ## Example Usage -```hcl +```terraform resource "aws_lex_intent" "order_flowers_intent" { confirmation_prompt { max_attempts = 2 diff --git a/website/docs/r/lex_slot_type.html.markdown b/website/docs/r/lex_slot_type.html.markdown index 877c2a904e9..8f7e2d0b14e 100644 --- a/website/docs/r/lex_slot_type.html.markdown +++ b/website/docs/r/lex_slot_type.html.markdown @@ -13,7 +13,7 @@ Provides an Amazon Lex Slot Type resource. For more information see ## Example Usage -```hcl +```terraform resource "aws_lex_slot_type" "flower_types" { create_version = true description = "Types of flowers to order" diff --git a/website/docs/r/licensemanager_association.markdown b/website/docs/r/licensemanager_association.markdown index 720df0a343e..bceb4cdf5a3 100644 --- a/website/docs/r/licensemanager_association.markdown +++ b/website/docs/r/licensemanager_association.markdown @@ -14,7 +14,7 @@ Provides a License Manager association. ## Example Usage -```hcl +```terraform data "aws_ami" "example" { most_recent = true owners = ["amazon"] diff --git a/website/docs/r/licensemanager_license_configuration.markdown b/website/docs/r/licensemanager_license_configuration.markdown index e7b3162bffe..14a73ac4a81 100644 --- a/website/docs/r/licensemanager_license_configuration.markdown +++ b/website/docs/r/licensemanager_license_configuration.markdown @@ -14,7 +14,7 @@ Provides a License Manager license configuration resource. ## Example Usage -```hcl +```terraform resource "aws_licensemanager_license_configuration" "example" { name = "Example" description = "Example" diff --git a/website/docs/r/lightsail_domain.html.markdown b/website/docs/r/lightsail_domain.html.markdown index b00f7314be0..12753d6d68d 100644 --- a/website/docs/r/lightsail_domain.html.markdown +++ b/website/docs/r/lightsail_domain.html.markdown @@ -18,7 +18,7 @@ this parameter to manage the DNS records for that domain. ## Example Usage -```hcl +```terraform resource "aws_lightsail_domain" "domain_test" { domain_name = "mydomain.com" } diff --git a/website/docs/r/lightsail_instance.html.markdown b/website/docs/r/lightsail_instance.html.markdown index 7c15aafe52d..8367f33e75b 100644 --- a/website/docs/r/lightsail_instance.html.markdown +++ b/website/docs/r/lightsail_instance.html.markdown @@ -16,7 +16,7 @@ for more information. ## Example Usage -```hcl +```terraform # Create a new GitLab Lightsail Instance resource "aws_lightsail_instance" "gitlab_test" { name = "custom_gitlab" diff --git a/website/docs/r/lightsail_key_pair.html.markdown b/website/docs/r/lightsail_key_pair.html.markdown index 2c8d3c7bf34..936e0ebb01e 100644 --- a/website/docs/r/lightsail_key_pair.html.markdown +++ b/website/docs/r/lightsail_key_pair.html.markdown @@ -18,7 +18,7 @@ Lightsail. ### Create New Key Pair -```hcl +```terraform # Create a new Lightsail Key Pair resource "aws_lightsail_key_pair" "lg_key_pair" { name = "lg_key_pair" @@ -27,7 +27,7 @@ resource "aws_lightsail_key_pair" "lg_key_pair" { ### Create New Key Pair with PGP Encrypted Private Key -```hcl +```terraform resource "aws_lightsail_key_pair" "lg_key_pair" { name = "lg_key_pair" pgp_key = "keybase:keybaseusername" @@ -36,7 +36,7 @@ resource "aws_lightsail_key_pair" "lg_key_pair" { ### Existing Public Key Import -```hcl +```terraform resource "aws_lightsail_key_pair" "lg_key_pair" { name = "importing" public_key = file("~/.ssh/id_rsa.pub") diff --git a/website/docs/r/lightsail_static_ip.html.markdown b/website/docs/r/lightsail_static_ip.html.markdown index f1c7d137e4b..b29f9ae463e 100644 --- a/website/docs/r/lightsail_static_ip.html.markdown +++ b/website/docs/r/lightsail_static_ip.html.markdown @@ -14,7 +14,7 @@ Allocates a static IP address. ## Example Usage -```hcl +```terraform resource "aws_lightsail_static_ip" "test" { name = "example" } diff --git a/website/docs/r/lightsail_static_ip_attachment.html.markdown b/website/docs/r/lightsail_static_ip_attachment.html.markdown index 5eec81ceb91..aa032456920 100644 --- a/website/docs/r/lightsail_static_ip_attachment.html.markdown +++ b/website/docs/r/lightsail_static_ip_attachment.html.markdown @@ -14,7 +14,7 @@ Provides a static IP address attachment - relationship between a Lightsail stati ## Example Usage -```hcl +```terraform resource "aws_lightsail_static_ip_attachment" "test" { static_ip_name = aws_lightsail_static_ip.test.id instance_name = aws_lightsail_instance.test.id diff --git a/website/docs/r/load_balancer_backend_server_policy.html.markdown b/website/docs/r/load_balancer_backend_server_policy.html.markdown index 631a0b3ba3b..04617496674 100644 --- a/website/docs/r/load_balancer_backend_server_policy.html.markdown +++ b/website/docs/r/load_balancer_backend_server_policy.html.markdown @@ -13,7 +13,7 @@ Attaches a load balancer policy to an ELB backend server. ## Example Usage -```hcl +```terraform resource "aws_elb" "wu-tang" { name = "wu-tang" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/load_balancer_listener_policy.html.markdown b/website/docs/r/load_balancer_listener_policy.html.markdown index eb72817ad91..75ac35700f4 100644 --- a/website/docs/r/load_balancer_listener_policy.html.markdown +++ b/website/docs/r/load_balancer_listener_policy.html.markdown @@ -15,7 +15,7 @@ Attaches a load balancer policy to an ELB Listener. ### Custom Policy -```hcl +```terraform resource "aws_elb" "wu-tang" { name = "wu-tang" availability_zones = ["us-east-1a"] @@ -63,7 +63,7 @@ This example shows how to customize the TLS settings of an HTTPS listener. ### AWS Predefined Security Policy -```hcl +```terraform resource "aws_elb" "wu-tang" { name = "wu-tang" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/load_balancer_policy.html.markdown b/website/docs/r/load_balancer_policy.html.markdown index 527e9b346dd..4ee26f1527f 100644 --- a/website/docs/r/load_balancer_policy.html.markdown +++ b/website/docs/r/load_balancer_policy.html.markdown @@ -12,7 +12,7 @@ Provides a load balancer policy, which can be attached to an ELB listener or bac ## Example Usage -```hcl +```terraform resource "aws_elb" "wu-tang" { name = "wu-tang" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/macie_member_account_association.html.markdown b/website/docs/r/macie_member_account_association.html.markdown index 237c727fbe5..b22b4ea3985 100644 --- a/website/docs/r/macie_member_account_association.html.markdown +++ b/website/docs/r/macie_member_account_association.html.markdown @@ -16,7 +16,7 @@ Associates an AWS account with Amazon Macie as a member account. ## Example Usage -```hcl +```terraform resource "aws_macie_member_account_association" "example" { member_account_id = "123456789012" } diff --git a/website/docs/r/macie_s3_bucket_association.html.markdown b/website/docs/r/macie_s3_bucket_association.html.markdown index ed0bb6f2e44..513ad15d4cb 100644 --- a/website/docs/r/macie_s3_bucket_association.html.markdown +++ b/website/docs/r/macie_s3_bucket_association.html.markdown @@ -16,7 +16,7 @@ Associates an S3 resource with Amazon Macie for monitoring and data classificati ## Example Usage -```hcl +```terraform resource "aws_macie_s3_bucket_association" "example" { bucket_name = "tf-macie-example" prefix = "data" diff --git a/website/docs/r/main_route_table_association.html.markdown b/website/docs/r/main_route_table_association.html.markdown index 9e011728705..fbe52a4ae52 100644 --- a/website/docs/r/main_route_table_association.html.markdown +++ b/website/docs/r/main_route_table_association.html.markdown @@ -12,7 +12,7 @@ Provides a resource for managing the main routing table of a VPC. ## Example Usage -```hcl +```terraform resource "aws_main_route_table_association" "a" { vpc_id = aws_vpc.foo.id route_table_id = aws_route_table.bar.id diff --git a/website/docs/r/media_convert_queue.html.markdown b/website/docs/r/media_convert_queue.html.markdown index 33b7af58248..c3c58703e11 100644 --- a/website/docs/r/media_convert_queue.html.markdown +++ b/website/docs/r/media_convert_queue.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Elemental MediaConvert Queue. ## Example Usage -```hcl +```terraform resource "aws_media_convert_queue" "test" { name = "tf-test-queue" } diff --git a/website/docs/r/media_package_channel.html.markdown b/website/docs/r/media_package_channel.html.markdown index 4910ea7ed6a..f0ef3f5b32c 100644 --- a/website/docs/r/media_package_channel.html.markdown +++ b/website/docs/r/media_package_channel.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Elemental MediaPackage Channel. ## Example Usage -```hcl +```terraform resource "aws_media_package_channel" "kittens" { channel_id = "kitten-channel" description = "A channel dedicated to amusing videos of kittens." diff --git a/website/docs/r/media_store_container.html.markdown b/website/docs/r/media_store_container.html.markdown index 8f14be6ef54..c906c88a7d6 100644 --- a/website/docs/r/media_store_container.html.markdown +++ b/website/docs/r/media_store_container.html.markdown @@ -12,7 +12,7 @@ Provides a MediaStore Container. ## Example Usage -```hcl +```terraform resource "aws_media_store_container" "example" { name = "example" } diff --git a/website/docs/r/media_store_container_policy.html.markdown b/website/docs/r/media_store_container_policy.html.markdown index 93a51ef5cd8..ea04d851cd1 100644 --- a/website/docs/r/media_store_container_policy.html.markdown +++ b/website/docs/r/media_store_container_policy.html.markdown @@ -12,7 +12,7 @@ Provides a MediaStore Container Policy. ## Example Usage -```hcl +```terraform data "aws_region" "current" {} data "aws_caller_identity" "current" {} diff --git a/website/docs/r/mq_broker.html.markdown b/website/docs/r/mq_broker.html.markdown index 7da2cbb7908..1a22f2050e1 100644 --- a/website/docs/r/mq_broker.html.markdown +++ b/website/docs/r/mq_broker.html.markdown @@ -23,7 +23,7 @@ Provides an Amazon MQ broker resource. This resources also manages users for the ### Basic Example -```hcl +```terraform resource "aws_mq_broker" "example" { broker_name = "example" @@ -48,7 +48,7 @@ resource "aws_mq_broker" "example" { This example shows the use of EBS storage for high-throughput optimized performance. -```hcl +```terraform resource "aws_mq_broker" "example" { broker_name = "example" diff --git a/website/docs/r/mq_configuration.html.markdown b/website/docs/r/mq_configuration.html.markdown index 6ed381ed29d..f3f86890923 100644 --- a/website/docs/r/mq_configuration.html.markdown +++ b/website/docs/r/mq_configuration.html.markdown @@ -14,7 +14,7 @@ For more information on Amazon MQ, see [Amazon MQ documentation](https://docs.aw ## Example Usage -```hcl +```terraform resource "aws_mq_configuration" "example" { description = "Example Configuration" name = "example" diff --git a/website/docs/r/msk_cluster.html.markdown b/website/docs/r/msk_cluster.html.markdown index 4a6412de92c..02a22c94483 100644 --- a/website/docs/r/msk_cluster.html.markdown +++ b/website/docs/r/msk_cluster.html.markdown @@ -12,7 +12,7 @@ Manages AWS Managed Streaming for Kafka cluster ## Example Usage -```hcl +```terraform resource "aws_vpc" "vpc" { cidr_block = "192.168.0.0/22" } diff --git a/website/docs/r/msk_configuration.html.markdown b/website/docs/r/msk_configuration.html.markdown index 227c36c2480..bdd5b1ef800 100644 --- a/website/docs/r/msk_configuration.html.markdown +++ b/website/docs/r/msk_configuration.html.markdown @@ -12,7 +12,7 @@ Manages an Amazon Managed Streaming for Kafka configuration. More information ca ## Example Usage -```hcl +```terraform resource "aws_msk_configuration" "example" { kafka_versions = ["2.1.0"] name = "example" diff --git a/website/docs/r/msk_scram_secret_association.html.markdown b/website/docs/r/msk_scram_secret_association.html.markdown index 017fc5b6be9..c7b9b613e94 100644 --- a/website/docs/r/msk_scram_secret_association.html.markdown +++ b/website/docs/r/msk_scram_secret_association.html.markdown @@ -22,7 +22,7 @@ resource](/docs/providers/aws/r/secretsmanager_secret_policy.html) as shown belo ## Example Usage -```hcl +```terraform resource "aws_msk_scram_secret_association" "example" { cluster_arn = aws_msk_cluster.example.arn secret_arn_list = [aws_secretsmanager_secret.example.arn] diff --git a/website/docs/r/nat_gateway.html.markdown b/website/docs/r/nat_gateway.html.markdown index 68cb1bb603f..62743dcfefd 100644 --- a/website/docs/r/nat_gateway.html.markdown +++ b/website/docs/r/nat_gateway.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a VPC NAT Gateway. ## Example Usage -```hcl +```terraform resource "aws_nat_gateway" "gw" { allocation_id = aws_eip.nat.id subnet_id = aws_subnet.example.id @@ -21,7 +21,7 @@ resource "aws_nat_gateway" "gw" { Usage with tags: -```hcl +```terraform resource "aws_nat_gateway" "gw" { allocation_id = aws_eip.nat.id subnet_id = aws_subnet.example.id @@ -42,7 +42,7 @@ The following arguments are supported: -> **Note:** It's recommended to denote that the NAT Gateway depends on the Internet Gateway for the VPC in which the NAT Gateway's subnet is located. For example: -```hcl +```terraform resource "aws_internet_gateway" "gw" { vpc_id = aws_vpc.main.id } diff --git a/website/docs/r/neptune_cluster.html.markdown b/website/docs/r/neptune_cluster.html.markdown index 74a1c75bd55..4df015fb564 100644 --- a/website/docs/r/neptune_cluster.html.markdown +++ b/website/docs/r/neptune_cluster.html.markdown @@ -20,7 +20,7 @@ phase because a modification has not yet taken place. You can use the ## Example Usage -```hcl +```terraform resource "aws_neptune_cluster" "default" { cluster_identifier = "neptune-cluster-demo" engine = "neptune" diff --git a/website/docs/r/neptune_cluster_instance.html.markdown b/website/docs/r/neptune_cluster_instance.html.markdown index d59fdbe3767..f090be4f661 100644 --- a/website/docs/r/neptune_cluster_instance.html.markdown +++ b/website/docs/r/neptune_cluster_instance.html.markdown @@ -18,7 +18,7 @@ meta-parameter to make multiple instances and join them all to the same Neptune The following example will create a neptune cluster with two neptune instances(one writer and one reader). -```hcl +```terraform resource "aws_neptune_cluster" "default" { cluster_identifier = "neptune-cluster-demo" engine = "neptune" diff --git a/website/docs/r/neptune_cluster_parameter_group.html.markdown b/website/docs/r/neptune_cluster_parameter_group.html.markdown index 5d61ecce4b8..022f167d691 100644 --- a/website/docs/r/neptune_cluster_parameter_group.html.markdown +++ b/website/docs/r/neptune_cluster_parameter_group.html.markdown @@ -12,7 +12,7 @@ Manages a Neptune Cluster Parameter Group ## Example Usage -```hcl +```terraform resource "aws_neptune_cluster_parameter_group" "example" { family = "neptune1" name = "example" diff --git a/website/docs/r/neptune_cluster_snapshot.html.markdown b/website/docs/r/neptune_cluster_snapshot.html.markdown index 3160e963bad..071cd91c2b3 100644 --- a/website/docs/r/neptune_cluster_snapshot.html.markdown +++ b/website/docs/r/neptune_cluster_snapshot.html.markdown @@ -12,7 +12,7 @@ Manages a Neptune database cluster snapshot. ## Example Usage -```hcl +```terraform resource "aws_neptune_cluster_snapshot" "example" { db_cluster_identifier = aws_neptune_cluster.example.id db_cluster_snapshot_identifier = "resourcetestsnapshot1234" diff --git a/website/docs/r/neptune_event_subscription.html.markdown b/website/docs/r/neptune_event_subscription.html.markdown index 25a68c7d0c6..b61d923d152 100644 --- a/website/docs/r/neptune_event_subscription.html.markdown +++ b/website/docs/r/neptune_event_subscription.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_neptune_cluster" "default" { cluster_identifier = "neptune-cluster-demo" engine = "neptune" diff --git a/website/docs/r/neptune_parameter_group.html.markdown b/website/docs/r/neptune_parameter_group.html.markdown index fbc21d16509..37856a425c7 100644 --- a/website/docs/r/neptune_parameter_group.html.markdown +++ b/website/docs/r/neptune_parameter_group.html.markdown @@ -12,7 +12,7 @@ Manages a Neptune Parameter Group ## Example Usage -```hcl +```terraform resource "aws_neptune_parameter_group" "example" { family = "neptune1" name = "example" diff --git a/website/docs/r/neptune_subnet_group.html.markdown b/website/docs/r/neptune_subnet_group.html.markdown index 84a337f96fb..00c0e67f94c 100644 --- a/website/docs/r/neptune_subnet_group.html.markdown +++ b/website/docs/r/neptune_subnet_group.html.markdown @@ -12,7 +12,7 @@ Provides an Neptune subnet group resource. ## Example Usage -```hcl +```terraform resource "aws_neptune_subnet_group" "default" { name = "main" subnet_ids = [aws_subnet.frontend.id, aws_subnet.backend.id] diff --git a/website/docs/r/network_acl.html.markdown b/website/docs/r/network_acl.html.markdown index 12180b46bb2..610ae509eb7 100644 --- a/website/docs/r/network_acl.html.markdown +++ b/website/docs/r/network_acl.html.markdown @@ -19,7 +19,7 @@ a conflict of rule settings and will overwrite rules. ## Example Usage -```hcl +```terraform resource "aws_network_acl" "main" { vpc_id = aws_vpc.main.id diff --git a/website/docs/r/network_acl_rule.html.markdown b/website/docs/r/network_acl_rule.html.markdown index 982d9e6255e..d9c510b3d5a 100644 --- a/website/docs/r/network_acl_rule.html.markdown +++ b/website/docs/r/network_acl_rule.html.markdown @@ -18,7 +18,7 @@ a conflict of rule settings and will overwrite rules. ## Example Usage -```hcl +```terraform resource "aws_network_acl" "bar" { vpc_id = aws_vpc.foo.id } diff --git a/website/docs/r/network_interface.markdown b/website/docs/r/network_interface.markdown index df298d2c741..88833a245f1 100644 --- a/website/docs/r/network_interface.markdown +++ b/website/docs/r/network_interface.markdown @@ -12,7 +12,7 @@ Provides an Elastic network interface (ENI) resource. ## Example Usage -```hcl +```terraform resource "aws_network_interface" "test" { subnet_id = aws_subnet.public_a.id private_ips = ["10.0.0.50"] diff --git a/website/docs/r/network_interface_attachment.html.markdown b/website/docs/r/network_interface_attachment.html.markdown index 9ab1fdb0cb6..ca160e39497 100644 --- a/website/docs/r/network_interface_attachment.html.markdown +++ b/website/docs/r/network_interface_attachment.html.markdown @@ -12,7 +12,7 @@ Attach an Elastic network interface (ENI) resource with EC2 instance. ## Example Usage -```hcl +```terraform resource "aws_network_interface_attachment" "test" { instance_id = aws_instance.test.id network_interface_id = aws_network_interface.test.id diff --git a/website/docs/r/network_interface_sg_attachment.html.markdown b/website/docs/r/network_interface_sg_attachment.html.markdown index 2c8dfef57b8..e565f07b24f 100644 --- a/website/docs/r/network_interface_sg_attachment.html.markdown +++ b/website/docs/r/network_interface_sg_attachment.html.markdown @@ -30,7 +30,7 @@ by `instance`) in the default security group, creating a security group primary network interface via the `aws_network_interface_sg_attachment` resource, named `sg_attachment`: -```hcl +```terraform data "aws_ami" "ami" { most_recent = true @@ -67,7 +67,7 @@ In this example, `instance` is provided by the `aws_instance` data source, fetching an external instance, possibly not managed by Terraform. `sg_attachment` then attaches to the output instance's `network_interface_id`: -```hcl +```terraform data "aws_instance" "instance" { instance_id = "i-1234567890abcdef0" } diff --git a/website/docs/r/networkfirewall_firewall.html.markdown b/website/docs/r/networkfirewall_firewall.html.markdown index ca93fdabb73..3fff8cc1329 100644 --- a/website/docs/r/networkfirewall_firewall.html.markdown +++ b/website/docs/r/networkfirewall_firewall.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Network Firewall Firewall Resource ## Example Usage -```hcl +```terraform resource "aws_networkfirewall_firewall" "example" { name = "example" firewall_policy_arn = aws_networkfirewall_firewall_policy.example.arn diff --git a/website/docs/r/networkfirewall_firewall_policy.html.markdown b/website/docs/r/networkfirewall_firewall_policy.html.markdown index ce8bb98fa3d..90bea139528 100644 --- a/website/docs/r/networkfirewall_firewall_policy.html.markdown +++ b/website/docs/r/networkfirewall_firewall_policy.html.markdown @@ -12,7 +12,7 @@ Provides an AWS Network Firewall Firewall Policy Resource ## Example Usage -```hcl +```terraform resource "aws_networkfirewall_firewall_policy" "example" { name = "example" @@ -34,7 +34,7 @@ resource "aws_networkfirewall_firewall_policy" "example" { ## Policy with a Custom Action for Stateless Inspection -```hcl +```terraform resource "aws_networkfirewall_firewall_policy" "test" { name = "example" diff --git a/website/docs/r/networkfirewall_logging_configuration.html.markdown b/website/docs/r/networkfirewall_logging_configuration.html.markdown index 84d2fcbe148..44b5d9f4d71 100644 --- a/website/docs/r/networkfirewall_logging_configuration.html.markdown +++ b/website/docs/r/networkfirewall_logging_configuration.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Network Firewall Logging Configuration Resource ### Logging to S3 -```hcl +```terraform resource "aws_networkfirewall_logging_configuration" "example" { firewall_arn = aws_networkfirewall_firewall.example.arn logging_configuration { @@ -32,7 +32,7 @@ resource "aws_networkfirewall_logging_configuration" "example" { ### Logging to CloudWatch -```hcl +```terraform resource "aws_networkfirewall_logging_configuration" "example" { firewall_arn = aws_networkfirewall_firewall.example.arn logging_configuration { @@ -49,7 +49,7 @@ resource "aws_networkfirewall_logging_configuration" "example" { ### Logging to Kinesis Data Firehose -```hcl +```terraform resource "aws_networkfirewall_logging_configuration" "example" { firewall_arn = aws_networkfirewall_firewall.example.arn logging_configuration { diff --git a/website/docs/r/networkfirewall_resource_policy.html.markdown b/website/docs/r/networkfirewall_resource_policy.html.markdown index ede3b3dfad0..e89a051f164 100644 --- a/website/docs/r/networkfirewall_resource_policy.html.markdown +++ b/website/docs/r/networkfirewall_resource_policy.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Network Firewall Resource Policy Resource for a rule group or fi ### For a Firewall Policy resource -```hcl +```terraform resource "aws_networkfirewall_resource_policy" "example" { resource_arn = aws_networkfirewall_firewall_policy.example.arn # policy's Action element must include all of the following operations @@ -39,7 +39,7 @@ resource "aws_networkfirewall_resource_policy" "example" { ### For a Rule Group resource -```hcl +```terraform resource "aws_networkfirewall_resource_policy" "example" { resource_arn = aws_networkfirewall_rule_group.example.arn # policy's Action element must include all of the following operations diff --git a/website/docs/r/networkfirewall_rule_group.html.markdown b/website/docs/r/networkfirewall_rule_group.html.markdown index ab078a5923f..ba0c1f74ace 100644 --- a/website/docs/r/networkfirewall_rule_group.html.markdown +++ b/website/docs/r/networkfirewall_rule_group.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Network Firewall Rule Group Resource ### Stateful Inspection for denying access to a domain -```hcl +```terraform resource "aws_networkfirewall_rule_group" "example" { capacity = 100 name = "example" @@ -38,7 +38,7 @@ resource "aws_networkfirewall_rule_group" "example" { ### Stateful Inspection for permitting packets from a source IP address -```hcl +```terraform resource "aws_networkfirewall_rule_group" "example" { capacity = 50 description = "Permits http traffic from source" @@ -78,7 +78,7 @@ locals { ### Stateful Inspection for blocking packets from going to an intended destination -```hcl +```terraform resource "aws_networkfirewall_rule_group" "example" { capacity = 100 name = "example" @@ -111,7 +111,7 @@ resource "aws_networkfirewall_rule_group" "example" { ### Stateful Inspection from rules specifications defined in Suricata flat format -```hcl +```terraform resource "aws_networkfirewall_rule_group" "example" { capacity = 100 name = "example" @@ -127,7 +127,7 @@ resource "aws_networkfirewall_rule_group" "example" { ### Stateless Inspection with a Custom Action -```hcl +```terraform resource "aws_networkfirewall_rule_group" "example" { description = "Stateless Rate Limiting Rule" capacity = 100 diff --git a/website/docs/r/opsworks_application.html.markdown b/website/docs/r/opsworks_application.html.markdown index aa3e4efb8c1..ea42ff62f0e 100644 --- a/website/docs/r/opsworks_application.html.markdown +++ b/website/docs/r/opsworks_application.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks application resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_application" "foo-app" { name = "foobar application" short_name = "foobar" diff --git a/website/docs/r/opsworks_custom_layer.html.markdown b/website/docs/r/opsworks_custom_layer.html.markdown index dbb46258c57..d54be4e1f34 100644 --- a/website/docs/r/opsworks_custom_layer.html.markdown +++ b/website/docs/r/opsworks_custom_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks custom layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_custom_layer" "custlayer" { name = "My Awesome Custom Layer" short_name = "awesome" diff --git a/website/docs/r/opsworks_ganglia_layer.html.markdown b/website/docs/r/opsworks_ganglia_layer.html.markdown index 830269d2322..458500badda 100644 --- a/website/docs/r/opsworks_ganglia_layer.html.markdown +++ b/website/docs/r/opsworks_ganglia_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks Ganglia layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_ganglia_layer" "monitor" { stack_id = aws_opsworks_stack.main.id password = "foobarbaz" diff --git a/website/docs/r/opsworks_haproxy_layer.html.markdown b/website/docs/r/opsworks_haproxy_layer.html.markdown index 157c8ded061..814f7ddaa3f 100644 --- a/website/docs/r/opsworks_haproxy_layer.html.markdown +++ b/website/docs/r/opsworks_haproxy_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks haproxy layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_haproxy_layer" "lb" { stack_id = aws_opsworks_stack.main.id stats_password = "foobarbaz" diff --git a/website/docs/r/opsworks_instance.html.markdown b/website/docs/r/opsworks_instance.html.markdown index 61d22039baa..b1482fe2949 100644 --- a/website/docs/r/opsworks_instance.html.markdown +++ b/website/docs/r/opsworks_instance.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks instance resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_instance" "my-instance" { stack_id = aws_opsworks_stack.main.id diff --git a/website/docs/r/opsworks_java_app_layer.html.markdown b/website/docs/r/opsworks_java_app_layer.html.markdown index 358ab3bc2ab..e457571c07d 100644 --- a/website/docs/r/opsworks_java_app_layer.html.markdown +++ b/website/docs/r/opsworks_java_app_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks Java application layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_java_app_layer" "app" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_memcached_layer.html.markdown b/website/docs/r/opsworks_memcached_layer.html.markdown index 9ef7e654005..57e11fa6b79 100644 --- a/website/docs/r/opsworks_memcached_layer.html.markdown +++ b/website/docs/r/opsworks_memcached_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks memcached layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_memcached_layer" "cache" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_mysql_layer.html.markdown b/website/docs/r/opsworks_mysql_layer.html.markdown index f8f7ccd4df3..c5ae74fcfb8 100644 --- a/website/docs/r/opsworks_mysql_layer.html.markdown +++ b/website/docs/r/opsworks_mysql_layer.html.markdown @@ -15,7 +15,7 @@ Provides an OpsWorks MySQL layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_mysql_layer" "db" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_nodejs_app_layer.html.markdown b/website/docs/r/opsworks_nodejs_app_layer.html.markdown index 763dd909dcd..ae9bf9bbb8a 100644 --- a/website/docs/r/opsworks_nodejs_app_layer.html.markdown +++ b/website/docs/r/opsworks_nodejs_app_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks NodeJS application layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_nodejs_app_layer" "app" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_permission.html.markdown b/website/docs/r/opsworks_permission.html.markdown index e44fddf6a3b..5f25da27ef6 100644 --- a/website/docs/r/opsworks_permission.html.markdown +++ b/website/docs/r/opsworks_permission.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks permission resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_permission" "my_stack_permission" { allow_ssh = true allow_sudo = true diff --git a/website/docs/r/opsworks_php_app_layer.html.markdown b/website/docs/r/opsworks_php_app_layer.html.markdown index bc97b8b8c64..9ff708edab7 100644 --- a/website/docs/r/opsworks_php_app_layer.html.markdown +++ b/website/docs/r/opsworks_php_app_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks PHP application layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_php_app_layer" "app" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_rails_app_layer.html.markdown b/website/docs/r/opsworks_rails_app_layer.html.markdown index e6e25a68a94..45d9986d967 100644 --- a/website/docs/r/opsworks_rails_app_layer.html.markdown +++ b/website/docs/r/opsworks_rails_app_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks Ruby on Rails application layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_rails_app_layer" "app" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_rds_db_instance.html.markdown b/website/docs/r/opsworks_rds_db_instance.html.markdown index b2a9d9e2ba7..5f97e4681d3 100644 --- a/website/docs/r/opsworks_rds_db_instance.html.markdown +++ b/website/docs/r/opsworks_rds_db_instance.html.markdown @@ -15,7 +15,7 @@ Provides an OpsWorks RDS DB Instance resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_rds_db_instance" "my_instance" { stack_id = aws_opsworks_stack.my_stack.id rds_db_instance_arn = aws_db_instance.my_instance.arn diff --git a/website/docs/r/opsworks_stack.html.markdown b/website/docs/r/opsworks_stack.html.markdown index ff7811f15f9..d3f7b5e1d3f 100644 --- a/website/docs/r/opsworks_stack.html.markdown +++ b/website/docs/r/opsworks_stack.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks stack resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_stack" "main" { name = "awesome-stack" region = "us-west-1" diff --git a/website/docs/r/opsworks_static_web_layer.html.markdown b/website/docs/r/opsworks_static_web_layer.html.markdown index b2bf8ea99d7..69ec3383903 100644 --- a/website/docs/r/opsworks_static_web_layer.html.markdown +++ b/website/docs/r/opsworks_static_web_layer.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks static web server layer resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_static_web_layer" "web" { stack_id = aws_opsworks_stack.main.id } diff --git a/website/docs/r/opsworks_user_profile.html.markdown b/website/docs/r/opsworks_user_profile.html.markdown index a573d53cbaa..2e8172cd04a 100644 --- a/website/docs/r/opsworks_user_profile.html.markdown +++ b/website/docs/r/opsworks_user_profile.html.markdown @@ -12,7 +12,7 @@ Provides an OpsWorks User Profile resource. ## Example Usage -```hcl +```terraform resource "aws_opsworks_user_profile" "my_profile" { user_arn = aws_iam_user.user.arn ssh_username = "my_user" diff --git a/website/docs/r/organizations_account.html.markdown b/website/docs/r/organizations_account.html.markdown index cc7edd97712..64923978fed 100644 --- a/website/docs/r/organizations_account.html.markdown +++ b/website/docs/r/organizations_account.html.markdown @@ -16,7 +16,7 @@ Provides a resource to create a member account in the current organization. ## Example Usage -```hcl +```terraform resource "aws_organizations_account" "account" { name = "my_new_account" email = "john@doe.org" @@ -51,7 +51,7 @@ $ terraform import aws_organizations_account.my_org 111111111111 Certain resource arguments, like `role_name`, do not have an Organizations API method for reading the information after account creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_organizations_account" "account" { name = "my_new_account" email = "john@doe.org" diff --git a/website/docs/r/organizations_organization.html.markdown b/website/docs/r/organizations_organization.html.markdown index 3a02b3b5b5f..6793b3d9ebe 100644 --- a/website/docs/r/organizations_organization.html.markdown +++ b/website/docs/r/organizations_organization.html.markdown @@ -14,7 +14,7 @@ Provides a resource to create an organization. ## Example Usage -```hcl +```terraform resource "aws_organizations_organization" "org" { aws_service_access_principals = [ "cloudtrail.amazonaws.com", diff --git a/website/docs/r/organizations_organizational_unit.html.markdown b/website/docs/r/organizations_organizational_unit.html.markdown index 39acb76ef7e..97f2d222258 100644 --- a/website/docs/r/organizations_organizational_unit.html.markdown +++ b/website/docs/r/organizations_organizational_unit.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create an organizational unit. ## Example Usage -```hcl +```terraform resource "aws_organizations_organizational_unit" "example" { name = "example" parent_id = aws_organizations_organization.example.roots[0].id diff --git a/website/docs/r/organizations_policy.html.markdown b/website/docs/r/organizations_policy.html.markdown index 284c98a1b41..8ed34e750ad 100644 --- a/website/docs/r/organizations_policy.html.markdown +++ b/website/docs/r/organizations_policy.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage an [AWS Organizations policy](https://docs.aws.ama ## Example Usage -```hcl +```terraform resource "aws_organizations_policy" "example" { name = "example" diff --git a/website/docs/r/organizations_policy_attachment.html.markdown b/website/docs/r/organizations_policy_attachment.html.markdown index f55a33fe7a8..d3fd7ca4499 100644 --- a/website/docs/r/organizations_policy_attachment.html.markdown +++ b/website/docs/r/organizations_policy_attachment.html.markdown @@ -14,7 +14,7 @@ Provides a resource to attach an AWS Organizations policy to an organization acc ### Organization Account -```hcl +```terraform resource "aws_organizations_policy_attachment" "account" { policy_id = aws_organizations_policy.example.id target_id = "123456789012" @@ -23,7 +23,7 @@ resource "aws_organizations_policy_attachment" "account" { ### Organization Root -```hcl +```terraform resource "aws_organizations_policy_attachment" "root" { policy_id = aws_organizations_policy.example.id target_id = aws_organizations_organization.example.roots[0].id @@ -32,7 +32,7 @@ resource "aws_organizations_policy_attachment" "root" { ### Organization Unit -```hcl +```terraform resource "aws_organizations_policy_attachment" "unit" { policy_id = aws_organizations_policy.example.id target_id = aws_organizations_organizational_unit.example.id diff --git a/website/docs/r/pinpoint_adm_channel.markdown b/website/docs/r/pinpoint_adm_channel.markdown index 2e93f991eea..c7dfe7b354a 100644 --- a/website/docs/r/pinpoint_adm_channel.markdown +++ b/website/docs/r/pinpoint_adm_channel.markdown @@ -16,7 +16,7 @@ Provides a Pinpoint ADM (Amazon Device Messaging) Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_app" "app" {} resource "aws_pinpoint_adm_channel" "channel" { diff --git a/website/docs/r/pinpoint_apns_channel.markdown b/website/docs/r/pinpoint_apns_channel.markdown index d9f5a013946..dd809cf855b 100644 --- a/website/docs/r/pinpoint_apns_channel.markdown +++ b/website/docs/r/pinpoint_apns_channel.markdown @@ -15,7 +15,7 @@ Provides a Pinpoint APNs Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_apns_channel" "apns" { application_id = aws_pinpoint_app.app.application_id diff --git a/website/docs/r/pinpoint_apns_sandbox_channel.markdown b/website/docs/r/pinpoint_apns_sandbox_channel.markdown index f11465e62a6..afb52dc4c67 100644 --- a/website/docs/r/pinpoint_apns_sandbox_channel.markdown +++ b/website/docs/r/pinpoint_apns_sandbox_channel.markdown @@ -15,7 +15,7 @@ Provides a Pinpoint APNs Sandbox Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_apns_sandbox_channel" "apns_sandbox" { application_id = aws_pinpoint_app.app.application_id diff --git a/website/docs/r/pinpoint_apns_voip_channel.markdown b/website/docs/r/pinpoint_apns_voip_channel.markdown index 4822fb1fae0..bbfd5f49be3 100644 --- a/website/docs/r/pinpoint_apns_voip_channel.markdown +++ b/website/docs/r/pinpoint_apns_voip_channel.markdown @@ -15,7 +15,7 @@ Provides a Pinpoint APNs VoIP Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_apns_voip_channel" "apns_voip" { application_id = aws_pinpoint_app.app.application_id diff --git a/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown b/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown index 308dd0812ea..c6b45c0b64a 100644 --- a/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown +++ b/website/docs/r/pinpoint_apns_voip_sandbox_channel.markdown @@ -15,7 +15,7 @@ Provides a Pinpoint APNs VoIP Sandbox Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_apns_voip_sandbox_channel" "apns_voip_sandbox" { application_id = aws_pinpoint_app.app.application_id diff --git a/website/docs/r/pinpoint_app.markdown b/website/docs/r/pinpoint_app.markdown index 969205f58de..3be04d6dbb1 100644 --- a/website/docs/r/pinpoint_app.markdown +++ b/website/docs/r/pinpoint_app.markdown @@ -12,7 +12,7 @@ Provides a Pinpoint App resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_app" "example" { name = "test-app" diff --git a/website/docs/r/pinpoint_baidu_channel.markdown b/website/docs/r/pinpoint_baidu_channel.markdown index cbe3767c647..ee6644230ac 100644 --- a/website/docs/r/pinpoint_baidu_channel.markdown +++ b/website/docs/r/pinpoint_baidu_channel.markdown @@ -16,7 +16,7 @@ Provides a Pinpoint Baidu Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_app" "app" {} resource "aws_pinpoint_baidu_channel" "channel" { diff --git a/website/docs/r/pinpoint_email_channel.markdown b/website/docs/r/pinpoint_email_channel.markdown index 3cc7404b2b8..098463de06b 100644 --- a/website/docs/r/pinpoint_email_channel.markdown +++ b/website/docs/r/pinpoint_email_channel.markdown @@ -12,7 +12,7 @@ Provides a Pinpoint Email Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_email_channel" "email" { application_id = aws_pinpoint_app.app.application_id from_address = "user@example.com" diff --git a/website/docs/r/pinpoint_event_stream.markdown b/website/docs/r/pinpoint_event_stream.markdown index 740929f7dc8..7b99c41d3b1 100644 --- a/website/docs/r/pinpoint_event_stream.markdown +++ b/website/docs/r/pinpoint_event_stream.markdown @@ -12,7 +12,7 @@ Provides a Pinpoint Event Stream resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_event_stream" "stream" { application_id = aws_pinpoint_app.app.application_id destination_stream_arn = aws_kinesis_stream.test_stream.arn diff --git a/website/docs/r/pinpoint_gcm_channel.markdown b/website/docs/r/pinpoint_gcm_channel.markdown index 72adcda5205..481efb28bdc 100644 --- a/website/docs/r/pinpoint_gcm_channel.markdown +++ b/website/docs/r/pinpoint_gcm_channel.markdown @@ -15,7 +15,7 @@ Provides a Pinpoint GCM Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_gcm_channel" "gcm" { application_id = aws_pinpoint_app.app.application_id api_key = "api_key" diff --git a/website/docs/r/pinpoint_sms_channel.markdown b/website/docs/r/pinpoint_sms_channel.markdown index b7e3ea4efaf..b6a99c69c9b 100644 --- a/website/docs/r/pinpoint_sms_channel.markdown +++ b/website/docs/r/pinpoint_sms_channel.markdown @@ -12,7 +12,7 @@ Provides a Pinpoint SMS Channel resource. ## Example Usage -```hcl +```terraform resource "aws_pinpoint_sms_channel" "sms" { application_id = aws_pinpoint_app.app.application_id } diff --git a/website/docs/r/placement_group.html.markdown b/website/docs/r/placement_group.html.markdown index 3c3380c05f3..495b73c2872 100644 --- a/website/docs/r/placement_group.html.markdown +++ b/website/docs/r/placement_group.html.markdown @@ -13,7 +13,7 @@ in [AWS Docs](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-grou ## Example Usage -```hcl +```terraform resource "aws_placement_group" "web" { name = "hunky-dory-pg" strategy = "cluster" diff --git a/website/docs/r/prometheus_workspace.html.markdown b/website/docs/r/prometheus_workspace.html.markdown index 79e16ddc98f..1288aef852e 100644 --- a/website/docs/r/prometheus_workspace.html.markdown +++ b/website/docs/r/prometheus_workspace.html.markdown @@ -14,7 +14,7 @@ Manages an Amazon Managed Service for Prometheus (AMP) Workspace. ## Example Usage -```hcl +```terraform resource "aws_prometheus_workspace" "demo" { alias = "prometheus-test" } diff --git a/website/docs/r/proxy_protocol_policy.html.markdown b/website/docs/r/proxy_protocol_policy.html.markdown index 45b6828ccec..b38a2c6e3bd 100644 --- a/website/docs/r/proxy_protocol_policy.html.markdown +++ b/website/docs/r/proxy_protocol_policy.html.markdown @@ -12,7 +12,7 @@ Provides a proxy protocol policy, which allows an ELB to carry a client connecti ## Example Usage -```hcl +```terraform resource "aws_elb" "lb" { name = "test-lb" availability_zones = ["us-east-1a"] diff --git a/website/docs/r/qldb_ledger.html.markdown b/website/docs/r/qldb_ledger.html.markdown index c5c92da4a78..8ed920a6837 100644 --- a/website/docs/r/qldb_ledger.html.markdown +++ b/website/docs/r/qldb_ledger.html.markdown @@ -14,7 +14,7 @@ Provides an AWS Quantum Ledger Database (QLDB) resource ## Example Usage -```hcl +```terraform resource "aws_qldb_ledger" "sample-ledger" { name = "sample-ledger" } diff --git a/website/docs/r/quicksight_group.html.markdown b/website/docs/r/quicksight_group.html.markdown index 580d6585486..f3b9cc8bc83 100644 --- a/website/docs/r/quicksight_group.html.markdown +++ b/website/docs/r/quicksight_group.html.markdown @@ -12,7 +12,7 @@ Resource for managing QuickSight Group ## Example Usage -```hcl +```terraform resource "aws_quicksight_group" "example" { group_name = "tf-example" } diff --git a/website/docs/r/quicksight_user.html.markdown b/website/docs/r/quicksight_user.html.markdown index f3be62bc1c1..117a4134e77 100644 --- a/website/docs/r/quicksight_user.html.markdown +++ b/website/docs/r/quicksight_user.html.markdown @@ -12,7 +12,7 @@ Resource for managing QuickSight User ## Example Usage -```hcl +```terraform resource "aws_quicksight_user" "example" { user_name = "an-author" email = "author@example.com" diff --git a/website/docs/r/ram_principal_association.markdown b/website/docs/r/ram_principal_association.markdown index 1b36d4d3043..ff0633ff1d0 100644 --- a/website/docs/r/ram_principal_association.markdown +++ b/website/docs/r/ram_principal_association.markdown @@ -24,7 +24,7 @@ When RAM Sharing with AWS Organizations is not enabled: ### AWS Account ID -```hcl +```terraform resource "aws_ram_resource_share" "example" { # ... other configuration ... allow_external_principals = true @@ -38,7 +38,7 @@ resource "aws_ram_principal_association" "example" { ### AWS Organization -```hcl +```terraform resource "aws_ram_principal_association" "example" { principal = aws_organizations_organization.example.arn resource_share_arn = aws_ram_resource_share.example.arn diff --git a/website/docs/r/ram_resource_association.html.markdown b/website/docs/r/ram_resource_association.html.markdown index 71c09163065..126428dbcb5 100644 --- a/website/docs/r/ram_resource_association.html.markdown +++ b/website/docs/r/ram_resource_association.html.markdown @@ -14,7 +14,7 @@ Manages a Resource Access Manager (RAM) Resource Association. ## Example Usage -```hcl +```terraform resource "aws_ram_resource_association" "example" { resource_arn = aws_subnet.example.arn resource_share_arn = aws_ram_resource_share.example.arn diff --git a/website/docs/r/ram_resource_share.markdown b/website/docs/r/ram_resource_share.markdown index 7eca5a62de1..2e7c95021d6 100644 --- a/website/docs/r/ram_resource_share.markdown +++ b/website/docs/r/ram_resource_share.markdown @@ -12,7 +12,7 @@ Manages a Resource Access Manager (RAM) Resource Share. To associate principals ## Example Usage -```hcl +```terraform resource "aws_ram_resource_share" "example" { name = "example" allow_external_principals = true diff --git a/website/docs/r/ram_resource_share_accepter.markdown b/website/docs/r/ram_resource_share_accepter.markdown index d8895f7933f..d89d797b277 100644 --- a/website/docs/r/ram_resource_share_accepter.markdown +++ b/website/docs/r/ram_resource_share_accepter.markdown @@ -16,7 +16,7 @@ Manage accepting a Resource Access Manager (RAM) Resource Share invitation. From This configuration provides an example of using multiple Terraform AWS providers to configure two different AWS accounts. In the _sender_ account, the configuration creates a `aws_ram_resource_share` and uses a data source in the _receiver_ account to create a `aws_ram_principal_association` resource with the _receiver's_ account ID. In the _receiver_ account, the configuration accepts the invitation to share resources with the `aws_ram_resource_share_accepter`. -```hcl +```terraform provider "aws" { profile = "profile2" } diff --git a/website/docs/r/rds_cluster.html.markdown b/website/docs/r/rds_cluster.html.markdown index 165097e739e..678a43c70b5 100644 --- a/website/docs/r/rds_cluster.html.markdown +++ b/website/docs/r/rds_cluster.html.markdown @@ -32,7 +32,7 @@ for more information. ### Aurora MySQL 2.x (MySQL 5.7) -```hcl +```terraform resource "aws_rds_cluster" "default" { cluster_identifier = "aurora-cluster-demo" engine = "aurora-mysql" @@ -48,7 +48,7 @@ resource "aws_rds_cluster" "default" { ### Aurora MySQL 1.x (MySQL 5.6) -```hcl +```terraform resource "aws_rds_cluster" "default" { cluster_identifier = "aurora-cluster-demo" availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] @@ -62,7 +62,7 @@ resource "aws_rds_cluster" "default" { ### Aurora with PostgreSQL engine -```hcl +```terraform resource "aws_rds_cluster" "postgresql" { cluster_identifier = "aurora-cluster-demo" engine = "aurora-postgresql" @@ -79,7 +79,7 @@ resource "aws_rds_cluster" "postgresql" { -> More information about Aurora Multi-Master Clusters can be found in the [RDS User Guide](https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html). -```hcl +```terraform resource "aws_rds_cluster" "example" { cluster_identifier = "example" db_subnet_group_name = aws_db_subnet_group.example.name @@ -140,7 +140,7 @@ Full details on the core parameters and impacts are in the API Docs: [RestoreDBC ~> **NOTE:** RDS Aurora Serverless does not support loading data from S3, so its not possible to directly use `engine_mode` set to `serverless` with `s3_import`. -```hcl +```terraform resource "aws_rds_cluster" "db" { engine = "aurora" @@ -168,7 +168,7 @@ This will not recreate the resource if the S3 object changes in some way. It's o Example: -```hcl +```terraform resource "aws_rds_cluster" "example-clone" { # ... other configuration ... @@ -192,7 +192,7 @@ resource "aws_rds_cluster" "example-clone" { Example: -```hcl +```terraform resource "aws_rds_cluster" "example" { # ... other configuration ... diff --git a/website/docs/r/rds_cluster_endpoint.html.markdown b/website/docs/r/rds_cluster_endpoint.html.markdown index 5c1121fe1b8..dd9c5707527 100644 --- a/website/docs/r/rds_cluster_endpoint.html.markdown +++ b/website/docs/r/rds_cluster_endpoint.html.markdown @@ -14,7 +14,7 @@ You can refer to the [User Guide][1]. ## Example Usage -```hcl +```terraform resource "aws_rds_cluster" "default" { cluster_identifier = "aurora-cluster-demo" availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] diff --git a/website/docs/r/rds_cluster_instance.html.markdown b/website/docs/r/rds_cluster_instance.html.markdown index 0c81f2b7b25..02d14991bd7 100644 --- a/website/docs/r/rds_cluster_instance.html.markdown +++ b/website/docs/r/rds_cluster_instance.html.markdown @@ -25,7 +25,7 @@ For more information on Amazon Aurora, see [Aurora on Amazon RDS][2] in the Amaz ## Example Usage -```hcl +```terraform resource "aws_rds_cluster_instance" "cluster_instances" { count = 2 identifier = "aurora-cluster-demo-${count.index}" diff --git a/website/docs/r/rds_cluster_parameter_group.markdown b/website/docs/r/rds_cluster_parameter_group.markdown index d19afdc698c..6e76b4bbcd8 100644 --- a/website/docs/r/rds_cluster_parameter_group.markdown +++ b/website/docs/r/rds_cluster_parameter_group.markdown @@ -15,7 +15,7 @@ Provides an RDS DB cluster parameter group resource. Documentation of the availa ## Example Usage -```hcl +```terraform resource "aws_rds_cluster_parameter_group" "default" { name = "rds-cluster-pg" family = "aurora5.6" diff --git a/website/docs/r/rds_global_cluster.html.markdown b/website/docs/r/rds_global_cluster.html.markdown index de76a8e4327..1dcf1ff03e5 100644 --- a/website/docs/r/rds_global_cluster.html.markdown +++ b/website/docs/r/rds_global_cluster.html.markdown @@ -16,7 +16,7 @@ More information about Aurora global databases can be found in the [Aurora User ### New Global Cluster -```hcl +```terraform provider "aws" { alias = "primary" region = "us-east-2" @@ -65,7 +65,7 @@ resource "aws_rds_cluster_instance" "secondary" { ### New Global Cluster From Existing DB Cluster -```hcl +```terraform resource "aws_rds_cluster" "example" { # ... other configuration ... @@ -123,7 +123,7 @@ Certain resource arguments, like `force_destroy`, only exist within Terraform. I Certain resource arguments, like `source_db_cluster_identifier`, do not have an API method for reading the information after creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_rds_global_cluster" "example" { # ... other configuration ... diff --git a/website/docs/r/redshift_cluster.html.markdown b/website/docs/r/redshift_cluster.html.markdown index e46ad1e4644..026510da8ab 100644 --- a/website/docs/r/redshift_cluster.html.markdown +++ b/website/docs/r/redshift_cluster.html.markdown @@ -15,7 +15,7 @@ Provides a Redshift Cluster Resource. ## Example Usage -```hcl +```terraform resource "aws_redshift_cluster" "default" { cluster_identifier = "tf-redshift-cluster" database_name = "mydb" diff --git a/website/docs/r/redshift_event_subscription.html.markdown b/website/docs/r/redshift_event_subscription.html.markdown index 8395bda963b..80e2fd5f071 100644 --- a/website/docs/r/redshift_event_subscription.html.markdown +++ b/website/docs/r/redshift_event_subscription.html.markdown @@ -12,7 +12,7 @@ Provides a Redshift event subscription resource. ## Example Usage -```hcl +```terraform resource "aws_redshift_cluster" "default" { cluster_identifier = "default" database_name = "default" diff --git a/website/docs/r/redshift_parameter_group.html.markdown b/website/docs/r/redshift_parameter_group.html.markdown index 4b09c3fe3d5..bb32df9f8ba 100644 --- a/website/docs/r/redshift_parameter_group.html.markdown +++ b/website/docs/r/redshift_parameter_group.html.markdown @@ -12,7 +12,7 @@ Provides a Redshift Cluster parameter group resource. ## Example Usage -```hcl +```terraform resource "aws_redshift_parameter_group" "bar" { name = "parameter-group-test-terraform" family = "redshift-1.0" diff --git a/website/docs/r/redshift_security_group.html.markdown b/website/docs/r/redshift_security_group.html.markdown index 86916648998..8c3ec47afee 100644 --- a/website/docs/r/redshift_security_group.html.markdown +++ b/website/docs/r/redshift_security_group.html.markdown @@ -12,7 +12,7 @@ Creates a new Amazon Redshift security group. You use security groups to control ## Example Usage -```hcl +```terraform resource "aws_redshift_security_group" "default" { name = "redshift-sg" diff --git a/website/docs/r/redshift_snapshot_copy_grant.html.markdown b/website/docs/r/redshift_snapshot_copy_grant.html.markdown index 09a6242ea14..91cf613b958 100644 --- a/website/docs/r/redshift_snapshot_copy_grant.html.markdown +++ b/website/docs/r/redshift_snapshot_copy_grant.html.markdown @@ -14,7 +14,7 @@ Note that the grant must exist in the destination region, and not in the region ## Example Usage -```hcl +```terraform resource "aws_redshift_snapshot_copy_grant" "test" { snapshot_copy_grant_name = "my-grant" } diff --git a/website/docs/r/redshift_snapshot_schedule.html.markdown b/website/docs/r/redshift_snapshot_schedule.html.markdown index 476b40d978c..e69fdd14dde 100644 --- a/website/docs/r/redshift_snapshot_schedule.html.markdown +++ b/website/docs/r/redshift_snapshot_schedule.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_redshift_snapshot_schedule" "default" { identifier = "tf-redshift-snapshot-schedule" definitions = [ diff --git a/website/docs/r/redshift_snapshot_schedule_association.html.markdown b/website/docs/r/redshift_snapshot_schedule_association.html.markdown index 601d6162dfb..952888df4d7 100644 --- a/website/docs/r/redshift_snapshot_schedule_association.html.markdown +++ b/website/docs/r/redshift_snapshot_schedule_association.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_redshift_cluster" "default" { cluster_identifier = "tf-redshift-cluster" database_name = "mydb" diff --git a/website/docs/r/redshift_subnet_group.html.markdown b/website/docs/r/redshift_subnet_group.html.markdown index 930e4751882..1f42bd6db52 100644 --- a/website/docs/r/redshift_subnet_group.html.markdown +++ b/website/docs/r/redshift_subnet_group.html.markdown @@ -12,7 +12,7 @@ Creates a new Amazon Redshift subnet group. You must provide a list of one or mo ## Example Usage -```hcl +```terraform resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" } diff --git a/website/docs/r/resourcegroups_group.html.markdown b/website/docs/r/resourcegroups_group.html.markdown index 5d81066ffbd..ed0fbfa8db4 100644 --- a/website/docs/r/resourcegroups_group.html.markdown +++ b/website/docs/r/resourcegroups_group.html.markdown @@ -12,7 +12,7 @@ Provides a Resource Group. ## Example Usage -```hcl +```terraform resource "aws_resourcegroups_group" "test" { name = "test-group" diff --git a/website/docs/r/route.html.markdown b/website/docs/r/route.html.markdown index 4dc66df7bb7..d15cb644372 100644 --- a/website/docs/r/route.html.markdown +++ b/website/docs/r/route.html.markdown @@ -18,7 +18,7 @@ a conflict of rule settings and will overwrite rules. ## Example Usage -```hcl +```terraform resource "aws_route" "r" { route_table_id = "rtb-4fbb3ac4" destination_cidr_block = "10.0.1.0/22" @@ -29,7 +29,7 @@ resource "aws_route" "r" { ## Example IPv6 Usage -```hcl +```terraform resource "aws_vpc" "vpc" { cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true diff --git a/website/docs/r/route53_delegation_set.html.markdown b/website/docs/r/route53_delegation_set.html.markdown index 1a405692bcb..374524db6a5 100644 --- a/website/docs/r/route53_delegation_set.html.markdown +++ b/website/docs/r/route53_delegation_set.html.markdown @@ -12,7 +12,7 @@ Provides a [Route53 Delegation Set](https://docs.aws.amazon.com/Route53/latest/A ## Example Usage -```hcl +```terraform resource "aws_route53_delegation_set" "main" { reference_name = "DynDNS" } diff --git a/website/docs/r/route53_health_check.html.markdown b/website/docs/r/route53_health_check.html.markdown index 78546e28ca8..00e686bf9a0 100644 --- a/website/docs/r/route53_health_check.html.markdown +++ b/website/docs/r/route53_health_check.html.markdown @@ -13,7 +13,7 @@ Provides a Route53 health check. ### Connectivity and HTTP Status Code Check -```hcl +```terraform resource "aws_route53_health_check" "example" { fqdn = "example.com" port = 80 @@ -30,7 +30,7 @@ resource "aws_route53_health_check" "example" { ### Connectivity and String Matching Check -```hcl +```terraform resource "aws_route53_health_check" "example" { failure_threshold = "5" fqdn = "example.com" @@ -44,7 +44,7 @@ resource "aws_route53_health_check" "example" { ### Aggregate Check -```hcl +```terraform resource "aws_route53_health_check" "parent" { type = "CALCULATED" child_health_threshold = 1 @@ -58,7 +58,7 @@ resource "aws_route53_health_check" "parent" { ### CloudWatch Alarm Check -```hcl +```terraform resource "aws_cloudwatch_metric_alarm" "foobar" { alarm_name = "terraform-test-foobar5" comparison_operator = "GreaterThanOrEqualToThreshold" diff --git a/website/docs/r/route53_hosted_zone_dnssec.html.markdown b/website/docs/r/route53_hosted_zone_dnssec.html.markdown index ae35fca4b0f..17a6bc4eaf7 100644 --- a/website/docs/r/route53_hosted_zone_dnssec.html.markdown +++ b/website/docs/r/route53_hosted_zone_dnssec.html.markdown @@ -12,7 +12,7 @@ Manages Route 53 Hosted Zone Domain Name System Security Extensions (DNSSEC). Fo ## Example Usage -```hcl +```terraform provider "aws" { region = "us-east-1" } diff --git a/website/docs/r/route53_key_signing_key.html.markdown b/website/docs/r/route53_key_signing_key.html.markdown index c61c74063c4..2f16effa492 100644 --- a/website/docs/r/route53_key_signing_key.html.markdown +++ b/website/docs/r/route53_key_signing_key.html.markdown @@ -12,7 +12,7 @@ Manages a Route 53 Key Signing Key. To manage Domain Name System Security Extens ## Example Usage -```hcl +```terraform provider "aws" { region = "us-east-1" } diff --git a/website/docs/r/route53_query_log.html.markdown b/website/docs/r/route53_query_log.html.markdown index 9e20e531b84..e3c7c1ad46c 100644 --- a/website/docs/r/route53_query_log.html.markdown +++ b/website/docs/r/route53_query_log.html.markdown @@ -18,7 +18,7 @@ See [Configuring Logging for DNS Queries](https://docs.aws.amazon.com/Route53/la ## Example Usage -```hcl +```terraform # Example CloudWatch log group in us-east-1 provider "aws" { diff --git a/website/docs/r/route53_record.html.markdown b/website/docs/r/route53_record.html.markdown index 5d0fd3eb5ca..b65b1eba708 100644 --- a/website/docs/r/route53_record.html.markdown +++ b/website/docs/r/route53_record.html.markdown @@ -14,7 +14,7 @@ Provides a Route53 record resource. ### Simple routing policy -```hcl +```terraform resource "aws_route53_record" "www" { zone_id = aws_route53_zone.primary.zone_id name = "www.example.com" @@ -27,7 +27,7 @@ resource "aws_route53_record" "www" { ### Weighted routing policy Other routing policies are configured similarly. See [AWS Route53 Developer Guide](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-policy.html) for details. -```hcl +```terraform resource "aws_route53_record" "www-dev" { zone_id = aws_route53_zone.primary.zone_id name = "www" @@ -64,7 +64,7 @@ to understand differences between alias and non-alias records. TTL for all alias records is [60 seconds](https://aws.amazon.com/route53/faqs/#dns_failover_do_i_need_to_adjust), you cannot change this, therefore `ttl` has to be omitted in alias records. -```hcl +```terraform resource "aws_elb" "main" { name = "foobar-terraform-elb" availability_zones = ["us-east-1c"] @@ -94,7 +94,7 @@ resource "aws_route53_record" "www" { When creating Route 53 zones, the `NS` and `SOA` records for the zone are automatically created. Enabling the `allow_overwrite` argument will allow managing these records in a single Terraform run without the requirement for `terraform import`. -```hcl +```terraform resource "aws_route53_zone" "example" { name = "test.example.com" } diff --git a/website/docs/r/route53_resolver_dnssec_config.html.markdown b/website/docs/r/route53_resolver_dnssec_config.html.markdown index 326efa867f0..2dcf9ba1655 100644 --- a/website/docs/r/route53_resolver_dnssec_config.html.markdown +++ b/website/docs/r/route53_resolver_dnssec_config.html.markdown @@ -12,7 +12,7 @@ Provides a Route 53 Resolver DNSSEC config resource. ## Example Usage -```hcl +```terraform resource "aws_vpc" "example" { cidr_block = "10.0.0.0/16" enable_dns_support = true diff --git a/website/docs/r/route53_resolver_endpoint.html.markdown b/website/docs/r/route53_resolver_endpoint.html.markdown index 5c6dd617aed..85070935485 100644 --- a/website/docs/r/route53_resolver_endpoint.html.markdown +++ b/website/docs/r/route53_resolver_endpoint.html.markdown @@ -12,7 +12,7 @@ Provides a Route 53 Resolver endpoint resource. ## Example Usage -```hcl +```terraform resource "aws_route53_resolver_endpoint" "foo" { name = "foo" direction = "INBOUND" diff --git a/website/docs/r/route53_resolver_query_log_config.html.markdown b/website/docs/r/route53_resolver_query_log_config.html.markdown index 5070a4e5868..1c994e97490 100644 --- a/website/docs/r/route53_resolver_query_log_config.html.markdown +++ b/website/docs/r/route53_resolver_query_log_config.html.markdown @@ -12,7 +12,7 @@ Provides a Route 53 Resolver query logging configuration resource. ## Example Usage -```hcl +```terraform resource "aws_route53_resolver_query_log_config" "example" { name = "example" destination_arn = aws_s3_bucket.example.arn diff --git a/website/docs/r/route53_resolver_query_log_config_association.html.markdown b/website/docs/r/route53_resolver_query_log_config_association.html.markdown index de8b338bc5e..7a9cbc40e94 100644 --- a/website/docs/r/route53_resolver_query_log_config_association.html.markdown +++ b/website/docs/r/route53_resolver_query_log_config_association.html.markdown @@ -12,7 +12,7 @@ Provides a Route 53 Resolver query logging configuration association resource. ## Example Usage -```hcl +```terraform resource "aws_route53_resolver_query_log_config_association" "example" { resolver_query_log_config_id = aws_route53_resolver_query_log_config.example.id resource_id = aws_vpc.example.id diff --git a/website/docs/r/route53_resolver_rule.html.markdown b/website/docs/r/route53_resolver_rule.html.markdown index d5594f5db0d..7da51bd4378 100644 --- a/website/docs/r/route53_resolver_rule.html.markdown +++ b/website/docs/r/route53_resolver_rule.html.markdown @@ -14,7 +14,7 @@ Provides a Route53 Resolver rule. ### System rule -```hcl +```terraform resource "aws_route53_resolver_rule" "sys" { domain_name = "subdomain.example.com" rule_type = "SYSTEM" @@ -23,7 +23,7 @@ resource "aws_route53_resolver_rule" "sys" { ### Forward rule -```hcl +```terraform resource "aws_route53_resolver_rule" "fwd" { domain_name = "example.com" name = "example" diff --git a/website/docs/r/route53_resolver_rule_association.html.markdown b/website/docs/r/route53_resolver_rule_association.html.markdown index 3435b89e018..67e118ddb61 100644 --- a/website/docs/r/route53_resolver_rule_association.html.markdown +++ b/website/docs/r/route53_resolver_rule_association.html.markdown @@ -12,7 +12,7 @@ Provides a Route53 Resolver rule association. ## Example Usage -```hcl +```terraform resource "aws_route53_resolver_rule_association" "example" { resolver_rule_id = aws_route53_resolver_rule.sys.id vpc_id = aws_vpc.foo.id diff --git a/website/docs/r/route53_vpc_association_authorization.html.markdown b/website/docs/r/route53_vpc_association_authorization.html.markdown index 9d346432522..f762dd13255 100644 --- a/website/docs/r/route53_vpc_association_authorization.html.markdown +++ b/website/docs/r/route53_vpc_association_authorization.html.markdown @@ -12,7 +12,7 @@ Authorizes a VPC in a peer account to be associated with a local Route53 Hosted ## Example Usage -```hcl +```terraform provider "aws" { } diff --git a/website/docs/r/route53_zone.html.markdown b/website/docs/r/route53_zone.html.markdown index 1b1e2690cf6..8f6b9ee48a9 100644 --- a/website/docs/r/route53_zone.html.markdown +++ b/website/docs/r/route53_zone.html.markdown @@ -14,7 +14,7 @@ Manages a Route53 Hosted Zone. For managing Domain Name System Security Extensio ### Public Zone -```hcl +```terraform resource "aws_route53_zone" "primary" { name = "example.com" } @@ -26,7 +26,7 @@ For use in subdomains, note that you need to create a `aws_route53_record` of type `NS` as well as the subdomain zone. -```hcl +```terraform resource "aws_route53_zone" "main" { name = "example.com" } @@ -54,7 +54,7 @@ resource "aws_route53_record" "dev-ns" { ~> **NOTE:** Private zones require at least one VPC association at all times. -```hcl +```terraform resource "aws_route53_zone" "private" { name = "example.com" diff --git a/website/docs/r/route53_zone_association.html.markdown b/website/docs/r/route53_zone_association.html.markdown index c39fef313eb..b93039a8c3d 100644 --- a/website/docs/r/route53_zone_association.html.markdown +++ b/website/docs/r/route53_zone_association.html.markdown @@ -16,7 +16,7 @@ Manages a Route53 Hosted Zone VPC association. VPC associations can only be made ## Example Usage -```hcl +```terraform resource "aws_vpc" "primary" { cidr_block = "10.6.0.0/16" enable_dns_hostnames = true diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index a3c4e945aa4..06e9d9b3492 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -31,7 +31,7 @@ the separate resource. ## Example Usage -```hcl +```terraform resource "aws_route_table" "r" { vpc_id = aws_vpc.default.id diff --git a/website/docs/r/route_table_association.html.markdown b/website/docs/r/route_table_association.html.markdown index ac6b1f27417..47f0c481409 100644 --- a/website/docs/r/route_table_association.html.markdown +++ b/website/docs/r/route_table_association.html.markdown @@ -13,14 +13,14 @@ internet gateway or virtual private gateway. ## Example Usage -```hcl +```terraform resource "aws_route_table_association" "a" { subnet_id = aws_subnet.foo.id route_table_id = aws_route_table.bar.id } ``` -```hcl +```terraform resource "aws_route_table_association" "b" { gateway_id = aws_internet_gateway.foo.id route_table_id = aws_route_table.bar.id diff --git a/website/docs/r/s3_access_point.html.markdown b/website/docs/r/s3_access_point.html.markdown index 555a222dcc4..6bec98c9920 100644 --- a/website/docs/r/s3_access_point.html.markdown +++ b/website/docs/r/s3_access_point.html.markdown @@ -16,7 +16,7 @@ Provides a resource to manage an S3 Access Point. ### AWS Partition Bucket -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } @@ -29,7 +29,7 @@ resource "aws_s3_access_point" "example" { ### S3 on Outposts Bucket -```hcl +```terraform resource "aws_s3control_bucket" "example" { bucket = "example" } diff --git a/website/docs/r/s3_account_public_access_block.html.markdown b/website/docs/r/s3_account_public_access_block.html.markdown index 87c883b616f..8e0065ca9cc 100644 --- a/website/docs/r/s3_account_public_access_block.html.markdown +++ b/website/docs/r/s3_account_public_access_block.html.markdown @@ -16,7 +16,7 @@ Manages S3 account-level Public Access Block configuration. For more information ## Example Usage -```hcl +```terraform resource "aws_s3_account_public_access_block" "example" { block_public_acls = true block_public_policy = true diff --git a/website/docs/r/s3_bucket.html.markdown b/website/docs/r/s3_bucket.html.markdown index ae1f785c637..b9e5a7dab68 100644 --- a/website/docs/r/s3_bucket.html.markdown +++ b/website/docs/r/s3_bucket.html.markdown @@ -16,7 +16,7 @@ Provides a S3 bucket resource. ### Private Bucket w/ Tags -```hcl +```terraform resource "aws_s3_bucket" "b" { bucket = "my-tf-test-bucket" acl = "private" @@ -30,7 +30,7 @@ resource "aws_s3_bucket" "b" { ### Static Website Hosting -```hcl +```terraform resource "aws_s3_bucket" "b" { bucket = "s3-website-test.hashicorp.com" acl = "public-read" @@ -56,7 +56,7 @@ EOF ### Using CORS -```hcl +```terraform resource "aws_s3_bucket" "b" { bucket = "s3-website-test.hashicorp.com" acl = "public-read" @@ -73,7 +73,7 @@ resource "aws_s3_bucket" "b" { ### Using versioning -```hcl +```terraform resource "aws_s3_bucket" "b" { bucket = "my-tf-test-bucket" acl = "private" @@ -86,7 +86,7 @@ resource "aws_s3_bucket" "b" { ### Enable Logging -```hcl +```terraform resource "aws_s3_bucket" "log_bucket" { bucket = "my-tf-log-bucket" acl = "log-delivery-write" @@ -105,7 +105,7 @@ resource "aws_s3_bucket" "b" { ### Using object lifecycle -```hcl +```terraform resource "aws_s3_bucket" "bucket" { bucket = "my-bucket" acl = "private" @@ -178,7 +178,7 @@ resource "aws_s3_bucket" "versioning_bucket" { ### Using replication configuration -```hcl +```terraform provider "aws" { region = "eu-west-1" } @@ -289,7 +289,7 @@ resource "aws_s3_bucket" "bucket" { ### Enable Default Server Side Encryption -```hcl +```terraform resource "aws_kms_key" "mykey" { description = "This key is used to encrypt bucket objects" deletion_window_in_days = 10 @@ -311,7 +311,7 @@ resource "aws_s3_bucket" "mybucket" { ### Using ACL policy grants -```hcl +```terraform data "aws_canonical_user_id" "current_user" {} resource "aws_s3_bucket" "bucket" { diff --git a/website/docs/r/s3_bucket_analytics_configuration.html.markdown b/website/docs/r/s3_bucket_analytics_configuration.html.markdown index 81820a70bc9..73ccb431c85 100644 --- a/website/docs/r/s3_bucket_analytics_configuration.html.markdown +++ b/website/docs/r/s3_bucket_analytics_configuration.html.markdown @@ -14,7 +14,7 @@ Provides a S3 bucket [analytics configuration](https://docs.aws.amazon.com/Amazo ### Add analytics configuration for entire S3 bucket and export results to a second S3 bucket -```hcl +```terraform resource "aws_s3_bucket_analytics_configuration" "example-entire-bucket" { bucket = aws_s3_bucket.example.bucket name = "EntireBucket" @@ -41,7 +41,7 @@ resource "aws_s3_bucket" "analytics" { ### Add analytics configuration with S3 bucket object filter -```hcl +```terraform resource "aws_s3_bucket_analytics_configuration" "example-filtered" { bucket = aws_s3_bucket.example.bucket name = "ImportantBlueDocuments" diff --git a/website/docs/r/s3_bucket_inventory.html.markdown b/website/docs/r/s3_bucket_inventory.html.markdown index 02e99e8bab9..288f4115d26 100644 --- a/website/docs/r/s3_bucket_inventory.html.markdown +++ b/website/docs/r/s3_bucket_inventory.html.markdown @@ -14,7 +14,7 @@ Provides a S3 bucket [inventory configuration](https://docs.aws.amazon.com/Amazo ### Add inventory configuration -```hcl +```terraform resource "aws_s3_bucket" "test" { bucket = "my-tf-test-bucket" } @@ -44,7 +44,7 @@ resource "aws_s3_bucket_inventory" "test" { ### Add inventory configuration with S3 bucket object prefix -```hcl +```terraform resource "aws_s3_bucket" "test" { bucket = "my-tf-test-bucket" } diff --git a/website/docs/r/s3_bucket_metric.html.markdown b/website/docs/r/s3_bucket_metric.html.markdown index 91fde862861..6e5c7d6256d 100644 --- a/website/docs/r/s3_bucket_metric.html.markdown +++ b/website/docs/r/s3_bucket_metric.html.markdown @@ -14,7 +14,7 @@ Provides a S3 bucket [metrics configuration](http://docs.aws.amazon.com/AmazonS3 ### Add metrics configuration for entire S3 bucket -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } @@ -27,7 +27,7 @@ resource "aws_s3_bucket_metric" "example-entire-bucket" { ### Add metrics configuration with S3 bucket object filter -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } diff --git a/website/docs/r/s3_bucket_notification.html.markdown b/website/docs/r/s3_bucket_notification.html.markdown index 28504815be2..e4ff22224e7 100644 --- a/website/docs/r/s3_bucket_notification.html.markdown +++ b/website/docs/r/s3_bucket_notification.html.markdown @@ -16,7 +16,7 @@ Manages a S3 Bucket Notification Configuration. For additional information, see ### Add notification configuration to SNS Topic -```hcl +```terraform resource "aws_sns_topic" "topic" { name = "s3-event-notification-topic" @@ -53,7 +53,7 @@ resource "aws_s3_bucket_notification" "bucket_notification" { ### Add notification configuration to SQS Queue -```hcl +```terraform resource "aws_sqs_queue" "queue" { name = "s3-event-notification-queue" @@ -92,7 +92,7 @@ resource "aws_s3_bucket_notification" "bucket_notification" { ### Add notification configuration to Lambda Function -```hcl +```terraform resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" @@ -148,7 +148,7 @@ resource "aws_s3_bucket_notification" "bucket_notification" { ### Trigger multiple Lambda functions -```hcl +```terraform resource "aws_iam_role" "iam_for_lambda" { name = "iam_for_lambda" @@ -229,7 +229,7 @@ resource "aws_s3_bucket_notification" "bucket_notification" { ### Add multiple notification configurations to SQS Queue -```hcl +```terraform resource "aws_sqs_queue" "queue" { name = "s3-event-notification-queue" diff --git a/website/docs/r/s3_bucket_object.html.markdown b/website/docs/r/s3_bucket_object.html.markdown index fd7bb5090d2..8d0698a43a1 100644 --- a/website/docs/r/s3_bucket_object.html.markdown +++ b/website/docs/r/s3_bucket_object.html.markdown @@ -14,7 +14,7 @@ Provides a S3 bucket object resource. ### Uploading a file to a bucket -```hcl +```terraform resource "aws_s3_bucket_object" "object" { bucket = "your_bucket_name" key = "new_object_key" @@ -29,7 +29,7 @@ resource "aws_s3_bucket_object" "object" { ### Encrypting with KMS Key -```hcl +```terraform resource "aws_kms_key" "examplekms" { description = "KMS key 1" deletion_window_in_days = 7 @@ -50,7 +50,7 @@ resource "aws_s3_bucket_object" "examplebucket_object" { ### Server Side Encryption with S3 Default Master Key -```hcl +```terraform resource "aws_s3_bucket" "examplebucket" { bucket = "examplebuckettftest" acl = "private" @@ -66,7 +66,7 @@ resource "aws_s3_bucket_object" "examplebucket_object" { ### Server Side Encryption with AWS-Managed Key -```hcl +```terraform resource "aws_s3_bucket" "examplebucket" { bucket = "examplebuckettftest" acl = "private" @@ -82,7 +82,7 @@ resource "aws_s3_bucket_object" "examplebucket_object" { ### S3 Object Lock -```hcl +```terraform resource "aws_s3_bucket" "examplebucket" { bucket = "examplebuckettftest" acl = "private" diff --git a/website/docs/r/s3_bucket_ownership_controls.html.markdown b/website/docs/r/s3_bucket_ownership_controls.html.markdown index 40ea8eceb54..38102677653 100644 --- a/website/docs/r/s3_bucket_ownership_controls.html.markdown +++ b/website/docs/r/s3_bucket_ownership_controls.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage S3 Bucket Ownership Controls. For more information ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } diff --git a/website/docs/r/s3_bucket_policy.html.markdown b/website/docs/r/s3_bucket_policy.html.markdown index 69c59555175..425917b025e 100644 --- a/website/docs/r/s3_bucket_policy.html.markdown +++ b/website/docs/r/s3_bucket_policy.html.markdown @@ -14,7 +14,7 @@ Attaches a policy to an S3 bucket resource. ### Basic Usage -```hcl +```terraform resource "aws_s3_bucket" "b" { bucket = "my-tf-test-bucket" } diff --git a/website/docs/r/s3_bucket_public_access_block.html.markdown b/website/docs/r/s3_bucket_public_access_block.html.markdown index e6311ee5046..d40aceb16ce 100644 --- a/website/docs/r/s3_bucket_public_access_block.html.markdown +++ b/website/docs/r/s3_bucket_public_access_block.html.markdown @@ -12,7 +12,7 @@ Manages S3 bucket-level Public Access Block configuration. For more information ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "example" { bucket = "example" } diff --git a/website/docs/r/s3_object_copy.html.markdown b/website/docs/r/s3_object_copy.html.markdown index 344d2d2eef3..76b05e18ee5 100644 --- a/website/docs/r/s3_object_copy.html.markdown +++ b/website/docs/r/s3_object_copy.html.markdown @@ -12,7 +12,7 @@ Provides a resource for copying an S3 object. ## Example Usage -```hcl +```terraform resource "aws_s3_object_copy" "test" { bucket = "destination_bucket" key = "destination_key" diff --git a/website/docs/r/s3control_bucket.html.markdown b/website/docs/r/s3control_bucket.html.markdown index d71da2ce72b..874cf779010 100644 --- a/website/docs/r/s3control_bucket.html.markdown +++ b/website/docs/r/s3control_bucket.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage an S3 Control Bucket. ## Example Usage -```hcl +```terraform resource "aws_s3control_bucket" "example" { bucket = "example" outpost_id = data.aws_outposts_outpost.example.id diff --git a/website/docs/r/s3control_bucket_lifecycle_configuration.html.markdown b/website/docs/r/s3control_bucket_lifecycle_configuration.html.markdown index 0cc5533f109..304392dc66b 100644 --- a/website/docs/r/s3control_bucket_lifecycle_configuration.html.markdown +++ b/website/docs/r/s3control_bucket_lifecycle_configuration.html.markdown @@ -16,7 +16,7 @@ Provides a resource to manage an S3 Control Bucket Lifecycle Configuration. ## Example Usage -```hcl +```terraform resource "aws_s3control_bucket_lifecycle_configuration" "example" { bucket = aws_s3control_bucket.example.arn diff --git a/website/docs/r/s3control_bucket_policy.html.markdown b/website/docs/r/s3control_bucket_policy.html.markdown index 8fc4ffe5fc3..b3e90c62786 100644 --- a/website/docs/r/s3control_bucket_policy.html.markdown +++ b/website/docs/r/s3control_bucket_policy.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage an S3 Control Bucket Policy. ## Example Usage -```hcl +```terraform resource "aws_s3control_bucket_policy" "example" { bucket = aws_s3control_bucket.example.arn policy = jsonencode({ diff --git a/website/docs/r/s3outposts_endpoint.html.markdown b/website/docs/r/s3outposts_endpoint.html.markdown index f447eff3cef..c1837a15915 100644 --- a/website/docs/r/s3outposts_endpoint.html.markdown +++ b/website/docs/r/s3outposts_endpoint.html.markdown @@ -12,7 +12,7 @@ Provides a resource to manage an S3 Outposts Endpoint. ## Example Usage -```hcl +```terraform resource "aws_s3outposts_endpoint" "example" { outpost_id = data.aws_outposts_outpost.example.id security_group_id = aws_security_group.example.id diff --git a/website/docs/r/sagemaker_app.html.markdown b/website/docs/r/sagemaker_app.html.markdown index 365bcc0c4e8..c14b69bb1d8 100644 --- a/website/docs/r/sagemaker_app.html.markdown +++ b/website/docs/r/sagemaker_app.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker App resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_app" "example" { domain_id = aws_sagemaker_domain.example.id user_profile_name = aws_sagemaker_user_profile.example.user_profile_name diff --git a/website/docs/r/sagemaker_app_image_config.html.markdown b/website/docs/r/sagemaker_app_image_config.html.markdown index e6fc28163f4..a90519d1af0 100644 --- a/website/docs/r/sagemaker_app_image_config.html.markdown +++ b/website/docs/r/sagemaker_app_image_config.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker App Image Config resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_app_image_config" "test" { app_image_config_name = "example" @@ -28,7 +28,7 @@ resource "aws_sagemaker_app_image_config" "test" { ### Default File System Config -```hcl +```terraform resource "aws_sagemaker_app_image_config" "test" { app_image_config_name = "example" diff --git a/website/docs/r/sagemaker_code_repository.html.markdown b/website/docs/r/sagemaker_code_repository.html.markdown index 70f5db89881..09a0e758c47 100644 --- a/website/docs/r/sagemaker_code_repository.html.markdown +++ b/website/docs/r/sagemaker_code_repository.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Code Repository resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_code_repository" "example" { code_repository_name = "example" @@ -26,7 +26,7 @@ resource "aws_sagemaker_code_repository" "example" { ### Example with Secret -```hcl +```terraform resource "aws_secretsmanager_secret" "example" { name = "example" } diff --git a/website/docs/r/sagemaker_domain.html.markdown b/website/docs/r/sagemaker_domain.html.markdown index 05932c20264..86c55cfc21e 100644 --- a/website/docs/r/sagemaker_domain.html.markdown +++ b/website/docs/r/sagemaker_domain.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Domain resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_domain" "example" { domain_name = "example" auth_mode = "IAM" @@ -46,7 +46,7 @@ data "aws_iam_policy_document" "example" { ### Using Custom Images -```hcl +```terraform resource "aws_sagemaker_image" "test" { image_name = "example" role_arn = aws_iam_role.test.arn diff --git a/website/docs/r/sagemaker_endpoint.html.markdown b/website/docs/r/sagemaker_endpoint.html.markdown index d5c80239344..4b43829e82c 100644 --- a/website/docs/r/sagemaker_endpoint.html.markdown +++ b/website/docs/r/sagemaker_endpoint.html.markdown @@ -14,7 +14,7 @@ Provides a SageMaker Endpoint resource. Basic usage: -```hcl +```terraform resource "aws_sagemaker_endpoint" "e" { name = "my-endpoint" endpoint_config_name = aws_sagemaker_endpoint_configuration.ec.name diff --git a/website/docs/r/sagemaker_endpoint_configuration.html.markdown b/website/docs/r/sagemaker_endpoint_configuration.html.markdown index 82f9315448c..e4d95b18db8 100644 --- a/website/docs/r/sagemaker_endpoint_configuration.html.markdown +++ b/website/docs/r/sagemaker_endpoint_configuration.html.markdown @@ -15,7 +15,7 @@ Provides a SageMaker endpoint configuration resource. Basic usage: -```hcl +```terraform resource "aws_sagemaker_endpoint_configuration" "ec" { name = "my-endpoint-config" diff --git a/website/docs/r/sagemaker_feature_group.html.markdown b/website/docs/r/sagemaker_feature_group.html.markdown index e27c72bef4b..3913eb6475a 100644 --- a/website/docs/r/sagemaker_feature_group.html.markdown +++ b/website/docs/r/sagemaker_feature_group.html.markdown @@ -14,7 +14,7 @@ Provides a SageMaker Feature Group resource. Basic usage: -```hcl +```terraform resource "aws_sagemaker_feature_group" "example" { feature_group_name = "example" record_identifier_feature_name = "example" diff --git a/website/docs/r/sagemaker_image.html.markdown b/website/docs/r/sagemaker_image.html.markdown index 9f1d329bd0b..283fdef6225 100644 --- a/website/docs/r/sagemaker_image.html.markdown +++ b/website/docs/r/sagemaker_image.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Image resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_image" "example" { image_name = "example" role_arn = aws_iam_role.test.arn diff --git a/website/docs/r/sagemaker_image_version.html.markdown b/website/docs/r/sagemaker_image_version.html.markdown index 8c19800d04c..ee732e31864 100644 --- a/website/docs/r/sagemaker_image_version.html.markdown +++ b/website/docs/r/sagemaker_image_version.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Image Version resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_image_version" "test" { image_name = aws_sagemaker_image.test.id base_image = "012345678912.dkr.ecr.us-west-2.amazonaws.com/image:latest" diff --git a/website/docs/r/sagemaker_model.html.markdown b/website/docs/r/sagemaker_model.html.markdown index aaaa1d3468e..b34405d565d 100644 --- a/website/docs/r/sagemaker_model.html.markdown +++ b/website/docs/r/sagemaker_model.html.markdown @@ -14,7 +14,7 @@ Provides a SageMaker model resource. Basic usage: -```hcl +```terraform resource "aws_sagemaker_model" "example" { name = "my-model" execution_role_arn = aws_iam_role.example.arn diff --git a/website/docs/r/sagemaker_model_package_group.html.markdown b/website/docs/r/sagemaker_model_package_group.html.markdown index 9570e375adc..db0b4b35446 100644 --- a/website/docs/r/sagemaker_model_package_group.html.markdown +++ b/website/docs/r/sagemaker_model_package_group.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Model Package Group resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_model_package_group" "example" { model_package_group_name = "example" } diff --git a/website/docs/r/sagemaker_notebook_instance.html.markdown b/website/docs/r/sagemaker_notebook_instance.html.markdown index f42db4b3553..1f9e7586a8b 100644 --- a/website/docs/r/sagemaker_notebook_instance.html.markdown +++ b/website/docs/r/sagemaker_notebook_instance.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker Notebook Instance resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_notebook_instance" "ni" { name = "my-notebook-instance" role_arn = aws_iam_role.role.arn @@ -28,7 +28,7 @@ resource "aws_sagemaker_notebook_instance" "ni" { ### Code repository usage -```hcl +```terraform resource "aws_sagemaker_code_repository" "example" { code_repository_name = "my-notebook-instance-code-repo" diff --git a/website/docs/r/sagemaker_notebook_instance_lifecycle_configuration.html.markdown b/website/docs/r/sagemaker_notebook_instance_lifecycle_configuration.html.markdown index 54bd3ec3b82..99e989d9e20 100644 --- a/website/docs/r/sagemaker_notebook_instance_lifecycle_configuration.html.markdown +++ b/website/docs/r/sagemaker_notebook_instance_lifecycle_configuration.html.markdown @@ -14,7 +14,7 @@ Provides a lifecycle configuration for SageMaker Notebook Instances. Usage: -```hcl +```terraform resource "aws_sagemaker_notebook_instance_lifecycle_configuration" "lc" { name = "foo" on_create = base64encode("echo foo") diff --git a/website/docs/r/sagemaker_user_profile.html.markdown b/website/docs/r/sagemaker_user_profile.html.markdown index cb7afaa7e89..151f329db13 100644 --- a/website/docs/r/sagemaker_user_profile.html.markdown +++ b/website/docs/r/sagemaker_user_profile.html.markdown @@ -14,7 +14,7 @@ Provides a Sagemaker User Profile resource. ### Basic usage -```hcl +```terraform resource "aws_sagemaker_user_profile" "example" { domain_id = aws_sagemaker_domain.test.id user_profile_name = "example" diff --git a/website/docs/r/secretsmanager_secret.html.markdown b/website/docs/r/secretsmanager_secret.html.markdown index ffe5d4ef638..24ef93f62ec 100644 --- a/website/docs/r/secretsmanager_secret.html.markdown +++ b/website/docs/r/secretsmanager_secret.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage AWS Secrets Manager secret metadata. To manage sec ### Basic -```hcl +```terraform resource "aws_secretsmanager_secret" "example" { name = "example" } @@ -28,7 +28,7 @@ To enable automatic secret rotation, the Secrets Manager service requires usage ~> **NOTE:** If you cancel a rotation that is in progress (by removing the `rotation` configuration), it can leave the VersionStage labels in an unexpected state. Depending on what step of the rotation was in progress, you might need to remove the staging label AWSPENDING from the partially created version, specified by the SecretVersionId response value. You should also evaluate the partially rotated new version to see if it should be deleted, which you can do by removing all staging labels from the new version's VersionStage field. -```hcl +```terraform resource "aws_secretsmanager_secret" "rotation-example" { name = "rotation-example" rotation_lambda_arn = aws_lambda_function.example.arn diff --git a/website/docs/r/secretsmanager_secret_policy.html.markdown b/website/docs/r/secretsmanager_secret_policy.html.markdown index 2dab6768396..df8c35d91b8 100644 --- a/website/docs/r/secretsmanager_secret_policy.html.markdown +++ b/website/docs/r/secretsmanager_secret_policy.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage AWS Secrets Manager secret policy. ### Basic -```hcl +```terraform resource "aws_secretsmanager_secret" "example" { name = "example" } diff --git a/website/docs/r/secretsmanager_secret_rotation.html.markdown b/website/docs/r/secretsmanager_secret_rotation.html.markdown index 8acf22eb7fe..307966364dd 100644 --- a/website/docs/r/secretsmanager_secret_rotation.html.markdown +++ b/website/docs/r/secretsmanager_secret_rotation.html.markdown @@ -14,7 +14,7 @@ Provides a resource to manage AWS Secrets Manager secret rotation. To manage a s ### Basic -```hcl +```terraform resource "aws_secretsmanager_secret_rotation" "example" { secret_id = aws_secretsmanager_secret.example.id rotation_lambda_arn = aws_lambda_function.example.arn diff --git a/website/docs/r/secretsmanager_secret_version.html.markdown b/website/docs/r/secretsmanager_secret_version.html.markdown index 7629aac1759..5728740522a 100644 --- a/website/docs/r/secretsmanager_secret_version.html.markdown +++ b/website/docs/r/secretsmanager_secret_version.html.markdown @@ -16,7 +16,7 @@ Provides a resource to manage AWS Secrets Manager secret version including its s ### Simple String Value -```hcl +```terraform resource "aws_secretsmanager_secret_version" "example" { secret_id = aws_secretsmanager_secret.example.id secret_string = "example-string-to-protect" @@ -27,7 +27,7 @@ resource "aws_secretsmanager_secret_version" "example" { Secrets Manager also accepts key-value pairs in JSON. -```hcl +```terraform # The map here can come from other supported configurations # like locals, resource attribute, map() built-in, etc. variable "example" { @@ -47,7 +47,7 @@ resource "aws_secretsmanager_secret_version" "example" { Reading key-value pairs from JSON back into a native Terraform map can be accomplished in Terraform 0.12 and later with the [`jsondecode()` function](https://www.terraform.io/docs/configuration/functions/jsondecode.html): -```hcl +```terraform output "example" { value = jsondecode(aws_secretsmanager_secret_version.example.secret_string)["key1"] } diff --git a/website/docs/r/security_group.html.markdown b/website/docs/r/security_group.html.markdown index ca5d2b4f02f..77982527349 100644 --- a/website/docs/r/security_group.html.markdown +++ b/website/docs/r/security_group.html.markdown @@ -25,7 +25,7 @@ a conflict of rule settings and will overwrite rules. Basic usage -```hcl +```terraform resource "aws_security_group" "allow_tls" { name = "allow_tls" description = "Allow TLS inbound traffic" @@ -116,7 +116,7 @@ specifically re-create it if you desire that rule. We feel this leads to fewer surprises in terms of controlling your egress rules. If you desire this rule to be in place, you can use this `egress` block: -```hcl +```terraform resource "aws_security_group" "example" { # ... other configuration ... @@ -136,7 +136,7 @@ Prefix Lists are either managed by AWS internally, or created by the customer us AWS are associated with a prefix list name, or service name, that is linked to a specific region. Prefix list IDs are exported on VPC Endpoints, so you can use this format: -```hcl +```terraform resource "aws_security_group" "example" { # ... other configuration ... diff --git a/website/docs/r/security_group_rule.html.markdown b/website/docs/r/security_group_rule.html.markdown index 9b1c0b24915..4d55b905311 100644 --- a/website/docs/r/security_group_rule.html.markdown +++ b/website/docs/r/security_group_rule.html.markdown @@ -26,7 +26,7 @@ a conflict of rule settings and will overwrite rules. Basic usage -```hcl +```terraform resource "aws_security_group_rule" "example" { type = "ingress" from_port = 0 @@ -64,7 +64,7 @@ AWS are associated with a prefix list name, or service name, that is linked to a Prefix list IDs are exported on VPC Endpoints, so you can use this format: -```hcl +```terraform resource "aws_security_group_rule" "allow_all" { type = "egress" to_port = 0 diff --git a/website/docs/r/securityhub_account.markdown b/website/docs/r/securityhub_account.markdown index 04dcb09ad74..05bdb1e9c71 100644 --- a/website/docs/r/securityhub_account.markdown +++ b/website/docs/r/securityhub_account.markdown @@ -14,7 +14,7 @@ Enables Security Hub for this AWS account. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} ``` diff --git a/website/docs/r/securityhub_action_target.html.markdown b/website/docs/r/securityhub_action_target.html.markdown index 91420616ef4..3205e11ad87 100644 --- a/website/docs/r/securityhub_action_target.html.markdown +++ b/website/docs/r/securityhub_action_target.html.markdown @@ -12,7 +12,7 @@ Creates Security Hub custom action. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} resource "aws_securityhub_action_target" "example" { diff --git a/website/docs/r/securityhub_invite_accepter.markdown b/website/docs/r/securityhub_invite_accepter.markdown index 319416bb942..d96a602164d 100644 --- a/website/docs/r/securityhub_invite_accepter.markdown +++ b/website/docs/r/securityhub_invite_accepter.markdown @@ -14,7 +14,7 @@ Accepts a Security Hub invitation. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} resource "aws_securityhub_member" "example" { diff --git a/website/docs/r/securityhub_member.markdown b/website/docs/r/securityhub_member.markdown index d3b6a67d143..4531108e15f 100644 --- a/website/docs/r/securityhub_member.markdown +++ b/website/docs/r/securityhub_member.markdown @@ -12,7 +12,7 @@ Provides a Security Hub member resource. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} resource "aws_securityhub_member" "example" { diff --git a/website/docs/r/securityhub_organization_admin_account.html.markdown b/website/docs/r/securityhub_organization_admin_account.html.markdown index 54760557bf3..3941c489671 100644 --- a/website/docs/r/securityhub_organization_admin_account.html.markdown +++ b/website/docs/r/securityhub_organization_admin_account.html.markdown @@ -12,7 +12,7 @@ Manages a Security Hub administrator account for an organization. The AWS accoun ## Example Usage -```hcl +```terraform resource "aws_organizations_organization" "example" { aws_service_access_principals = ["securityhub.amazonaws.com"] feature_set = "ALL" diff --git a/website/docs/r/securityhub_product_subscription.markdown b/website/docs/r/securityhub_product_subscription.markdown index 690968ea602..ffe2f719e8d 100644 --- a/website/docs/r/securityhub_product_subscription.markdown +++ b/website/docs/r/securityhub_product_subscription.markdown @@ -12,7 +12,7 @@ Subscribes to a Security Hub product. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} data "aws_region" "current" {} diff --git a/website/docs/r/securityhub_standards_subscription.markdown b/website/docs/r/securityhub_standards_subscription.markdown index b988765a57e..6bd11f7030e 100644 --- a/website/docs/r/securityhub_standards_subscription.markdown +++ b/website/docs/r/securityhub_standards_subscription.markdown @@ -12,7 +12,7 @@ Subscribes to a Security Hub standard. ## Example Usage -```hcl +```terraform resource "aws_securityhub_account" "example" {} resource "aws_securityhub_standards_subscription" "cis" { diff --git a/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown b/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown index ea5a0c644a3..305fcdf0fa7 100644 --- a/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown +++ b/website/docs/r/serverlessapplicationrepository_cloudformation_stack.html.markdown @@ -12,7 +12,7 @@ Deploys an Application CloudFormation Stack from the Serverless Application Repo ## Example Usage -```hcl +```terraform resource "aws_serverlessapplicationrepository_cloudformation_stack" "postgres-rotator" { name = "postgres-rotator" application_id = "arn:aws:serverlessrepo:us-east-1:297356227824:applications/SecretsManagerRDSPostgreSQLRotationSingleUser" diff --git a/website/docs/r/service_discovery_http_namespace.html.markdown b/website/docs/r/service_discovery_http_namespace.html.markdown index 4c2969d46fd..1fdd7cfa314 100644 --- a/website/docs/r/service_discovery_http_namespace.html.markdown +++ b/website/docs/r/service_discovery_http_namespace.html.markdown @@ -11,7 +11,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_service_discovery_http_namespace" "example" { name = "development" description = "example" diff --git a/website/docs/r/service_discovery_private_dns_namespace.html.markdown b/website/docs/r/service_discovery_private_dns_namespace.html.markdown index 0a5cfa5d672..3f486a7a9e9 100644 --- a/website/docs/r/service_discovery_private_dns_namespace.html.markdown +++ b/website/docs/r/service_discovery_private_dns_namespace.html.markdown @@ -12,7 +12,7 @@ Provides a Service Discovery Private DNS Namespace resource. ## Example Usage -```hcl +```terraform resource "aws_vpc" "example" { cidr_block = "10.0.0.0/16" } diff --git a/website/docs/r/service_discovery_public_dns_namespace.html.markdown b/website/docs/r/service_discovery_public_dns_namespace.html.markdown index ad8f78a83ee..b07af9b837a 100644 --- a/website/docs/r/service_discovery_public_dns_namespace.html.markdown +++ b/website/docs/r/service_discovery_public_dns_namespace.html.markdown @@ -12,7 +12,7 @@ Provides a Service Discovery Public DNS Namespace resource. ## Example Usage -```hcl +```terraform resource "aws_service_discovery_public_dns_namespace" "example" { name = "hoge.example.com" description = "example" diff --git a/website/docs/r/service_discovery_service.html.markdown b/website/docs/r/service_discovery_service.html.markdown index 6b691cde263..a892e4e8e70 100644 --- a/website/docs/r/service_discovery_service.html.markdown +++ b/website/docs/r/service_discovery_service.html.markdown @@ -12,7 +12,7 @@ Provides a Service Discovery Service resource. ## Example Usage -```hcl +```terraform resource "aws_vpc" "example" { cidr_block = "10.0.0.0/16" enable_dns_support = true @@ -45,7 +45,7 @@ resource "aws_service_discovery_service" "example" { } ``` -```hcl +```terraform resource "aws_service_discovery_public_dns_namespace" "example" { name = "example.terraform.com" description = "example" diff --git a/website/docs/r/servicecatalog_portfolio.html.markdown b/website/docs/r/servicecatalog_portfolio.html.markdown index 2667385ea6d..3793a73a8f4 100644 --- a/website/docs/r/servicecatalog_portfolio.html.markdown +++ b/website/docs/r/servicecatalog_portfolio.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a Service Catalog Portfolio. ## Example Usage -```hcl +```terraform resource "aws_servicecatalog_portfolio" "portfolio" { name = "My App Portfolio" description = "List of my organizations apps" diff --git a/website/docs/r/servicequotas_service_quota.html.markdown b/website/docs/r/servicequotas_service_quota.html.markdown index 6979f573010..97208d1f13e 100644 --- a/website/docs/r/servicequotas_service_quota.html.markdown +++ b/website/docs/r/servicequotas_service_quota.html.markdown @@ -12,7 +12,7 @@ Manages an individual Service Quota. ## Example Usage -```hcl +```terraform resource "aws_servicequotas_service_quota" "example" { quota_code = "L-F678F1CE" service_code = "vpc" diff --git a/website/docs/r/ses_active_receipt_rule_set.html.markdown b/website/docs/r/ses_active_receipt_rule_set.html.markdown index f40d17e303e..d085c5abe19 100644 --- a/website/docs/r/ses_active_receipt_rule_set.html.markdown +++ b/website/docs/r/ses_active_receipt_rule_set.html.markdown @@ -12,7 +12,7 @@ Provides a resource to designate the active SES receipt rule set ## Example Usage -```hcl +```terraform resource "aws_ses_active_receipt_rule_set" "main" { rule_set_name = "primary-rules" } diff --git a/website/docs/r/ses_configuration_set.html.markdown b/website/docs/r/ses_configuration_set.html.markdown index 492fb862139..510aa53929f 100644 --- a/website/docs/r/ses_configuration_set.html.markdown +++ b/website/docs/r/ses_configuration_set.html.markdown @@ -12,7 +12,7 @@ Provides an SES configuration set resource. ## Example Usage -```hcl +```terraform resource "aws_ses_configuration_set" "test" { name = "some-configuration-set-test" } @@ -20,7 +20,7 @@ resource "aws_ses_configuration_set" "test" { ### Require TLS Connections -```hcl +```terraform resource "aws_ses_configuration_set" "test" { name = "some-configuration-set-test" diff --git a/website/docs/r/ses_domain_dkim.html.markdown b/website/docs/r/ses_domain_dkim.html.markdown index 5dd856438dd..9a2a9202453 100644 --- a/website/docs/r/ses_domain_dkim.html.markdown +++ b/website/docs/r/ses_domain_dkim.html.markdown @@ -31,7 +31,7 @@ In addition to all arguments above, the following attributes are exported: ## Example Usage -```hcl +```terraform resource "aws_ses_domain_identity" "example" { domain = "example.com" } diff --git a/website/docs/r/ses_domain_identity.html.markdown b/website/docs/r/ses_domain_identity.html.markdown index 23c7d6af204..7185ac9d8fe 100644 --- a/website/docs/r/ses_domain_identity.html.markdown +++ b/website/docs/r/ses_domain_identity.html.markdown @@ -32,7 +32,7 @@ In addition to all arguments above, the following attributes are exported: ## Example Usage -```hcl +```terraform resource "aws_ses_domain_identity" "example" { domain = "example.com" } diff --git a/website/docs/r/ses_domain_identity_verification.html.markdown b/website/docs/r/ses_domain_identity_verification.html.markdown index 2edfa29a94c..d61954ab12a 100644 --- a/website/docs/r/ses_domain_identity_verification.html.markdown +++ b/website/docs/r/ses_domain_identity_verification.html.markdown @@ -18,7 +18,7 @@ deploy the required DNS verification records, and wait for verification to compl ## Example Usage -```hcl +```terraform resource "aws_ses_domain_identity" "example" { domain = "example.com" } diff --git a/website/docs/r/ses_domain_mail_from.html.markdown b/website/docs/r/ses_domain_mail_from.html.markdown index a951fa546f9..455480b337b 100644 --- a/website/docs/r/ses_domain_mail_from.html.markdown +++ b/website/docs/r/ses_domain_mail_from.html.markdown @@ -14,7 +14,7 @@ Provides an SES domain MAIL FROM resource. ## Example Usage -```hcl +```terraform resource "aws_ses_domain_mail_from" "example" { domain = aws_ses_domain_identity.example.domain mail_from_domain = "bounce.${aws_ses_domain_identity.example.domain}" diff --git a/website/docs/r/ses_email_identity.html.markdown b/website/docs/r/ses_email_identity.html.markdown index 59f543f6ba5..e200389321a 100644 --- a/website/docs/r/ses_email_identity.html.markdown +++ b/website/docs/r/ses_email_identity.html.markdown @@ -24,7 +24,7 @@ In addition to all arguments above, the following attributes are exported: ## Example Usage -```hcl +```terraform resource "aws_ses_email_identity" "example" { email = "email@example.com" } diff --git a/website/docs/r/ses_event_destination.html.markdown b/website/docs/r/ses_event_destination.html.markdown index d665811a0a8..4a535761a2a 100644 --- a/website/docs/r/ses_event_destination.html.markdown +++ b/website/docs/r/ses_event_destination.html.markdown @@ -14,7 +14,7 @@ Provides an SES event destination ### CloudWatch Destination -```hcl +```terraform resource "aws_ses_event_destination" "cloudwatch" { name = "event-destination-cloudwatch" configuration_set_name = aws_ses_configuration_set.example.name @@ -31,7 +31,7 @@ resource "aws_ses_event_destination" "cloudwatch" { ### Kinesis Destination -```hcl +```terraform resource "aws_ses_event_destination" "kinesis" { name = "event-destination-kinesis" configuration_set_name = aws_ses_configuration_set.example.name @@ -47,7 +47,7 @@ resource "aws_ses_event_destination" "kinesis" { ### SNS Destination -```hcl +```terraform resource "aws_ses_event_destination" "sns" { name = "event-destination-sns" configuration_set_name = aws_ses_configuration_set.example.name diff --git a/website/docs/r/ses_identity_notification_topic.markdown b/website/docs/r/ses_identity_notification_topic.markdown index f367e910fff..2df6b32e20a 100644 --- a/website/docs/r/ses_identity_notification_topic.markdown +++ b/website/docs/r/ses_identity_notification_topic.markdown @@ -12,7 +12,7 @@ Resource for managing SES Identity Notification Topics ## Example Usage -```hcl +```terraform resource "aws_ses_identity_notification_topic" "test" { topic_arn = aws_sns_topic.example.arn notification_type = "Bounce" diff --git a/website/docs/r/ses_identity_policy.html.markdown b/website/docs/r/ses_identity_policy.html.markdown index c244cff2a77..5ddc7cc4212 100644 --- a/website/docs/r/ses_identity_policy.html.markdown +++ b/website/docs/r/ses_identity_policy.html.markdown @@ -12,7 +12,7 @@ Manages a SES Identity Policy. More information about SES Sending Authorization ## Example Usage -```hcl +```terraform resource "aws_ses_domain_identity" "example" { domain = "example.com" } diff --git a/website/docs/r/ses_receipt_filter.html.markdown b/website/docs/r/ses_receipt_filter.html.markdown index eff58d99bd2..67db104c366 100644 --- a/website/docs/r/ses_receipt_filter.html.markdown +++ b/website/docs/r/ses_receipt_filter.html.markdown @@ -12,7 +12,7 @@ Provides an SES receipt filter resource ## Example Usage -```hcl +```terraform resource "aws_ses_receipt_filter" "filter" { name = "block-spammer" cidr = "10.10.10.10" diff --git a/website/docs/r/ses_receipt_rule.html.markdown b/website/docs/r/ses_receipt_rule.html.markdown index 93ce0e2ba0f..28c9158009e 100644 --- a/website/docs/r/ses_receipt_rule.html.markdown +++ b/website/docs/r/ses_receipt_rule.html.markdown @@ -12,7 +12,7 @@ Provides an SES receipt rule resource ## Example Usage -```hcl +```terraform # Add a header to the email and store it in S3 resource "aws_ses_receipt_rule" "store" { name = "store" diff --git a/website/docs/r/ses_receipt_rule_set.html.markdown b/website/docs/r/ses_receipt_rule_set.html.markdown index 6f94e3bed98..372cf37e16c 100644 --- a/website/docs/r/ses_receipt_rule_set.html.markdown +++ b/website/docs/r/ses_receipt_rule_set.html.markdown @@ -12,7 +12,7 @@ Provides an SES receipt rule set resource. ## Example Usage -```hcl +```terraform resource "aws_ses_receipt_rule_set" "main" { rule_set_name = "primary-rules" } diff --git a/website/docs/r/ses_template.html.markdown b/website/docs/r/ses_template.html.markdown index fda424bb7a5..9bb632bb293 100644 --- a/website/docs/r/ses_template.html.markdown +++ b/website/docs/r/ses_template.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a SES template. ## Example Usage -```hcl +```terraform resource "aws_ses_template" "MyTemplate" { name = "MyTemplate" subject = "Greetings, {{name}}!" diff --git a/website/docs/r/sfn_activity.html.markdown b/website/docs/r/sfn_activity.html.markdown index d7dce685273..7521043d884 100644 --- a/website/docs/r/sfn_activity.html.markdown +++ b/website/docs/r/sfn_activity.html.markdown @@ -12,7 +12,7 @@ Provides a Step Function Activity resource ## Example Usage -```hcl +```terraform resource "aws_sfn_activity" "sfn_activity" { name = "my-activity" } diff --git a/website/docs/r/sfn_state_machine.html.markdown b/website/docs/r/sfn_state_machine.html.markdown index 496dd69e177..785560813f6 100644 --- a/website/docs/r/sfn_state_machine.html.markdown +++ b/website/docs/r/sfn_state_machine.html.markdown @@ -13,7 +13,7 @@ Provides a Step Function State Machine resource ## Example Usage ### Basic (Standard Workflow) -```hcl +```terraform # ... resource "aws_sfn_state_machine" "sfn_state_machine" { @@ -38,7 +38,7 @@ EOF ### Basic (Express Workflow) -```hcl +```terraform # ... resource "aws_sfn_state_machine" "sfn_state_machine" { @@ -66,7 +66,7 @@ EOF ~> *NOTE:* See the [AWS Step Functions Developer Guide](https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) for more information about enabling Step Function logging. -```hcl +```terraform # ... resource "aws_sfn_state_machine" "sfn_state_machine" { diff --git a/website/docs/r/shield_protection.html.markdown b/website/docs/r/shield_protection.html.markdown index 0e65a55fea3..23ce5a50381 100644 --- a/website/docs/r/shield_protection.html.markdown +++ b/website/docs/r/shield_protection.html.markdown @@ -15,7 +15,7 @@ The resource can be an Amazon CloudFront distribution, Elastic Load Balancing lo ### Create protection -```hcl +```terraform data "aws_availability_zones" "available" {} data "aws_region" "current" {} data "aws_caller_identity" "current" {} diff --git a/website/docs/r/signer_signing_job.html.markdown b/website/docs/r/signer_signing_job.html.markdown index 4883693936f..2df4d4d83e5 100644 --- a/website/docs/r/signer_signing_job.html.markdown +++ b/website/docs/r/signer_signing_job.html.markdown @@ -12,7 +12,7 @@ Creates a Signer Signing Job. ## Example Usage -```hcl +```terraform resource "aws_signer_signing_profile" "test_sp" { platform_id = "AWSLambda-SHA384-ECDSA" } diff --git a/website/docs/r/signer_signing_profile.html.markdown b/website/docs/r/signer_signing_profile.html.markdown index 7fb0e97b48b..2dc50bef461 100644 --- a/website/docs/r/signer_signing_profile.html.markdown +++ b/website/docs/r/signer_signing_profile.html.markdown @@ -12,7 +12,7 @@ Creates a Signer Signing Profile. A signing profile contains information about t ## Example Usage -```hcl +```terraform resource "aws_signer_signing_profile" "test_sp" { platform_id = "AWSLambda-SHA384-ECDSA" } diff --git a/website/docs/r/signer_signing_profile_permission.html.markdown b/website/docs/r/signer_signing_profile_permission.html.markdown index 2312649cba4..f6c5a337574 100644 --- a/website/docs/r/signer_signing_profile_permission.html.markdown +++ b/website/docs/r/signer_signing_profile_permission.html.markdown @@ -12,7 +12,7 @@ Creates a Signer Signing Profile Permission. That is, a cross-account permission ## Example Usage -```hcl +```terraform resource "aws_signer_signing_profile" "prod_sp" { platform_id = "AWSLambda-SHA384-ECDSA" name_prefix = "prod_sp_" diff --git a/website/docs/r/simpledb_domain.html.markdown b/website/docs/r/simpledb_domain.html.markdown index d6f77045254..fea4d6b4c0d 100644 --- a/website/docs/r/simpledb_domain.html.markdown +++ b/website/docs/r/simpledb_domain.html.markdown @@ -12,7 +12,7 @@ Provides a SimpleDB domain resource ## Example Usage -```hcl +```terraform resource "aws_simpledb_domain" "users" { name = "users" } diff --git a/website/docs/r/snapshot_create_volume_permission.html.markdown b/website/docs/r/snapshot_create_volume_permission.html.markdown index c28f34a47fe..efeb621c730 100644 --- a/website/docs/r/snapshot_create_volume_permission.html.markdown +++ b/website/docs/r/snapshot_create_volume_permission.html.markdown @@ -12,7 +12,7 @@ Adds permission to create volumes off of a given EBS Snapshot. ## Example Usage -```hcl +```terraform resource "aws_snapshot_create_volume_permission" "example_perm" { snapshot_id = aws_ebs_snapshot.example_snapshot.id account_id = "12345678" diff --git a/website/docs/r/sns_platform_application.html.markdown b/website/docs/r/sns_platform_application.html.markdown index 1e56811002e..480f1f38785 100644 --- a/website/docs/r/sns_platform_application.html.markdown +++ b/website/docs/r/sns_platform_application.html.markdown @@ -14,7 +14,7 @@ Provides an SNS platform application resource ### Apple Push Notification Service (APNS) -```hcl +```terraform resource "aws_sns_platform_application" "apns_application" { name = "apns_application" platform = "APNS" @@ -25,7 +25,7 @@ resource "aws_sns_platform_application" "apns_application" { ### Google Cloud Messaging (GCM) -```hcl +```terraform resource "aws_sns_platform_application" "gcm_application" { name = "gcm_application" platform = "GCM" diff --git a/website/docs/r/sns_sms_preferences.html.markdown b/website/docs/r/sns_sms_preferences.html.markdown index 9218ea0ed92..d7c3642fec2 100644 --- a/website/docs/r/sns_sms_preferences.html.markdown +++ b/website/docs/r/sns_sms_preferences.html.markdown @@ -12,7 +12,7 @@ Provides a way to set SNS SMS preferences. ## Example Usage -```hcl +```terraform resource "aws_sns_sms_preferences" "update_sms_prefs" {} ``` diff --git a/website/docs/r/sns_topic.html.markdown b/website/docs/r/sns_topic.html.markdown index 3b86c8518e4..fff6102b39c 100644 --- a/website/docs/r/sns_topic.html.markdown +++ b/website/docs/r/sns_topic.html.markdown @@ -12,7 +12,7 @@ Provides an SNS topic resource ## Example Usage -```hcl +```terraform resource "aws_sns_topic" "user_updates" { name = "user-updates-topic" } @@ -47,7 +47,7 @@ EOF ## Example with Server-side encryption (SSE) -```hcl +```terraform resource "aws_sns_topic" "user_updates" { name = "user-updates-topic" kms_master_key_id = "alias/aws/sns" diff --git a/website/docs/r/sns_topic_policy.html.markdown b/website/docs/r/sns_topic_policy.html.markdown index 9f82ec6cf62..5434f81dfec 100644 --- a/website/docs/r/sns_topic_policy.html.markdown +++ b/website/docs/r/sns_topic_policy.html.markdown @@ -14,7 +14,7 @@ Provides an SNS topic policy resource ## Example Usage -```hcl +```terraform resource "aws_sns_topic" "test" { name = "my-topic-with-policy" } diff --git a/website/docs/r/sns_topic_subscription.html.markdown b/website/docs/r/sns_topic_subscription.html.markdown index 46d17ced8b5..2904dbbb617 100644 --- a/website/docs/r/sns_topic_subscription.html.markdown +++ b/website/docs/r/sns_topic_subscription.html.markdown @@ -24,7 +24,7 @@ Provides a resource for subscribing to SNS topics. Requires that an SNS topic ex You can directly supply a topic and ARN by hand in the `topic_arn` property along with the queue ARN: -```hcl +```terraform resource "aws_sns_topic_subscription" "user_updates_sqs_target" { topic_arn = "arn:aws:sns:us-west-2:432981146916:user-updates-topic" protocol = "sqs" @@ -34,7 +34,7 @@ resource "aws_sns_topic_subscription" "user_updates_sqs_target" { Alternatively you can use the ARN properties of a managed SNS topic and SQS queue: -```hcl +```terraform resource "aws_sns_topic" "user_updates" { name = "user-updates-topic" } @@ -52,7 +52,7 @@ resource "aws_sns_topic_subscription" "user_updates_sqs_target" { You can subscribe SNS topics to SQS queues in different Amazon accounts and regions: -```hcl +```terraform variable "sns" { default = { account-id = "111111111111" diff --git a/website/docs/r/spot_datafeed_subscription.html.markdown b/website/docs/r/spot_datafeed_subscription.html.markdown index 73a0461dd56..37f22eca863 100644 --- a/website/docs/r/spot_datafeed_subscription.html.markdown +++ b/website/docs/r/spot_datafeed_subscription.html.markdown @@ -15,7 +15,7 @@ This data feed is sent to an Amazon S3 bucket that you specify when you subscrib ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "default" { bucket = "tf-spot-datafeed" } diff --git a/website/docs/r/spot_fleet_request.html.markdown b/website/docs/r/spot_fleet_request.html.markdown index d57ed06fe10..4491f0bcf63 100644 --- a/website/docs/r/spot_fleet_request.html.markdown +++ b/website/docs/r/spot_fleet_request.html.markdown @@ -15,7 +15,7 @@ instances to be requested on the Spot market. ### Using launch specifications -```hcl +```terraform # Request a Spot fleet resource "aws_spot_fleet_request" "cheap_compute" { iam_fleet_role = "arn:aws:iam::12345678:role/spot-fleet" @@ -56,7 +56,7 @@ resource "aws_spot_fleet_request" "cheap_compute" { ### Using launch templates -```hcl +```terraform resource "aws_launch_template" "foo" { name = "launch-template" image_id = "ami-516b9131" @@ -86,7 +86,7 @@ launch configuration block. If you want to specify multiple values, then separat ### Using multiple launch specifications -```hcl +```terraform resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "arn:aws:iam::12345678:role/spot-fleet" spot_price = "0.005" @@ -112,7 +112,7 @@ resource "aws_spot_fleet_request" "foo" { ### Using multiple launch configurations -```hcl +```terraform data "aws_subnet_ids" "example" { vpc_id = var.vpc_id } diff --git a/website/docs/r/spot_instance_request.html.markdown b/website/docs/r/spot_instance_request.html.markdown index e351cd33e04..3f8d0dc0279 100644 --- a/website/docs/r/spot_instance_request.html.markdown +++ b/website/docs/r/spot_instance_request.html.markdown @@ -34,7 +34,7 @@ for more information. ## Example Usage -```hcl +```terraform # Request a spot instance at $0.03 resource "aws_spot_instance_request" "cheap_worker" { ami = "ami-1234" diff --git a/website/docs/r/sqs_queue.html.markdown b/website/docs/r/sqs_queue.html.markdown index 3a02eb8bbfb..19b3cc0cc99 100644 --- a/website/docs/r/sqs_queue.html.markdown +++ b/website/docs/r/sqs_queue.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_sqs_queue" "terraform_queue" { name = "terraform-example-queue" delay_seconds = 90 @@ -30,7 +30,7 @@ resource "aws_sqs_queue" "terraform_queue" { ## FIFO queue -```hcl +```terraform resource "aws_sqs_queue" "terraform_queue" { name = "terraform-example-queue.fifo" fifo_queue = true @@ -40,7 +40,7 @@ resource "aws_sqs_queue" "terraform_queue" { ## Server-side encryption (SSE) -```hcl +```terraform resource "aws_sqs_queue" "terraform_queue" { name = "terraform-example-queue" kms_master_key_id = "alias/aws/sqs" diff --git a/website/docs/r/sqs_queue_policy.html.markdown b/website/docs/r/sqs_queue_policy.html.markdown index b63be0e06ef..96b1d56a467 100644 --- a/website/docs/r/sqs_queue_policy.html.markdown +++ b/website/docs/r/sqs_queue_policy.html.markdown @@ -13,7 +13,7 @@ while referencing ARN of the queue within the policy. ## Example Usage -```hcl +```terraform resource "aws_sqs_queue" "q" { name = "examplequeue" } diff --git a/website/docs/r/ssm_activation.html.markdown b/website/docs/r/ssm_activation.html.markdown index 2c573a33932..3f6c4beecf7 100644 --- a/website/docs/r/ssm_activation.html.markdown +++ b/website/docs/r/ssm_activation.html.markdown @@ -12,7 +12,7 @@ Registers an on-premises server or virtual machine with Amazon EC2 so that it ca ## Example Usage -```hcl +```terraform resource "aws_iam_role" "test_role" { name = "test_role" diff --git a/website/docs/r/ssm_association.html.markdown b/website/docs/r/ssm_association.html.markdown index 8d6d88ed9f9..6d19447fca2 100644 --- a/website/docs/r/ssm_association.html.markdown +++ b/website/docs/r/ssm_association.html.markdown @@ -12,7 +12,7 @@ Associates an SSM Document to an instance or EC2 tag. ## Example Usage -```hcl +```terraform resource "aws_ssm_association" "example" { name = aws_ssm_document.example.name diff --git a/website/docs/r/ssm_document.html.markdown b/website/docs/r/ssm_document.html.markdown index f55e96d6c35..70d15345cda 100644 --- a/website/docs/r/ssm_document.html.markdown +++ b/website/docs/r/ssm_document.html.markdown @@ -16,7 +16,7 @@ schema version you must recreate the resource. ## Example Usage -```hcl +```terraform resource "aws_ssm_document" "foo" { name = "test_document" document_type = "Command" @@ -105,7 +105,7 @@ $ terraform import aws_ssm_document.example example The `attachments_source` argument does not have an SSM API method for reading the attachment information detail after creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_ssm_document" "test" { name = "test_document" document_type = "Package" diff --git a/website/docs/r/ssm_maintenance_window.html.markdown b/website/docs/r/ssm_maintenance_window.html.markdown index 41c0bee3794..f443c3ded7b 100644 --- a/website/docs/r/ssm_maintenance_window.html.markdown +++ b/website/docs/r/ssm_maintenance_window.html.markdown @@ -12,7 +12,7 @@ Provides an SSM Maintenance Window resource ## Example Usage -```hcl +```terraform resource "aws_ssm_maintenance_window" "production" { name = "maintenance-window-application" schedule = "cron(0 16 ? * TUE *)" diff --git a/website/docs/r/ssm_maintenance_window_target.html.markdown b/website/docs/r/ssm_maintenance_window_target.html.markdown index 4a7e31cd4a2..2b5692475c8 100644 --- a/website/docs/r/ssm_maintenance_window_target.html.markdown +++ b/website/docs/r/ssm_maintenance_window_target.html.markdown @@ -14,7 +14,7 @@ Provides an SSM Maintenance Window Target resource ### Instance Target -```hcl +```terraform resource "aws_ssm_maintenance_window" "window" { name = "maintenance-window-webapp" schedule = "cron(0 16 ? * TUE *)" @@ -37,7 +37,7 @@ resource "aws_ssm_maintenance_window_target" "target1" { ### Resource Group Target -```hcl +```terraform resource "aws_ssm_maintenance_window" "window" { name = "maintenance-window-webapp" schedule = "cron(0 16 ? * TUE *)" diff --git a/website/docs/r/ssm_maintenance_window_task.html.markdown b/website/docs/r/ssm_maintenance_window_task.html.markdown index b733fbbf8c8..05b7a2b8c49 100644 --- a/website/docs/r/ssm_maintenance_window_task.html.markdown +++ b/website/docs/r/ssm_maintenance_window_task.html.markdown @@ -14,7 +14,7 @@ Provides an SSM Maintenance Window Task resource ### Automation Tasks -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { max_concurrency = 2 max_errors = 1 @@ -43,7 +43,7 @@ resource "aws_ssm_maintenance_window_task" "example" { ### Lambda Tasks -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { max_concurrency = 2 max_errors = 1 @@ -68,7 +68,7 @@ resource "aws_ssm_maintenance_window_task" "example" { ### Run Command Tasks -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { max_concurrency = 2 max_errors = 1 @@ -106,7 +106,7 @@ resource "aws_ssm_maintenance_window_task" "example" { ### Step Function Tasks -```hcl +```terraform resource "aws_ssm_maintenance_window_task" "example" { max_concurrency = 2 max_errors = 1 diff --git a/website/docs/r/ssm_parameter.html.markdown b/website/docs/r/ssm_parameter.html.markdown index 269b9d7e47d..e22540694a7 100644 --- a/website/docs/r/ssm_parameter.html.markdown +++ b/website/docs/r/ssm_parameter.html.markdown @@ -14,7 +14,7 @@ Provides an SSM Parameter resource. To store a basic string parameter: -```hcl +```terraform resource "aws_ssm_parameter" "foo" { name = "foo" type = "String" @@ -24,7 +24,7 @@ resource "aws_ssm_parameter" "foo" { To store an encrypted string using the default SSM KMS key: -```hcl +```terraform resource "aws_db_instance" "default" { allocated_storage = 10 storage_type = "gp2" diff --git a/website/docs/r/ssm_patch_baseline.html.markdown b/website/docs/r/ssm_patch_baseline.html.markdown index d48135b0e36..ded4b2a9ed2 100644 --- a/website/docs/r/ssm_patch_baseline.html.markdown +++ b/website/docs/r/ssm_patch_baseline.html.markdown @@ -18,7 +18,7 @@ of them is specified. Basic usage using `approved_patches` only -```hcl +```terraform resource "aws_ssm_patch_baseline" "production" { name = "patch-baseline" approved_patches = ["KB123456"] @@ -27,7 +27,7 @@ resource "aws_ssm_patch_baseline" "production" { Advanced usage, specifying patch filters -```hcl +```terraform resource "aws_ssm_patch_baseline" "production" { name = "patch-baseline" description = "Patch Baseline Description" @@ -82,7 +82,7 @@ resource "aws_ssm_patch_baseline" "production" { Advanced usage, specifying Microsoft application and Windows patch rules -```hcl +```terraform resource "aws_ssm_patch_baseline" "windows_os_apps" { name = "WindowsOSAndMicrosoftApps" description = "Patch both Windows and Microsoft apps" @@ -121,7 +121,7 @@ resource "aws_ssm_patch_baseline" "windows_os_apps" { Advanced usage, specifying alternate patch source repository -```hcl +```terraform resource "aws_ssm_patch_baseline" "al_2017_09" { name = "Amazon-Linux-2017.09" description = "My patch repository for Amazon Linux 2017.09" diff --git a/website/docs/r/ssm_patch_group.html.markdown b/website/docs/r/ssm_patch_group.html.markdown index 93d6d97f7e8..68ab843b688 100644 --- a/website/docs/r/ssm_patch_group.html.markdown +++ b/website/docs/r/ssm_patch_group.html.markdown @@ -12,7 +12,7 @@ Provides an SSM Patch Group resource ## Example Usage -```hcl +```terraform resource "aws_ssm_patch_baseline" "production" { name = "patch-baseline" approved_patches = ["KB123456"] diff --git a/website/docs/r/ssm_resource_data_sync.html.markdown b/website/docs/r/ssm_resource_data_sync.html.markdown index f693ebe47fd..a251c136aba 100644 --- a/website/docs/r/ssm_resource_data_sync.html.markdown +++ b/website/docs/r/ssm_resource_data_sync.html.markdown @@ -12,7 +12,7 @@ Provides a SSM resource data sync. ## Example Usage -```hcl +```terraform resource "aws_s3_bucket" "hoge" { bucket = "tf-test-bucket-1234" } diff --git a/website/docs/r/ssoadmin_account_assignment.html.markdown b/website/docs/r/ssoadmin_account_assignment.html.markdown index 176b5cd2486..6ad791922d6 100644 --- a/website/docs/r/ssoadmin_account_assignment.html.markdown +++ b/website/docs/r/ssoadmin_account_assignment.html.markdown @@ -12,7 +12,7 @@ Provides a Single Sign-On (SSO) Account Assignment resource ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} data "aws_ssoadmin_permission_set" "example" { diff --git a/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown b/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown index f10b8b99e86..29441ce6844 100644 --- a/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown +++ b/website/docs/r/ssoadmin_managed_policy_attachment.html.markdown @@ -14,7 +14,7 @@ Provides an IAM managed policy for a Single Sign-On (SSO) Permission Set resourc ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} resource "aws_ssoadmin_permission_set" "example" { diff --git a/website/docs/r/ssoadmin_permission_set.html.markdown b/website/docs/r/ssoadmin_permission_set.html.markdown index c682196481b..39197cde941 100644 --- a/website/docs/r/ssoadmin_permission_set.html.markdown +++ b/website/docs/r/ssoadmin_permission_set.html.markdown @@ -14,7 +14,7 @@ Provides a Single Sign-On (SSO) Permission Set resource ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} resource "aws_ssoadmin_permission_set" "example" { 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 e5c19127b19..c3e8e2558f0 100644 --- a/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown +++ b/website/docs/r/ssoadmin_permission_set_inline_policy.html.markdown @@ -15,7 +15,7 @@ Creating or updating this resource will automatically [Provision the Permission ## Example Usage -```hcl +```terraform data "aws_ssoadmin_instances" "example" {} resource "aws_ssoadmin_permission_set" "example" { diff --git a/website/docs/r/storagegateway_cache.html.markdown b/website/docs/r/storagegateway_cache.html.markdown index 09d73925784..d40ef8b2cf2 100644 --- a/website/docs/r/storagegateway_cache.html.markdown +++ b/website/docs/r/storagegateway_cache.html.markdown @@ -14,7 +14,7 @@ Manages an AWS Storage Gateway cache. ## Example Usage -```hcl +```terraform resource "aws_storagegateway_cache" "example" { disk_id = data.aws_storagegateway_local_disk.example.id gateway_arn = aws_storagegateway_gateway.example.arn diff --git a/website/docs/r/storagegateway_cached_iscsi_volume.html.markdown b/website/docs/r/storagegateway_cached_iscsi_volume.html.markdown index c9cf49eebe7..88b2dc7c82a 100644 --- a/website/docs/r/storagegateway_cached_iscsi_volume.html.markdown +++ b/website/docs/r/storagegateway_cached_iscsi_volume.html.markdown @@ -20,7 +20,7 @@ Manages an AWS Storage Gateway cached iSCSI volume. ### Create Empty Cached iSCSI Volume -```hcl +```terraform resource "aws_storagegateway_cached_iscsi_volume" "example" { gateway_arn = aws_storagegateway_cache.example.gateway_arn network_interface_id = aws_instance.example.private_ip @@ -31,7 +31,7 @@ resource "aws_storagegateway_cached_iscsi_volume" "example" { ### Create Cached iSCSI Volume From Snapshot -```hcl +```terraform resource "aws_storagegateway_cached_iscsi_volume" "example" { gateway_arn = aws_storagegateway_cache.example.gateway_arn network_interface_id = aws_instance.example.private_ip @@ -43,7 +43,7 @@ resource "aws_storagegateway_cached_iscsi_volume" "example" { ### Create Cached iSCSI Volume From Source Volume -```hcl +```terraform resource "aws_storagegateway_cached_iscsi_volume" "example" { gateway_arn = aws_storagegateway_cache.example.gateway_arn network_interface_id = aws_instance.example.private_ip diff --git a/website/docs/r/storagegateway_gateway.html.markdown b/website/docs/r/storagegateway_gateway.html.markdown index c07f62bf937..8ccfba535ba 100644 --- a/website/docs/r/storagegateway_gateway.html.markdown +++ b/website/docs/r/storagegateway_gateway.html.markdown @@ -16,7 +16,7 @@ Manages an AWS Storage Gateway file, tape, or volume gateway in the provider reg ### File Gateway -```hcl +```terraform resource "aws_storagegateway_gateway" "example" { gateway_ip_address = "1.2.3.4" gateway_name = "example" @@ -27,7 +27,7 @@ resource "aws_storagegateway_gateway" "example" { ### Tape Gateway -```hcl +```terraform resource "aws_storagegateway_gateway" "example" { gateway_ip_address = "1.2.3.4" gateway_name = "example" @@ -40,7 +40,7 @@ resource "aws_storagegateway_gateway" "example" { ### Volume Gateway (Cached) -```hcl +```terraform resource "aws_storagegateway_gateway" "example" { gateway_ip_address = "1.2.3.4" gateway_name = "example" @@ -51,7 +51,7 @@ resource "aws_storagegateway_gateway" "example" { ### Volume Gateway (Stored) -```hcl +```terraform resource "aws_storagegateway_gateway" "example" { gateway_ip_address = "1.2.3.4" gateway_name = "example" @@ -130,7 +130,7 @@ $ terraform import aws_storagegateway_gateway.example arn:aws:storagegateway:us- Certain resource arguments, like `gateway_ip_address` do not have a Storage Gateway API method for reading the information after creation, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_storagegateway_gateway" "example" { # ... other configuration ... diff --git a/website/docs/r/storagegateway_nfs_file_share.html.markdown b/website/docs/r/storagegateway_nfs_file_share.html.markdown index deebc12898a..b15471641c9 100644 --- a/website/docs/r/storagegateway_nfs_file_share.html.markdown +++ b/website/docs/r/storagegateway_nfs_file_share.html.markdown @@ -12,7 +12,7 @@ Manages an AWS Storage Gateway NFS File Share. ## Example Usage -```hcl +```terraform resource "aws_storagegateway_nfs_file_share" "example" { client_list = ["0.0.0.0/0"] gateway_arn = aws_storagegateway_gateway.example.arn diff --git a/website/docs/r/storagegateway_smb_file_share.html.markdown b/website/docs/r/storagegateway_smb_file_share.html.markdown index cd4256f8a2f..89933687463 100644 --- a/website/docs/r/storagegateway_smb_file_share.html.markdown +++ b/website/docs/r/storagegateway_smb_file_share.html.markdown @@ -16,7 +16,7 @@ Manages an AWS Storage Gateway SMB File Share. ~> **NOTE:** The gateway must have already joined the Active Directory domain prior to SMB file share creation. e.g. via "SMB Settings" in the AWS Storage Gateway console or `smb_active_directory_settings` in the [`aws_storagegateway_gateway` resource](/docs/providers/aws/r/storagegateway_gateway.html). -```hcl +```terraform resource "aws_storagegateway_smb_file_share" "example" { authentication = "ActiveDirectory" gateway_arn = aws_storagegateway_gateway.example.arn @@ -29,7 +29,7 @@ resource "aws_storagegateway_smb_file_share" "example" { ~> **NOTE:** The gateway must have already had the SMB guest password set prior to SMB file share creation. e.g. via "SMB Settings" in the AWS Storage Gateway console or `smb_guest_password` in the [`aws_storagegateway_gateway` resource](/docs/providers/aws/r/storagegateway_gateway.html). -```hcl +```terraform resource "aws_storagegateway_smb_file_share" "example" { authentication = "GuestAccess" gateway_arn = aws_storagegateway_gateway.example.arn diff --git a/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown b/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown index abd14313a63..8d4e3144463 100644 --- a/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown +++ b/website/docs/r/storagegateway_stored_iscsi_volume.html.markdown @@ -16,7 +16,7 @@ Manages an AWS Storage Gateway stored iSCSI volume. ### Create Empty Stored iSCSI Volume -```hcl +```terraform resource "aws_storagegateway_stored_iscsi_volume" "example" { gateway_arn = aws_storagegateway_cache.example.gateway_arn network_interface_id = aws_instance.example.private_ip @@ -28,7 +28,7 @@ resource "aws_storagegateway_stored_iscsi_volume" "example" { ### Create Stored iSCSI Volume From Snapshot -```hcl +```terraform resource "aws_storagegateway_stored_iscsi_volume" "example" { gateway_arn = aws_storagegateway_cache.example.gateway_arn network_interface_id = aws_instance.example.private_ip diff --git a/website/docs/r/storagegateway_tape_pool.html.markdown b/website/docs/r/storagegateway_tape_pool.html.markdown index 07921c9184a..6b6055abf93 100644 --- a/website/docs/r/storagegateway_tape_pool.html.markdown +++ b/website/docs/r/storagegateway_tape_pool.html.markdown @@ -12,7 +12,7 @@ Manages an AWS Storage Gateway Tape Pool. ## Example Usage -```hcl +```terraform resource "aws_storagegateway_tape_pool" "example" { pool_name = "example" storage_class = "GLACIER" diff --git a/website/docs/r/storagegateway_upload_buffer.html.markdown b/website/docs/r/storagegateway_upload_buffer.html.markdown index 9c313682bf1..7eb8c0e21be 100644 --- a/website/docs/r/storagegateway_upload_buffer.html.markdown +++ b/website/docs/r/storagegateway_upload_buffer.html.markdown @@ -14,7 +14,7 @@ Manages an AWS Storage Gateway upload buffer. ## Example Usage -```hcl +```terraform resource "aws_storagegateway_upload_buffer" "example" { disk_id = data.aws_storagegateway_local_disk.example.id gateway_arn = aws_storagegateway_gateway.example.arn diff --git a/website/docs/r/storagegateway_working_storage.html.markdown b/website/docs/r/storagegateway_working_storage.html.markdown index 63882bc25e6..e41b11fab7a 100644 --- a/website/docs/r/storagegateway_working_storage.html.markdown +++ b/website/docs/r/storagegateway_working_storage.html.markdown @@ -14,7 +14,7 @@ Manages an AWS Storage Gateway working storage. ## Example Usage -```hcl +```terraform resource "aws_storagegateway_working_storage" "example" { disk_id = data.aws_storagegateway_local_disk.example.id gateway_arn = aws_storagegateway_gateway.example.arn diff --git a/website/docs/r/subnet.html.markdown b/website/docs/r/subnet.html.markdown index 3c1d0e9b213..06b99583250 100644 --- a/website/docs/r/subnet.html.markdown +++ b/website/docs/r/subnet.html.markdown @@ -16,7 +16,7 @@ Provides an VPC subnet resource. ### Basic Usage -```hcl +```terraform resource "aws_subnet" "main" { vpc_id = aws_vpc.main.id cidr_block = "10.0.1.0/24" @@ -32,7 +32,7 @@ resource "aws_subnet" "main" { When managing subnets in one of a VPC's secondary CIDR blocks created using a [`aws_vpc_ipv4_cidr_block_association`](vpc_ipv4_cidr_block_association.html) resource, it is recommended to reference that resource's `vpc_id` attribute to ensure correct dependency ordering. -```hcl +```terraform resource "aws_vpc_ipv4_cidr_block_association" "secondary_cidr" { vpc_id = aws_vpc.main.id cidr_block = "172.2.0.0/16" diff --git a/website/docs/r/swf_domain.html.markdown b/website/docs/r/swf_domain.html.markdown index ef1ba6b720e..54ff506f2b9 100644 --- a/website/docs/r/swf_domain.html.markdown +++ b/website/docs/r/swf_domain.html.markdown @@ -14,7 +14,7 @@ Provides an SWF Domain resource. To register a basic SWF domain: -```hcl +```terraform resource "aws_swf_domain" "foo" { name = "foo" description = "Terraform SWF Domain" diff --git a/website/docs/r/synthetics_canary.html.markdown b/website/docs/r/synthetics_canary.html.markdown index 745322205fe..afce6ab4484 100644 --- a/website/docs/r/synthetics_canary.html.markdown +++ b/website/docs/r/synthetics_canary.html.markdown @@ -14,7 +14,7 @@ Provides a Synthetics Canary resource. ## Example Usage -```hcl +```terraform resource "aws_synthetics_canary" "some" { name = "some-canary" artifact_s3_location = "s3://some-bucket/" diff --git a/website/docs/r/transfer_server.html.markdown b/website/docs/r/transfer_server.html.markdown index 09bc5988851..1667d6f31e0 100644 --- a/website/docs/r/transfer_server.html.markdown +++ b/website/docs/r/transfer_server.html.markdown @@ -12,7 +12,7 @@ Provides a AWS Transfer Server resource. ## Example Usage -```hcl +```terraform resource "aws_transfer_server" "example" { identity_provider_type = "SERVICE_MANAGED" logging_role = aws_iam_role.example.arn diff --git a/website/docs/r/transfer_ssh_key.html.markdown b/website/docs/r/transfer_ssh_key.html.markdown index fd3f222feab..f81895d5eec 100644 --- a/website/docs/r/transfer_ssh_key.html.markdown +++ b/website/docs/r/transfer_ssh_key.html.markdown @@ -12,7 +12,7 @@ Provides a AWS Transfer User SSH Key resource. ## Example Usage -```hcl +```terraform resource "aws_transfer_ssh_key" "example" { server_id = aws_transfer_server.example.id user_name = aws_transfer_user.example.user_name diff --git a/website/docs/r/transfer_user.html.markdown b/website/docs/r/transfer_user.html.markdown index e3612371a3c..96782817d7f 100644 --- a/website/docs/r/transfer_user.html.markdown +++ b/website/docs/r/transfer_user.html.markdown @@ -12,7 +12,7 @@ Provides a AWS Transfer User resource. Managing SSH keys can be accomplished wit ## Example Usage -```hcl +```terraform resource "aws_transfer_server" "foo" { identity_provider_type = "SERVICE_MANAGED" diff --git a/website/docs/r/volume_attachment.html.markdown b/website/docs/r/volume_attachment.html.markdown index 918b9de79d1..193e6070723 100644 --- a/website/docs/r/volume_attachment.html.markdown +++ b/website/docs/r/volume_attachment.html.markdown @@ -15,7 +15,7 @@ detach volumes from AWS Instances. ## Example Usage -```hcl +```terraform resource "aws_volume_attachment" "ebs_att" { device_name = "/dev/sdh" volume_id = aws_ebs_volume.example.id diff --git a/website/docs/r/vpc.html.markdown b/website/docs/r/vpc.html.markdown index 53f9f6dba53..915c0432f31 100644 --- a/website/docs/r/vpc.html.markdown +++ b/website/docs/r/vpc.html.markdown @@ -14,7 +14,7 @@ Provides a VPC resource. Basic usage: -```hcl +```terraform resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" } @@ -22,7 +22,7 @@ resource "aws_vpc" "main" { Basic usage with tags: -```hcl +```terraform resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" instance_tenancy = "default" diff --git a/website/docs/r/vpc_dhcp_options.html.markdown b/website/docs/r/vpc_dhcp_options.html.markdown index bf36af819a9..e95063633af 100644 --- a/website/docs/r/vpc_dhcp_options.html.markdown +++ b/website/docs/r/vpc_dhcp_options.html.markdown @@ -14,7 +14,7 @@ Provides a VPC DHCP Options resource. Basic usage: -```hcl +```terraform resource "aws_vpc_dhcp_options" "dns_resolver" { domain_name_servers = ["8.8.8.8", "8.8.4.4"] } @@ -22,7 +22,7 @@ resource "aws_vpc_dhcp_options" "dns_resolver" { Full usage: -```hcl +```terraform resource "aws_vpc_dhcp_options" "foo" { domain_name = "service.consul" domain_name_servers = ["127.0.0.1", "10.0.0.2"] diff --git a/website/docs/r/vpc_dhcp_options_association.html.markdown b/website/docs/r/vpc_dhcp_options_association.html.markdown index a77932755bc..2779035acbf 100644 --- a/website/docs/r/vpc_dhcp_options_association.html.markdown +++ b/website/docs/r/vpc_dhcp_options_association.html.markdown @@ -12,7 +12,7 @@ Provides a VPC DHCP Options Association resource. ## Example Usage -```hcl +```terraform resource "aws_vpc_dhcp_options_association" "dns_resolver" { vpc_id = aws_vpc.foo.id dhcp_options_id = aws_vpc_dhcp_options.foo.id diff --git a/website/docs/r/vpc_endpoint.html.markdown b/website/docs/r/vpc_endpoint.html.markdown index 3a82dbd7e6b..f107efee5fc 100644 --- a/website/docs/r/vpc_endpoint.html.markdown +++ b/website/docs/r/vpc_endpoint.html.markdown @@ -21,7 +21,7 @@ Doing so will cause a conflict of associations and will overwrite the associatio ### Basic -```hcl +```terraform resource "aws_vpc_endpoint" "s3" { vpc_id = aws_vpc.main.id service_name = "com.amazonaws.us-west-2.s3" @@ -30,7 +30,7 @@ resource "aws_vpc_endpoint" "s3" { ### Basic w/ Tags -```hcl +```terraform resource "aws_vpc_endpoint" "s3" { vpc_id = aws_vpc.main.id service_name = "com.amazonaws.us-west-2.s3" @@ -43,7 +43,7 @@ resource "aws_vpc_endpoint" "s3" { ### Interface Endpoint Type -```hcl +```terraform resource "aws_vpc_endpoint" "ec2" { vpc_id = aws_vpc.main.id service_name = "com.amazonaws.us-west-2.ec2" @@ -59,7 +59,7 @@ resource "aws_vpc_endpoint" "ec2" { ### Gateway Load Balancer Endpoint Type -```hcl +```terraform data "aws_caller_identity" "current" {} resource "aws_vpc_endpoint_service" "example" { @@ -78,7 +78,7 @@ resource "aws_vpc_endpoint" "example" { ### Non-AWS Service -```hcl +```terraform resource "aws_vpc_endpoint" "ptfe_service" { vpc_id = var.vpc_id service_name = var.ptfe_service diff --git a/website/docs/r/vpc_endpoint_connection_notification.html.markdown b/website/docs/r/vpc_endpoint_connection_notification.html.markdown index 96292bdb839..0cbe474f6c5 100644 --- a/website/docs/r/vpc_endpoint_connection_notification.html.markdown +++ b/website/docs/r/vpc_endpoint_connection_notification.html.markdown @@ -13,7 +13,7 @@ Connection notifications notify subscribers of VPC Endpoint events. ## Example Usage -```hcl +```terraform resource "aws_sns_topic" "topic" { name = "vpce-notification-topic" diff --git a/website/docs/r/vpc_endpoint_route_table_association.html.markdown b/website/docs/r/vpc_endpoint_route_table_association.html.markdown index 5e7a45695fd..2094e6a2133 100644 --- a/website/docs/r/vpc_endpoint_route_table_association.html.markdown +++ b/website/docs/r/vpc_endpoint_route_table_association.html.markdown @@ -12,7 +12,7 @@ Manages a VPC Endpoint Route Table Association ## Example Usage -```hcl +```terraform resource "aws_vpc_endpoint_route_table_association" "example" { route_table_id = aws_route_table.example.id vpc_endpoint_id = aws_vpc_endpoint.example.id diff --git a/website/docs/r/vpc_endpoint_service.html.markdown b/website/docs/r/vpc_endpoint_service.html.markdown index b9291fb8541..31c6511c7a5 100644 --- a/website/docs/r/vpc_endpoint_service.html.markdown +++ b/website/docs/r/vpc_endpoint_service.html.markdown @@ -21,7 +21,7 @@ and will overwrite the association. ### Network Load Balancers -```hcl +```terraform resource "aws_vpc_endpoint_service" "example" { acceptance_required = false network_load_balancer_arns = [aws_lb.example.arn] @@ -30,7 +30,7 @@ resource "aws_vpc_endpoint_service" "example" { ### Gateway Load Balancers -```hcl +```terraform resource "aws_vpc_endpoint_service" "example" { acceptance_required = false gateway_load_balancer_arns = [aws_lb.example.arn] diff --git a/website/docs/r/vpc_endpoint_service_allowed_principal.html.markdown b/website/docs/r/vpc_endpoint_service_allowed_principal.html.markdown index 3f398df634a..a3fd43f3e2d 100644 --- a/website/docs/r/vpc_endpoint_service_allowed_principal.html.markdown +++ b/website/docs/r/vpc_endpoint_service_allowed_principal.html.markdown @@ -20,7 +20,7 @@ and will overwrite the association. Basic usage: -```hcl +```terraform data "aws_caller_identity" "current" {} resource "aws_vpc_endpoint_service_allowed_principal" "allow_me_to_foo" { diff --git a/website/docs/r/vpc_endpoint_subnet_association.html.markdown b/website/docs/r/vpc_endpoint_subnet_association.html.markdown index 783e3e038c6..59adfedf7ab 100644 --- a/website/docs/r/vpc_endpoint_subnet_association.html.markdown +++ b/website/docs/r/vpc_endpoint_subnet_association.html.markdown @@ -20,7 +20,7 @@ Association resource. Doing so will cause a conflict of associations and will ov Basic usage: -```hcl +```terraform resource "aws_vpc_endpoint_subnet_association" "sn_ec2" { vpc_endpoint_id = aws_vpc_endpoint.ec2.id subnet_id = aws_subnet.sn.id diff --git a/website/docs/r/vpc_ipv4_cidr_block_association.html.markdown b/website/docs/r/vpc_ipv4_cidr_block_association.html.markdown index 0435df8c707..e61e8100c0c 100644 --- a/website/docs/r/vpc_ipv4_cidr_block_association.html.markdown +++ b/website/docs/r/vpc_ipv4_cidr_block_association.html.markdown @@ -15,7 +15,7 @@ The `aws_vpc_ipv4_cidr_block_association` resource allows further IPv4 CIDR bloc ## Example Usage -```hcl +```terraform resource "aws_vpc" "main" { cidr_block = "10.0.0.0/16" } diff --git a/website/docs/r/vpc_peering_connection.html.markdown b/website/docs/r/vpc_peering_connection.html.markdown index 56bbb88ba5a..6b424acb073 100644 --- a/website/docs/r/vpc_peering_connection.html.markdown +++ b/website/docs/r/vpc_peering_connection.html.markdown @@ -24,7 +24,7 @@ connection and use the `aws_vpc_peering_connection_accepter` resource to manage ## Example Usage -```hcl +```terraform resource "aws_vpc_peering_connection" "foo" { peer_owner_id = var.peer_owner_id peer_vpc_id = aws_vpc.bar.id @@ -34,7 +34,7 @@ resource "aws_vpc_peering_connection" "foo" { Basic usage with connection options: -```hcl +```terraform resource "aws_vpc_peering_connection" "foo" { peer_owner_id = var.peer_owner_id peer_vpc_id = aws_vpc.bar.id @@ -52,7 +52,7 @@ resource "aws_vpc_peering_connection" "foo" { Basic usage with tags: -```hcl +```terraform resource "aws_vpc_peering_connection" "foo" { peer_owner_id = var.peer_owner_id peer_vpc_id = aws_vpc.bar.id @@ -76,7 +76,7 @@ resource "aws_vpc" "bar" { Basic usage with region: -```hcl +```terraform resource "aws_vpc_peering_connection" "foo" { peer_owner_id = var.peer_owner_id peer_vpc_id = aws_vpc.bar.id diff --git a/website/docs/r/vpc_peering_connection_accepter.html.markdown b/website/docs/r/vpc_peering_connection_accepter.html.markdown index 8d734896d78..930e21f4556 100644 --- a/website/docs/r/vpc_peering_connection_accepter.html.markdown +++ b/website/docs/r/vpc_peering_connection_accepter.html.markdown @@ -19,7 +19,7 @@ connection into management. ## Example Usage -```hcl +```terraform provider "aws" { region = "us-east-1" @@ -127,7 +127,7 @@ $ terraform import aws_vpc_peering_connection_accepter.example pcx-12345678 Certain resource arguments, like `auto_accept`, do not have an EC2 API method for reading the information after peering connection creation. If the argument is set in the Terraform configuration on an imported resource, Terraform will always show a difference. To workaround this behavior, either omit the argument from the Terraform configuration or use [`ignore_changes`](https://www.terraform.io/docs/configuration/meta-arguments/lifecycle.html#ignore_changes) to hide the difference, e.g. -```hcl +```terraform resource "aws_vpc_peering_connection_accepter" "example" { # ... other configuration ... diff --git a/website/docs/r/vpc_peering_connection_options.html.markdown b/website/docs/r/vpc_peering_connection_options.html.markdown index efaec0ada0c..25f73cd6b42 100644 --- a/website/docs/r/vpc_peering_connection_options.html.markdown +++ b/website/docs/r/vpc_peering_connection_options.html.markdown @@ -23,7 +23,7 @@ cross-account scenarios. ### Basic Usage -```hcl +```terraform resource "aws_vpc" "foo" { cidr_block = "10.0.0.0/16" } @@ -54,7 +54,7 @@ resource "aws_vpc_peering_connection_options" "foo" { ### Cross-Account Usage -```hcl +```terraform provider "aws" { alias = "requester" diff --git a/website/docs/r/vpn_connection.html.markdown b/website/docs/r/vpn_connection.html.markdown index 3b7edab9947..de95eb47287 100644 --- a/website/docs/r/vpn_connection.html.markdown +++ b/website/docs/r/vpn_connection.html.markdown @@ -20,7 +20,7 @@ Manages an EC2 VPN connection. These objects can be connected to customer gatewa ### EC2 Transit Gateway -```hcl +```terraform resource "aws_ec2_transit_gateway" "example" {} resource "aws_customer_gateway" "example" { @@ -38,7 +38,7 @@ resource "aws_vpn_connection" "example" { ### Virtual Private Gateway -```hcl +```terraform resource "aws_vpc" "vpc" { cidr_block = "10.0.0.0/16" } diff --git a/website/docs/r/vpn_connection_route.html.markdown b/website/docs/r/vpn_connection_route.html.markdown index 24b3d823a15..e8ea0a83348 100644 --- a/website/docs/r/vpn_connection_route.html.markdown +++ b/website/docs/r/vpn_connection_route.html.markdown @@ -12,7 +12,7 @@ Provides a static route between a VPN connection and a customer gateway. ## Example Usage -```hcl +```terraform resource "aws_vpc" "vpc" { cidr_block = "10.0.0.0/16" } diff --git a/website/docs/r/vpn_gateway.html.markdown b/website/docs/r/vpn_gateway.html.markdown index 6d2fd5a5f4b..b2c3547668d 100644 --- a/website/docs/r/vpn_gateway.html.markdown +++ b/website/docs/r/vpn_gateway.html.markdown @@ -12,7 +12,7 @@ Provides a resource to create a VPC VPN Gateway. ## Example Usage -```hcl +```terraform resource "aws_vpn_gateway" "vpn_gw" { vpc_id = aws_vpc.main.id diff --git a/website/docs/r/vpn_gateway_attachment.html.markdown b/website/docs/r/vpn_gateway_attachment.html.markdown index a5263c3dea0..6c88b45d41f 100644 --- a/website/docs/r/vpn_gateway_attachment.html.markdown +++ b/website/docs/r/vpn_gateway_attachment.html.markdown @@ -17,7 +17,7 @@ to an existing VPC by setting the [`vpc_id`](vpn_gateway.html#vpc_id) attribute ## Example Usage -```hcl +```terraform resource "aws_vpc" "network" { cidr_block = "10.0.0.0/16" } diff --git a/website/docs/r/vpn_gateway_route_propagation.html.markdown b/website/docs/r/vpn_gateway_route_propagation.html.markdown index 6aad37e90eb..24400a3ee5f 100644 --- a/website/docs/r/vpn_gateway_route_propagation.html.markdown +++ b/website/docs/r/vpn_gateway_route_propagation.html.markdown @@ -16,7 +16,7 @@ propagation not explicitly listed in its value will be removed. ## Example Usage -```hcl +```terraform resource "aws_vpn_gateway_route_propagation" "example" { vpn_gateway_id = aws_vpn_gateway.example.id route_table_id = aws_route_table.example.id diff --git a/website/docs/r/waf_byte_match_set.html.markdown b/website/docs/r/waf_byte_match_set.html.markdown index ee9296887bc..456d60f40c0 100644 --- a/website/docs/r/waf_byte_match_set.html.markdown +++ b/website/docs/r/waf_byte_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Byte Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_byte_match_set" "byte_set" { name = "tf_waf_byte_match_set" diff --git a/website/docs/r/waf_geo_match_set.html.markdown b/website/docs/r/waf_geo_match_set.html.markdown index 05c2e31fa12..f50fef5e7e6 100644 --- a/website/docs/r/waf_geo_match_set.html.markdown +++ b/website/docs/r/waf_geo_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Geo Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_geo_match_set" "geo_match_set" { name = "geo_match_set" diff --git a/website/docs/r/waf_ipset.html.markdown b/website/docs/r/waf_ipset.html.markdown index 5f0d8f31b83..960ab8068b8 100644 --- a/website/docs/r/waf_ipset.html.markdown +++ b/website/docs/r/waf_ipset.html.markdown @@ -12,7 +12,7 @@ Provides a WAF IPSet Resource ## Example Usage -```hcl +```terraform resource "aws_waf_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/waf_rate_based_rule.html.markdown b/website/docs/r/waf_rate_based_rule.html.markdown index 108cce9b2a3..ffe086df5fd 100644 --- a/website/docs/r/waf_rate_based_rule.html.markdown +++ b/website/docs/r/waf_rate_based_rule.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Rate Based Rule Resource ## Example Usage -```hcl +```terraform resource "aws_waf_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/waf_regex_match_set.html.markdown b/website/docs/r/waf_regex_match_set.html.markdown index 7daf76c54b2..2d944525bab 100644 --- a/website/docs/r/waf_regex_match_set.html.markdown +++ b/website/docs/r/waf_regex_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regex Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_regex_match_set" "example" { name = "example" diff --git a/website/docs/r/waf_regex_pattern_set.html.markdown b/website/docs/r/waf_regex_pattern_set.html.markdown index 4b41feb3117..b70e01e21ee 100644 --- a/website/docs/r/waf_regex_pattern_set.html.markdown +++ b/website/docs/r/waf_regex_pattern_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regex Pattern Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_regex_pattern_set" "example" { name = "tf_waf_regex_pattern_set" regex_pattern_strings = ["one", "two"] diff --git a/website/docs/r/waf_rule.html.markdown b/website/docs/r/waf_rule.html.markdown index 8015a6badf1..08b22cc49b9 100644 --- a/website/docs/r/waf_rule.html.markdown +++ b/website/docs/r/waf_rule.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Rule Resource ## Example Usage -```hcl +```terraform resource "aws_waf_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/waf_rule_group.html.markdown b/website/docs/r/waf_rule_group.html.markdown index bdd479cff19..b31b3d70e8a 100644 --- a/website/docs/r/waf_rule_group.html.markdown +++ b/website/docs/r/waf_rule_group.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Rule Group Resource ## Example Usage -```hcl +```terraform resource "aws_waf_rule" "example" { name = "example" metric_name = "example" diff --git a/website/docs/r/waf_size_constraint_set.html.markdown b/website/docs/r/waf_size_constraint_set.html.markdown index 7f71fa827e3..967d80b1698 100644 --- a/website/docs/r/waf_size_constraint_set.html.markdown +++ b/website/docs/r/waf_size_constraint_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Size Constraint Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_size_constraint_set" "size_constraint_set" { name = "tfsize_constraints" diff --git a/website/docs/r/waf_sql_injection_match_set.html.markdown b/website/docs/r/waf_sql_injection_match_set.html.markdown index 08da2041fb7..5f15be5a86b 100644 --- a/website/docs/r/waf_sql_injection_match_set.html.markdown +++ b/website/docs/r/waf_sql_injection_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF SQL Injection Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_sql_injection_match_set" "sql_injection_match_set" { name = "tf-sql_injection_match_set" diff --git a/website/docs/r/waf_web_acl.html.markdown b/website/docs/r/waf_web_acl.html.markdown index bfc344c0003..0baf09d5e3e 100644 --- a/website/docs/r/waf_web_acl.html.markdown +++ b/website/docs/r/waf_web_acl.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Web ACL Resource ## Example Usage -```hcl +```terraform resource "aws_waf_ipset" "ipset" { name = "tfIPSet" @@ -62,7 +62,7 @@ resource "aws_waf_web_acl" "waf_acl" { ~> *NOTE:* The Kinesis Firehose Delivery Stream name must begin with `aws-waf-logs-` and be located in `us-east-1` region. See the [AWS WAF Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) for more information about enabling WAF logging. -```hcl +```terraform resource "aws_waf_web_acl" "example" { # ... other configuration ... logging_configuration { diff --git a/website/docs/r/waf_xss_match_set.html.markdown b/website/docs/r/waf_xss_match_set.html.markdown index 099e52af684..53ae21926f1 100644 --- a/website/docs/r/waf_xss_match_set.html.markdown +++ b/website/docs/r/waf_xss_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF XSS Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_waf_xss_match_set" "xss_match_set" { name = "xss_match_set" diff --git a/website/docs/r/wafregional_byte_match_set.html.markdown b/website/docs/r/wafregional_byte_match_set.html.markdown index 7385dca8d0f..4d95e16a0c3 100644 --- a/website/docs/r/wafregional_byte_match_set.html.markdown +++ b/website/docs/r/wafregional_byte_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Byte Match Set Resource for use with Application Load Ba ## Example Usage -```hcl +```terraform resource "aws_wafregional_byte_match_set" "byte_set" { name = "tf_waf_byte_match_set" diff --git a/website/docs/r/wafregional_geo_match_set.html.markdown b/website/docs/r/wafregional_geo_match_set.html.markdown index 372c49cdfbb..bb74aa5d228 100644 --- a/website/docs/r/wafregional_geo_match_set.html.markdown +++ b/website/docs/r/wafregional_geo_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Geo Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_wafregional_geo_match_set" "geo_match_set" { name = "geo_match_set" diff --git a/website/docs/r/wafregional_ipset.html.markdown b/website/docs/r/wafregional_ipset.html.markdown index ec2735d7d6f..a045292b6ca 100644 --- a/website/docs/r/wafregional_ipset.html.markdown +++ b/website/docs/r/wafregional_ipset.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional IPSet Resource for use with Application Load Balancer. ## Example Usage -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/wafregional_rate_based_rule.html.markdown b/website/docs/r/wafregional_rate_based_rule.html.markdown index 3b7a2d45602..b50f80c30ea 100644 --- a/website/docs/r/wafregional_rate_based_rule.html.markdown +++ b/website/docs/r/wafregional_rate_based_rule.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Rate Based Rule Resource ## Example Usage -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/wafregional_regex_match_set.html.markdown b/website/docs/r/wafregional_regex_match_set.html.markdown index a62da853921..a7153fd94aa 100644 --- a/website/docs/r/wafregional_regex_match_set.html.markdown +++ b/website/docs/r/wafregional_regex_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Regex Match Set Resource ## Example Usage -```hcl +```terraform resource "aws_wafregional_regex_match_set" "example" { name = "example" diff --git a/website/docs/r/wafregional_regex_pattern_set.html.markdown b/website/docs/r/wafregional_regex_pattern_set.html.markdown index b1074dd779c..3c7e79d2f06 100644 --- a/website/docs/r/wafregional_regex_pattern_set.html.markdown +++ b/website/docs/r/wafregional_regex_pattern_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Regex Pattern Set Resource ## Example Usage -```hcl +```terraform resource "aws_wafregional_regex_pattern_set" "example" { name = "example" regex_pattern_strings = ["one", "two"] diff --git a/website/docs/r/wafregional_rule.html.markdown b/website/docs/r/wafregional_rule.html.markdown index 524864e31c7..41e712f4c2f 100644 --- a/website/docs/r/wafregional_rule.html.markdown +++ b/website/docs/r/wafregional_rule.html.markdown @@ -12,7 +12,7 @@ Provides an WAF Regional Rule Resource for use with Application Load Balancer. ## Example Usage -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/wafregional_rule_group.html.markdown b/website/docs/r/wafregional_rule_group.html.markdown index 0f0966dad45..181665b1b08 100644 --- a/website/docs/r/wafregional_rule_group.html.markdown +++ b/website/docs/r/wafregional_rule_group.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Rule Group Resource ## Example Usage -```hcl +```terraform resource "aws_wafregional_rule" "example" { name = "example" metric_name = "example" diff --git a/website/docs/r/wafregional_size_constraint_set.html.markdown b/website/docs/r/wafregional_size_constraint_set.html.markdown index aa4bc596e35..c7558c2954d 100644 --- a/website/docs/r/wafregional_size_constraint_set.html.markdown +++ b/website/docs/r/wafregional_size_constraint_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional Size Constraint Set Resource for use with Application Lo ## Example Usage -```hcl +```terraform resource "aws_wafregional_size_constraint_set" "size_constraint_set" { name = "tfsize_constraints" diff --git a/website/docs/r/wafregional_sql_injection_match_set.html.markdown b/website/docs/r/wafregional_sql_injection_match_set.html.markdown index 6780264e456..7978425c800 100644 --- a/website/docs/r/wafregional_sql_injection_match_set.html.markdown +++ b/website/docs/r/wafregional_sql_injection_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional SQL Injection Match Set Resource for use with Applicatio ## Example Usage -```hcl +```terraform resource "aws_wafregional_sql_injection_match_set" "sql_injection_match_set" { name = "tf-sql_injection_match_set" diff --git a/website/docs/r/wafregional_web_acl.html.markdown b/website/docs/r/wafregional_web_acl.html.markdown index 9aa7fb02fc5..6d33d16ae35 100644 --- a/website/docs/r/wafregional_web_acl.html.markdown +++ b/website/docs/r/wafregional_web_acl.html.markdown @@ -14,7 +14,7 @@ Provides a WAF Regional Web ACL Resource for use with Application Load Balancer. ### Regular Rule -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" @@ -57,7 +57,7 @@ resource "aws_wafregional_web_acl" "wafacl" { ### Group Rule -```hcl +```terraform resource "aws_wafregional_web_acl" "example" { name = "example" metric_name = "example" @@ -82,7 +82,7 @@ resource "aws_wafregional_web_acl" "example" { ~> *NOTE:* The Kinesis Firehose Delivery Stream name must begin with `aws-waf-logs-`. See the [AWS WAF Developer Guide](https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) for more information about enabling WAF logging. -```hcl +```terraform resource "aws_wafregional_web_acl" "example" { # ... other configuration ... diff --git a/website/docs/r/wafregional_web_acl_association.html.markdown b/website/docs/r/wafregional_web_acl_association.html.markdown index acbfe6358f3..b7f106c2b9a 100644 --- a/website/docs/r/wafregional_web_acl_association.html.markdown +++ b/website/docs/r/wafregional_web_acl_association.html.markdown @@ -16,7 +16,7 @@ Manages an association with WAF Regional Web ACL. ### Application Load Balancer Association -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" @@ -86,7 +86,7 @@ resource "aws_wafregional_web_acl_association" "foo" { ### API Gateway Association -```hcl +```terraform resource "aws_wafregional_ipset" "ipset" { name = "tfIPSet" diff --git a/website/docs/r/wafregional_xss_match_set.html.markdown b/website/docs/r/wafregional_xss_match_set.html.markdown index dc020e00abc..222e73fd319 100644 --- a/website/docs/r/wafregional_xss_match_set.html.markdown +++ b/website/docs/r/wafregional_xss_match_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAF Regional XSS Match Set Resource for use with Application Load Bal ## Example Usage -```hcl +```terraform resource "aws_wafregional_xss_match_set" "xss_match_set" { name = "xss_match_set" diff --git a/website/docs/r/wafv2_ip_set.html.markdown b/website/docs/r/wafv2_ip_set.html.markdown index 10fa926bbe6..f0d46a50d83 100644 --- a/website/docs/r/wafv2_ip_set.html.markdown +++ b/website/docs/r/wafv2_ip_set.html.markdown @@ -12,7 +12,7 @@ Provides a WAFv2 IP Set Resource ## Example Usage -```hcl +```terraform resource "aws_wafv2_ip_set" "example" { name = "example" description = "Example IP set" diff --git a/website/docs/r/wafv2_regex_pattern_set.html.markdown b/website/docs/r/wafv2_regex_pattern_set.html.markdown index 02e643041a5..71d7aff53ca 100644 --- a/website/docs/r/wafv2_regex_pattern_set.html.markdown +++ b/website/docs/r/wafv2_regex_pattern_set.html.markdown @@ -12,7 +12,7 @@ Provides an AWS WAFv2 Regex Pattern Set Resource ## Example Usage -```hcl +```terraform resource "aws_wafv2_regex_pattern_set" "example" { name = "example" description = "Example regex pattern set" diff --git a/website/docs/r/wafv2_rule_group.html.markdown b/website/docs/r/wafv2_rule_group.html.markdown index 26e43c86034..ca47b030c7e 100644 --- a/website/docs/r/wafv2_rule_group.html.markdown +++ b/website/docs/r/wafv2_rule_group.html.markdown @@ -14,7 +14,7 @@ Creates a WAFv2 Rule Group resource. ### Simple -```hcl +```terraform resource "aws_wafv2_rule_group" "example" { name = "example-rule" scope = "REGIONAL" @@ -52,7 +52,7 @@ resource "aws_wafv2_rule_group" "example" { ### Complex -```hcl +```terraform resource "aws_wafv2_ip_set" "test" { name = "test" scope = "REGIONAL" diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index 170b9e59c54..f3a91cb8d71 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -17,7 +17,7 @@ This resource is based on `aws_wafv2_rule_group`, check the documentation of the ### Managed Rule -```hcl +```terraform resource "aws_wafv2_web_acl" "example" { name = "managed-rule-example" description = "Example of a managed rule." @@ -72,7 +72,7 @@ resource "aws_wafv2_web_acl" "example" { ### Rate Based -```hcl +```terraform resource "aws_wafv2_web_acl" "example" { name = "rate-based-example" description = "Example of a rate based statement." @@ -125,7 +125,7 @@ resource "aws_wafv2_web_acl" "example" { ### Rule Group Reference -```hcl +```terraform resource "aws_wafv2_rule_group" "example" { capacity = 10 name = "example-rule-group" diff --git a/website/docs/r/wafv2_web_acl_association.html.markdown b/website/docs/r/wafv2_web_acl_association.html.markdown index 03e41dd8e63..fe82ebd6663 100644 --- a/website/docs/r/wafv2_web_acl_association.html.markdown +++ b/website/docs/r/wafv2_web_acl_association.html.markdown @@ -17,7 +17,7 @@ Creates a WAFv2 Web ACL Association. ## Example Usage -```hcl +```terraform resource "aws_api_gateway_rest_api" "example" { body = jsonencode({ openapi = "3.0.1" diff --git a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown index 2c2307a83bf..62955499241 100644 --- a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown +++ b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown @@ -16,7 +16,7 @@ Be sure to give the data firehose a name that starts with the prefix `aws-waf-lo ## Example Usage -```hcl +```terraform resource "aws_wafv2_web_acl_logging_configuration" "example" { log_destination_configs = [aws_kinesis_firehose_delivery_stream.example.arn] resource_arn = aws_wafv2_web_acl.example.arn diff --git a/website/docs/r/worklink_fleet.html.markdown b/website/docs/r/worklink_fleet.html.markdown index 88a40b57ef0..70aa0d41102 100644 --- a/website/docs/r/worklink_fleet.html.markdown +++ b/website/docs/r/worklink_fleet.html.markdown @@ -12,7 +12,7 @@ description: |- Basic usage: -```hcl +```terraform resource "aws_worklink_fleet" "example" { name = "terraform-example" } @@ -20,7 +20,7 @@ resource "aws_worklink_fleet" "example" { Network Configuration Usage: -```hcl +```terraform resource "aws_worklink_fleet" "example" { name = "terraform-example" @@ -34,7 +34,7 @@ resource "aws_worklink_fleet" "example" { Identity Provider Configuration Usage: -```hcl +```terraform resource "aws_worklink_fleet" "test" { name = "tf-worklink-fleet" diff --git a/website/docs/r/worklink_website_certificate_authority_association.html.markdown b/website/docs/r/worklink_website_certificate_authority_association.html.markdown index faf157b5a7d..16ac310c02d 100644 --- a/website/docs/r/worklink_website_certificate_authority_association.html.markdown +++ b/website/docs/r/worklink_website_certificate_authority_association.html.markdown @@ -10,7 +10,7 @@ description: |- ## Example Usage -```hcl +```terraform resource "aws_worklink_fleet" "example" { name = "terraform-example" } diff --git a/website/docs/r/workspaces_directory.html.markdown b/website/docs/r/workspaces_directory.html.markdown index 53bd1a31882..9e5c913c932 100644 --- a/website/docs/r/workspaces_directory.html.markdown +++ b/website/docs/r/workspaces_directory.html.markdown @@ -14,7 +14,7 @@ Provides a WorkSpaces directory in AWS WorkSpaces Service. ## Example Usage -```hcl +```terraform resource "aws_workspaces_directory" "example" { directory_id = aws_directory_service_directory.example.id subnet_ids = [ @@ -128,7 +128,7 @@ resource "aws_subnet" "example_d" { ### IP Groups -```hcl +```terraform resource "aws_workspaces_directory" "example" { directory_id = aws_directory_service_directory.example.id diff --git a/website/docs/r/workspaces_ip_group.html.markdown b/website/docs/r/workspaces_ip_group.html.markdown index e15aebba92e..3923da0c1bd 100644 --- a/website/docs/r/workspaces_ip_group.html.markdown +++ b/website/docs/r/workspaces_ip_group.html.markdown @@ -12,7 +12,7 @@ Provides an IP access control group in AWS WorkSpaces Service ## Example Usage -```hcl +```terraform resource "aws_workspaces_ip_group" "contractors" { name = "Contractors" description = "Contractors IP access control group" diff --git a/website/docs/r/workspaces_workspace.html.markdown b/website/docs/r/workspaces_workspace.html.markdown index a62b266f437..d39f28cd4cc 100644 --- a/website/docs/r/workspaces_workspace.html.markdown +++ b/website/docs/r/workspaces_workspace.html.markdown @@ -14,7 +14,7 @@ Provides a workspace in [AWS Workspaces](https://docs.aws.amazon.com/workspaces/ ## Example Usage -```hcl +```terraform data "aws_workspaces_bundle" "value_windows_10" { bundle_id = "wsb-bh8rsxt14" # Value with Windows 10 (English) } diff --git a/website/docs/r/xray_encryption_config.html.markdown b/website/docs/r/xray_encryption_config.html.markdown index 758d578a84c..6e566c28349 100644 --- a/website/docs/r/xray_encryption_config.html.markdown +++ b/website/docs/r/xray_encryption_config.html.markdown @@ -14,7 +14,7 @@ Creates and manages an AWS XRay Encryption Config. ## Example Usage -```hcl +```terraform resource "aws_xray_encryption_config" "example" { type = "NONE" } @@ -22,7 +22,7 @@ resource "aws_xray_encryption_config" "example" { ## Example Usage with KMS Key -```hcl +```terraform resource "aws_kms_key" "example" { description = "Some Key" deletion_window_in_days = 7 diff --git a/website/docs/r/xray_group.html.markdown b/website/docs/r/xray_group.html.markdown index 83844b545ac..4da5bd4f8bd 100644 --- a/website/docs/r/xray_group.html.markdown +++ b/website/docs/r/xray_group.html.markdown @@ -12,7 +12,7 @@ Creates and manages an AWS XRay Group. ## Example Usage -```hcl +```terraform resource "aws_xray_group" "example" { group_name = "example" filter_expression = "responsetime > 5" diff --git a/website/docs/r/xray_sampling_rule.html.markdown b/website/docs/r/xray_sampling_rule.html.markdown index f596f7bc296..12fd88c3842 100644 --- a/website/docs/r/xray_sampling_rule.html.markdown +++ b/website/docs/r/xray_sampling_rule.html.markdown @@ -12,7 +12,7 @@ Creates and manages an AWS XRay Sampling Rule. ## Example Usage -```hcl +```terraform resource "aws_xray_sampling_rule" "example" { rule_name = "example" priority = 10000 From 45838f9f2c0ea60cb6332961ebb2b782b6a97a6d Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 15:40:07 +0000 Subject: [PATCH 0083/1252] Update CHANGELOG.md for #18008 --- CHANGELOG.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 43a594b9b4b..26ef22e87d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ ENHANCEMENTS: BUG FIXES: +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + +ENHANCEMENTS: + +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) + +BUG FIXES: + * resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) * resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) * resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) From af44f2a27427d2bdb64fccd0284d0d0479c2637b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 14:23:32 -0500 Subject: [PATCH 0084/1252] tests: Add mechanism for general ErrorCheck --- aws/provider_test.go | 62 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/aws/provider_test.go b/aws/provider_test.go index 70af59809db..349a92a308d 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1036,6 +1036,68 @@ func testAccErrorCheckSkipMessagesContaining(t *testing.T, messages ...string) r } } +type ServiceErrorCheckFunc func(*testing.T) resource.ErrorCheckFunc + +var serviceErrorCheckFuncs map[string]ServiceErrorCheckFunc + +func RegisterServiceErrorCheckFunc(endpointID string, f ServiceErrorCheckFunc) { + if serviceErrorCheckFuncs == nil { + serviceErrorCheckFuncs = make(map[string]ServiceErrorCheckFunc) + } + serviceErrorCheckFuncs[endpointID] = f +} + +func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckFunc { + return func(err error) error { + if err == nil { + return err + } + + if f, ok := serviceErrorCheckFuncs[endpointID]; ok { + ef := f(t) + err = ef(err) + } + + if testAccErrorCheckSkipError(err) { + t.Skipf("skipping test for %s/%s: %s", testAccGetPartition(), testAccGetRegion(), err.Error()) + } + + return err + } +} + +func testAccErrorCheckSkipError(err error) bool { + if strings.Contains(err.Error(), "is not supported in this region") { + return true + } + + if strings.Contains(err.Error(), "is currently not supported in this region") { + return true + } + + if strings.Contains(err.Error(), "is not supported in this partition") { + return true + } + + if tfawserr.ErrCodeEquals(err, "UnknownOperationException") { + return true + } + + if tfawserr.ErrCodeEquals(err, "UnsupportedOperation") { + return true + } + + if tfawserr.ErrMessageContains(err, "InvalidInputException", "Unknown operation") { + return true + } + + if tfawserr.ErrMessageContains(err, "InvalidAction", "Unavailable Operation") { + return true + } + + return false +} + // Check service API call error for reasons to skip acceptance testing // These include missing API endpoints and unsupported API calls func testAccPreCheckSkipError(err error) bool { From b7ea4b9ee2d0ebf2fcadcc7688cb126f71be448a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 14:24:39 -0500 Subject: [PATCH 0085/1252] tests: Rename ErrorCheck helper --- aws/provider_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 349a92a308d..5a846665b07 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1058,7 +1058,7 @@ func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckF err = ef(err) } - if testAccErrorCheckSkipError(err) { + if testAccErrorCheck(err) { t.Skipf("skipping test for %s/%s: %s", testAccGetPartition(), testAccGetRegion(), err.Error()) } @@ -1066,7 +1066,7 @@ func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckF } } -func testAccErrorCheckSkipError(err error) bool { +func testAccErrorCheck(err error) bool { if strings.Contains(err.Error(), "is not supported in this region") { return true } From d503be1d5d7eadae13da633e798a84152d53910b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 14:25:23 -0500 Subject: [PATCH 0086/1252] tests/route53: Use new general ErrorCheck with Route53 --- aws/resource_aws_route53_record_test.go | 70 +++++++++++++------------ 1 file changed, 37 insertions(+), 33 deletions(-) diff --git a/aws/resource_aws_route53_record_test.go b/aws/resource_aws_route53_record_test.go index c2b29e2fdae..19df1a382e9 100644 --- a/aws/resource_aws_route53_record_test.go +++ b/aws/resource_aws_route53_record_test.go @@ -15,6 +15,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +func init() { + RegisterServiceErrorCheckFunc(route53.EndpointsID, testAccErrorCheckSkipRoute53) +} + func TestCleanRecordName(t *testing.T) { cases := []struct { Input, Output string @@ -110,7 +114,7 @@ func TestAccAWSRoute53Record_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -137,7 +141,7 @@ func TestAccAWSRoute53Record_underscored(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -164,7 +168,7 @@ func TestAccAWSRoute53Record_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -187,7 +191,7 @@ func TestAccAWSRoute53Record_disappears_MultipleRecords(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -214,7 +218,7 @@ func TestAccAWSRoute53Record_basic_fqdn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -256,7 +260,7 @@ func TestAccAWSRoute53Record_basic_trailingPeriodAndZoneID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -283,7 +287,7 @@ func TestAccAWSRoute53Record_txtSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"zone_id"}, // just for this test Providers: testAccProviders, @@ -311,7 +315,7 @@ func TestAccAWSRoute53Record_spfSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -339,7 +343,7 @@ func TestAccAWSRoute53Record_caaSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -367,7 +371,7 @@ func TestAccAWSRoute53Record_dsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -393,7 +397,7 @@ func TestAccAWSRoute53Record_generatesSuffix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -420,7 +424,7 @@ func TestAccAWSRoute53Record_wildcard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -455,7 +459,7 @@ func TestAccAWSRoute53Record_failover(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -483,7 +487,7 @@ func TestAccAWSRoute53Record_weighted_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: "aws_route53_record.www-live", Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -512,7 +516,7 @@ func TestAccAWSRoute53Record_weighted_to_simple_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -546,7 +550,7 @@ func TestAccAWSRoute53Record_Alias_Elb(t *testing.T) { config := fmt.Sprintf(testAccRoute53RecordConfigAliasElb, rs) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -574,7 +578,7 @@ func TestAccAWSRoute53Record_Alias_S3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -601,7 +605,7 @@ func TestAccAWSRoute53Record_Alias_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -633,7 +637,7 @@ func TestAccAWSRoute53Record_Alias_Uppercase(t *testing.T) { config := fmt.Sprintf(testAccRoute53RecordConfigAliasElbUppercase, rs) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -660,7 +664,7 @@ func TestAccAWSRoute53Record_weighted_alias(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -698,7 +702,7 @@ func TestAccAWSRoute53Record_geolocation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -727,7 +731,7 @@ func TestAccAWSRoute53Record_HealthCheckId_SetIdentifierChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -760,7 +764,7 @@ func TestAccAWSRoute53Record_HealthCheckId_TypeChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -793,7 +797,7 @@ func TestAccAWSRoute53Record_latency_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -821,7 +825,7 @@ func TestAccAWSRoute53Record_TypeChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -856,7 +860,7 @@ func TestAccAWSRoute53Record_NameChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -892,7 +896,7 @@ func TestAccAWSRoute53Record_SetIdentifierChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -927,7 +931,7 @@ func TestAccAWSRoute53Record_AliasChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -962,7 +966,7 @@ func TestAccAWSRoute53Record_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -984,7 +988,7 @@ func TestAccAWSRoute53Record_longTXTrecord(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -1011,7 +1015,7 @@ func TestAccAWSRoute53Record_multivalue_answer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -1052,7 +1056,7 @@ func TestAccAWSRoute53Record_allowOverwrite(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -1080,7 +1084,7 @@ func testAccErrorCheckSkipRoute53(t *testing.T) resource.ErrorCheckFunc { func testAccAWSRoute53RecordOverwriteExpectErrorCheck(t *testing.T) resource.ErrorCheckFunc { return func(err error) error { - f := testAccErrorCheckSkipRoute53(t) + f := testAccErrorCheckSkip(t, route53.EndpointsID) err = f(err) if err == nil { From c19cb5d9c1cffc385a55f985fb8ae3f812483436 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 14:37:41 -0500 Subject: [PATCH 0087/1252] tests: Rename ErrorCheck func --- aws/provider_test.go | 6 +-- aws/resource_aws_route53_record_test.go | 66 ++++++++++++------------- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 5a846665b07..f79dbf153c2 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1047,7 +1047,7 @@ func RegisterServiceErrorCheckFunc(endpointID string, f ServiceErrorCheckFunc) { serviceErrorCheckFuncs[endpointID] = f } -func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckFunc { +func testAccErrorCheck(t *testing.T, endpointID string) resource.ErrorCheckFunc { return func(err error) error { if err == nil { return err @@ -1058,7 +1058,7 @@ func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckF err = ef(err) } - if testAccErrorCheck(err) { + if testAccErrorCheckCommon(err) { t.Skipf("skipping test for %s/%s: %s", testAccGetPartition(), testAccGetRegion(), err.Error()) } @@ -1066,7 +1066,7 @@ func testAccErrorCheckSkip(t *testing.T, endpointID string) resource.ErrorCheckF } } -func testAccErrorCheck(err error) bool { +func testAccErrorCheckCommon(err error) bool { if strings.Contains(err.Error(), "is not supported in this region") { return true } diff --git a/aws/resource_aws_route53_record_test.go b/aws/resource_aws_route53_record_test.go index 19df1a382e9..8cf383082db 100644 --- a/aws/resource_aws_route53_record_test.go +++ b/aws/resource_aws_route53_record_test.go @@ -114,7 +114,7 @@ func TestAccAWSRoute53Record_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -141,7 +141,7 @@ func TestAccAWSRoute53Record_underscored(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -168,7 +168,7 @@ func TestAccAWSRoute53Record_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -191,7 +191,7 @@ func TestAccAWSRoute53Record_disappears_MultipleRecords(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -218,7 +218,7 @@ func TestAccAWSRoute53Record_basic_fqdn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -260,7 +260,7 @@ func TestAccAWSRoute53Record_basic_trailingPeriodAndZoneID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -287,7 +287,7 @@ func TestAccAWSRoute53Record_txtSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"zone_id"}, // just for this test Providers: testAccProviders, @@ -315,7 +315,7 @@ func TestAccAWSRoute53Record_spfSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -343,7 +343,7 @@ func TestAccAWSRoute53Record_caaSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -371,7 +371,7 @@ func TestAccAWSRoute53Record_dsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -397,7 +397,7 @@ func TestAccAWSRoute53Record_generatesSuffix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -424,7 +424,7 @@ func TestAccAWSRoute53Record_wildcard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -459,7 +459,7 @@ func TestAccAWSRoute53Record_failover(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -487,7 +487,7 @@ func TestAccAWSRoute53Record_weighted_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: "aws_route53_record.www-live", Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -516,7 +516,7 @@ func TestAccAWSRoute53Record_weighted_to_simple_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -550,7 +550,7 @@ func TestAccAWSRoute53Record_Alias_Elb(t *testing.T) { config := fmt.Sprintf(testAccRoute53RecordConfigAliasElb, rs) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -578,7 +578,7 @@ func TestAccAWSRoute53Record_Alias_S3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -605,7 +605,7 @@ func TestAccAWSRoute53Record_Alias_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -637,7 +637,7 @@ func TestAccAWSRoute53Record_Alias_Uppercase(t *testing.T) { config := fmt.Sprintf(testAccRoute53RecordConfigAliasElbUppercase, rs) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -664,7 +664,7 @@ func TestAccAWSRoute53Record_weighted_alias(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -702,7 +702,7 @@ func TestAccAWSRoute53Record_geolocation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -731,7 +731,7 @@ func TestAccAWSRoute53Record_HealthCheckId_SetIdentifierChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -764,7 +764,7 @@ func TestAccAWSRoute53Record_HealthCheckId_TypeChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -797,7 +797,7 @@ func TestAccAWSRoute53Record_latency_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -825,7 +825,7 @@ func TestAccAWSRoute53Record_TypeChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -860,7 +860,7 @@ func TestAccAWSRoute53Record_NameChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -896,7 +896,7 @@ func TestAccAWSRoute53Record_SetIdentifierChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -931,7 +931,7 @@ func TestAccAWSRoute53Record_AliasChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -966,7 +966,7 @@ func TestAccAWSRoute53Record_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -988,7 +988,7 @@ func TestAccAWSRoute53Record_longTXTrecord(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, @@ -1015,7 +1015,7 @@ func TestAccAWSRoute53Record_multivalue_answer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -1056,7 +1056,7 @@ func TestAccAWSRoute53Record_allowOverwrite(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkip(t, route53.EndpointsID), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53RecordDestroy, Steps: []resource.TestStep{ @@ -1084,7 +1084,7 @@ func testAccErrorCheckSkipRoute53(t *testing.T) resource.ErrorCheckFunc { func testAccAWSRoute53RecordOverwriteExpectErrorCheck(t *testing.T) resource.ErrorCheckFunc { return func(err error) error { - f := testAccErrorCheckSkip(t, route53.EndpointsID) + f := testAccErrorCheck(t, route53.EndpointsID) err = f(err) if err == nil { From 38677eabfcedf655d4405de6a151edcd72528b1c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 15:18:57 -0500 Subject: [PATCH 0088/1252] tests/route53: Skip no such host error --- aws/resource_aws_route53_record_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_route53_record_test.go b/aws/resource_aws_route53_record_test.go index 8cf383082db..d35c0d21064 100644 --- a/aws/resource_aws_route53_record_test.go +++ b/aws/resource_aws_route53_record_test.go @@ -1079,6 +1079,7 @@ func testAccErrorCheckSkipRoute53(t *testing.T) resource.ErrorCheckFunc { return testAccErrorCheckSkipMessagesContaining(t, "Operations related to PublicDNS", "Regional control plane current does not support", + "NoSuchHostedZone: The specified hosted zone", ) } From c9d75e61dd22e18abe6760dff121b4196242af89 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 11 Mar 2021 15:22:28 -0500 Subject: [PATCH 0089/1252] tests/route53: Tweak error messages --- aws/provider_test.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index f79dbf153c2..3efd4af9615 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1067,15 +1067,11 @@ func testAccErrorCheck(t *testing.T, endpointID string) resource.ErrorCheckFunc } func testAccErrorCheckCommon(err error) bool { - if strings.Contains(err.Error(), "is not supported in this region") { + if strings.Contains(err.Error(), "is not supported in this") { return true } - if strings.Contains(err.Error(), "is currently not supported in this region") { - return true - } - - if strings.Contains(err.Error(), "is not supported in this partition") { + if strings.Contains(err.Error(), "is currently not supported") { return true } From c98ba47ff13a984a06d263eef4c00f749e3775ad Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 12 Mar 2021 13:40:35 -0500 Subject: [PATCH 0090/1252] tests/ErrorCheck: Make variadic --- aws/provider_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 3efd4af9615..be486b753a7 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1047,15 +1047,17 @@ func RegisterServiceErrorCheckFunc(endpointID string, f ServiceErrorCheckFunc) { serviceErrorCheckFuncs[endpointID] = f } -func testAccErrorCheck(t *testing.T, endpointID string) resource.ErrorCheckFunc { +func testAccErrorCheck(t *testing.T, endpointIDs ...string) resource.ErrorCheckFunc { return func(err error) error { if err == nil { return err } - if f, ok := serviceErrorCheckFuncs[endpointID]; ok { - ef := f(t) - err = ef(err) + for _, endpointID := range endpointIDs { + if f, ok := serviceErrorCheckFuncs[endpointID]; ok { + ef := f(t) + err = ef(err) + } } if testAccErrorCheckCommon(err) { From 099aed34d66d50e09321a15ad37f52a3d8b362f6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 14:00:30 -0400 Subject: [PATCH 0091/1252] tests: Panic for re-registering ServiceErrorCheckFuncs --- aws/provider_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/provider_test.go b/aws/provider_test.go index be486b753a7..298340e9773 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1044,6 +1044,12 @@ func RegisterServiceErrorCheckFunc(endpointID string, f ServiceErrorCheckFunc) { if serviceErrorCheckFuncs == nil { serviceErrorCheckFuncs = make(map[string]ServiceErrorCheckFunc) } + + if _, ok := serviceErrorCheckFuncs[endpointID]; ok { + // already registered + panic(fmt.Sprintf("Cannot re-register a service! ServiceErrorCheckFunc exists for %s", endpointID)) + } + serviceErrorCheckFuncs[endpointID] = f } @@ -1058,6 +1064,10 @@ func testAccErrorCheck(t *testing.T, endpointIDs ...string) resource.ErrorCheckF ef := f(t) err = ef(err) } + + if err == nil { + break + } } if testAccErrorCheckCommon(err) { From eb9bf5fabbbbc1858869f41ab4f7006354f2a827 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Wed, 17 Mar 2021 14:12:00 -0400 Subject: [PATCH 0092/1252] resource/aws_codebuild_project: Deprecate source and secondary_sources auth blocks (#17465) resource/aws_codebuild_project: Deprecate source and secondary_sources auth blocks Reference: https://docs.aws.amazon.com/codebuild/latest/APIReference/API_SourceAuth.html Reference: https://github.com/hashicorp/terraform-provider-aws/issues/13450 Currently, the following consistent test failure occurs in AWSCodeBuildProject acceptance testing: ``` --- FAIL: TestAccAWSCodeBuildProject_Source_Auth (11.50s) testing.go:683: Step 1 error: errors during apply: Error: Error creating CodeBuild project: InvalidInputException: No Access token found, please visit AWS CodeBuild console to connect to GitHub ``` The API documentation now very explicitly states this underlying API type is deprecated. Here we mark the block and underlying attributes as deprecated suggesting the `aws_codebuild_source_credential` resource and removing the problematic test rather than temporarily introducing a skipping mechanism. --- .changelog/17465.txt | 3 + aws/resource_aws_codebuild_project.go | 18 ++++-- aws/resource_aws_codebuild_project_test.go | 61 ------------------- .../docs/r/codebuild_project.html.markdown | 12 ++-- 4 files changed, 21 insertions(+), 73 deletions(-) create mode 100644 .changelog/17465.txt diff --git a/.changelog/17465.txt b/.changelog/17465.txt new file mode 100644 index 00000000000..79e78c67280 --- /dev/null +++ b/.changelog/17465.txt @@ -0,0 +1,3 @@ +```release-note:note +resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. +``` diff --git a/aws/resource_aws_codebuild_project.go b/aws/resource_aws_codebuild_project.go index 36e2630d4ed..e082891d3a9 100644 --- a/aws/resource_aws_codebuild_project.go +++ b/aws/resource_aws_codebuild_project.go @@ -402,9 +402,10 @@ func resourceAwsCodeBuildProject() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "resource": { - Type: schema.TypeString, - Sensitive: true, - Optional: true, + Type: schema.TypeString, + Sensitive: true, + Optional: true, + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, "type": { Type: schema.TypeString, @@ -412,9 +413,11 @@ func resourceAwsCodeBuildProject() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ codebuild.SourceAuthTypeOauth, }, false), + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, }, }, + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, "buildspec": { Type: schema.TypeString, @@ -486,9 +489,10 @@ func resourceAwsCodeBuildProject() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "resource": { - Type: schema.TypeString, - Sensitive: true, - Optional: true, + Type: schema.TypeString, + Sensitive: true, + Optional: true, + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, "type": { Type: schema.TypeString, @@ -496,9 +500,11 @@ func resourceAwsCodeBuildProject() *schema.Resource { ValidateFunc: validation.StringInSlice([]string{ codebuild.SourceAuthTypeOauth, }, false), + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, }, }, + Deprecated: "Use the aws_codebuild_source_credential resource instead", }, "buildspec": { Type: schema.TypeString, diff --git a/aws/resource_aws_codebuild_project_test.go b/aws/resource_aws_codebuild_project_test.go index 873c60516b9..a764044159a 100644 --- a/aws/resource_aws_codebuild_project_test.go +++ b/aws/resource_aws_codebuild_project_test.go @@ -594,38 +594,6 @@ func TestAccAWSCodeBuildProject_LogsConfig_S3Logs(t *testing.T) { }) } -func TestAccAWSCodeBuildProject_Source_Auth(t *testing.T) { - var project codebuild.Project - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_codebuild_project.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCodeBuildProjectConfig_Source_Auth(rName, "FAKERESOURCE1", "INVALID"), - ExpectError: regexp.MustCompile(`expected source.0.auth.0.type to be one of`), - }, - { - Config: testAccAWSCodeBuildProjectConfig_Source_Auth(rName, "FAKERESOURCE1", "OAUTH"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeBuildProjectExists(resourceName, &project), - resource.TestCheckResourceAttr(resourceName, "source.0.auth.#", "1"), - resource.TestCheckResourceAttr(resourceName, "source.0.auth.0.resource", "FAKERESOURCE1"), - resource.TestCheckResourceAttr(resourceName, "source.0.auth.0.type", "OAUTH"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSCodeBuildProject_Source_GitCloneDepth(t *testing.T) { var project codebuild.Project rName := acctest.RandomWithPrefix("tf-acc-test") @@ -2835,35 +2803,6 @@ resource "aws_codebuild_project" "test" { `, rName, status, location, encryptionDisabled)) } -func testAccAWSCodeBuildProjectConfig_Source_Auth(rName, authResource, authType string) string { - return composeConfig(testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName), fmt.Sprintf(` -resource "aws_codebuild_project" "test" { - name = "%s" - service_role = aws_iam_role.test.arn - - artifacts { - type = "NO_ARTIFACTS" - } - - environment { - compute_type = "BUILD_GENERAL1_SMALL" - image = "2" - type = "LINUX_CONTAINER" - } - - source { - type = "GITHUB" - location = "https://github.com/hashicorp/packer.git" - - auth { - resource = "%s" - type = "%s" - } - } -} -`, rName, authResource, authType)) -} - func testAccAWSCodeBuildProjectConfig_Source_GitCloneDepth(rName string, gitCloneDepth int) string { return composeConfig(testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName), fmt.Sprintf(` resource "aws_codebuild_project" "test" { diff --git a/website/docs/r/codebuild_project.html.markdown b/website/docs/r/codebuild_project.html.markdown index c37395a08a3..92a0259e526 100755 --- a/website/docs/r/codebuild_project.html.markdown +++ b/website/docs/r/codebuild_project.html.markdown @@ -316,7 +316,7 @@ Credentials for access to a private Docker registry. ### secondary_sources -* `auth` - (Optional) Configuration block. Detailed below. +* `auth` - (Optional, **Deprecated**) Configuration block with the authorization settings for AWS CodeBuild to access the source code to be built. This information is for the AWS CodeBuild console's use only. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. Auth blocks are documented below. * `buildspec` - (Optional) Build specification to use for this build project's related builds. * `git_clone_depth` - (Optional) Truncate git history to this many commits. Use `0` for a `Full` checkout which you need to run commands like `git branch --show-current`. See [AWS CodePipeline User Guide: Tutorial: Use full clone with a GitHub pipeline source](https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-github-gitclone.html) for details. * `git_submodules_config` - (Optional) Configuration block. Detailed below. @@ -328,8 +328,8 @@ Credentials for access to a private Docker registry. #### secondary_sources: auth -* `resource` - (Optional) Resource value that applies to the specified authorization type. -* `type` - (Required) Authorization type to use. The only valid value is `OAUTH`. +* `resource` - (Optional, **Deprecated**) Resource value that applies to the specified authorization type. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. +* `type` - (Required, **Deprecated**) Authorization type to use. The only valid value is `OAUTH`. This data type is deprecated and is no longer accurate or used. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. #### secondary_sources: git_submodules_config @@ -339,7 +339,7 @@ This block is only valid when the `type` is `CODECOMMIT`, `GITHUB` or `GITHUB_EN ### source -* `auth` - (Optional) Configuration block. Detailed below. +* `auth` - (Optional, **Deprecated**) Configuration block with the authorization settings for AWS CodeBuild to access the source code to be built. This information is for the AWS CodeBuild console's use only. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. Auth blocks are documented below. * `buildspec` - (Optional) Build specification to use for this build project's related builds. This must be set when `type` is `NO_SOURCE`. * `git_clone_depth` - (Optional) Truncate git history to this many commits. Use `0` for a `Full` checkout which you need to run commands like `git branch --show-current`. See [AWS CodePipeline User Guide: Tutorial: Use full clone with a GitHub pipeline source](https://docs.aws.amazon.com/codepipeline/latest/userguide/tutorials-github-gitclone.html) for details. * `git_submodules_config` - (Optional) Configuration block. Detailed below. @@ -350,8 +350,8 @@ This block is only valid when the `type` is `CODECOMMIT`, `GITHUB` or `GITHUB_EN #### source: auth -* `resource` - (Optional) Resource value that applies to the specified authorization type. -* `type` - (Required) Authorization type to use. The only valid value is `OAUTH`. +* `resource` - (Optional, **Deprecated**) Resource value that applies to the specified authorization type. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. +* `type` - (Required, **Deprecated**) Authorization type to use. The only valid value is `OAUTH`. This data type is deprecated and is no longer accurate or used. Use the [`aws_codebuild_source_credential` resource](codebuild_source_credential.html) instead. #### source: git_submodules_config From 8e716fb1c6057847ad577fee1015b4d5a3312802 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 18:14:03 +0000 Subject: [PATCH 0093/1252] Update CHANGELOG.md for #17465 --- CHANGELOG.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26ef22e87d4..07b2f865054 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ ## 3.32.0 (March 12, 2021) +NOTES: + +* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) + +ENHANCEMENTS: + +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + ENHANCEMENTS: * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) From bdd310529fd893093970d1686124c3621e845c89 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 14:12:11 -0400 Subject: [PATCH 0094/1252] tests: Ignore panic lint --- aws/provider_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 298340e9773..2e033874c2e 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1047,7 +1047,7 @@ func RegisterServiceErrorCheckFunc(endpointID string, f ServiceErrorCheckFunc) { if _, ok := serviceErrorCheckFuncs[endpointID]; ok { // already registered - panic(fmt.Sprintf("Cannot re-register a service! ServiceErrorCheckFunc exists for %s", endpointID)) + panic(fmt.Sprintf("Cannot re-register a service! ServiceErrorCheckFunc exists for %s", endpointID)) //lintignore:R009 } serviceErrorCheckFuncs[endpointID] = f From 3d0b87f0a0a3c823e906f22b5f16c2cb03139b4b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 21:27:45 +0000 Subject: [PATCH 0095/1252] Update CHANGELOG.md for #18059 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07b2f865054..3c1f07145b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,25 @@ NOTES: ENHANCEMENTS: +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) +* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + +NOTES: + +* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) + +ENHANCEMENTS: + * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) BUG FIXES: From 49aaf01f06b25c2fc5b77530ef1d1ffb49ea0b2e Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 17 Mar 2021 21:31:08 +0000 Subject: [PATCH 0096/1252] Update CHANGELOG.md for #18040 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c1f07145b7..2bda4612aea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,25 @@ NOTES: ENHANCEMENTS: +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) +* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + +NOTES: + +* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) + +ENHANCEMENTS: + * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) BUG FIXES: From f66bcdd901c6900b909331f75e7a80070b38f52f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:58:24 -0400 Subject: [PATCH 0097/1252] ami: Fix main branch --- aws/resource_aws_ami.go | 4 ---- aws/resource_aws_ami_copy.go | 4 ---- aws/resource_aws_ami_from_instance.go | 4 ---- 3 files changed, 12 deletions(-) diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 87705c0ee9c..3fdf4de1cba 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -242,10 +242,6 @@ func resourceAwsAmi() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, "platform": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index bcaee39f4f7..a410f25a4d0 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -214,10 +214,6 @@ func resourceAwsAmiCopy() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, "platform": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index b9e9ea648a6..6bb65bca95d 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -201,10 +201,6 @@ func resourceAwsAmiFromInstance() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "owner_id": { - Type: schema.TypeString, - Computed: true, - }, "platform": { Type: schema.TypeString, Computed: true, From 3df8b1c1aae554765add0394bb6238f08fe19b70 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 23:22:26 -0400 Subject: [PATCH 0098/1252] ami: Clean up argument order to avoid multiple additions --- aws/resource_aws_ami.go | 111 ++++++++++++++++++---------------------- 1 file changed, 51 insertions(+), 60 deletions(-) diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 3fdf4de1cba..3f59a9d220b 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -46,12 +46,6 @@ func resourceAwsAmi() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "image_location": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, "architecture": { Type: schema.TypeString, Optional: true, @@ -59,6 +53,10 @@ func resourceAwsAmi() *schema.Resource { Default: ec2.ArchitectureValuesX8664, ValidateFunc: validation.StringInSlice(ec2.ArchitectureValues_Values(), false), }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -81,45 +79,38 @@ func resourceAwsAmi() *schema.Resource { Default: true, ForceNew: true, }, - "device_name": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "encrypted": { Type: schema.TypeBool, Optional: true, ForceNew: true, }, - "iops": { Type: schema.TypeInt, Optional: true, ForceNew: true, }, - "snapshot_id": { Type: schema.TypeString, Optional: true, ForceNew: true, }, - "throughput": { Type: schema.TypeInt, Optional: true, Computed: true, ForceNew: true, }, - "volume_size": { Type: schema.TypeInt, Optional: true, Computed: true, ForceNew: true, }, - "volume_type": { Type: schema.TypeString, Optional: true, @@ -153,7 +144,6 @@ func resourceAwsAmi() *schema.Resource { Type: schema.TypeString, Required: true, }, - "virtual_name": { Type: schema.TypeString, Required: true, @@ -168,6 +158,24 @@ func resourceAwsAmi() *schema.Resource { return hashcode.String(buf.String()) }, }, + "hypervisor": { + Type: schema.TypeString, + Computed: true, + }, + "image_location": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "image_owner_alias": { + Type: schema.TypeString, + Computed: true, + }, + "image_type": { + Type: schema.TypeString, + Computed: true, + }, "kernel_id": { Type: schema.TypeString, Optional: true, @@ -190,6 +198,18 @@ func resourceAwsAmi() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "platform_details": { + Type: schema.TypeString, + Computed: true, + }, + "platform": { + Type: schema.TypeString, + Computed: true, + }, + "public": { + Type: schema.TypeBool, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Optional: true, @@ -211,6 +231,10 @@ func resourceAwsAmi() *schema.Resource { Default: "simple", }, "tags": tagsSchema(), + "usage_operation": { + Type: schema.TypeString, + Computed: true, + }, "virtualization_type": { Type: schema.TypeString, Optional: true, @@ -218,38 +242,6 @@ func resourceAwsAmi() *schema.Resource { Default: ec2.VirtualizationTypeParavirtual, ValidateFunc: validation.StringInSlice(ec2.VirtualizationType_Values(), false), }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "usage_operation": { - Type: schema.TypeString, - Computed: true, - }, - "platform_details": { - Type: schema.TypeString, - Computed: true, - }, - "image_owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "image_type": { - Type: schema.TypeString, - Computed: true, - }, - "hypervisor": { - Type: schema.TypeString, - Computed: true, - }, - "platform": { - Type: schema.TypeString, - Computed: true, - }, - "public": { - Type: schema.TypeBool, - Computed: true, - }, }, } } @@ -258,14 +250,14 @@ func resourceAwsAmiCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*AWSClient).ec2conn req := &ec2.RegisterImageInput{ - Name: aws.String(d.Get("name").(string)), - Description: aws.String(d.Get("description").(string)), Architecture: aws.String(d.Get("architecture").(string)), + Description: aws.String(d.Get("description").(string)), + EnaSupport: aws.Bool(d.Get("ena_support").(bool)), ImageLocation: aws.String(d.Get("image_location").(string)), + Name: aws.String(d.Get("name").(string)), RootDeviceName: aws.String(d.Get("root_device_name").(string)), SriovNetSupport: aws.String(d.Get("sriov_net_support").(string)), VirtualizationType: aws.String(d.Get("virtualization_type").(string)), - EnaSupport: aws.Bool(d.Get("ena_support").(bool)), } if kernelId := d.Get("kernel_id").(string); kernelId != "" { @@ -396,26 +388,25 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("AMI has become %s", state) } - d.Set("name", image.Name) + d.Set("architecture", image.Architecture) d.Set("description", image.Description) + d.Set("ena_support", image.EnaSupport) + d.Set("hypervisor", image.Hypervisor) d.Set("image_location", image.ImageLocation) - d.Set("architecture", image.Architecture) + d.Set("image_owner_alias", image.ImageOwnerAlias) + d.Set("image_type", image.ImageType) d.Set("kernel_id", image.KernelId) + d.Set("name", image.Name) d.Set("owner_id", image.OwnerId) + d.Set("platform_details", image.PlatformDetails) + d.Set("platform", image.Platform) + d.Set("public", image.Public) d.Set("ramdisk_id", image.RamdiskId) d.Set("root_device_name", image.RootDeviceName) d.Set("root_snapshot_id", amiRootSnapshotId(image)) d.Set("sriov_net_support", image.SriovNetSupport) - d.Set("virtualization_type", image.VirtualizationType) - d.Set("ena_support", image.EnaSupport) d.Set("usage_operation", image.UsageOperation) - d.Set("platform_details", image.PlatformDetails) - d.Set("hypervisor", image.Hypervisor) - d.Set("image_type", image.ImageType) - d.Set("owner_id", image.OwnerId) - d.Set("public", image.Public) - d.Set("image_owner_alias", image.ImageOwnerAlias) - d.Set("platform", image.Platform) + d.Set("virtualization_type", image.VirtualizationType) imageArn := arn.ARN{ Partition: meta.(*AWSClient).partition, From a488b175861de244341edd71750d98a8d2334bf6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 23:26:12 -0400 Subject: [PATCH 0099/1252] ami_from_instance: Clean up arguments --- aws/resource_aws_ami_from_instance.go | 58 +++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index 6bb65bca95d..931f5069b2b 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -26,6 +26,10 @@ func resourceAwsAmiFromInstance() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -121,10 +125,22 @@ func resourceAwsAmiFromInstance() *schema.Resource { return hashcode.String(buf.String()) }, }, + "hypervisor": { + Type: schema.TypeString, + Computed: true, + }, "image_location": { Type: schema.TypeString, Computed: true, }, + "image_owner_alias": { + Type: schema.TypeString, + Computed: true, + }, + "image_type": { + Type: schema.TypeString, + Computed: true, + }, "kernel_id": { Type: schema.TypeString, Computed: true, @@ -146,6 +162,18 @@ func resourceAwsAmiFromInstance() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "platform": { + Type: schema.TypeString, + Computed: true, + }, + "platform_details": { + Type: schema.TypeString, + Computed: true, + }, + "public": { + Type: schema.TypeBool, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Computed: true, @@ -173,42 +201,14 @@ func resourceAwsAmiFromInstance() *schema.Resource { Computed: true, }, "tags": tagsSchema(), - "virtualization_type": { - Type: schema.TypeString, - Computed: true, - }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, "usage_operation": { Type: schema.TypeString, Computed: true, }, - "platform_details": { - Type: schema.TypeString, - Computed: true, - }, - "image_owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "image_type": { - Type: schema.TypeString, - Computed: true, - }, - "hypervisor": { - Type: schema.TypeString, - Computed: true, - }, - "platform": { + "virtualization_type": { Type: schema.TypeString, Computed: true, }, - "public": { - Type: schema.TypeBool, - Computed: true, - }, }, // The remaining operations are shared with the generic aws_ami resource, From bc407cb777fac932ecd3fe5ea28e5d3d77251643 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 23:29:46 -0400 Subject: [PATCH 0100/1252] ami_copy: Clean up arguments --- aws/resource_aws_ami_copy.go | 76 ++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index a410f25a4d0..9a4a863238b 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -26,6 +26,10 @@ func resourceAwsAmiCopy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -91,6 +95,16 @@ func resourceAwsAmiCopy() *schema.Resource { return hashcode.String(buf.String()) }, }, + "ena_support": { + Type: schema.TypeBool, + Computed: true, + }, + "encrypted": { + Type: schema.TypeBool, + Optional: true, + Default: false, + ForceNew: true, + }, "ephemeral_block_device": { Type: schema.TypeSet, Optional: true, @@ -117,20 +131,22 @@ func resourceAwsAmiCopy() *schema.Resource { return hashcode.String(buf.String()) }, }, - "ena_support": { - Type: schema.TypeBool, + "hypervisor": { + Type: schema.TypeString, Computed: true, }, - "encrypted": { - Type: schema.TypeBool, - Optional: true, - Default: false, - ForceNew: true, - }, "image_location": { Type: schema.TypeString, Computed: true, }, + "image_owner_alias": { + Type: schema.TypeString, + Computed: true, + }, + "image_type": { + Type: schema.TypeString, + Computed: true, + }, "kernel_id": { Type: schema.TypeString, Computed: true, @@ -159,6 +175,18 @@ func resourceAwsAmiCopy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "platform": { + Type: schema.TypeString, + Computed: true, + }, + "platform_details": { + Type: schema.TypeString, + Computed: true, + }, + "public": { + Type: schema.TypeBool, + Computed: true, + }, "ramdisk_id": { Type: schema.TypeString, Computed: true, @@ -190,38 +218,10 @@ func resourceAwsAmiCopy() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "arn": { - Type: schema.TypeString, - Computed: true, - }, "usage_operation": { Type: schema.TypeString, Computed: true, }, - "platform_details": { - Type: schema.TypeString, - Computed: true, - }, - "image_owner_alias": { - Type: schema.TypeString, - Computed: true, - }, - "image_type": { - Type: schema.TypeString, - Computed: true, - }, - "hypervisor": { - Type: schema.TypeString, - Computed: true, - }, - "platform": { - Type: schema.TypeString, - Computed: true, - }, - "public": { - Type: schema.TypeBool, - Computed: true, - }, }, // The remaining operations are shared with the generic aws_ami resource, @@ -236,11 +236,11 @@ func resourceAwsAmiCopyCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*AWSClient).ec2conn req := &ec2.CopyImageInput{ - Name: aws.String(d.Get("name").(string)), Description: aws.String(d.Get("description").(string)), + Encrypted: aws.Bool(d.Get("encrypted").(bool)), + Name: aws.String(d.Get("name").(string)), SourceImageId: aws.String(d.Get("source_ami_id").(string)), SourceRegion: aws.String(d.Get("source_ami_region").(string)), - Encrypted: aws.Bool(d.Get("encrypted").(bool)), } if v, ok := d.GetOk("kms_key_id"); ok { From 35b626fc9618b075c534295542e20a41de08d946 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 23:30:52 -0400 Subject: [PATCH 0101/1252] ami: Clean up arguments --- aws/resource_aws_ami_from_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index 931f5069b2b..693b3069e31 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -223,9 +223,9 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) client := meta.(*AWSClient).ec2conn req := &ec2.CreateImageInput{ - Name: aws.String(d.Get("name").(string)), Description: aws.String(d.Get("description").(string)), InstanceId: aws.String(d.Get("source_instance_id").(string)), + Name: aws.String(d.Get("name").(string)), NoReboot: aws.Bool(d.Get("snapshot_without_reboot").(bool)), } From d820423b8596eea1756aec7b7fcb1ff0b9406a29 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 21:51:15 -0400 Subject: [PATCH 0102/1252] tests/ec2: Add ErrorCheck --- aws/data_source_aws_ami_ids_test.go | 11 ++++--- aws/data_source_aws_ami_test.go | 26 +++++++++------- aws/data_source_aws_availability_zone_test.go | 30 +++++++++++-------- ...data_source_aws_availability_zones_test.go | 30 +++++++++++-------- aws/data_source_aws_customer_gateway_test.go | 11 ++++--- ...ata_source_aws_ebs_default_kms_key_test.go | 5 ++-- ...urce_aws_ebs_encryption_by_default_test.go | 5 ++-- aws/data_source_aws_ebs_snapshot_ids_test.go | 16 ++++++---- aws/data_source_aws_ebs_snapshot_test.go | 16 ++++++---- aws/data_source_aws_ebs_volume_test.go | 11 ++++--- aws/data_source_aws_ebs_volumes_test.go | 2 ++ 11 files changed, 99 insertions(+), 64 deletions(-) diff --git a/aws/data_source_aws_ami_ids_test.go b/aws/data_source_aws_ami_ids_test.go index e2c6ba4689a..ae29537a228 100644 --- a/aws/data_source_aws_ami_ids_test.go +++ b/aws/data_source_aws_ami_ids_test.go @@ -4,13 +4,15 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceAwsAmiIds_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAmiIdsConfig_basic, @@ -24,8 +26,9 @@ func TestAccDataSourceAwsAmiIds_basic(t *testing.T) { func TestAccDataSourceAwsAmiIds_sorted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAmiIdsConfig_sorted(false), diff --git a/aws/data_source_aws_ami_test.go b/aws/data_source_aws_ami_test.go index e78b351d0bd..8bb59cb297d 100644 --- a/aws/data_source_aws_ami_test.go +++ b/aws/data_source_aws_ami_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -13,8 +14,9 @@ import ( func TestAccAWSAmiDataSource_natInstance(t *testing.T) { resourceName := "data.aws_ami.nat_ami" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAmiDataSourceConfig, @@ -63,8 +65,9 @@ func TestAccAWSAmiDataSource_natInstance(t *testing.T) { func TestAccAWSAmiDataSource_windowsInstance(t *testing.T) { resourceName := "data.aws_ami.windows_ami" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAmiDataSourceWindowsConfig, @@ -106,8 +109,9 @@ func TestAccAWSAmiDataSource_windowsInstance(t *testing.T) { func TestAccAWSAmiDataSource_instanceStore(t *testing.T) { resourceName := "data.aws_ami.amzn-ami-minimal-hvm-instance-store" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccLatestAmazonLinuxHvmInstanceStoreAmiConfig(), @@ -144,8 +148,9 @@ func TestAccAWSAmiDataSource_instanceStore(t *testing.T) { func TestAccAWSAmiDataSource_localNameFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAmiDataSourceNameRegexConfig, @@ -164,8 +169,9 @@ func TestAccAWSAmiDataSource_Gp3BlockDevice(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAmiDataSourceConfigGp3BlockDevice(rName), diff --git a/aws/data_source_aws_availability_zone_test.go b/aws/data_source_aws_availability_zone_test.go index 9f0f28f8f44..99db4bf475c 100644 --- a/aws/data_source_aws_availability_zone_test.go +++ b/aws/data_source_aws_availability_zone_test.go @@ -14,8 +14,9 @@ func TestAccDataSourceAwsAvailabilityZone_AllAvailabilityZones(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigAllAvailabilityZones(), @@ -41,8 +42,9 @@ func TestAccDataSourceAwsAvailabilityZone_Filter(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigFilter(), @@ -68,8 +70,9 @@ func TestAccDataSourceAwsAvailabilityZone_LocalZone(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLocalZoneAvailable(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLocalZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigZoneType("local-zone"), @@ -95,8 +98,9 @@ func TestAccDataSourceAwsAvailabilityZone_Name(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigName(), @@ -122,8 +126,9 @@ func TestAccDataSourceAwsAvailabilityZone_WavelengthZone(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigZoneType("wavelength-zone"), @@ -149,8 +154,9 @@ func TestAccDataSourceAwsAvailabilityZone_ZoneId(t *testing.T) { dataSourceName := "data.aws_availability_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAvailabilityZoneConfigZoneId(), diff --git a/aws/data_source_aws_availability_zones_test.go b/aws/data_source_aws_availability_zones_test.go index 28ed3881ad1..c9e77a232d9 100644 --- a/aws/data_source_aws_availability_zones_test.go +++ b/aws/data_source_aws_availability_zones_test.go @@ -75,8 +75,9 @@ func TestAvailabilityZonesSort(t *testing.T) { func TestAccAWSAvailabilityZones_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesConfig, @@ -92,8 +93,9 @@ func TestAccAWSAvailabilityZones_AllAvailabilityZones(t *testing.T) { dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesConfigAllAvailabilityZones(), @@ -109,8 +111,9 @@ func TestAccAWSAvailabilityZones_Filter(t *testing.T) { dataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesConfigFilter(), @@ -127,8 +130,9 @@ func TestAccAWSAvailabilityZones_ExcludeNames(t *testing.T) { excludeDataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesConfigExcludeNames(), @@ -145,8 +149,9 @@ func TestAccAWSAvailabilityZones_ExcludeZoneIds(t *testing.T) { excludeDataSourceName := "data.aws_availability_zones.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesConfigExcludeZoneIds(), @@ -160,8 +165,9 @@ func TestAccAWSAvailabilityZones_ExcludeZoneIds(t *testing.T) { func TestAccAWSAvailabilityZones_stateFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAvailabilityZonesStateConfig, diff --git a/aws/data_source_aws_customer_gateway_test.go b/aws/data_source_aws_customer_gateway_test.go index 3acf5c49c11..c2a94ca5f58 100644 --- a/aws/data_source_aws_customer_gateway_test.go +++ b/aws/data_source_aws_customer_gateway_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,9 +17,8 @@ func TestAccAWSCustomerGatewayDataSource_Filter(t *testing.T) { hostOctet := acctest.RandIntRange(1, 254) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, Steps: []resource.TestStep{ @@ -44,9 +44,8 @@ func TestAccAWSCustomerGatewayDataSource_ID(t *testing.T) { hostOctet := acctest.RandIntRange(1, 254) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, Steps: []resource.TestStep{ diff --git a/aws/data_source_aws_ebs_default_kms_key_test.go b/aws/data_source_aws_ebs_default_kms_key_test.go index 2049b7e1fcb..54313ca826a 100644 --- a/aws/data_source_aws_ebs_default_kms_key_test.go +++ b/aws/data_source_aws_ebs_default_kms_key_test.go @@ -12,8 +12,9 @@ import ( func TestAccDataSourceAwsEBSDefaultKmsKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEBSDefaultKmsKeyConfig, diff --git a/aws/data_source_aws_ebs_encryption_by_default_test.go b/aws/data_source_aws_ebs_encryption_by_default_test.go index 39f313de8fb..0cbdc5c06ce 100644 --- a/aws/data_source_aws_ebs_encryption_by_default_test.go +++ b/aws/data_source_aws_ebs_encryption_by_default_test.go @@ -13,8 +13,9 @@ import ( func TestAccDataSourceAwsEBSEncryptionByDefault_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEBSEncryptionByDefaultConfig, diff --git a/aws/data_source_aws_ebs_snapshot_ids_test.go b/aws/data_source_aws_ebs_snapshot_ids_test.go index 1bca667a475..f5275624722 100644 --- a/aws/data_source_aws_ebs_snapshot_ids_test.go +++ b/aws/data_source_aws_ebs_snapshot_ids_test.go @@ -4,14 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceAwsEbsSnapshotIds_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEbsSnapshotIdsConfig_basic(), @@ -27,8 +29,9 @@ func TestAccDataSourceAwsEbsSnapshotIds_sorted(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEbsSnapshotIdsConfig_sorted1(rName), @@ -56,8 +59,9 @@ func TestAccDataSourceAwsEbsSnapshotIds_sorted(t *testing.T) { func TestAccDataSourceAwsEbsSnapshotIds_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEbsSnapshotIdsConfig_empty, diff --git a/aws/data_source_aws_ebs_snapshot_test.go b/aws/data_source_aws_ebs_snapshot_test.go index b8df0fd13a4..baaa94f6aa7 100644 --- a/aws/data_source_aws_ebs_snapshot_test.go +++ b/aws/data_source_aws_ebs_snapshot_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -13,8 +14,9 @@ func TestAccAWSEbsSnapshotDataSource_basic(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEbsSnapshotDataSourceConfig, @@ -41,8 +43,9 @@ func TestAccAWSEbsSnapshotDataSource_Filter(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEbsSnapshotDataSourceConfigFilter, @@ -60,8 +63,9 @@ func TestAccAWSEbsSnapshotDataSource_MostRecent(t *testing.T) { resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEbsSnapshotDataSourceConfigMostRecent, diff --git a/aws/data_source_aws_ebs_volume_test.go b/aws/data_source_aws_ebs_volume_test.go index a956929510d..515e6c2406a 100644 --- a/aws/data_source_aws_ebs_volume_test.go +++ b/aws/data_source_aws_ebs_volume_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -13,8 +14,9 @@ func TestAccAWSEbsVolumeDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ebs_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEbsVolumeDataSourceConfig, @@ -37,8 +39,9 @@ func TestAccAWSEbsVolumeDataSource_multipleFilters(t *testing.T) { dataSourceName := "data.aws_ebs_volume.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEbsVolumeDataSourceConfigWithMultipleFilters, diff --git a/aws/data_source_aws_ebs_volumes_test.go b/aws/data_source_aws_ebs_volumes_test.go index 9f35936ab9a..548596efe6a 100644 --- a/aws/data_source_aws_ebs_volumes_test.go +++ b/aws/data_source_aws_ebs_volumes_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccDataSourceAwsEbsVolumes_basic(t *testing.T) { rInt := acctest.RandIntRange(0, 256) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeDestroy, Steps: []resource.TestStep{ From 517ca9e299d9e5a5ceb774a94f3cf6ec1ccda9d3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 21:59:44 -0400 Subject: [PATCH 0103/1252] tests/ec2_coip_pool_test: Add ErrorCheck --- aws/data_source_aws_ec2_coip_pool_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ec2_coip_pool_test.go b/aws/data_source_aws_ec2_coip_pool_test.go index 9cb93025c89..6c6b4d4daa4 100644 --- a/aws/data_source_aws_ec2_coip_pool_test.go +++ b/aws/data_source_aws_ec2_coip_pool_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ func TestAccDataSourceAwsEc2CoipPool_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2CoipPoolDataSourceConfigFilter(), @@ -30,8 +32,9 @@ func TestAccDataSourceAwsEc2CoipPool_Id(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pool.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2CoipPoolDataSourceConfigId(), From 037334a5a3290d67bae15a63a43d218ab54b866b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:00:05 -0400 Subject: [PATCH 0104/1252] tests/ec2_coip_pools_test: Add ErrorCheck --- aws/data_source_aws_ec2_coip_pools_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ec2_coip_pools_test.go b/aws/data_source_aws_ec2_coip_pools_test.go index b152a7cb5eb..e31c70bbf6e 100644 --- a/aws/data_source_aws_ec2_coip_pools_test.go +++ b/aws/data_source_aws_ec2_coip_pools_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,8 +11,9 @@ func TestAccDataSourceAwsEc2CoipPools_basic(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pools.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2CoipPoolsConfig(), @@ -27,8 +29,9 @@ func TestAccDataSourceAwsEc2CoipPools_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_coip_pools.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2CoipPoolsConfigFilter(), From 9f6e50fdd780a442cc8771b8fce993d1a49e4b32 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:00:52 -0400 Subject: [PATCH 0105/1252] tests/ec2_instance_type_offering_test: Add ErrorCheck --- aws/data_source_aws_ec2_instance_type_offering_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_instance_type_offering_test.go b/aws/data_source_aws_ec2_instance_type_offering_test.go index 43657eea38e..3115aada695 100644 --- a/aws/data_source_aws_ec2_instance_type_offering_test.go +++ b/aws/data_source_aws_ec2_instance_type_offering_test.go @@ -13,6 +13,7 @@ func TestAccAWSEc2InstanceTypeOfferingDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -31,6 +32,7 @@ func TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -49,6 +51,7 @@ func TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From f2d259c72f96b52e8d85423a53ade6e57eaa5410 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:01:05 -0400 Subject: [PATCH 0106/1252] tests/ec2_instance_type_offerings_test: Add ErrorCheck --- aws/data_source_aws_ec2_instance_type_offerings_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_ec2_instance_type_offerings_test.go b/aws/data_source_aws_ec2_instance_type_offerings_test.go index 73d122360cd..b3b41eb3f72 100644 --- a/aws/data_source_aws_ec2_instance_type_offerings_test.go +++ b/aws/data_source_aws_ec2_instance_type_offerings_test.go @@ -15,6 +15,7 @@ func TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOfferings(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -33,6 +34,7 @@ func TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOfferings(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 27615cd1504299f969b3f16dd7c3e18d16179cad Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:01:26 -0400 Subject: [PATCH 0107/1252] tests/ec2_instance_type_test: Add ErrorCheck --- aws/data_source_aws_ec2_instance_type_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_ec2_instance_type_test.go b/aws/data_source_aws_ec2_instance_type_test.go index 0a362929b00..9c94a6851cd 100644 --- a/aws/data_source_aws_ec2_instance_type_test.go +++ b/aws/data_source_aws_ec2_instance_type_test.go @@ -3,14 +3,16 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceAwsEc2InstanceType_basic(t *testing.T) { resourceBasic := "data.aws_ec2_instance_type.basic" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceEc2InstanceTypeBasic, @@ -66,8 +68,9 @@ func TestAccDataSourceAwsEc2InstanceType_basic(t *testing.T) { func TestAccDataSourceAwsEc2InstanceType_metal(t *testing.T) { resourceMetal := "data.aws_ec2_instance_type.metal" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceEc2InstanceTypeMetal, @@ -92,8 +95,9 @@ func TestAccDataSourceAwsEc2InstanceType_metal(t *testing.T) { func TestAccDataSourceAwsEc2InstanceType_gpu(t *testing.T) { resourceGpu := "data.aws_ec2_instance_type.gpu" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceEc2InstanceTypeGpu, @@ -112,8 +116,9 @@ func TestAccDataSourceAwsEc2InstanceType_gpu(t *testing.T) { func TestAccDataSourceAwsEc2InstanceType_fpga(t *testing.T) { resourceFpga := "data.aws_ec2_instance_type.fpga" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceEc2InstanceTypeFgpa, From 257974c81177349d531647e80538df68f115597d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:02:04 -0400 Subject: [PATCH 0108/1252] tests/ec2_local_gateway_route_table_test: Add ErrorCheck --- ..._aws_ec2_local_gateway_route_table_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_route_table_test.go b/aws/data_source_aws_ec2_local_gateway_route_table_test.go index 77aab4f6f78..76b3b38b858 100644 --- a/aws/data_source_aws_ec2_local_gateway_route_table_test.go +++ b/aws/data_source_aws_ec2_local_gateway_route_table_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTable_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTableConfigLocalGatewayRouteTableId(), @@ -31,8 +33,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTable_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTableConfigFilter(), @@ -51,8 +54,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTable_LocalGatewayId(t *testing.T) dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTableConfigLocalGatewayId(), @@ -71,8 +75,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTable_OutpostArn(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTableConfigOutpostArn(), From cd37ed6ab5cbeae979ff143b683d2787014f12c5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:02:15 -0400 Subject: [PATCH 0109/1252] tests/ec2_local_gateway_route_tables_test: Add ErrorCheck --- ..._source_aws_ec2_local_gateway_route_tables_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_route_tables_test.go b/aws/data_source_aws_ec2_local_gateway_route_tables_test.go index 92e4f7b801c..372fd77269a 100644 --- a/aws/data_source_aws_ec2_local_gateway_route_tables_test.go +++ b/aws/data_source_aws_ec2_local_gateway_route_tables_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,8 +11,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTables_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTablesConfig(), @@ -27,8 +29,9 @@ func TestAccDataSourceAwsEc2LocalGatewayRouteTables_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayRouteTablesConfigFilter(), From 1b13e3ed929dcc26c7c6d45a782c23c77fc5b1ac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:03:01 -0400 Subject: [PATCH 0110/1252] tests/ec2_local_gateway_virtual_interface_group_test: Add ErrorCheck --- ...local_gateway_virtual_interface_group_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_virtual_interface_group_test.go b/aws/data_source_aws_ec2_local_gateway_virtual_interface_group_test.go index 604931b17e4..774f913edc8 100644 --- a/aws/data_source_aws_ec2_local_gateway_virtual_interface_group_test.go +++ b/aws/data_source_aws_ec2_local_gateway_virtual_interface_group_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Filter(t *testing. dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupConfigFilter(), @@ -32,8 +34,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_LocalGatewayId(t * dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupConfigLocalGatewayId(), @@ -53,8 +56,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroup_Tags(t *testing.T) dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupConfigTags(rName), From 6f395833b934c53b108577117a02b39c70c5e72c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:03:45 -0400 Subject: [PATCH 0111/1252] tests/ec2_local_gateway_virtual_interface_groups_test: Add ErrorCheck --- ...ocal_gateway_virtual_interface_groups_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_virtual_interface_groups_test.go b/aws/data_source_aws_ec2_local_gateway_virtual_interface_groups_test.go index 5cd34d09d2f..35f6249f79f 100644 --- a/aws/data_source_aws_ec2_local_gateway_virtual_interface_groups_test.go +++ b/aws/data_source_aws_ec2_local_gateway_virtual_interface_groups_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_basic(t *testing. dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupsConfig(), @@ -30,8 +32,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Filter(t *testing dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupsConfigFilter(), @@ -49,8 +52,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroups_Tags(t *testing.T dataSourceName := "data.aws_ec2_local_gateway_virtual_interface_groups.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceGroupsConfigTags(rName), From 0318a646bc6f53db5da4b38edcf773dfb8e47593 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:03:58 -0400 Subject: [PATCH 0112/1252] tests/ec2_local_gateway_virtual_interface_test: Add ErrorCheck --- ...s_ec2_local_gateway_virtual_interface_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_virtual_interface_test.go b/aws/data_source_aws_ec2_local_gateway_virtual_interface_test.go index 5c9734330c5..a8ae2780910 100644 --- a/aws/data_source_aws_ec2_local_gateway_virtual_interface_test.go +++ b/aws/data_source_aws_ec2_local_gateway_virtual_interface_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterface_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceConfigFilter(), @@ -36,8 +38,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterface_Id(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceConfigId(), @@ -61,8 +64,9 @@ func TestAccDataSourceAwsEc2LocalGatewayVirtualInterface_Tags(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway_virtual_interface.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayVirtualInterfaceConfigTags(rName), From 7c457de8ade78a0f1682e04ee4179236d0a384ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:10:39 -0400 Subject: [PATCH 0113/1252] tests/ds/ec2_local_gateway: Add ErrorCheck --- aws/data_source_aws_ec2_local_gateway_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateway_test.go b/aws/data_source_aws_ec2_local_gateway_test.go index 9d94560f7e7..1ae8f2d9089 100644 --- a/aws/data_source_aws_ec2_local_gateway_test.go +++ b/aws/data_source_aws_ec2_local_gateway_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ func TestAccDataSourceAwsEc2LocalGateway_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewayConfigId(), From 1f3273251c688bf97c16f71e7c84ea7ca62dbfbc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:11:06 -0400 Subject: [PATCH 0114/1252] tests/ds/ec2_local_gateways: Add ErrorCheck --- aws/data_source_aws_ec2_local_gateways_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ec2_local_gateways_test.go b/aws/data_source_aws_ec2_local_gateways_test.go index 18a30150d6d..2bef51d2e0b 100644 --- a/aws/data_source_aws_ec2_local_gateways_test.go +++ b/aws/data_source_aws_ec2_local_gateways_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,8 +11,9 @@ func TestAccDataSourceAwsEc2LocalGateways_basic(t *testing.T) { dataSourceName := "data.aws_ec2_local_gateways.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2LocalGatewaysConfig(), From d6ede315e342fd3c056bc7a9ff15a1de47a6a0ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:11:40 -0400 Subject: [PATCH 0115/1252] tests/ds/ec2_managed_prefix_list: Add ErrorCheck --- ...ata_source_aws_ec2_managed_prefix_list_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ec2_managed_prefix_list_test.go b/aws/data_source_aws_ec2_managed_prefix_list_test.go index f313a68589f..412a7f22e86 100644 --- a/aws/data_source_aws_ec2_managed_prefix_list_test.go +++ b/aws/data_source_aws_ec2_managed_prefix_list_test.go @@ -44,8 +44,9 @@ func TestAccDataSourceAwsEc2ManagedPrefixList_basic(t *testing.T) { prefixListResourceName := "data.aws_prefix_list.s3_by_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2ManagedPrefixListConfig_basic, @@ -98,8 +99,9 @@ func TestAccDataSourceAwsEc2ManagedPrefixList_filter(t *testing.T) { resourceById := "data.aws_ec2_managed_prefix_list.s3_by_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2ManagedPrefixListConfig_filter, @@ -149,8 +151,9 @@ data "aws_ec2_managed_prefix_list" "s3_by_id" { func TestAccDataSourceAwsEc2ManagedPrefixList_matchesTooMany(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsPrefixListConfig_matchesTooMany, From f3fbd9eac8d413dcfea251fa181bf5f903a2a7bd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:12:21 -0400 Subject: [PATCH 0116/1252] tests/ds/ec2_spot_price: Add ErrorCheck --- aws/data_source_aws_ec2_spot_price_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_ec2_spot_price_test.go b/aws/data_source_aws_ec2_spot_price_test.go index 9fa7ede1b6c..c02f5f8c91c 100644 --- a/aws/data_source_aws_ec2_spot_price_test.go +++ b/aws/data_source_aws_ec2_spot_price_test.go @@ -14,6 +14,7 @@ func TestAccAwsEc2SpotPriceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEc2SpotPrice(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -33,6 +34,7 @@ func TestAccAwsEc2SpotPriceDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEc2SpotPrice(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From ff1102978f79fc7306dc62bd080d796f49ddafee Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:12:49 -0400 Subject: [PATCH 0117/1252] tests/ds/ec2_transit_gateway_dx_gateway_attachment: Add ErrorCheck --- ...ource_aws_ec2_transit_gateway_dx_gateway_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment_test.go b/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment_test.go index bf0191e562d..74ee3bf3166 100644 --- a/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -20,6 +21,7 @@ func TestAccAWSEc2TransitGatewayDxGatewayAttachmentDataSource_TransitGatewayIdAn testAccPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -47,6 +49,7 @@ func TestAccAWSEc2TransitGatewayDxGatewayAttachmentDataSource_filter(t *testing. testAccPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From b100e3cf9e69987307830b714a75d569195281d7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:13:18 -0400 Subject: [PATCH 0118/1252] tests/ds/ec2_transit_gateway_peering_attachment: Add ErrorCheck --- ..._aws_ec2_transit_gateway_peering_attachment_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_peering_attachment_test.go b/aws/data_source_aws_ec2_transit_gateway_peering_attachment_test.go index ab6a6f52a4a..ea08e75b99c 100644 --- a/aws/data_source_aws_ec2_transit_gateway_peering_attachment_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_peering_attachment_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.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" @@ -19,6 +20,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_sameAccount(t testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -35,6 +37,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_sameAccount(t }, }) } + func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_differentAccount(t *testing.T) { var providers []*schema.Provider rName := acctest.RandomWithPrefix("tf-acc-test") @@ -48,6 +51,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_differentAcco testAccMultipleRegionPreCheck(t, 2) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -63,6 +67,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Filter_differentAcco }, }) } + func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_sameAccount(t *testing.T) { var providers []*schema.Provider rName := acctest.RandomWithPrefix("tf-acc-test") @@ -74,6 +79,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_sameAccount(t *te testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -90,6 +96,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_sameAccount(t *te }, }) } + func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_differentAccount(t *testing.T) { var providers []*schema.Provider rName := acctest.RandomWithPrefix("tf-acc-test") @@ -103,6 +110,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_differentAccount( testAccMultipleRegionPreCheck(t, 2) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -118,6 +126,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_ID_differentAccount( }, }) } + func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Tags(t *testing.T) { var providers []*schema.Provider rName := acctest.RandomWithPrefix("tf-acc-test") @@ -129,6 +138,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentDataSource_Tags(t *testing.T) { testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 72ef14bf295b1e071f96ebd922d2b210b556e448 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:13:55 -0400 Subject: [PATCH 0119/1252] tests/ds/ec2_transit_gateway_route_table: Add ErrorCheck --- aws/data_source_aws_ec2_transit_gateway_route_table_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_table_test.go b/aws/data_source_aws_ec2_transit_gateway_route_table_test.go index fa1d266159c..c12a45c72a2 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_table_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_table_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSEc2TransitGatewayRouteTableDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -35,6 +37,7 @@ func TestAccAWSEc2TransitGatewayRouteTableDataSource_ID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 8dfd40a41be98c4fb68265cb32467238678632f9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:14:21 -0400 Subject: [PATCH 0120/1252] tests/ds/ec2_transit_gateway: Add ErrorCheck --- aws/data_source_aws_ec2_transit_gateway_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_test.go b/aws/data_source_aws_ec2_transit_gateway_test.go index f681df83cf6..c0769d6b56a 100644 --- a/aws/data_source_aws_ec2_transit_gateway_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSEc2TransitGatewayDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -42,6 +44,7 @@ func TestAccAWSEc2TransitGatewayDataSource_ID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 7c25df5d92a8019ba301110b8df8ba56a309ffed Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:14:46 -0400 Subject: [PATCH 0121/1252] tests/ds/ec2_transit_gateway_vpc_attachment: Add ErrorCheck --- aws/data_source_aws_ec2_transit_gateway_vpc_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_vpc_attachment_test.go b/aws/data_source_aws_ec2_transit_gateway_vpc_attachment_test.go index d2a419f7b11..d496ab4e3d9 100644 --- a/aws/data_source_aws_ec2_transit_gateway_vpc_attachment_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_vpc_attachment_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachmentDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -38,6 +40,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachmentDataSource_ID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 31a699dab2c27473ae0a12adb0e6d13d67ab7f8f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:15:18 -0400 Subject: [PATCH 0122/1252] tests/ds/ec2_transit_gateway_vpn_attachment: Add ErrorCheck --- aws/data_source_aws_ec2_transit_gateway_vpn_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_ec2_transit_gateway_vpn_attachment_test.go b/aws/data_source_aws_ec2_transit_gateway_vpn_attachment_test.go index c8d7a5f92a3..322489fde91 100644 --- a/aws/data_source_aws_ec2_transit_gateway_vpn_attachment_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_vpn_attachment_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -19,6 +20,7 @@ func TestAccAWSEc2TransitGatewayVpnAttachmentDataSource_TransitGatewayIdAndVpnCo testAccPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -45,6 +47,7 @@ func TestAccAWSEc2TransitGatewayVpnAttachmentDataSource_filter(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 78b3991b1b452047ffbe4d50486a44c1152f369c Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 05:12:36 +0000 Subject: [PATCH 0123/1252] Update CHANGELOG.md for #18150 --- CHANGELOG.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bda4612aea..922929fd9d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,25 @@ NOTES: ENHANCEMENTS: +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) +* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + +NOTES: + +* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) + +ENHANCEMENTS: + * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) BUG FIXES: From 5f7f547edb0c8333a25b0a3a367097220a97a2c0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:25:53 -0400 Subject: [PATCH 0124/1252] tests/ds/eip: Add ErrorCheck --- aws/data_source_aws_eip_test.go | 43 +++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/aws/data_source_aws_eip_test.go b/aws/data_source_aws_eip_test.go index 97c35b23b1f..36c5920513e 100644 --- a/aws/data_source_aws_eip_test.go +++ b/aws/data_source_aws_eip_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAWSEIP_Filter(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigFilter(rName), @@ -34,8 +36,9 @@ func TestAccDataSourceAWSEIP_Id(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigId, @@ -48,12 +51,14 @@ func TestAccDataSourceAWSEIP_Id(t *testing.T) { }, }) } + func TestAccDataSourceAWSEIP_PublicIP_EC2Classic(t *testing.T) { dataSourceName := "data.aws_eip.test" resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { @@ -73,8 +78,9 @@ func TestAccDataSourceAWSEIP_PublicIP_VPC(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigPublicIpVpc, @@ -95,8 +101,9 @@ func TestAccDataSourceAWSEIP_Tags(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigTags(rName), @@ -115,8 +122,9 @@ func TestAccDataSourceAWSEIP_NetworkInterface(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigNetworkInterface, @@ -137,8 +145,9 @@ func TestAccDataSourceAWSEIP_Instance(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigInstance, @@ -158,8 +167,9 @@ func TestAccDataSourceAWSEIP_CarrierIP(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigCarrierIP(rName), @@ -177,8 +187,9 @@ func TestAccDataSourceAWSEIP_CustomerOwnedIpv4Pool(t *testing.T) { resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSEIPConfigCustomerOwnedIpv4Pool(), From 751dd503e0867741a1a30cc97c9116aecb27457e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:29:17 -0400 Subject: [PATCH 0125/1252] tests/ds/instance: Add ErrorCheck --- aws/data_source_aws_instance_test.go | 121 ++++++++++++++++----------- 1 file changed, 73 insertions(+), 48 deletions(-) diff --git a/aws/data_source_aws_instance_test.go b/aws/data_source_aws_instance_test.go index ae5831ebbce..8375c1fc24c 100644 --- a/aws/data_source_aws_instance_test.go +++ b/aws/data_source_aws_instance_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSInstanceDataSource_basic(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig, @@ -37,8 +39,9 @@ func TestAccAWSInstanceDataSource_tags(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_Tags(rInt), @@ -57,8 +60,9 @@ func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_AzUserData, @@ -79,8 +83,9 @@ func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_gp2IopsDevice, @@ -103,8 +108,9 @@ func TestAccAWSInstanceDataSource_gp3ThroughputDevice(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_gp3ThroughputDevice, @@ -127,8 +133,9 @@ func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_blockDevices, @@ -151,8 +158,9 @@ func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) { // Test to verify that ebs_block_device kms_key_id does not elicit a panic func TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_EbsBlockDevice_KmsKeyId, @@ -164,8 +172,9 @@ func TestAccAWSInstanceDataSource_EbsBlockDevice_KmsKeyId(t *testing.T) { // Test to verify that root_block_device kms_key_id does not elicit a panic func TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_RootBlockDevice_KmsKeyId, @@ -179,8 +188,9 @@ func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_rootInstanceStore, @@ -202,8 +212,9 @@ func TestAccAWSInstanceDataSource_privateIP(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_privateIP(rName), @@ -223,8 +234,9 @@ func TestAccAWSInstanceDataSource_secondaryPrivateIPs(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_secondaryPrivateIPs(rName), @@ -244,8 +256,9 @@ func TestAccAWSInstanceDataSource_keyPair(t *testing.T) { rName := fmt.Sprintf("tf-test-key-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_keyPair(rName), @@ -266,8 +279,9 @@ func TestAccAWSInstanceDataSource_VPC(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_VPC(rName), @@ -289,8 +303,9 @@ func TestAccAWSInstanceDataSource_PlacementGroup(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_PlacementGroup(rName), @@ -308,8 +323,9 @@ func TestAccAWSInstanceDataSource_SecurityGroups(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_SecurityGroups(rInt), @@ -331,8 +347,9 @@ func TestAccAWSInstanceDataSource_VPCSecurityGroups(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_VPCSecurityGroups(rName), @@ -352,8 +369,9 @@ func TestAccAWSInstanceDataSource_getPasswordData_trueToFalse(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_getPasswordData(rName, true), @@ -378,8 +396,9 @@ func TestAccAWSInstanceDataSource_getPasswordData_falseToTrue(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_getPasswordData(rName, false), @@ -404,8 +423,9 @@ func TestAccAWSInstanceDataSource_GetUserData(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfigGetUserData(rName, true), @@ -438,8 +458,9 @@ func TestAccAWSInstanceDataSource_GetUserData_NoUserData(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(rName, true), @@ -475,8 +496,9 @@ func TestAccAWSInstanceDataSource_creditSpecification(t *testing.T) { rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandString(12)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -497,8 +519,9 @@ func TestAccAWSInstanceDataSource_metadataOptions(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_metadataOptions(rName), @@ -519,8 +542,9 @@ func TestAccAWSInstanceDataSource_enclaveOptions(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_enclaveOptions(rName), @@ -539,8 +563,9 @@ func TestAccAWSInstanceDataSource_blockDeviceTags(t *testing.T) { datasourceName := "data.aws_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstanceDataSourceConfig_blockDeviceTags(rName), From cedd6dc1f024db8c9d7068177a177320d4863f7f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:31:27 -0400 Subject: [PATCH 0126/1252] tests/ds/instances: Add ErrorCheck --- aws/data_source_aws_instances_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_instances_test.go b/aws/data_source_aws_instances_test.go index ac7940e27d8..6f0197eae64 100644 --- a/aws/data_source_aws_instances_test.go +++ b/aws/data_source_aws_instances_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSInstancesDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstancesDataSourceConfig_ids(rName), @@ -32,8 +34,9 @@ func TestAccAWSInstancesDataSource_tags(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstancesDataSourceConfig_tags(rName), @@ -49,8 +52,9 @@ func TestAccAWSInstancesDataSource_instanceStateNames(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccInstancesDataSourceConfig_instanceStateNames(rName), From 169d17ec310cd2edb46d6729dc5c138671f670df Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:33:38 -0400 Subject: [PATCH 0127/1252] tests/ds/internet_gateway: Add ErrorCheck --- aws/data_source_aws_internet_gateway_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_internet_gateway_test.go b/aws/data_source_aws_internet_gateway_test.go index ad115a7e970..ff909b6caaf 100644 --- a/aws/data_source_aws_internet_gateway_test.go +++ b/aws/data_source_aws_internet_gateway_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsInternetGateway_typical(t *testing.T) { ds3ResourceName := "data.aws_internet_gateway.by_tags" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsInternetGatewayConfig, From cbebf542a14164c433a49895bbdd0b2e357db2bd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:35:32 -0400 Subject: [PATCH 0128/1252] tests/ds/launch_template: Add ErrorCheck --- aws/data_source_aws_launch_template_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/data_source_aws_launch_template_test.go b/aws/data_source_aws_launch_template_test.go index 41d8dfb559e..84919d90e73 100644 --- a/aws/data_source_aws_launch_template_test.go +++ b/aws/data_source_aws_launch_template_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSLaunchTemplateDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -40,6 +42,7 @@ func TestAccAWSLaunchTemplateDataSource_id_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -64,6 +67,7 @@ func TestAccAWSLaunchTemplateDataSource_filter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -109,6 +113,7 @@ func TestAccAWSLaunchTemplateDataSource_filter_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -133,6 +138,7 @@ func TestAccAWSLaunchTemplateDataSource_metadataOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -156,6 +162,7 @@ func TestAccAWSLaunchTemplateDataSource_enclaveOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -177,6 +184,7 @@ func TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -212,6 +220,7 @@ func TestAccAWSLaunchTemplateDataSource_associateCarrierIPAddress(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -247,6 +256,7 @@ func TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -278,6 +288,7 @@ func TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination(t func TestAccAWSLaunchTemplateDataSource_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ From ba957e11ba9a997451cd1db5349ef34a271a9774 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:36:07 -0400 Subject: [PATCH 0129/1252] tests/ds/nat_gateway: Add ErrorCheck --- aws/data_source_aws_nat_gateway_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_nat_gateway_test.go b/aws/data_source_aws_nat_gateway_test.go index 8fdfba88cc1..138474e41bb 100644 --- a/aws/data_source_aws_nat_gateway_test.go +++ b/aws/data_source_aws_nat_gateway_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsNatGateway_basic(t *testing.T) { rInt := acctest.RandIntRange(4, 254) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsNatGatewayConfig(rInt), From d349c688618d48c6796c74b111203085365ea05a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:37:08 -0400 Subject: [PATCH 0130/1252] tests/ds/network_acls: Add ErrorCheck --- aws/data_source_aws_network_acls_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/data_source_aws_network_acls_test.go b/aws/data_source_aws_network_acls_test.go index e153fcbf3d8..b4bb0b89536 100644 --- a/aws/data_source_aws_network_acls_test.go +++ b/aws/data_source_aws_network_acls_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccDataSourceAwsNetworkAcls_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -39,6 +41,7 @@ func TestAccDataSourceAwsNetworkAcls_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -58,6 +61,7 @@ func TestAccDataSourceAwsNetworkAcls_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -77,6 +81,7 @@ func TestAccDataSourceAwsNetworkAcls_VpcID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From b12fafeea56047cc88bda64abdb4271fad9ca8c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:37:30 -0400 Subject: [PATCH 0131/1252] tests/ds/network_interface: Add ErrorCheck --- aws/data_source_aws_network_interface_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_network_interface_test.go b/aws/data_source_aws_network_interface_test.go index f5f101db7b3..c609fbcab6e 100644 --- a/aws/data_source_aws_network_interface_test.go +++ b/aws/data_source_aws_network_interface_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsNetworkInterface_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsNetworkInterfaceConfigBasic(rName), @@ -41,8 +43,9 @@ func TestAccDataSourceAwsNetworkInterface_filters(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsNetworkInterfaceConfigFilters(rName), @@ -65,8 +68,9 @@ func TestAccDataSourceAwsNetworkInterface_CarrierIPAssociation(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsNetworkInterfaceConfigCarrierIPAssociation(rName), @@ -112,8 +116,9 @@ func TestAccDataSourceAwsNetworkInterface_PublicIPAssociation(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsNetworkInterfaceConfigPublicIPAssociation(rName), From 345c358795d8d4f65f7534a5e7dc83fba582444a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:37:46 -0400 Subject: [PATCH 0132/1252] tests/ds/network_interfaces: Add ErrorCheck --- aws/data_source_aws_network_interfaces_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_network_interfaces_test.go b/aws/data_source_aws_network_interfaces_test.go index d1341e75d28..c11165ebfdb 100644 --- a/aws/data_source_aws_network_interfaces_test.go +++ b/aws/data_source_aws_network_interfaces_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccDataSourceAwsNetworkInterfaces_Filter(t *testing.T) { rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -29,6 +31,7 @@ func TestAccDataSourceAwsNetworkInterfaces_Tags(t *testing.T) { rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From f9b5934441754e9328435e766c7bdc25d09b982d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:38:17 -0400 Subject: [PATCH 0133/1252] tests/ds/prefix_list: Add ErrorCheck --- aws/data_source_aws_prefix_list_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_prefix_list_test.go b/aws/data_source_aws_prefix_list_test.go index 4c5304e7d9c..a28adc29b79 100644 --- a/aws/data_source_aws_prefix_list_test.go +++ b/aws/data_source_aws_prefix_list_test.go @@ -14,8 +14,9 @@ import ( func TestAccDataSourceAwsPrefixList_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsPrefixListConfig, @@ -30,8 +31,9 @@ func TestAccDataSourceAwsPrefixList_basic(t *testing.T) { func TestAccDataSourceAwsPrefixList_filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsPrefixListConfigFilter, @@ -46,8 +48,9 @@ func TestAccDataSourceAwsPrefixList_filter(t *testing.T) { func TestAccDataSourceAwsPrefixList_nameDoesNotOverrideFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsPrefixListConfig_nameDoesNotOverrideFilter, From 2ced771b9f6606c6c90866841150ed6a1dcf4cc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:42:33 -0400 Subject: [PATCH 0134/1252] tests/ds/region: Add ErrorCheck --- aws/data_source_aws_region_test.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_region_test.go b/aws/data_source_aws_region_test.go index 11a847dba41..54a29f00515 100644 --- a/aws/data_source_aws_region_test.go +++ b/aws/data_source_aws_region_test.go @@ -77,8 +77,9 @@ func TestAccDataSourceAwsRegion_basic(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionConfig_empty, @@ -96,8 +97,9 @@ func TestAccDataSourceAwsRegion_endpoint(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionConfig_endpoint(), @@ -115,8 +117,9 @@ func TestAccDataSourceAwsRegion_endpointAndName(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionConfig_endpointAndName(), @@ -134,8 +137,9 @@ func TestAccDataSourceAwsRegion_name(t *testing.T) { dataSourceName := "data.aws_region.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionConfig_name(), From 7a0c4105aa0d9e40524722d6bd0524f2117c471b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:42:59 -0400 Subject: [PATCH 0135/1252] tests/ds/regions: Add ErrorCheck --- aws/data_source_aws_regions_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_regions_test.go b/aws/data_source_aws_regions_test.go index b4a3c080332..e68e812b06d 100644 --- a/aws/data_source_aws_regions_test.go +++ b/aws/data_source_aws_regions_test.go @@ -5,6 +5,7 @@ import ( "strconv" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsRegions_basic(t *testing.T) { resourceName := "data.aws_regions.empty" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionsConfig_empty(), @@ -31,8 +33,9 @@ func TestAccDataSourceAwsRegions_Filter(t *testing.T) { resourceName := "data.aws_regions.opt_in_status" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionsConfig_allRegionsFiltered("opt-in-not-required"), @@ -48,8 +51,9 @@ func TestAccDataSourceAwsRegions_AllRegions(t *testing.T) { resourceAllRegions := "data.aws_regions.all_regions" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRegionsConfig_allRegions(), From 2019047875e6ec7070ec08bd0a904bb1488d29e9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:43:20 -0400 Subject: [PATCH 0136/1252] tests/ds/route_table: Add ErrorCheck --- aws/data_source_aws_route_table_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_route_table_test.go b/aws/data_source_aws_route_table_test.go index 49672939e36..fb52049ba02 100644 --- a/aws/data_source_aws_route_table_test.go +++ b/aws/data_source_aws_route_table_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -22,8 +23,9 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRouteTableConfigBasic(rName), @@ -99,8 +101,9 @@ func TestAccDataSourceAwsRouteTable_main(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRouteTableConfigMain(rName), From 0876d98300b1929f8e05d43fd88288d04b1ee245 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:43:33 -0400 Subject: [PATCH 0137/1252] tests/ds/route_tables: Add ErrorCheck --- aws/data_source_aws_route_tables_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_route_tables_test.go b/aws/data_source_aws_route_tables_test.go index 710f47f8d90..abbcd124f43 100644 --- a/aws/data_source_aws_route_tables_test.go +++ b/aws/data_source_aws_route_tables_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccDataSourceAwsRouteTables_basic(t *testing.T) { rInt := acctest.RandIntRange(0, 256) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From 2c1c8b40e8d8cd5253e0f6e2a8182a9d749d41c8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:43:38 -0400 Subject: [PATCH 0138/1252] tests/ds/route: Add ErrorCheck --- aws/data_source_aws_route_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_route_test.go b/aws/data_source_aws_route_test.go index f1a97b41cb3..29fede2dc29 100644 --- a/aws/data_source_aws_route_test.go +++ b/aws/data_source_aws_route_test.go @@ -21,8 +21,9 @@ func TestAccAWSRouteDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRouteConfigBasic(rName), @@ -54,6 +55,7 @@ func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -77,6 +79,7 @@ func TestAccAWSRouteDataSource_IPv6DestinationCidr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -99,6 +102,7 @@ func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From 4806fe319bfc4dde477287d74ef568218c9f1749 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:43:58 -0400 Subject: [PATCH 0139/1252] tests/ds/security_group: Add ErrorCheck --- aws/data_source_aws_security_group_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_security_group_test.go b/aws/data_source_aws_security_group_test.go index fe89ea60624..b805b7f6ce2 100644 --- a/aws/data_source_aws_security_group_test.go +++ b/aws/data_source_aws_security_group_test.go @@ -5,6 +5,7 @@ import ( "strings" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -13,8 +14,9 @@ import ( func TestAccDataSourceAwsSecurityGroup_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecurityGroupConfig(rInt), From fc6ee0a23df531c482401bd9f4bd0ac9bec43668 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:44:11 -0400 Subject: [PATCH 0140/1252] tests/ds/security_groups: Add ErrorCheck --- aws/data_source_aws_security_groups_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_security_groups_test.go b/aws/data_source_aws_security_groups_test.go index 646865bc8be..4e004a4befd 100644 --- a/aws/data_source_aws_security_groups_test.go +++ b/aws/data_source_aws_security_groups_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccDataSourceAwsSecurityGroups_tag(t *testing.T) { rInt := acctest.RandInt() dataSourceName := "data.aws_security_groups.by_tag" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecurityGroupsConfig_tag(rInt), @@ -31,8 +33,9 @@ func TestAccDataSourceAwsSecurityGroups_filter(t *testing.T) { rInt := acctest.RandInt() dataSourceName := "data.aws_security_groups.by_filter" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecurityGroupsConfig_filter(rInt), From 32f8318666d4b239e5b4659e611f491713938422 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:44:50 -0400 Subject: [PATCH 0141/1252] tests/ds/subnet_ids: Add ErrorCheck --- aws/data_source_aws_subnet_ids_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_subnet_ids_test.go b/aws/data_source_aws_subnet_ids_test.go index 8b4615ba89e..afa25a12111 100644 --- a/aws/data_source_aws_subnet_ids_test.go +++ b/aws/data_source_aws_subnet_ids_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccDataSourceAwsSubnetIDs_basic(t *testing.T) { rInt := acctest.RandIntRange(0, 256) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -35,6 +37,7 @@ func TestAccDataSourceAwsSubnetIDs_filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From 256b511c153e281bae40322d3eea6a0a0d220ff6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:45:10 -0400 Subject: [PATCH 0142/1252] tests/ds/subnet: Add ErrorCheck --- aws/data_source_aws_subnet_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_subnet_test.go b/aws/data_source_aws_subnet_test.go index ce7d549ddc2..da7307be7a9 100644 --- a/aws/data_source_aws_subnet_test.go +++ b/aws/data_source_aws_subnet_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -24,6 +25,7 @@ func TestAccDataSourceAwsSubnet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -113,8 +115,9 @@ func TestAccDataSourceAwsSubnet_basic(t *testing.T) { func TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter(t *testing.T) { rInt := acctest.RandIntRange(0, 256) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSubnetConfigIpv6(rInt), @@ -133,8 +136,9 @@ func TestAccDataSourceAwsSubnet_ipv6ByIpv6Filter(t *testing.T) { func TestAccDataSourceAwsSubnet_ipv6ByIpv6CidrBlock(t *testing.T) { rInt := acctest.RandIntRange(0, 256) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSubnetConfigIpv6(rInt), From 1d9457c8f923d6ba085575cb44774fa4671692e6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:45:32 -0400 Subject: [PATCH 0143/1252] tests/ds/vpc_dhcp_options: Add ErrorCheck --- aws/data_source_aws_vpc_dhcp_options_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_vpc_dhcp_options_test.go b/aws/data_source_aws_vpc_dhcp_options_test.go index 2e00e4fba2b..bf42a68fa24 100644 --- a/aws/data_source_aws_vpc_dhcp_options_test.go +++ b/aws/data_source_aws_vpc_dhcp_options_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsVpcDhcpOptions_basic(t *testing.T) { datasourceName := "data.aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcDhcpOptionsConfig_Missing, @@ -50,8 +52,9 @@ func TestAccDataSourceAwsVpcDhcpOptions_Filter(t *testing.T) { datasourceName := "data.aws_vpc_dhcp_options.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcDhcpOptionsConfig_Filter(rInt, 1), From 5c7ec0e22f4532c617b187588a35a5c9b3409ae1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:47:46 -0400 Subject: [PATCH 0144/1252] tests/ds/vpc_endpoint_service: Add ErrorCheck --- ...ta_source_aws_vpc_endpoint_service_test.go | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/aws/data_source_aws_vpc_endpoint_service_test.go b/aws/data_source_aws_vpc_endpoint_service_test.go index 755edaba519..ee05a1a11d7 100644 --- a/aws/data_source_aws_vpc_endpoint_service_test.go +++ b/aws/data_source_aws_vpc_endpoint_service_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsVpcEndpointService_gateway(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceGatewayConfig, @@ -40,8 +42,9 @@ func TestAccDataSourceAwsVpcEndpointService_interface(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceInterfaceConfig, @@ -67,8 +70,9 @@ func TestAccDataSourceAwsVpcEndpointService_custom(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceCustomConfig(rName), @@ -93,8 +97,9 @@ func TestAccDataSourceAwsVpcEndpointService_custom_filter(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceCustomConfigFilter(rName), @@ -119,8 +124,9 @@ func TestAccDataSourceAwsVpcEndpointService_custom_filter_tags(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceCustomConfigFilterTags(rName), @@ -144,8 +150,9 @@ func TestAccDataSourceAwsVpcEndpointService_ServiceType_Gateway(t *testing.T) { datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceConfig_ServiceType("s3", "Gateway"), @@ -162,8 +169,9 @@ func TestAccDataSourceAwsVpcEndpointService_ServiceType_Interface(t *testing.T) datasourceName := "data.aws_vpc_endpoint_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointServiceConfig_ServiceType("ec2", "Interface"), From e522b1d5510812fb619852e5c327377e9b0cba8e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:48:00 -0400 Subject: [PATCH 0145/1252] tests/ds/vpc_endpoint: Add ErrorCheck --- aws/data_source_aws_vpc_endpoint_test.go | 31 +++++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/aws/data_source_aws_vpc_endpoint_test.go b/aws/data_source_aws_vpc_endpoint_test.go index bc6c7827a36..2d8ec584f78 100644 --- a/aws/data_source_aws_vpc_endpoint_test.go +++ b/aws/data_source_aws_vpc_endpoint_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsVpcEndpoint_gatewayBasic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_gatewayBasic(rName), @@ -43,8 +45,9 @@ func TestAccDataSourceAwsVpcEndpoint_byId(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_byId(rName), @@ -72,8 +75,9 @@ func TestAccDataSourceAwsVpcEndpoint_byFilter(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_byFilter(rName), @@ -101,8 +105,9 @@ func TestAccDataSourceAwsVpcEndpoint_byTags(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_byTags(rName), @@ -130,8 +135,9 @@ func TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags(t *testing.T) rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_gatewayWithRouteTableAndTags(rName), @@ -160,8 +166,9 @@ func TestAccDataSourceAwsVpcEndpoint_interface(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcEndpointConfig_interface(rName), From d7e04eaff60c6c78e543c4c3b11a6bea8845074d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:48:34 -0400 Subject: [PATCH 0146/1252] tests/ds/vpc_peering_connection: Add ErrorCheck --- ..._source_aws_vpc_peering_connection_test.go | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/aws/data_source_aws_vpc_peering_connection_test.go b/aws/data_source_aws_vpc_peering_connection_test.go index ab4bff7c2fd..b8f387ba638 100644 --- a/aws/data_source_aws_vpc_peering_connection_test.go +++ b/aws/data_source_aws_vpc_peering_connection_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccDataSourceAwsVpcPeeringConnection_CidrBlock(t *testing.T) { requesterVpcResourceName := "aws_vpc.requester" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionConfigCidrBlock(), @@ -33,8 +35,9 @@ func TestAccDataSourceAwsVpcPeeringConnection_Id(t *testing.T) { requesterVpcResourceName := "aws_vpc.requester" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionConfigId(), @@ -70,8 +73,9 @@ func TestAccDataSourceAwsVpcPeeringConnection_PeerCidrBlock(t *testing.T) { accepterVpcResourceName := "aws_vpc.accepter" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionConfigPeerCidrBlock(), @@ -89,8 +93,9 @@ func TestAccDataSourceAwsVpcPeeringConnection_PeerVpcId(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionConfigPeerVpcId(), @@ -108,8 +113,9 @@ func TestAccDataSourceAwsVpcPeeringConnection_VpcId(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionConfigVpcId(), From 77bdfd6c8ef8c0c647f6859a3400f1d4e9e690dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:48:51 -0400 Subject: [PATCH 0147/1252] tests/ds/vpc_peering_connections: Add ErrorCheck --- aws/data_source_aws_vpc_peering_connections_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_vpc_peering_connections_test.go b/aws/data_source_aws_vpc_peering_connections_test.go index 6fe61df7489..51fc55ca062 100644 --- a/aws/data_source_aws_vpc_peering_connections_test.go +++ b/aws/data_source_aws_vpc_peering_connections_test.go @@ -3,13 +3,15 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceAwsVpcPeeringConnections_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcPeeringConnectionsConfig, From 10bc6e55978c9fd89bfa3dabffd0b5a85bb59107 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:49:08 -0400 Subject: [PATCH 0148/1252] tests/ds/vpc: Add ErrorCheck --- aws/data_source_aws_vpc_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_vpc_test.go b/aws/data_source_aws_vpc_test.go index cc2e973d24a..019945f7a48 100644 --- a/aws/data_source_aws_vpc_test.go +++ b/aws/data_source_aws_vpc_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -22,8 +23,9 @@ func TestAccDataSourceAwsVpc_basic(t *testing.T) { ds4ResourceName := "data.aws_vpc.by_filter" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcConfig(cidr, tag), @@ -87,8 +89,9 @@ func TestAccDataSourceAwsVpc_ipv6Associated(t *testing.T) { ds1ResourceName := "data.aws_vpc.by_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcConfigIpv6(cidr, tag), @@ -116,6 +119,7 @@ func TestAccDataSourceAwsVpc_CidrBlockAssociations_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From 75f3b9e00d425c798b1e0b3606e685d196514a9e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:49:21 -0400 Subject: [PATCH 0149/1252] tests/ds/vpcs: Add ErrorCheck --- aws/data_source_aws_vpcs_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_vpcs_test.go b/aws/data_source_aws_vpcs_test.go index 85658fca81f..97eedab56b6 100644 --- a/aws/data_source_aws_vpcs_test.go +++ b/aws/data_source_aws_vpcs_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -11,8 +12,9 @@ import ( func TestAccDataSourceAwsVpcs_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcsConfig(), @@ -27,8 +29,9 @@ func TestAccDataSourceAwsVpcs_basic(t *testing.T) { func TestAccDataSourceAwsVpcs_tags(t *testing.T) { rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcsConfig_tags(rName), @@ -44,8 +47,9 @@ func TestAccDataSourceAwsVpcs_tags(t *testing.T) { func TestAccDataSourceAwsVpcs_filters(t *testing.T) { rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpcsConfig_filters(rName), From c389e5fa6ca4beaaf3a3c5ad33ce9c1ebeffb032 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 17 Mar 2021 22:50:01 -0400 Subject: [PATCH 0150/1252] tests/ds/vpn_gateway: Add ErrorCheck --- aws/data_source_aws_vpn_gateway_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_vpn_gateway_test.go b/aws/data_source_aws_vpn_gateway_test.go index 6c8c1f752e7..738b2ce31ab 100644 --- a/aws/data_source_aws_vpn_gateway_test.go +++ b/aws/data_source_aws_vpn_gateway_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -17,8 +18,9 @@ func TestAccDataSourceAwsVpnGateway_unattached(t *testing.T) { resourceName := "aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpnGatewayUnattachedConfig(rInt), @@ -42,8 +44,9 @@ func TestAccDataSourceAwsVpnGateway_attached(t *testing.T) { dataSourceName := "data.aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsVpnGatewayAttachedConfig(rInt), From ae29d63022da1aa533ec757a72c10262d45a9dfa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:45:52 -0400 Subject: [PATCH 0151/1252] tests/r/ami_copy: Add ErrorCheck --- aws/resource_aws_ami_copy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ami_copy_test.go b/aws/resource_aws_ami_copy_test.go index c24807304ed..48a2b8bf3cd 100644 --- a/aws/resource_aws_ami_copy_test.go +++ b/aws/resource_aws_ami_copy_test.go @@ -19,6 +19,7 @@ func TestAccAWSAMICopy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMICopyDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSAMICopy_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMICopyDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAWSAMICopy_EnaSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMICopyDestroy, Steps: []resource.TestStep{ @@ -95,6 +98,7 @@ func TestAccAWSAMICopy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMICopyDestroy, Steps: []resource.TestStep{ From 240526df6a31c67d4bffd0f27c5491faa70783ab Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:46:17 -0400 Subject: [PATCH 0152/1252] tests/r/ami_from_instance: Add ErrorCheck --- aws/resource_aws_ami_from_instance_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ami_from_instance_test.go b/aws/resource_aws_ami_from_instance_test.go index d2e7ef44391..3a35cfdc919 100644 --- a/aws/resource_aws_ami_from_instance_test.go +++ b/aws/resource_aws_ami_from_instance_test.go @@ -19,6 +19,7 @@ func TestAccAWSAMIFromInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMIFromInstanceDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSAMIFromInstance_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMIFromInstanceDestroy, Steps: []resource.TestStep{ From e6597230ac9c088e034667072eb994d2b5e00824 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:46:46 -0400 Subject: [PATCH 0153/1252] tests/r/ami_launch_permission: Add ErrorCheck --- aws/resource_aws_ami_launch_permission_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ami_launch_permission_test.go b/aws/resource_aws_ami_launch_permission_test.go index 417ba85c2cf..65dc0e311d3 100644 --- a/aws/resource_aws_ami_launch_permission_test.go +++ b/aws/resource_aws_ami_launch_permission_test.go @@ -17,6 +17,7 @@ func TestAccAWSAMILaunchPermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMILaunchPermissionDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSAMILaunchPermission_Disappears_LaunchPermission(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMILaunchPermissionDestroy, Steps: []resource.TestStep{ @@ -65,6 +67,7 @@ func TestAccAWSAMILaunchPermission_Disappears_LaunchPermission_Public(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMILaunchPermissionDestroy, Steps: []resource.TestStep{ @@ -88,6 +91,7 @@ func TestAccAWSAMILaunchPermission_Disappears_AMI(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMILaunchPermissionDestroy, Steps: []resource.TestStep{ From cb3f7e11900a186c4e134ae8927f0f69994cece7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:48:12 -0400 Subject: [PATCH 0154/1252] tests/r/ami: Add ErrorCheck --- aws/resource_aws_ami_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_ami_test.go b/aws/resource_aws_ami_test.go index 22073c68a56..3d601b90552 100644 --- a/aws/resource_aws_ami_test.go +++ b/aws/resource_aws_ami_test.go @@ -22,6 +22,7 @@ func TestAccAWSAMI_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -83,6 +84,7 @@ func TestAccAWSAMI_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -167,6 +169,7 @@ func TestAccAWSAMI_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAWSAMI_EphemeralBlockDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -251,6 +255,7 @@ func TestAccAWSAMI_Gp3BlockDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -313,6 +318,7 @@ func TestAccAWSAMI_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ From 6bc6a8b483eb239038edd70b1888daf605faeea8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:48:53 -0400 Subject: [PATCH 0155/1252] tests/r/customer_gateway: Add ErrorCheck --- aws/resource_aws_customer_gateway_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_customer_gateway_test.go b/aws/resource_aws_customer_gateway_test.go index 10f81b09ae1..80174d674f2 100644 --- a/aws/resource_aws_customer_gateway_test.go +++ b/aws/resource_aws_customer_gateway_test.go @@ -157,6 +157,7 @@ func TestAccAWSCustomerGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, Steps: []resource.TestStep{ From a8e20833b8fd89b91633e0962923bd9bf846eefe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:49:13 -0400 Subject: [PATCH 0156/1252] tests/r/default_network_acl: Add ErrorCheck --- aws/resource_aws_default_network_acl_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_default_network_acl_test.go b/aws/resource_aws_default_network_acl_test.go index faf3790a45a..fff3f5708c6 100644 --- a/aws/resource_aws_default_network_acl_test.go +++ b/aws/resource_aws_default_network_acl_test.go @@ -32,6 +32,7 @@ func TestAccAWSDefaultNetworkAcl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSDefaultNetworkAcl_basicIpv6Vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSDefaultNetworkAcl_deny_ingress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ @@ -112,6 +115,7 @@ func TestAccAWSDefaultNetworkAcl_withIpv6Ingress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ @@ -137,6 +141,7 @@ func TestAccAWSDefaultNetworkAcl_SubnetRemoval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ @@ -179,6 +184,7 @@ func TestAccAWSDefaultNetworkAcl_SubnetReassign(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultNetworkAclDestroy, Steps: []resource.TestStep{ From f81ea1cca1015f1b85a3673730350ff416681846 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:49:35 -0400 Subject: [PATCH 0157/1252] tests/r/default_route_table: Add ErrorCheck --- aws/resource_aws_default_route_table_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index 69a2ec8100b..877bdce29c5 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -20,6 +20,7 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSDefaultRouteTable_disappears_Vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -220,6 +222,7 @@ func TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -251,6 +254,7 @@ func TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -321,6 +325,7 @@ func TestAccAWSDefaultRouteTable_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -363,6 +368,7 @@ func TestAccAWSDefaultRouteTable_ConditionalCidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From 5906596470e5be89ede1408d4e8771dc58568751 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:50:03 -0400 Subject: [PATCH 0158/1252] tests/r/default_security_group: Add ErrorCheck --- aws/resource_aws_default_security_group_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_default_security_group_test.go b/aws/resource_aws_default_security_group_test.go index 4f632e5ff08..16123c4847c 100644 --- a/aws/resource_aws_default_security_group_test.go +++ b/aws/resource_aws_default_security_group_test.go @@ -98,6 +98,7 @@ func TestAccAWSDefaultSecurityGroup_Classic_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSDefaultSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -149,6 +150,7 @@ func TestAccAWSDefaultSecurityGroup_Classic_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSDefaultSecurityGroupDestroy, Steps: []resource.TestStep{ From 4e32691a9776ab7a4399a07d3f54d8347c0bf352 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:50:12 -0400 Subject: [PATCH 0159/1252] tests/r/default_subnet: Add ErrorCheck --- aws/resource_aws_default_subnet_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_default_subnet_test.go b/aws/resource_aws_default_subnet_test.go index 35bb31ba4d3..28f2e30c7f6 100644 --- a/aws/resource_aws_default_subnet_test.go +++ b/aws/resource_aws_default_subnet_test.go @@ -19,6 +19,7 @@ func TestAccAWSDefaultSubnet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultSubnetDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSDefaultSubnet_publicIp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultSubnetDestroy, Steps: []resource.TestStep{ From 21399e2998b0f4f5994b05b5040557ec584bdfc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:50:55 -0400 Subject: [PATCH 0160/1252] tests/r/default_vpc_dhcp_options: Add ErrorCheck --- aws/resource_aws_default_vpc_dhcp_options_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_default_vpc_dhcp_options_test.go b/aws/resource_aws_default_vpc_dhcp_options_test.go index 74d62800762..51cf6c6c971 100644 --- a/aws/resource_aws_default_vpc_dhcp_options_test.go +++ b/aws/resource_aws_default_vpc_dhcp_options_test.go @@ -15,6 +15,7 @@ func TestAccAWSDefaultVpcDhcpOptions_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultVpcDhcpOptionsDestroy, Steps: []resource.TestStep{ From 5226f3254ab0b876674dfa73c0c7e026e1a80cc5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:55:28 -0400 Subject: [PATCH 0161/1252] tests/r/vpc: Add ErrorCheck --- aws/resource_aws_vpc_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index d02d3480ff0..1f909402307 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -108,6 +108,7 @@ func TestAccAWSVpc_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -144,6 +145,7 @@ func TestAccAWSVpc_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAWSVpc_ignoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSVpc_AssignGeneratedIpv6CidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -247,6 +251,7 @@ func TestAccAWSVpc_Tenancy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -288,6 +293,7 @@ func TestAccAWSVpc_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -331,6 +337,7 @@ func TestAccAWSVpc_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -475,6 +482,7 @@ func TestAccAWSVpc_bothDnsOptionsSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -502,6 +510,7 @@ func TestAccAWSVpc_DisabledDnsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -527,6 +536,7 @@ func TestAccAWSVpc_classiclinkOptionSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -552,6 +562,7 @@ func TestAccAWSVpc_classiclinkDnsSupportOptionSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From 3d33ba56665654857a38eeba7956e32fb5263d19 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:56:01 -0400 Subject: [PATCH 0162/1252] tests/r/ebs_default_kms_key: Add ErrorCheck --- aws/resource_aws_ebs_default_kms_key_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ebs_default_kms_key_test.go b/aws/resource_aws_ebs_default_kms_key_test.go index d8a0bfb7978..28c5d0f26f8 100644 --- a/aws/resource_aws_ebs_default_kms_key_test.go +++ b/aws/resource_aws_ebs_default_kms_key_test.go @@ -17,6 +17,7 @@ func TestAccAWSEBSDefaultKmsKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEbsDefaultKmsKeyDestroy, Steps: []resource.TestStep{ From 647168d4f1f2bb14049f7af7d1e4ef6ee272a63f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:56:23 -0400 Subject: [PATCH 0163/1252] tests/r/ebs_encryption_by_default: Add ErrorCheck --- aws/resource_aws_ebs_encryption_by_default_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ebs_encryption_by_default_test.go b/aws/resource_aws_ebs_encryption_by_default_test.go index 4e9fed80f0d..2439c646caa 100644 --- a/aws/resource_aws_ebs_encryption_by_default_test.go +++ b/aws/resource_aws_ebs_encryption_by_default_test.go @@ -15,6 +15,7 @@ func TestAccAWSEBSEncryptionByDefault_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEncryptionByDefaultDestroy, Steps: []resource.TestStep{ From 20eb36529ec7d8b698c0ce1259100f2fd56a4e81 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:56:45 -0400 Subject: [PATCH 0164/1252] tests/r/ebs_snapshot_copy: Add ErrorCheck --- aws/resource_aws_ebs_snapshot_copy_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_ebs_snapshot_copy_test.go b/aws/resource_aws_ebs_snapshot_copy_test.go index d75eccf4452..0038944297d 100644 --- a/aws/resource_aws_ebs_snapshot_copy_test.go +++ b/aws/resource_aws_ebs_snapshot_copy_test.go @@ -18,6 +18,7 @@ func TestAccAWSEbsSnapshotCopy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ @@ -39,6 +40,7 @@ func TestAccAWSEbsSnapshotCopy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ @@ -77,6 +79,7 @@ func TestAccAWSEbsSnapshotCopy_withDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ @@ -101,6 +104,7 @@ func TestAccAWSEbsSnapshotCopy_withRegions(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ @@ -122,6 +126,7 @@ func TestAccAWSEbsSnapshotCopy_withKms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ @@ -142,6 +147,7 @@ func TestAccAWSEbsSnapshotCopy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, Steps: []resource.TestStep{ From 7b9ea5d42186f0fd7e89609f0d327588094a27a3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:57:01 -0400 Subject: [PATCH 0165/1252] tests/r/ebs_snapshot: Add ErrorCheck --- aws/resource_aws_ebs_snapshot_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ebs_snapshot_test.go b/aws/resource_aws_ebs_snapshot_test.go index dbcc0b4e480..cbf599bb19d 100644 --- a/aws/resource_aws_ebs_snapshot_test.go +++ b/aws/resource_aws_ebs_snapshot_test.go @@ -19,6 +19,7 @@ func TestAccAWSEBSSnapshot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSEBSSnapshot_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, Steps: []resource.TestStep{ @@ -91,6 +93,7 @@ func TestAccAWSEBSSnapshot_withDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func TestAccAWSEBSSnapshot_withKms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, Steps: []resource.TestStep{ @@ -144,6 +148,7 @@ func TestAccAWSEBSSnapshot_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, Steps: []resource.TestStep{ From 55f8039fcd9110d374d0567d267646bc9aa581d9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:58:03 -0400 Subject: [PATCH 0166/1252] tests/r/ec2_availability_zone_group: Add ErrorCheck --- aws/resource_aws_ec2_availability_zone_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ec2_availability_zone_group_test.go b/aws/resource_aws_ec2_availability_zone_group_test.go index 3370c34c29f..31b3acd9ae8 100644 --- a/aws/resource_aws_ec2_availability_zone_group_test.go +++ b/aws/resource_aws_ec2_availability_zone_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSEc2AvailabilityZoneGroup_OptInStatus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2AvailabilityZoneGroup(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 66d840b8a73071858410af7ad81c05b4022c29d4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:58:27 -0400 Subject: [PATCH 0167/1252] tests/r/ec2_capacity_reservation: Add ErrorCheck --- aws/resource_aws_ec2_capacity_reservation_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_ec2_capacity_reservation_test.go b/aws/resource_aws_ec2_capacity_reservation_test.go index 3a64e9d5107..099a5840796 100644 --- a/aws/resource_aws_ec2_capacity_reservation_test.go +++ b/aws/resource_aws_ec2_capacity_reservation_test.go @@ -71,6 +71,7 @@ func TestAccAWSEc2CapacityReservation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -108,6 +109,7 @@ func TestAccAWSEc2CapacityReservation_ebsOptimized(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSEc2CapacityReservation_endDate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -170,6 +173,7 @@ func TestAccAWSEc2CapacityReservation_endDateType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -210,6 +214,7 @@ func TestAccAWSEc2CapacityReservation_ephemeralStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -235,6 +240,7 @@ func TestAccAWSEc2CapacityReservation_instanceCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -267,6 +273,7 @@ func TestAccAWSEc2CapacityReservation_instanceMatchCriteria(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -292,6 +299,7 @@ func TestAccAWSEc2CapacityReservation_instanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -324,6 +332,7 @@ func TestAccAWSEc2CapacityReservation_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -367,6 +376,7 @@ func TestAccAWSEc2CapacityReservation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ @@ -390,6 +400,7 @@ func TestAccAWSEc2CapacityReservation_tenancy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2CapacityReservation(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2CapacityReservationDestroy, Steps: []resource.TestStep{ From 84eb193e3aa9e907b4b58b09b6b86cac78768be9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 01:59:53 -0400 Subject: [PATCH 0168/1252] tests/r/ec2_client_vpn_authorization_rule: Add ErrorCheck --- aws/resource_aws_ec2_client_vpn_authorization_rule_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ec2_client_vpn_authorization_rule_test.go b/aws/resource_aws_ec2_client_vpn_authorization_rule_test.go index 5b2a3a5346a..f96d1b1011d 100644 --- a/aws/resource_aws_ec2_client_vpn_authorization_rule_test.go +++ b/aws/resource_aws_ec2_client_vpn_authorization_rule_test.go @@ -21,6 +21,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy, Steps: []resource.TestStep{ @@ -65,6 +66,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_groups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_Subnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy, Steps: []resource.TestStep{ @@ -177,6 +180,7 @@ func testAccAwsEc2ClientVpnAuthorizationRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnAuthorizationRuleDestroy, Steps: []resource.TestStep{ From facdb556714b16dc029ecd226c53bdb5e8dd96d7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:00:21 -0400 Subject: [PATCH 0169/1252] tests/r/ec2_client_vpn_endpoint: Add ErrorCheck --- aws/resource_aws_ec2_client_vpn_endpoint_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_ec2_client_vpn_endpoint_test.go b/aws/resource_aws_ec2_client_vpn_endpoint_test.go index 1ef30b67f68..26217711301 100644 --- a/aws/resource_aws_ec2_client_vpn_endpoint_test.go +++ b/aws/resource_aws_ec2_client_vpn_endpoint_test.go @@ -136,6 +136,7 @@ func testAccAwsEc2ClientVpnEndpoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -165,6 +166,7 @@ func testAccAwsEc2ClientVpnEndpoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -187,6 +189,7 @@ func testAccAwsEc2ClientVpnEndpoint_msAD(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -214,6 +217,7 @@ func testAccAwsEc2ClientVpnEndpoint_mutualAuthAndMsAD(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -242,6 +246,7 @@ func testAccAwsEc2ClientVpnEndpoint_federated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -271,6 +276,7 @@ func testAccAwsEc2ClientVpnEndpoint_withLogGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -306,6 +312,7 @@ func testAccAwsEc2ClientVpnEndpoint_withDNSServers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -332,6 +339,7 @@ func testAccAwsEc2ClientVpnEndpoint_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ @@ -374,6 +382,7 @@ func testAccAwsEc2ClientVpnEndpoint_splitTunnel(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnEndpointDestroy, Steps: []resource.TestStep{ From 4bd05604abf4d32963a00587d2b9b0b3aa537506 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:01:03 -0400 Subject: [PATCH 0170/1252] tests/r/ec2_client_vpn_network_association: Add ErrorCheck --- aws/resource_aws_ec2_client_vpn_network_association_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index 55035fc4dbf..ea823ae1ae5 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -104,6 +104,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy, Steps: []resource.TestStep{ @@ -138,6 +139,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy, Steps: []resource.TestStep{ @@ -163,6 +165,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_securityGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckClientVPNSyncronize(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy, Steps: []resource.TestStep{ From 00bc01be06ed50980dceaef642da2215feccf51f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:03:21 -0400 Subject: [PATCH 0171/1252] tests/r/ec2_client_vpn_route: Add ErrorCheck --- aws/resource_aws_ec2_client_vpn_route_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_client_vpn_route_test.go b/aws/resource_aws_ec2_client_vpn_route_test.go index dfd37835c29..587881400c3 100644 --- a/aws/resource_aws_ec2_client_vpn_route_test.go +++ b/aws/resource_aws_ec2_client_vpn_route_test.go @@ -22,6 +22,7 @@ func testAccAwsEc2ClientVpnRoute_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnRouteDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func testAccAwsEc2ClientVpnRoute_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnRouteDestroy, Steps: []resource.TestStep{ @@ -85,6 +87,7 @@ func testAccAwsEc2ClientVpnRoute_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnRouteDestroy, Steps: []resource.TestStep{ From 6286a3374e55fad8826f6bf467a575f344a90c66 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:03:42 -0400 Subject: [PATCH 0172/1252] tests/r/ec2_fleet: Add ErrorCheck --- aws/resource_aws_ec2_fleet_test.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/aws/resource_aws_ec2_fleet_test.go b/aws/resource_aws_ec2_fleet_test.go index b4cc6346e28..59641b90445 100644 --- a/aws/resource_aws_ec2_fleet_test.go +++ b/aws/resource_aws_ec2_fleet_test.go @@ -22,6 +22,7 @@ func TestAccAWSEc2Fleet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -68,6 +69,7 @@ func TestAccAWSEc2Fleet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -90,6 +92,7 @@ func TestAccAWSEc2Fleet_ExcessCapacityTerminationPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -127,6 +130,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_LaunchT resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -170,6 +174,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_LaunchT resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -213,6 +218,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_LaunchTemplateSpecification_Version resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -261,6 +267,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_AvailabilityZone(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -300,6 +307,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_InstanceType(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -341,6 +349,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_MaxPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -380,6 +389,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_Priority(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -419,6 +429,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_Priority_Multiple(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -462,6 +473,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_SubnetId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -501,6 +513,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_WeightedCapacity(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -540,6 +553,7 @@ func TestAccAWSEc2Fleet_LaunchTemplateConfig_Override_WeightedCapacity_Multiple( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -581,6 +595,7 @@ func TestAccAWSEc2Fleet_OnDemandOptions_AllocationStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -618,6 +633,7 @@ func TestAccAWSEc2Fleet_ReplaceUnhealthyInstances(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -653,6 +669,7 @@ func TestAccAWSEc2Fleet_SpotOptions_AllocationStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -690,6 +707,7 @@ func TestAccAWSEc2Fleet_SpotOptions_CapacityRebalance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -719,6 +737,7 @@ func TestAccAWSEc2Fleet_SpotOptions_InstanceInterruptionBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -756,6 +775,7 @@ func TestAccAWSEc2Fleet_SpotOptions_InstancePoolsToUseCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -793,6 +813,7 @@ func TestAccAWSEc2Fleet_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -829,6 +850,7 @@ func TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -860,6 +882,7 @@ func TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType_On resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -888,6 +911,7 @@ func TestAccAWSEc2Fleet_TargetCapacitySpecification_DefaultTargetCapacityType_Sp resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -916,6 +940,7 @@ func TestAccAWSEc2Fleet_TargetCapacitySpecification_TotalTargetCapacity(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -953,6 +978,7 @@ func TestAccAWSEc2Fleet_TerminateInstancesWithExpiration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -988,6 +1014,7 @@ func TestAccAWSEc2Fleet_Type(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ @@ -1025,6 +1052,7 @@ func TestAccAWSEc2Fleet_TemplateMultipleNetworkInterfaces(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2FleetDestroy, Steps: []resource.TestStep{ From e27c877622350e2ca7f3b9b3aadabc89bda70378 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:04:09 -0400 Subject: [PATCH 0173/1252] tests/r/ec2_local_gateway_route_table_vpc_association: Add ErrorCheck --- ...e_aws_ec2_local_gateway_route_table_vpc_association_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_local_gateway_route_table_vpc_association_test.go b/aws/resource_aws_ec2_local_gateway_route_table_vpc_association_test.go index 1c6a8e681c8..2f06b877290 100644 --- a/aws/resource_aws_ec2_local_gateway_route_table_vpc_association_test.go +++ b/aws/resource_aws_ec2_local_gateway_route_table_vpc_association_test.go @@ -19,6 +19,7 @@ func TestAccAwsEc2LocalGatewayRouteTableVpcAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2LocalGatewayRouteTableVpcAssociationDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAwsEc2LocalGatewayRouteTableVpcAssociation_disappears(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2LocalGatewayRouteTableVpcAssociationDestroy, Steps: []resource.TestStep{ @@ -68,6 +70,7 @@ func TestAccAwsEc2LocalGatewayRouteTableVpcAssociation_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2LocalGatewayRouteTableVpcAssociationDestroy, Steps: []resource.TestStep{ From 9befa8909c0b73222581ceb302207437ec5a4b15 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:04:36 -0400 Subject: [PATCH 0174/1252] tests/r/ec2_local_gateway_route: Add ErrorCheck --- aws/resource_aws_ec2_local_gateway_route_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_local_gateway_route_test.go b/aws/resource_aws_ec2_local_gateway_route_test.go index acefe135050..9839b9870eb 100644 --- a/aws/resource_aws_ec2_local_gateway_route_test.go +++ b/aws/resource_aws_ec2_local_gateway_route_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -18,6 +19,7 @@ func TestAccAWSEc2LocalGatewayRoute_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2LocalGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -46,6 +48,7 @@ func TestAccAWSEc2LocalGatewayRoute_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2LocalGatewayRouteDestroy, Steps: []resource.TestStep{ From 2aeae10ffd0bcf6ffab3072a7eba7ccf3e42e824 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:05:01 -0400 Subject: [PATCH 0175/1252] tests/r/ec2_managed_prefix_list: Add ErrorCheck --- aws/resource_aws_ec2_managed_prefix_list_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_ec2_managed_prefix_list_test.go b/aws/resource_aws_ec2_managed_prefix_list_test.go index 07216393049..d82cd4ded0d 100644 --- a/aws/resource_aws_ec2_managed_prefix_list_test.go +++ b/aws/resource_aws_ec2_managed_prefix_list_test.go @@ -20,6 +20,7 @@ func TestAccAwsEc2ManagedPrefixList_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAwsEc2ManagedPrefixList_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAwsEc2ManagedPrefixList_AddressFamily_IPv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ @@ -100,6 +103,7 @@ func TestAccAwsEc2ManagedPrefixList_Entry(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ @@ -158,6 +162,7 @@ func TestAccAwsEc2ManagedPrefixList_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ @@ -194,6 +199,7 @@ func TestAccAwsEc2ManagedPrefixList_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ManagedPrefixListDestroy, Steps: []resource.TestStep{ From a122645114f3b2953d307e3e835da6dde1dbdbe2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:05:26 -0400 Subject: [PATCH 0176/1252] tests/r/ec2_traffic_mirror_filter_rule: Add ErrorCheck --- aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go b/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go index 274983a3192..826f7daeb80 100644 --- a/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go @@ -31,6 +31,7 @@ func TestAccAWSEc2TrafficMirrorFilterRule_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorFilterRule(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterRuleDestroy, Steps: []resource.TestStep{ @@ -113,6 +114,7 @@ func TestAccAWSEc2TrafficMirrorFilterRule_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorFilterRule(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterRuleDestroy, Steps: []resource.TestStep{ From 6ffe5e0deef1e121efb1dbf8324c67d18ceaacec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:05:48 -0400 Subject: [PATCH 0177/1252] tests/r/ec2_traffic_mirror_filter: Add ErrorCheck --- aws/resource_aws_ec2_traffic_mirror_filter_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_traffic_mirror_filter_test.go b/aws/resource_aws_ec2_traffic_mirror_filter_test.go index 911e619eb87..824d6dfb6c7 100644 --- a/aws/resource_aws_ec2_traffic_mirror_filter_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_filter_test.go @@ -21,6 +21,7 @@ func TestAccAWSEc2TrafficMirrorFilter_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorFilter(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterDestroy, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAWSEc2TrafficMirrorFilter_tags(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorFilter(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterDestroy, Steps: []resource.TestStep{ @@ -117,6 +119,7 @@ func TestAccAWSEc2TrafficMirrorFilter_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorFilter(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterDestroy, Steps: []resource.TestStep{ From 831946b5219518714e4d83360ed8a7470278c2ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:06:21 -0400 Subject: [PATCH 0178/1252] tests/r/ec2_traffic_mirror_session: Add ErrorCheck --- aws/resource_aws_ec2_traffic_mirror_session_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_traffic_mirror_session_test.go b/aws/resource_aws_ec2_traffic_mirror_session_test.go index 1b5c7cde223..eda920a28bd 100644 --- a/aws/resource_aws_ec2_traffic_mirror_session_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_session_test.go @@ -27,6 +27,7 @@ func TestAccAWSEc2TrafficMirrorSession_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorSession(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorSessionDestroy, Steps: []resource.TestStep{ @@ -87,6 +88,7 @@ func TestAccAWSEc2TrafficMirrorSession_tags(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorSession(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorSessionDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSEc2TrafficMirrorSession_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorSession(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorSessionDestroy, Steps: []resource.TestStep{ From 0d0a43d97bb1bfb95b28f75b4feecd973fa98127 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:06:51 -0400 Subject: [PATCH 0179/1252] tests/r/ec2_traffic_mirror_target: Add ErrorCheck --- aws/resource_aws_ec2_traffic_mirror_target_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ec2_traffic_mirror_target_test.go b/aws/resource_aws_ec2_traffic_mirror_target_test.go index 385dbec107d..cd557cf59bb 100644 --- a/aws/resource_aws_ec2_traffic_mirror_target_test.go +++ b/aws/resource_aws_ec2_traffic_mirror_target_test.go @@ -23,6 +23,7 @@ func TestAccAWSEc2TrafficMirrorTarget_nlb(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorTarget(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSEc2TrafficMirrorTarget_eni(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorTarget(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, Steps: []resource.TestStep{ @@ -89,6 +91,7 @@ func TestAccAWSEc2TrafficMirrorTarget_tags(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorTarget(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, Steps: []resource.TestStep{ @@ -137,6 +140,7 @@ func TestAccAWSEc2TrafficMirrorTarget_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TrafficMirrorTarget(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, Steps: []resource.TestStep{ From efe38ccbb38862d583aa1c5c73722a84e0679299 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:07:16 -0400 Subject: [PATCH 0180/1252] tests/r/ec2_transit_gateway_peering_attachment: Add ErrorCheck --- ...esource_aws_ec2_transit_gateway_peering_attachment_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_peering_attachment_test.go b/aws/resource_aws_ec2_transit_gateway_peering_attachment_test.go index 8003764130d..8b5998ca08c 100644 --- a/aws/resource_aws_ec2_transit_gateway_peering_attachment_test.go +++ b/aws/resource_aws_ec2_transit_gateway_peering_attachment_test.go @@ -93,6 +93,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachment_basic(t *testing.T) { testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ @@ -129,6 +130,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachment_disappears(t *testing.T) { testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ @@ -156,6 +158,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachment_Tags_sameAccount(t *testing.T) testAccPreCheckAWSEc2TransitGateway(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ @@ -210,6 +213,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachment_differentAccount(t *testing.T) testAccMultipleRegionPreCheck(t, 2) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ From ab76c02b15adfb283dd08c670b2bfbb1507820eb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:09:51 -0400 Subject: [PATCH 0181/1252] tests/r/ec2_transit_gateway_peering_attachment_accepter: Add ErrorCheck --- ...aws_ec2_transit_gateway_peering_attachment_accepter_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_peering_attachment_accepter_test.go b/aws/resource_aws_ec2_transit_gateway_peering_attachment_accepter_test.go index d1a2cee7aac..d8f0f835f08 100644 --- a/aws/resource_aws_ec2_transit_gateway_peering_attachment_accepter_test.go +++ b/aws/resource_aws_ec2_transit_gateway_peering_attachment_accepter_test.go @@ -25,6 +25,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_sameAccount(t *t testAccMultipleRegionPreCheck(t, 2) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_Tags_sameAccount(t *te testAccMultipleRegionPreCheck(t, 2) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ @@ -112,6 +114,7 @@ func TestAccAWSEc2TransitGatewayPeeringAttachmentAccepter_basic_differentAccount testAccAlternateAccountPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayPeeringAttachmentDestroy, Steps: []resource.TestStep{ From 4c1bc758c51ded15465008870c52f291c0981f04 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:10:47 -0400 Subject: [PATCH 0182/1252] tests/r/ec2_transit_gateway_prefix_list_reference: Add ErrorCheck --- ...rce_aws_ec2_transit_gateway_prefix_list_reference_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_prefix_list_reference_test.go b/aws/resource_aws_ec2_transit_gateway_prefix_list_reference_test.go index 21cdfadbfd6..f89af1b89d7 100644 --- a/aws/resource_aws_ec2_transit_gateway_prefix_list_reference_test.go +++ b/aws/resource_aws_ec2_transit_gateway_prefix_list_reference_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -24,6 +25,7 @@ func TestAccAwsEc2TransitGatewayPrefixListReference_basic(t *testing.T) { testAccPreCheckAWSEc2TransitGateway(t) testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2TransitGatewayPrefixListReferenceDestroy, Steps: []resource.TestStep{ @@ -57,6 +59,7 @@ func TestAccAwsEc2TransitGatewayPrefixListReference_disappears(t *testing.T) { testAccPreCheckAWSEc2TransitGateway(t) testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2TransitGatewayPrefixListReferenceDestroy, Steps: []resource.TestStep{ @@ -83,6 +86,7 @@ func TestAccAwsEc2TransitGatewayPrefixListReference_disappears_TransitGateway(t testAccPreCheckAWSEc2TransitGateway(t) testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2TransitGatewayPrefixListReferenceDestroy, Steps: []resource.TestStep{ @@ -110,6 +114,7 @@ func TestAccAwsEc2TransitGatewayPrefixListReference_TransitGatewayAttachmentId(t testAccPreCheckAWSEc2TransitGateway(t) testAccPreCheckEc2ManagedPrefixList(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2TransitGatewayPrefixListReferenceDestroy, Steps: []resource.TestStep{ From 5e6257da68471b5e98dd3bc686c8289ff62a0009 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:11:12 -0400 Subject: [PATCH 0183/1252] tests/r/ec2_transit_gateway_route_table_association: Add ErrorCheck --- ...ource_aws_ec2_transit_gateway_route_table_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ec2_transit_gateway_route_table_association_test.go b/aws/resource_aws_ec2_transit_gateway_route_table_association_test.go index 4ef5527f375..b41d56b79f5 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table_association_test.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table_association_test.go @@ -17,6 +17,7 @@ func TestAccAWSEc2TransitGatewayRouteTableAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTableAssociationDestroy, Steps: []resource.TestStep{ From 244f114fa6073b6ce64463293447c6370810608c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:11:37 -0400 Subject: [PATCH 0184/1252] tests/r/ec2_transit_gateway_route_table_propagation: Add ErrorCheck --- ...ource_aws_ec2_transit_gateway_route_table_propagation_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ec2_transit_gateway_route_table_propagation_test.go b/aws/resource_aws_ec2_transit_gateway_route_table_propagation_test.go index ef1577bbb2e..f4bf3cc9e27 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table_propagation_test.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table_propagation_test.go @@ -17,6 +17,7 @@ func TestAccAWSEc2TransitGatewayRouteTablePropagation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTablePropagationDestroy, Steps: []resource.TestStep{ From 0297f19a6cb41650123179b1598599676673e685 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:11:54 -0400 Subject: [PATCH 0185/1252] tests/r/ec2_transit_gateway_route_table: Add ErrorCheck --- aws/resource_aws_ec2_transit_gateway_route_table_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_route_table_test.go b/aws/resource_aws_ec2_transit_gateway_route_table_test.go index 33356d33dce..959b642e2d4 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table_test.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table_test.go @@ -19,6 +19,7 @@ func TestAccAWSEc2TransitGatewayRouteTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTableDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSEc2TransitGatewayRouteTable_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTableDestroy, Steps: []resource.TestStep{ @@ -71,6 +73,7 @@ func TestAccAWSEc2TransitGatewayRouteTable_disappears_TransitGateway(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTableDestroy, Steps: []resource.TestStep{ @@ -93,6 +96,7 @@ func TestAccAWSEc2TransitGatewayRouteTable_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteTableDestroy, Steps: []resource.TestStep{ From 1ff019f1f9afb197f850d2a03b447073ee16645d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:12:17 -0400 Subject: [PATCH 0186/1252] tests/r/ec2_transit_gateway_route: Add ErrorCheck --- aws/resource_aws_ec2_transit_gateway_route_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_route_test.go b/aws/resource_aws_ec2_transit_gateway_route_test.go index cb5b9941bc6..b127957c98e 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_test.go +++ b/aws/resource_aws_ec2_transit_gateway_route_test.go @@ -17,6 +17,7 @@ func TestAccAWSEc2TransitGatewayRoute_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSEc2TransitGatewayRoute_basic_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSEc2TransitGatewayRoute_blackhole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -106,6 +109,7 @@ func TestAccAWSEc2TransitGatewayRoute_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -132,6 +136,7 @@ func TestAccAWSEc2TransitGatewayRoute_disappears_TransitGatewayAttachment(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayRouteDestroy, Steps: []resource.TestStep{ From 1e65cae7717d48f983e6afa35dcac92b3c4ce597 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:12:32 -0400 Subject: [PATCH 0187/1252] tests/r/ec2_transit_gateway: Add ErrorCheck --- aws/resource_aws_ec2_transit_gateway_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_test.go b/aws/resource_aws_ec2_transit_gateway_test.go index 8cd8529a758..67f1878082a 100644 --- a/aws/resource_aws_ec2_transit_gateway_test.go +++ b/aws/resource_aws_ec2_transit_gateway_test.go @@ -114,6 +114,7 @@ func TestAccAWSEc2TransitGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -150,6 +151,7 @@ func TestAccAWSEc2TransitGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -171,6 +173,7 @@ func TestAccAWSEc2TransitGateway_AmazonSideASN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -204,6 +207,7 @@ func TestAccAWSEc2TransitGateway_AutoAcceptSharedAttachments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -237,6 +241,7 @@ func TestAccAWSEc2TransitGateway_DefaultRouteTableAssociationAndPropagationDisab resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -263,6 +268,7 @@ func TestAccAWSEc2TransitGateway_DefaultRouteTableAssociation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -304,6 +310,7 @@ func TestAccAWSEc2TransitGateway_DefaultRouteTablePropagation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -345,6 +352,7 @@ func TestAccAWSEc2TransitGateway_DnsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -378,6 +386,7 @@ func TestAccAWSEc2TransitGateway_VpnEcmpSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -411,6 +420,7 @@ func TestAccAWSEc2TransitGateway_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ @@ -444,6 +454,7 @@ func TestAccAWSEc2TransitGateway_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, Steps: []resource.TestStep{ From 0c1b10979423c04a38864159b6563140c623aee1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:13:10 -0400 Subject: [PATCH 0188/1252] tests/r/ec2_transit_gateway_vpc_attachment_accepter: Add ErrorCheck --- ...rce_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go index 8c533cf293d..23f926cdf8b 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go @@ -26,6 +26,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic(t *testing.T) { testAccAlternateAccountPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -72,6 +73,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags(t *testing.T) { testAccAlternateAccountPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -141,6 +143,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRoute testAccAlternateAccountPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ From 6481e16a066ef091b4ee933f4d5abaa96b881f37 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:13:29 -0400 Subject: [PATCH 0189/1252] tests/r/ec2_transit_gateway_vpc_attachment: Add ErrorCheck --- ...rce_aws_ec2_transit_gateway_vpc_attachment_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_test.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_test.go index 47a5799d9d4..7337b2883d5 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_test.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_test.go @@ -91,6 +91,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -124,6 +125,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -145,6 +147,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_ApplianceModeSupport(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -186,6 +189,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_DnsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -219,6 +223,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_Ipv6Support(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -259,6 +264,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_SharedTransitGateway(t *testing.T) testAccAlternateAccountPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -284,6 +290,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_SubnetIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -325,6 +332,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -372,6 +380,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_TransitGatewayDefaultRouteTableAss resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -403,6 +412,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_TransitGatewayDefaultRouteTableAss resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ @@ -452,6 +462,7 @@ func TestAccAWSEc2TransitGatewayVpcAttachment_TransitGatewayDefaultRouteTablePro resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEc2TransitGatewayVpcAttachmentDestroy, Steps: []resource.TestStep{ From 650a9841435a93ee108e8e5a2b7b401570e2b142 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:14:31 -0400 Subject: [PATCH 0190/1252] tests/r/efs_mount_target: Add ErrorCheck --- aws/resource_aws_efs_mount_target_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_efs_mount_target_test.go b/aws/resource_aws_efs_mount_target_test.go index edef6809ef2..28035fdf4a5 100644 --- a/aws/resource_aws_efs_mount_target_test.go +++ b/aws/resource_aws_efs_mount_target_test.go @@ -94,6 +94,7 @@ func TestAccAWSEFSMountTarget_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsMountTargetDestroy, Steps: []resource.TestStep{ @@ -136,6 +137,7 @@ func TestAccAWSEFSMountTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, Steps: []resource.TestStep{ @@ -157,6 +159,7 @@ func TestAccAWSEFSMountTarget_IpAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsMountTargetDestroy, Steps: []resource.TestStep{ @@ -183,6 +186,7 @@ func TestAccAWSEFSMountTarget_IpAddress_EmptyString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsMountTargetDestroy, Steps: []resource.TestStep{ From be164ad6cf5ecdf23a9ef4e3b5c03b6680a5f39f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:16:30 -0400 Subject: [PATCH 0191/1252] tests/r/egress_only_internet_gateway: Add ErrorCheck --- aws/resource_aws_egress_only_internet_gateway_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_egress_only_internet_gateway_test.go b/aws/resource_aws_egress_only_internet_gateway_test.go index 6c88fe2f648..00a3152795f 100644 --- a/aws/resource_aws_egress_only_internet_gateway_test.go +++ b/aws/resource_aws_egress_only_internet_gateway_test.go @@ -67,6 +67,7 @@ func TestAccAWSEgressOnlyInternetGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEgressOnlyInternetGatewayDestroy, Steps: []resource.TestStep{ From b1f014dc308349225882eec7dc56f814826b592b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:16:51 -0400 Subject: [PATCH 0192/1252] tests/r/eip_association: Add ErrorCheck --- aws/resource_aws_eip_association_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_eip_association_test.go b/aws/resource_aws_eip_association_test.go index 7599a705e22..257bfb5918b 100644 --- a/aws/resource_aws_eip_association_test.go +++ b/aws/resource_aws_eip_association_test.go @@ -17,6 +17,7 @@ func TestAccAWSEIPAssociation_instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSEIPAssociation_networkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSEIPAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2VPCOnlyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -96,6 +99,7 @@ func TestAccAWSEIPAssociation_ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -125,6 +129,7 @@ func TestAccAWSEIPAssociation_spotInstance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -153,6 +158,7 @@ func TestAccAWSEIPAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ From d27d27f2fbb0d7292ee223257e92ddec99dcdbc4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:17:10 -0400 Subject: [PATCH 0193/1252] tests/r/eip: Add ErrorCheck --- aws/resource_aws_eip_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_eip_test.go b/aws/resource_aws_eip_test.go index 89602e45992..2abb3635fde 100644 --- a/aws/resource_aws_eip_test.go +++ b/aws/resource_aws_eip_test.go @@ -91,6 +91,7 @@ func TestAccAWSEIP_Ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ @@ -279,6 +280,7 @@ func TestAccAWSEIP_Instance_Reassociate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ @@ -305,6 +307,7 @@ func TestAccAWSEIP_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ @@ -362,6 +365,7 @@ func TestAccAWSEIP_tags_Vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ @@ -400,6 +404,7 @@ func TestAccAWSEIP_tags_Ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ From 9b0440d9cc4f208801669c630fd76714e89f64fc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:17:58 -0400 Subject: [PATCH 0194/1252] tests/r/flow_log: Add ErrorCheck --- aws/resource_aws_flow_log_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_flow_log_test.go b/aws/resource_aws_flow_log_test.go index bcc8abc6058..07f49287110 100644 --- a/aws/resource_aws_flow_log_test.go +++ b/aws/resource_aws_flow_log_test.go @@ -75,6 +75,7 @@ func TestAccAWSFlowLog_VPCID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -114,6 +115,7 @@ func TestAccAWSFlowLog_LogFormat(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -148,6 +150,7 @@ func TestAccAWSFlowLog_SubnetID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -182,6 +185,7 @@ func TestAccAWSFlowLog_LogDestinationType_CloudWatchLogs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -213,6 +217,7 @@ func TestAccAWSFlowLog_LogDestinationType_S3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -240,6 +245,7 @@ func TestAccAWSFlowLog_LogDestinationType_S3_Invalid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -258,6 +264,7 @@ func TestAccAWSFlowLog_LogDestinationType_MaxAggregationInterval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -285,6 +292,7 @@ func TestAccAWSFlowLog_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ @@ -332,6 +340,7 @@ func TestAccAWSFlowLog_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFlowLogDestroy, Steps: []resource.TestStep{ From 47440e92f39066d467390e197f152a44dc930047 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:18:31 -0400 Subject: [PATCH 0195/1252] tests/r/instance: Add ErrorCheck --- aws/resource_aws_instance_test.go | 67 +++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/aws/resource_aws_instance_test.go b/aws/resource_aws_instance_test.go index c04a8cec4d8..af111930b14 100644 --- a/aws/resource_aws_instance_test.go +++ b/aws/resource_aws_instance_test.go @@ -158,6 +158,7 @@ func TestAccAWSInstance_inDefaultVpcBySgName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -183,6 +184,7 @@ func TestAccAWSInstance_inDefaultVpcBySgId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -207,6 +209,7 @@ func TestAccAWSInstance_inEc2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -308,6 +311,7 @@ func TestAccAWSInstance_EbsBlockDevice_KmsKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -330,6 +334,7 @@ func TestAccAWSInstance_EbsBlockDevice_KmsKeyArn(t *testing.T) { func TestAccAWSInstance_EbsBlockDevice_InvalidIopsForVolumeType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -344,6 +349,7 @@ func TestAccAWSInstance_EbsBlockDevice_InvalidIopsForVolumeType(t *testing.T) { func TestAccAWSInstance_EbsBlockDevice_InvalidThroughputForVolumeType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -363,6 +369,7 @@ func TestAccAWSInstance_RootBlockDevice_KmsKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -466,6 +473,7 @@ func TestAccAWSInstance_GP2IopsDevice(t *testing.T) { func TestAccAWSInstance_GP2WithIopsValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -890,6 +898,7 @@ func TestAccAWSInstance_ipv6_supportAddressCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -914,6 +923,7 @@ func TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -932,6 +942,7 @@ func TestAccAWSInstance_ipv6_supportAddressCountWithIpv4(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1049,6 +1060,7 @@ func TestAccAWSInstance_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1083,6 +1095,7 @@ func TestAccAWSInstance_blockDeviceTags_volumeTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1135,6 +1148,7 @@ func TestAccAWSInstance_blockDeviceTags_withAttachedVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1182,6 +1196,7 @@ func TestAccAWSInstance_blockDeviceTags_ebsAndRoot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1333,6 +1348,7 @@ func TestAccAWSInstance_withIamInstanceProfilePath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1510,6 +1526,7 @@ func TestAccAWSInstance_rootBlockDeviceMismatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRegionPreCheck(t, endpoints.UsWest2RegionID) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1581,6 +1598,7 @@ func TestAccAWSInstance_changeInstanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1614,6 +1632,7 @@ func TestAccAWSInstance_EbsRootDevice_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1648,6 +1667,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifySize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1673,6 +1693,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifySize(t *testing.T) { }, }) } + func TestAccAWSInstance_EbsRootDevice_ModifyType(t *testing.T) { var original ec2.Instance var updated ec2.Instance @@ -1686,6 +1707,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1726,6 +1748,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io1(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1768,6 +1791,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyIOPS_Io2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1810,6 +1834,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyThroughput_Gp3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1851,6 +1876,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyDeleteOnTermination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1895,6 +1921,7 @@ func TestAccAWSInstance_EbsRootDevice_ModifyAll(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1934,6 +1961,7 @@ func TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifySize(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -1986,6 +2014,7 @@ func TestAccAWSInstance_EbsRootDevice_MultipleBlockDevices_ModifyDeleteOnTermina resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2036,6 +2065,7 @@ func TestAccAWSInstance_EbsRootDevice_MultipleDynamicEBSBlockDevices(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2088,6 +2118,7 @@ func TestAccAWSInstance_primaryNetworkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2118,6 +2149,7 @@ func TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2151,6 +2183,7 @@ func TestAccAWSInstance_addSecondaryInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2189,6 +2222,7 @@ func TestAccAWSInstance_addSecurityGroupNetworkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2223,6 +2257,7 @@ func TestAccAWSInstance_NewNetworkInterface_PublicIPAndSecondaryPrivateIPs(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2262,6 +2297,7 @@ func TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPs resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2292,6 +2328,7 @@ func TestAccAWSInstance_NewNetworkInterface_EmptyPrivateIPAndSecondaryPrivateIPs resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2338,6 +2375,7 @@ func TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPs(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2369,6 +2407,7 @@ func TestAccAWSInstance_NewNetworkInterface_PrivateIPAndSecondaryPrivateIPsUpdat resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2413,6 +2452,7 @@ func TestAccAWSInstance_associatePublic_defaultPrivate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2441,6 +2481,7 @@ func TestAccAWSInstance_associatePublic_defaultPublic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2469,6 +2510,7 @@ func TestAccAWSInstance_associatePublic_explicitPublic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2497,6 +2539,7 @@ func TestAccAWSInstance_associatePublic_explicitPrivate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2525,6 +2568,7 @@ func TestAccAWSInstance_associatePublic_overridePublic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2553,6 +2597,7 @@ func TestAccAWSInstance_associatePublic_overridePrivate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2580,6 +2625,7 @@ func TestAccAWSInstance_getPasswordData_falseToTrue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2616,6 +2662,7 @@ func TestAccAWSInstance_getPasswordData_trueToFalse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2653,6 +2700,7 @@ func TestAccAWSInstance_CreditSpecification_Empty_NonBurstable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2680,6 +2728,7 @@ func TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2711,6 +2760,7 @@ func TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2738,6 +2788,7 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2773,6 +2824,7 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2808,6 +2860,7 @@ func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2835,6 +2888,7 @@ func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2862,6 +2916,7 @@ func TestAccAWSInstance_creditSpecification_updateCpuCredits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2905,6 +2960,7 @@ func TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2931,6 +2987,7 @@ func TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2958,6 +3015,7 @@ func TestAccAWSInstance_creditSpecificationT3_standardCpuCredits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -2993,6 +3051,7 @@ func TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3028,6 +3087,7 @@ func TestAccAWSInstance_creditSpecificationT3_updateCpuCredits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3071,6 +3131,7 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3107,6 +3168,7 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3142,6 +3204,7 @@ func TestAccAWSInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3164,6 +3227,7 @@ func TestAccAWSInstance_UserData_EmptyStringToUnspecified(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3196,6 +3260,7 @@ func TestAccAWSInstance_UserData_UnspecifiedToEmptyString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3226,6 +3291,7 @@ func TestAccAWSInstance_hibernation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -3299,6 +3365,7 @@ func TestAccAWSInstance_enclaveOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ From 51b41cf735a53326fd34f61c8b5c18bf7c1b5ccd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:18:57 -0400 Subject: [PATCH 0196/1252] tests/r/internet_gateway: Add ErrorCheck --- aws/resource_aws_internet_gateway_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_internet_gateway_test.go b/aws/resource_aws_internet_gateway_test.go index 0e42d5095e8..c0101515706 100644 --- a/aws/resource_aws_internet_gateway_test.go +++ b/aws/resource_aws_internet_gateway_test.go @@ -256,6 +256,7 @@ func TestAccAWSInternetGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckInternetGatewayDestroy, Steps: []resource.TestStep{ From b24ffb9cd84b899a7a87501b23458e8f80cf7a5f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:19:15 -0400 Subject: [PATCH 0197/1252] tests/r/key_pair: Add ErrorCheck --- aws/resource_aws_key_pair_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_key_pair_test.go b/aws/resource_aws_key_pair_test.go index 3ba96594991..f3dc5ad69f1 100644 --- a/aws/resource_aws_key_pair_test.go +++ b/aws/resource_aws_key_pair_test.go @@ -65,6 +65,7 @@ func TestAccAWSKeyPair_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKeyPairDestroy, Steps: []resource.TestStep{ @@ -95,6 +96,7 @@ func TestAccAWSKeyPair_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKeyPairDestroy, Steps: []resource.TestStep{ @@ -139,6 +141,7 @@ func TestAccAWSKeyPair_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKeyPairDestroy, Steps: []resource.TestStep{ @@ -196,6 +199,7 @@ func TestAccAWSKeyPair_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKeyPairDestroy, Steps: []resource.TestStep{ From 5137a64adcd19e50297dce2c0d083fd02d778293 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:20:15 -0400 Subject: [PATCH 0198/1252] tests/r/main_route_table_association: Add ErrorCheck --- aws/resource_aws_main_route_table_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_main_route_table_association_test.go b/aws/resource_aws_main_route_table_association_test.go index e5ca346a28f..c511349fb00 100644 --- a/aws/resource_aws_main_route_table_association_test.go +++ b/aws/resource_aws_main_route_table_association_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -12,6 +13,7 @@ import ( func TestAccAWSMainRouteTableAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMainRouteTableAssociationDestroy, Steps: []resource.TestStep{ From aa93e43727287a8d038df6090ed2236ddb3ecffd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:20:37 -0400 Subject: [PATCH 0199/1252] tests/r/nat_gateway: Add ErrorCheck --- aws/resource_aws_nat_gateway_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_nat_gateway_test.go b/aws/resource_aws_nat_gateway_test.go index 115bb15307f..927051b705e 100644 --- a/aws/resource_aws_nat_gateway_test.go +++ b/aws/resource_aws_nat_gateway_test.go @@ -88,6 +88,7 @@ func TestAccAWSNatGateway_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNatGatewayDestroy, Steps: []resource.TestStep{ From f97dbaa5cfa6dacc586eaf589d4214c02a51c0d8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:21:22 -0400 Subject: [PATCH 0200/1252] tests/r/network_acl_rule: Add ErrorCheck --- aws/resource_aws_network_acl_rule_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_network_acl_rule_test.go b/aws/resource_aws_network_acl_rule_test.go index 92c3cad51f7..3df9748e3b2 100644 --- a/aws/resource_aws_network_acl_rule_test.go +++ b/aws/resource_aws_network_acl_rule_test.go @@ -17,6 +17,7 @@ import ( func TestAccAWSNetworkAclRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSNetworkAclRule_basic(t *testing.T) { func TestAccAWSNetworkAclRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -71,6 +73,7 @@ func TestAccAWSNetworkAclRule_disappears(t *testing.T) { func TestAccAWSNetworkAclRule_disappears_IngressEgressSameNumber(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -92,6 +95,7 @@ func TestAccAWSNetworkAclRule_disappears_NetworkAcl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -110,6 +114,7 @@ func TestAccAWSNetworkAclRule_disappears_NetworkAcl(t *testing.T) { func TestAccAWSNetworkAclRule_missingParam(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -124,6 +129,7 @@ func TestAccAWSNetworkAclRule_missingParam(t *testing.T) { func TestAccAWSNetworkAclRule_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -149,6 +155,7 @@ func TestAccAWSNetworkAclRule_ipv6ICMP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -176,6 +183,7 @@ func TestAccAWSNetworkAclRule_ipv6VpcAssignGeneratedIpv6CidrBlockUpdate(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -209,6 +217,7 @@ func TestAccAWSNetworkAclRule_ipv6VpcAssignGeneratedIpv6CidrBlockUpdate(t *testi func TestAccAWSNetworkAclRule_allProtocol(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ @@ -227,6 +236,7 @@ func TestAccAWSNetworkAclRule_allProtocol(t *testing.T) { func TestAccAWSNetworkAclRule_tcpProtocol(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclRuleDestroy, Steps: []resource.TestStep{ From 9782c2a0462db8770fb7c026d8aeba92b5997e03 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:23:09 -0400 Subject: [PATCH 0201/1252] tests/r/network_acl: Add ErrorCheck --- aws/resource_aws_network_acl_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_network_acl_test.go b/aws/resource_aws_network_acl_test.go index 47dbece2d95..be2516b9daf 100644 --- a/aws/resource_aws_network_acl_test.go +++ b/aws/resource_aws_network_acl_test.go @@ -109,6 +109,7 @@ func TestAccAWSNetworkAcl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -136,6 +137,7 @@ func TestAccAWSNetworkAcl_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -179,6 +181,7 @@ func TestAccAWSNetworkAcl_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -200,6 +203,7 @@ func TestAccAWSNetworkAcl_Egress_ConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -252,6 +256,7 @@ func TestAccAWSNetworkAcl_Ingress_ConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -653,6 +658,7 @@ func TestAccAWSNetworkAcl_ipv6ICMPRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ From f78977cb9c1438ddce7a26cd2d937fc94e9d72be Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:24:21 -0400 Subject: [PATCH 0202/1252] tests/r/network_interface_sg_attachment: Add ErrorCheck --- aws/resource_aws_network_interface_sg_attachment_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_network_interface_sg_attachment_test.go b/aws/resource_aws_network_interface_sg_attachment_test.go index 3fe47374d08..2d03de45136 100644 --- a/aws/resource_aws_network_interface_sg_attachment_test.go +++ b/aws/resource_aws_network_interface_sg_attachment_test.go @@ -19,6 +19,7 @@ func TestAccAWSNetworkInterfaceSGAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkInterfaceSGAttachmentDestroy, Steps: []resource.TestStep{ @@ -41,6 +42,7 @@ func TestAccAWSNetworkInterfaceSGAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkInterfaceSGAttachmentDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSNetworkInterfaceSGAttachment_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkInterfaceSGAttachmentDestroy, Steps: []resource.TestStep{ @@ -97,6 +100,7 @@ func TestAccAWSNetworkInterfaceSGAttachment_DataSource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkInterfaceSGAttachmentDestroy, Steps: []resource.TestStep{ @@ -127,6 +131,7 @@ func TestAccAWSNetworkInterfaceSGAttachment_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkInterfaceSGAttachmentDestroy, Steps: []resource.TestStep{ From f90ba3bec0b841ae374fe43c5c7bb48de73674bc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:24:43 -0400 Subject: [PATCH 0203/1252] tests/r/network_interface: Add ErrorCheck --- aws/resource_aws_network_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_network_interface_test.go b/aws/resource_aws_network_interface_test.go index 9c9d240eccc..84df78dd1ed 100644 --- a/aws/resource_aws_network_interface_test.go +++ b/aws/resource_aws_network_interface_test.go @@ -246,6 +246,7 @@ func TestAccAWSENI_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, Steps: []resource.TestStep{ @@ -422,6 +423,7 @@ func TestAccAWSENI_PrivateIpsCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, Steps: []resource.TestStep{ From 284e22ee6dd7bcf6e95018e066493cbb47d2123a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:25:12 -0400 Subject: [PATCH 0204/1252] tests/r/placement_group: Add ErrorCheck --- aws/resource_aws_placement_group_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_placement_group_test.go b/aws/resource_aws_placement_group_test.go index ec4b27f8044..46bfe37cb8d 100644 --- a/aws/resource_aws_placement_group_test.go +++ b/aws/resource_aws_placement_group_test.go @@ -18,6 +18,7 @@ func TestAccAWSPlacementGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPlacementGroupDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSPlacementGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPlacementGroupDestroy, Steps: []resource.TestStep{ @@ -89,6 +91,7 @@ func TestAccAWSPlacementGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPlacementGroupDestroy, Steps: []resource.TestStep{ From 152d81c6dfa2b8e3ba8ba8d6fa7f8281cf23268f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:25:39 -0400 Subject: [PATCH 0205/1252] tests/r/route_table_association: Add ErrorCheck --- aws/resource_aws_route_table_association_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_route_table_association_test.go b/aws/resource_aws_route_table_association_test.go index 0c138ff1f6a..9f865809374 100644 --- a/aws/resource_aws_route_table_association_test.go +++ b/aws/resource_aws_route_table_association_test.go @@ -20,6 +20,7 @@ func TestAccAWSRouteTableAssociation_Subnet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAWSRouteTableAssociation_Subnet_ChangeSubnet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func TestAccAWSRouteTableAssociation_Gateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -147,6 +151,7 @@ func TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -169,6 +174,7 @@ func TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable(t *testing.T) { }, }) } + func TestAccAWSRouteTableAssociation_Gateway_ChangeGateway(t *testing.T) { var rta1, rta2 ec2.RouteTableAssociation @@ -179,6 +185,7 @@ func TestAccAWSRouteTableAssociation_Gateway_ChangeGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ @@ -209,6 +216,7 @@ func TestAccAWSRouteTableAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ From 775ec2e53972dfc50f55e8d79ee39047dbae663b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:25:54 -0400 Subject: [PATCH 0206/1252] tests/r/route_table: Add ErrorCheck --- aws/resource_aws_route_table_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_route_table_test.go b/aws/resource_aws_route_table_test.go index 837a438df52..54e9fdbba86 100644 --- a/aws/resource_aws_route_table_test.go +++ b/aws/resource_aws_route_table_test.go @@ -149,6 +149,7 @@ func TestAccAWSRouteTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -179,6 +180,7 @@ func TestAccAWSRouteTable_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -201,6 +203,7 @@ func TestAccAWSRouteTable_disappears_SubnetAssociation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -434,6 +437,7 @@ func TestAccAWSRouteTable_Route_ConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -505,6 +509,7 @@ func TestAccAWSRouteTable_IPv4_To_TransitGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -539,6 +544,7 @@ func TestAccAWSRouteTable_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -573,6 +579,7 @@ func TestAccAWSRouteTable_IPv4_To_LocalGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -607,6 +614,7 @@ func TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -641,6 +649,7 @@ func TestAccAWSRouteTable_vgwRoutePropagation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ @@ -689,6 +698,7 @@ func TestAccAWSRouteTable_ConditionalCidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -792,6 +802,7 @@ func TestAccAWSRouteTable_VpcMultipleCidrs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -823,6 +834,7 @@ func TestAccAWSRouteTable_VpcClassicLink(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -856,6 +868,7 @@ func TestAccAWSRouteTable_GatewayVpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From ddeb681208a78b8d113099572144df736f610e52 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:26:11 -0400 Subject: [PATCH 0207/1252] tests/r/route: Add ErrorCheck --- aws/resource_aws_route_test.go | 55 ++++++++++++++++------------------ 1 file changed, 25 insertions(+), 30 deletions(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index ebcea685091..fc284ca32bc 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -33,9 +33,8 @@ func TestAccAWSRoute_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -60,9 +59,8 @@ func TestAccAWSRoute_disappears(t *testing.T) { var route ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -97,9 +95,8 @@ func TestAccAWSRoute_ipv6Support(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -129,9 +126,8 @@ func TestAccAWSRoute_ipv6ToInternetGateway(t *testing.T) { var route ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -155,9 +151,8 @@ func TestAccAWSRoute_ipv6ToInstance(t *testing.T) { var route ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -185,9 +180,8 @@ func TestAccAWSRoute_ipv6ToNetworkInterface(t *testing.T) { var route ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -211,9 +205,8 @@ func TestAccAWSRoute_ipv6ToPeeringConnection(t *testing.T) { var route ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -238,9 +231,8 @@ func TestAccAWSRoute_changeRouteTable(t *testing.T) { var after ec2.Route resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -312,9 +304,8 @@ func TestAccAWSRoute_changeCidr(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -356,9 +347,8 @@ func TestAccAWSRoute_noopdiff(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -392,6 +382,7 @@ func TestAccAWSRoute_doesNotCrashWithVPCEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -418,6 +409,7 @@ func TestAccAWSRoute_TransitGatewayID_DestinationCidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -445,6 +437,7 @@ func TestAccAWSRoute_LocalGatewayID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -472,6 +465,7 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -509,6 +503,7 @@ func TestAccAWSRoute_VpcEndpointId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From a7c61d8b1ed5681e29fb76f98ea700efb20f2748 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:27:07 -0400 Subject: [PATCH 0208/1252] tests/r/security_group_rule: Add ErrorCheck --- aws/resource_aws_security_group_rule_test.go | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/aws/resource_aws_security_group_rule_test.go b/aws/resource_aws_security_group_rule_test.go index 0453961b4db..cecb8378ebf 100644 --- a/aws/resource_aws_security_group_rule_test.go +++ b/aws/resource_aws_security_group_rule_test.go @@ -131,6 +131,7 @@ func TestAccAWSSecurityGroupRule_Ingress_VPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -163,6 +164,7 @@ func TestAccAWSSecurityGroupRule_Ingress_Source_With_Account_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -208,6 +210,7 @@ func TestAccAWSSecurityGroupRule_Ingress_Protocol(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -257,6 +260,7 @@ func TestAccAWSSecurityGroupRule_Ingress_Ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -298,6 +302,7 @@ func TestAccAWSSecurityGroupRule_Ingress_Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -347,6 +352,7 @@ func TestAccAWSSecurityGroupRule_MultiIngress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -373,6 +379,7 @@ func TestAccAWSSecurityGroupRule_Egress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -398,6 +405,7 @@ func TestAccAWSSecurityGroupRule_SelfReference(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -421,6 +429,7 @@ func TestAccAWSSecurityGroupRule_ExpectInvalidTypeError(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -436,6 +445,7 @@ func TestAccAWSSecurityGroupRule_ExpectInvalidCIDR(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -478,6 +488,7 @@ func TestAccAWSSecurityGroupRule_PartialMatching_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -540,6 +551,7 @@ func TestAccAWSSecurityGroupRule_PartialMatching_Source(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -567,6 +579,7 @@ func TestAccAWSSecurityGroupRule_Issue5310(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -591,6 +604,7 @@ func TestAccAWSSecurityGroupRule_Race(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -610,6 +624,7 @@ func TestAccAWSSecurityGroupRule_SelfSource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -670,6 +685,7 @@ func TestAccAWSSecurityGroupRule_PrefixListEgress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -700,6 +716,7 @@ func TestAccAWSSecurityGroupRule_IngressDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -727,6 +744,7 @@ func TestAccAWSSecurityGroupRule_EgressDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -754,6 +772,7 @@ func TestAccAWSSecurityGroupRule_IngressDescription_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -790,6 +809,7 @@ func TestAccAWSSecurityGroupRule_EgressDescription_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -842,6 +862,7 @@ func TestAccAWSSecurityGroupRule_Description_AllPorts(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -899,6 +920,7 @@ func TestAccAWSSecurityGroupRule_Description_AllPorts_NonZeroPorts(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -960,6 +982,7 @@ func TestAccAWSSecurityGroupRule_MultipleRuleSearching_AllProtocolCrash(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ @@ -1067,6 +1090,7 @@ func TestAccAWSSecurityGroupRule_MultiDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupRuleDestroy, Steps: []resource.TestStep{ From 36d336977700b7699cb7620d0e76795e4006cb15 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:27:29 -0400 Subject: [PATCH 0209/1252] tests/r/security_group: Add ErrorCheck --- aws/resource_aws_security_group_test.go | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/aws/resource_aws_security_group_test.go b/aws/resource_aws_security_group_test.go index de08b82f655..a097b082655 100644 --- a/aws/resource_aws_security_group_test.go +++ b/aws/resource_aws_security_group_test.go @@ -581,6 +581,7 @@ func TestAccAWSSecurityGroup_allowAll(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -606,6 +607,7 @@ func TestAccAWSSecurityGroup_sourceSecurityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -631,6 +633,7 @@ func TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -656,6 +659,7 @@ func TestAccAWSSecurityGroup_IPRangesWithSameRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -724,6 +728,7 @@ func TestAccAWSSecurityGroup_egressConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -764,6 +769,7 @@ func TestAccAWSSecurityGroup_ingressConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, Steps: []resource.TestStep{ @@ -805,6 +811,7 @@ func TestAccAWSSecurityGroup_ruleGathering(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -916,6 +923,7 @@ func TestAccAWSSecurityGroup_forceRevokeRulesTrue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -995,6 +1003,7 @@ func TestAccAWSSecurityGroup_forceRevokeRulesFalse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1100,6 +1109,7 @@ func TestAccAWSSecurityGroup_Name_Generated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1128,6 +1138,7 @@ func TestAccAWSSecurityGroup_Name_TerraformPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1155,6 +1166,7 @@ func TestAccAWSSecurityGroup_NamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1183,6 +1195,7 @@ func TestAccAWSSecurityGroup_NamePrefix_TerraformPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1333,6 +1346,7 @@ func TestAccAWSSecurityGroup_vpcNegOneIngress(t *testing.T) { }, }) } + func TestAccAWSSecurityGroup_vpcProtoNumIngress(t *testing.T) { var group ec2.SecurityGroup resourceName := "aws_security_group.test" @@ -1368,6 +1382,7 @@ func TestAccAWSSecurityGroup_vpcProtoNumIngress(t *testing.T) { }, }) } + func TestAccAWSSecurityGroup_multiIngress(t *testing.T) { var group ec2.SecurityGroup resourceName := "aws_security_group.test" @@ -1572,6 +1587,7 @@ func TestAccAWSSecurityGroup_defaultEgressClassic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSSecurityGroupEc2ClassicDestroy, Steps: []resource.TestStep{ @@ -1599,6 +1615,7 @@ func TestAccAWSSecurityGroup_drift(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1652,6 +1669,7 @@ func TestAccAWSSecurityGroup_driftComplex(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1726,6 +1744,7 @@ func TestAccAWSSecurityGroup_driftComplex(t *testing.T) { func TestAccAWSSecurityGroup_invalidCIDRBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1756,6 +1775,7 @@ func TestAccAWSSecurityGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1800,6 +1820,7 @@ func TestAccAWSSecurityGroup_CIDRandGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1826,6 +1847,7 @@ func TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1878,6 +1900,7 @@ func TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSSecurityGroupEc2ClassicDestroy, Steps: []resource.TestStep{ @@ -1917,6 +1940,7 @@ func TestAccAWSSecurityGroup_egressWithPrefixList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1944,6 +1968,7 @@ func TestAccAWSSecurityGroup_ingressWithPrefixList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -1971,6 +1996,7 @@ func TestAccAWSSecurityGroup_ipv4andipv6Egress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2534,6 +2560,7 @@ func TestAccAWSSecurityGroup_failWithDiffMismatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2558,6 +2585,7 @@ func TestAccAWSSecurityGroup_ruleLimitExceededAppend(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2604,6 +2632,7 @@ func TestAccAWSSecurityGroup_ruleLimitCidrBlockExceededAppend(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2672,6 +2701,7 @@ func TestAccAWSSecurityGroup_ruleLimitExceededPrepend(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2716,6 +2746,7 @@ func TestAccAWSSecurityGroup_ruleLimitExceededAllNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -2758,6 +2789,7 @@ func TestAccAWSSecurityGroup_rulesDropOnError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ From 94300229e3169796ed13c5c858962b0d60eafa92 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:27:49 -0400 Subject: [PATCH 0210/1252] tests/r/snapshot_create_volume_permission: Add ErrorCheck --- aws/resource_aws_snapshot_create_volume_permission_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_snapshot_create_volume_permission_test.go b/aws/resource_aws_snapshot_create_volume_permission_test.go index 400bc3f3fe6..ea1691eac18 100644 --- a/aws/resource_aws_snapshot_create_volume_permission_test.go +++ b/aws/resource_aws_snapshot_create_volume_permission_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -15,6 +16,7 @@ func TestAccAWSSnapshotCreateVolumePermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSSnapshotCreateVolumePermissionDestroy, Steps: []resource.TestStep{ @@ -43,6 +45,7 @@ func TestAccAWSSnapshotCreateVolumePermission_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSSnapshotCreateVolumePermissionDestroy, Steps: []resource.TestStep{ From 04bdabde4af97a0c707a6004bb53d8b4e6aa9c43 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:30:00 -0400 Subject: [PATCH 0211/1252] tests/r/spot_datafeed_subscription: Add ErrorCheck --- aws/resource_aws_spot_datafeed_subscription_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_spot_datafeed_subscription_test.go b/aws/resource_aws_spot_datafeed_subscription_test.go index f71ad27e6b1..7d053671320 100644 --- a/aws/resource_aws_spot_datafeed_subscription_test.go +++ b/aws/resource_aws_spot_datafeed_subscription_test.go @@ -33,6 +33,7 @@ func testAccAWSSpotDatafeedSubscription_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSpotDatafeedSubscription(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotDatafeedSubscriptionDestroy, Steps: []resource.TestStep{ @@ -82,6 +83,7 @@ func testAccAWSSpotDatafeedSubscription_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSpotDatafeedSubscription(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotDatafeedSubscriptionDestroy, Steps: []resource.TestStep{ From b7c2ac507acc8a6b6a633c5468a6a1ff84fa4eea Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:30:16 -0400 Subject: [PATCH 0212/1252] tests/r/spot_fleet_request: Add ErrorCheck --- aws/resource_aws_spot_fleet_request_test.go | 37 +++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/aws/resource_aws_spot_fleet_request_test.go b/aws/resource_aws_spot_fleet_request_test.go index 95ac81468f6..dedbe440adc 100644 --- a/aws/resource_aws_spot_fleet_request_test.go +++ b/aws/resource_aws_spot_fleet_request_test.go @@ -64,6 +64,7 @@ func TestAccAWSSpotFleetRequest_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -95,6 +96,7 @@ func TestAccAWSSpotFleetRequest_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -141,6 +143,7 @@ func TestAccAWSSpotFleetRequest_associatePublicIpAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSSpotFleetRequest_launchTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -203,6 +207,7 @@ func TestAccAWSSpotFleetRequest_launchTemplate_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -227,6 +232,7 @@ func TestAccAWSSpotFleetRequest_launchTemplateWithOverrides(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -257,6 +263,7 @@ func TestAccAWSSpotFleetRequest_launchTemplateToLaunchSpec(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -297,6 +304,7 @@ func TestAccAWSSpotFleetRequest_launchSpecToLaunchTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -331,6 +339,7 @@ func TestAccAWSSpotFleetRequest_instanceInterruptionBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -360,6 +369,7 @@ func TestAccAWSSpotFleetRequest_fleetType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -389,6 +399,7 @@ func TestAccAWSSpotFleetRequest_iamInstanceProfileArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -418,6 +429,7 @@ func TestAccAWSSpotFleetRequest_changePriceForcesNewRequest(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -458,6 +470,7 @@ func TestAccAWSSpotFleetRequest_updateTargetCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -502,6 +515,7 @@ func TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -538,6 +552,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -568,6 +583,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -599,6 +615,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -630,6 +647,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -664,6 +682,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -694,6 +713,7 @@ func TestAccAWSSpotFleetRequest_overriddingSpotPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -729,6 +749,7 @@ func TestAccAWSSpotFleetRequest_withoutSpotPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -758,6 +779,7 @@ func TestAccAWSSpotFleetRequest_diversifiedAllocation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -788,6 +810,7 @@ func TestAccAWSSpotFleetRequest_multipleInstancePools(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -833,6 +856,7 @@ func TestAccAWSSpotFleetRequest_withWeightedCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -871,6 +895,7 @@ func TestAccAWSSpotFleetRequest_withEBSDisk(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -899,6 +924,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -926,6 +952,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -952,6 +979,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDeviceGp3(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -985,6 +1013,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDeviceGp3(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1018,6 +1047,7 @@ func TestAccAWSSpotFleetRequest_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1050,6 +1080,7 @@ func TestAccAWSSpotFleetRequest_placementTenancyAndGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1079,6 +1110,7 @@ func TestAccAWSSpotFleetRequest_WithELBs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1108,6 +1140,7 @@ func TestAccAWSSpotFleetRequest_WithTargetGroups(t *testing.T) { resourceName := "aws_spot_fleet_request.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1138,6 +1171,7 @@ func TestAccAWSSpotFleetRequest_zero_capacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1180,6 +1214,7 @@ func TestAccAWSSpotFleetRequest_CapacityRebalance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1207,6 +1242,7 @@ func TestAccAWSSpotFleetRequest_WithInstanceStoreAmi(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ @@ -1226,6 +1262,7 @@ func TestAccAWSSpotFleetRequest_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ From 3d35beac935fd8d6113924476194f344b4b36166 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:30:34 -0400 Subject: [PATCH 0213/1252] tests/r/spot_instance_request: Add ErrorCheck --- aws/resource_aws_spot_instance_request_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_spot_instance_request_test.go b/aws/resource_aws_spot_instance_request_test.go index effff3e2bb8..47debe63a05 100644 --- a/aws/resource_aws_spot_instance_request_test.go +++ b/aws/resource_aws_spot_instance_request_test.go @@ -19,6 +19,7 @@ func TestAccAWSSpotInstanceRequest_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSSpotInstanceRequest_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -96,6 +98,7 @@ func TestAccAWSSpotInstanceRequest_withLaunchGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -127,6 +130,7 @@ func TestAccAWSSpotInstanceRequest_withBlockDuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -158,6 +162,7 @@ func TestAccAWSSpotInstanceRequest_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -190,6 +195,7 @@ func TestAccAWSSpotInstanceRequest_validUntil(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -221,6 +227,7 @@ func TestAccAWSSpotInstanceRequest_withoutSpotPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -250,6 +257,7 @@ func TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -278,6 +286,7 @@ func TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -307,6 +316,7 @@ func TestAccAWSSpotInstanceRequest_getPasswordData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -334,6 +344,7 @@ func TestAccAWSSpotInstanceRequest_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -570,6 +581,7 @@ func TestAccAWSSpotInstanceRequest_InterruptStop(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ @@ -598,6 +610,7 @@ func TestAccAWSSpotInstanceRequest_InterruptHibernate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSpotInstanceRequestDestroy, Steps: []resource.TestStep{ From 51c9f922c6ecf9d0acc61fa8d83199234bf406b1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:31:02 -0400 Subject: [PATCH 0214/1252] tests/r/subnet: Add ErrorCheck --- aws/resource_aws_subnet_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_subnet_test.go b/aws/resource_aws_subnet_test.go index fed7b085741..67a08356a86 100644 --- a/aws/resource_aws_subnet_test.go +++ b/aws/resource_aws_subnet_test.go @@ -210,6 +210,7 @@ func TestAccAWSSubnet_ignoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -349,6 +350,7 @@ func TestAccAWSSubnet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -371,6 +373,7 @@ func TestAccAWSSubnet_CustomerOwnedIpv4Pool(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -396,6 +399,7 @@ func TestAccAWSSubnet_MapCustomerOwnedIpOnLaunch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -421,6 +425,7 @@ func TestAccAWSSubnet_MapPublicIpOnLaunch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ From b7b614f498e04a8b5641ba8af2df2e589fab6e0d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:31:19 -0400 Subject: [PATCH 0215/1252] tests/r/volume_attachment: Add ErrorCheck --- aws/resource_aws_volume_attachment_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_volume_attachment_test.go b/aws/resource_aws_volume_attachment_test.go index 334d274c21d..23488aa30f4 100644 --- a/aws/resource_aws_volume_attachment_test.go +++ b/aws/resource_aws_volume_attachment_test.go @@ -20,6 +20,7 @@ func TestAccAWSVolumeAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeAttachmentDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSVolumeAttachment_skipDestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeAttachmentDestroy, Steps: []resource.TestStep{ @@ -108,6 +110,7 @@ func TestAccAWSVolumeAttachment_attachStopped(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeAttachmentDestroy, Steps: []resource.TestStep{ @@ -143,6 +146,7 @@ func TestAccAWSVolumeAttachment_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeAttachmentDestroy, Steps: []resource.TestStep{ @@ -192,6 +196,7 @@ func TestAccAWSVolumeAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVolumeAttachmentDestroy, Steps: []resource.TestStep{ From 69478577f56c2daed2ac7e954594e754d2890ffd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:31:49 -0400 Subject: [PATCH 0216/1252] tests/r/vpc_dhcp_options_association: Add ErrorCheck --- aws/resource_aws_vpc_dhcp_options_association_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_vpc_dhcp_options_association_test.go b/aws/resource_aws_vpc_dhcp_options_association_test.go index a12b844974c..01ab0d37b64 100644 --- a/aws/resource_aws_vpc_dhcp_options_association_test.go +++ b/aws/resource_aws_vpc_dhcp_options_association_test.go @@ -17,6 +17,7 @@ func TestAccAWSDHCPOptionsAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsAssociationDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSDHCPOptionsAssociation_disappears_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsAssociationDestroy, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAWSDHCPOptionsAssociation_disappears_dhcp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsAssociationDestroy, Steps: []resource.TestStep{ From aacca0c7e1473543912fd97f152a11ffe4e2e458 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:32:15 -0400 Subject: [PATCH 0217/1252] tests/r/vpc_dhcp_options: Add ErrorCheck --- aws/resource_aws_vpc_dhcp_options_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_vpc_dhcp_options_test.go b/aws/resource_aws_vpc_dhcp_options_test.go index 223c2b01c05..fdf0f812bf2 100644 --- a/aws/resource_aws_vpc_dhcp_options_test.go +++ b/aws/resource_aws_vpc_dhcp_options_test.go @@ -90,6 +90,7 @@ func TestAccAWSDHCPOptions_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ @@ -124,6 +125,7 @@ func TestAccAWSDHCPOptions_deleteOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ @@ -146,6 +148,7 @@ func TestAccAWSDHCPOptions_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAWSDHCPOptions_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ From c8870ffcbcb1a90c23bbb6749215c2126186f2b4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:33:11 -0400 Subject: [PATCH 0218/1252] tests/r/vpc_endpoint_route_table_association: Add ErrorCheck --- aws/resource_aws_vpc_endpoint_route_table_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_vpc_endpoint_route_table_association_test.go b/aws/resource_aws_vpc_endpoint_route_table_association_test.go index f71797c5070..4b5df488365 100644 --- a/aws/resource_aws_vpc_endpoint_route_table_association_test.go +++ b/aws/resource_aws_vpc_endpoint_route_table_association_test.go @@ -19,6 +19,7 @@ func TestAccAWSVpcEndpointRouteTableAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointRouteTableAssociationDestroy, Steps: []resource.TestStep{ From fe5650409a43e15e0726f35caefca90659ee94ae Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:33:51 -0400 Subject: [PATCH 0219/1252] tests/r/vpc_endpoint_service_allowed_principal: Add ErrorCheck --- aws/resource_aws_vpc_endpoint_service_allowed_principal_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_vpc_endpoint_service_allowed_principal_test.go b/aws/resource_aws_vpc_endpoint_service_allowed_principal_test.go index 940b2625652..cf07c24a8b3 100644 --- a/aws/resource_aws_vpc_endpoint_service_allowed_principal_test.go +++ b/aws/resource_aws_vpc_endpoint_service_allowed_principal_test.go @@ -17,6 +17,7 @@ func TestAccAWSVpcEndpointServiceAllowedPrincipal_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceAllowedPrincipalDestroy, Steps: []resource.TestStep{ From 0be66cd3278aa000c5bb96f0efb90a672edc0ca9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:34:13 -0400 Subject: [PATCH 0220/1252] tests/r/vpc_endpoint_service: Add ErrorCheck --- aws/resource_aws_vpc_endpoint_service_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_vpc_endpoint_service_test.go b/aws/resource_aws_vpc_endpoint_service_test.go index 56fce2961cf..6fd842d4330 100644 --- a/aws/resource_aws_vpc_endpoint_service_test.go +++ b/aws/resource_aws_vpc_endpoint_service_test.go @@ -92,6 +92,7 @@ func TestAccAWSVpcEndpointService_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ @@ -125,6 +126,7 @@ func TestAccAWSVpcEndpointService_AllowedPrincipals(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ @@ -169,6 +171,7 @@ func TestAccAWSVpcEndpointService_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ @@ -191,6 +194,7 @@ func TestAccAWSVpcEndpointService_GatewayLoadBalancerArns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ @@ -225,6 +229,7 @@ func TestAccAWSVpcEndpointService_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ @@ -270,6 +275,7 @@ func TestAccAWSVpcEndpointService_private_dns_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointServiceDestroy, Steps: []resource.TestStep{ From 9f80f07b8e4df31d1d2f78036d607d26feb9d249 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:35:43 -0400 Subject: [PATCH 0221/1252] tests/r/vpc_endpoint_subnet_association: Add ErrorCheck --- aws/resource_aws_vpc_endpoint_subnet_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_vpc_endpoint_subnet_association_test.go b/aws/resource_aws_vpc_endpoint_subnet_association_test.go index 01cff569aa2..8e6f80d1674 100644 --- a/aws/resource_aws_vpc_endpoint_subnet_association_test.go +++ b/aws/resource_aws_vpc_endpoint_subnet_association_test.go @@ -16,6 +16,7 @@ func TestAccAWSVpcEndpointSubnetAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointSubnetAssociationDestroy, Steps: []resource.TestStep{ @@ -35,6 +36,7 @@ func TestAccAWSVpcEndpointSubnetAssociation_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointSubnetAssociationDestroy, Steps: []resource.TestStep{ From 8ca3428aa9007d9069677d4eda3544d5db01445c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:36:02 -0400 Subject: [PATCH 0222/1252] tests/r/vpc_endpoint: Add ErrorCheck --- aws/resource_aws_vpc_endpoint_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_vpc_endpoint_test.go b/aws/resource_aws_vpc_endpoint_test.go index 413f33afb39..e8f5cc16bc5 100644 --- a/aws/resource_aws_vpc_endpoint_test.go +++ b/aws/resource_aws_vpc_endpoint_test.go @@ -94,6 +94,7 @@ func TestAccAWSVpcEndpoint_gatewayBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -132,6 +133,7 @@ func TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -225,6 +227,7 @@ func TestAccAWSVpcEndpoint_gatewayPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -256,6 +259,7 @@ func TestAccAWSVpcEndpoint_interfaceBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -293,6 +297,7 @@ func TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -350,6 +355,7 @@ func TestAccAWSVpcEndpoint_interfaceNonAWSServiceAcceptOnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -390,6 +396,7 @@ func TestAccAWSVpcEndpoint_interfaceNonAWSServiceAcceptOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -450,6 +457,7 @@ func TestAccAWSVpcEndpoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ @@ -518,6 +526,7 @@ func TestAccAWSVpcEndpoint_VpcEndpointType_GatewayLoadBalancer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, Steps: []resource.TestStep{ From 2d11302c7e0401d0a2479ea6186351a93dd1763d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:36:27 -0400 Subject: [PATCH 0223/1252] tests/r/vpc_ipv4_cidr_block_association: Add ErrorCheck --- aws/resource_aws_vpc_ipv4_cidr_block_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_vpc_ipv4_cidr_block_association_test.go b/aws/resource_aws_vpc_ipv4_cidr_block_association_test.go index bd1e4bfd989..f6f12ca7f46 100644 --- a/aws/resource_aws_vpc_ipv4_cidr_block_association_test.go +++ b/aws/resource_aws_vpc_ipv4_cidr_block_association_test.go @@ -16,6 +16,7 @@ func TestAccAwsVpcIpv4CidrBlockAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsVpcIpv4CidrBlockAssociationDestroy, Steps: []resource.TestStep{ From 8bbfecd8b9150c0570c2dca6493053e32115fb8d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:36:42 -0400 Subject: [PATCH 0224/1252] tests/r/vpc_peering_connection_accepter: Add ErrorCheck --- aws/resource_aws_vpc_peering_connection_accepter_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_vpc_peering_connection_accepter_test.go b/aws/resource_aws_vpc_peering_connection_accepter_test.go index 11fc8c27f38..677a86f5bf4 100644 --- a/aws/resource_aws_vpc_peering_connection_accepter_test.go +++ b/aws/resource_aws_vpc_peering_connection_accepter_test.go @@ -21,6 +21,7 @@ func TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAwsVPCPeeringConnectionAccepterDestroy, Steps: []resource.TestStep{ @@ -77,6 +78,7 @@ func TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount(t *testin testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccAwsVPCPeeringConnectionAccepterDestroy, Steps: []resource.TestStep{ @@ -122,6 +124,7 @@ func TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount(t *testin testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccAwsVPCPeeringConnectionAccepterDestroy, Steps: []resource.TestStep{ @@ -159,6 +162,7 @@ func TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount(t *t testAccMultipleRegionPreCheck(t, 2) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccAwsVPCPeeringConnectionAccepterDestroy, Steps: []resource.TestStep{ From a3978e173f0746a0ac5cce70cb2c7d4b32303042 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:37:06 -0400 Subject: [PATCH 0225/1252] tests/r/vpc_peering_connection_options: Add ErrorCheck --- aws/resource_aws_vpc_peering_connection_options_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_vpc_peering_connection_options_test.go b/aws/resource_aws_vpc_peering_connection_options_test.go index 13ab3115c4f..74a5d4cda51 100644 --- a/aws/resource_aws_vpc_peering_connection_options_test.go +++ b/aws/resource_aws_vpc_peering_connection_options_test.go @@ -18,6 +18,7 @@ func TestAccAWSVpcPeeringConnectionOptions_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAWSVpcPeeringConnectionOptions_differentRegionSameAccount(t *testing testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -206,6 +208,7 @@ func TestAccAWSVpcPeeringConnectionOptions_sameRegionDifferentAccount(t *testing testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ From 7c780f1e54d24819619b5661b9e3e9b39f72709b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:37:28 -0400 Subject: [PATCH 0226/1252] tests/r/vpc_peering_connection: Add ErrorCheck --- aws/resource_aws_vpc_peering_connection_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_vpc_peering_connection_test.go b/aws/resource_aws_vpc_peering_connection_test.go index dfd7ffc986b..1ea6c958515 100644 --- a/aws/resource_aws_vpc_peering_connection_test.go +++ b/aws/resource_aws_vpc_peering_connection_test.go @@ -650,6 +650,7 @@ func TestAccAWSVPCPeeringConnection_optionsNoAutoAccept(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ From c91a2146a93da4f6a629b18b2dcd90a39c80efc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:37:58 -0400 Subject: [PATCH 0227/1252] tests/r/vpc: Add ErrorCheck --- aws/resource_aws_vpc_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index d02d3480ff0..1f909402307 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -108,6 +108,7 @@ func TestAccAWSVpc_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -144,6 +145,7 @@ func TestAccAWSVpc_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAWSVpc_ignoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSVpc_AssignGeneratedIpv6CidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -247,6 +251,7 @@ func TestAccAWSVpc_Tenancy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -288,6 +293,7 @@ func TestAccAWSVpc_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -331,6 +337,7 @@ func TestAccAWSVpc_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -475,6 +482,7 @@ func TestAccAWSVpc_bothDnsOptionsSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -502,6 +510,7 @@ func TestAccAWSVpc_DisabledDnsSupport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -527,6 +536,7 @@ func TestAccAWSVpc_classiclinkOptionSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -552,6 +562,7 @@ func TestAccAWSVpc_classiclinkDnsSupportOptionSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From f4cbc3aa2705e4b1e93da4cee72b6427a2a7a5f0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:38:20 -0400 Subject: [PATCH 0228/1252] tests/r/vpn_connection_route: Add ErrorCheck --- aws/resource_aws_vpn_connection_route_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_vpn_connection_route_test.go b/aws/resource_aws_vpn_connection_route_test.go index d1954e15569..ae8db5c0891 100644 --- a/aws/resource_aws_vpn_connection_route_test.go +++ b/aws/resource_aws_vpn_connection_route_test.go @@ -16,6 +16,7 @@ func TestAccAWSVpnConnectionRoute_basic(t *testing.T) { rBgpAsn := acctest.RandIntRange(64512, 65534) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionRouteDestroy, Steps: []resource.TestStep{ From 02a702be711f5d145cc32e34f34f885e37499095 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:38:45 -0400 Subject: [PATCH 0229/1252] tests/r/vpn_connection: Add ErrorCheck --- aws/resource_aws_vpn_connection_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_vpn_connection_test.go b/aws/resource_aws_vpn_connection_test.go index e94ba820444..ae30abdf59c 100644 --- a/aws/resource_aws_vpn_connection_test.go +++ b/aws/resource_aws_vpn_connection_test.go @@ -139,6 +139,7 @@ func TestAccAWSVpnConnection_TransitGatewayID(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, Steps: []resource.TestStep{ @@ -441,6 +442,7 @@ func TestAccAWSVpnConnection_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, Steps: []resource.TestStep{ From 2240515efa38c6bf96f1831c695861bc0155776d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:39:03 -0400 Subject: [PATCH 0230/1252] tests/r/vpn_gateway_attachment: Add ErrorCheck --- aws/resource_aws_vpn_gateway_attachment_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_vpn_gateway_attachment_test.go b/aws/resource_aws_vpn_gateway_attachment_test.go index 8bd7068ff30..93c49bd6a6e 100644 --- a/aws/resource_aws_vpn_gateway_attachment_test.go +++ b/aws/resource_aws_vpn_gateway_attachment_test.go @@ -19,6 +19,7 @@ func TestAccAWSVpnGatewayAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayAttachmentDestroy, Steps: []resource.TestStep{ @@ -39,6 +40,7 @@ func TestAccAWSVpnGatewayAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayAttachmentDestroy, Steps: []resource.TestStep{ From bc0ec57d07be5b72021a0911b0ae0b6a0e151eb5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:41:29 -0400 Subject: [PATCH 0231/1252] tests/r/vpn_gateway: Add ErrorCheck --- aws/resource_aws_vpn_gateway_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_vpn_gateway_test.go b/aws/resource_aws_vpn_gateway_test.go index b6397b0fdac..fa133d813b0 100644 --- a/aws/resource_aws_vpn_gateway_test.go +++ b/aws/resource_aws_vpn_gateway_test.go @@ -144,6 +144,7 @@ func TestAccAWSVpnGateway_withAvailabilityZoneSetToState(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, Steps: []resource.TestStep{ @@ -163,12 +164,14 @@ func TestAccAWSVpnGateway_withAvailabilityZoneSetToState(t *testing.T) { }, }) } + func TestAccAWSVpnGateway_withAmazonSideAsnSetToState(t *testing.T) { var v ec2.VpnGateway resourceName := "aws_vpn_gateway.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSVpnGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, Steps: []resource.TestStep{ From 485a9645200fd27ecf06371ffd7e0aee36e67c51 Mon Sep 17 00:00:00 2001 From: Anthony Roach Date: Sat, 16 Jan 2021 13:27:33 -0500 Subject: [PATCH 0232/1252] add aws_kinesis_stream_consumer resource and data source Adapted from original commits from @rockycore at yomagroup:feature/kinesis-stream-consumer. Changes on top of the original commits: * rebased onto master, and squashed * added warning resource removal on not found during read * set the resource id immediately after creation * fixed import id syntax to match the documentation * added an import test * removed Optional from arn output in schema --- ...data_source_aws_kinesis_stream_consumer.go | 57 ++++ ...source_aws_kinesis_stream_consumer_test.go | 35 +++ aws/provider.go | 2 + aws/resource_aws_kinesis_stream_consumer.go | 229 ++++++++++++++++ ...source_aws_kinesis_stream_consumer_test.go | 258 ++++++++++++++++++ .../d/kinesis_stream_consumer.html.markdown | 41 +++ .../r/kinesis_stream_consumer.html.markdown | 68 +++++ 7 files changed, 690 insertions(+) create mode 100644 aws/data_source_aws_kinesis_stream_consumer.go create mode 100644 aws/data_source_aws_kinesis_stream_consumer_test.go create mode 100644 aws/resource_aws_kinesis_stream_consumer.go create mode 100644 aws/resource_aws_kinesis_stream_consumer_test.go create mode 100644 website/docs/d/kinesis_stream_consumer.html.markdown create mode 100644 website/docs/r/kinesis_stream_consumer.html.markdown diff --git a/aws/data_source_aws_kinesis_stream_consumer.go b/aws/data_source_aws_kinesis_stream_consumer.go new file mode 100644 index 00000000000..3bc611881a2 --- /dev/null +++ b/aws/data_source_aws_kinesis_stream_consumer.go @@ -0,0 +1,57 @@ +package aws + +import ( + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func dataSourceAwsKinesisStreamConsumer() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsKinesisStreamConsumerRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + + "stream_arn": { + Type: schema.TypeString, + Required: true, + }, + + "arn": { + Type: schema.TypeString, + Computed: true, + }, + + "creation_timestamp": { + Type: schema.TypeInt, + Computed: true, + }, + + "status": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsKinesisStreamConsumerRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).kinesisconn + cn := d.Get("name").(string) + sa := d.Get("stream_arn").(string) + + state, err := readKinesisStreamConsumerState(conn, cn, sa) + if err != nil { + return err + } + d.SetId(state.arn) + d.Set("arn", state.arn) + d.Set("name", cn) + d.Set("stream_arn", sa) + d.Set("status", state.status) + d.Set("creation_timestamp", state.creationTimestamp) + + return nil +} diff --git a/aws/data_source_aws_kinesis_stream_consumer_test.go b/aws/data_source_aws_kinesis_stream_consumer_test.go new file mode 100644 index 00000000000..d0a0e952b88 --- /dev/null +++ b/aws/data_source_aws_kinesis_stream_consumer_test.go @@ -0,0 +1,35 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccAWSKinesisStreamConsumerDataSource_basic(t *testing.T) { + var stream kinesis.StreamDescription + var consumer kinesis.ConsumerDescription + config := createAccKinesisStreamConsumerConfig() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + Steps: []resource.TestStep{ + { + Config: config.data(), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisStreamExists(config.stream.getName(), &stream), + testAccCheckKinesisStreamConsumerExists(config, -1, &consumer), + resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "arn"), + resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "stream_arn"), + resource.TestCheckResourceAttr(fmt.Sprintf("data.%s", config.getName()), "name", config.getConsumerName()), + resource.TestCheckResourceAttr(fmt.Sprintf("data.%s", config.getName()), "status", "ACTIVE"), + resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "creation_timestamp"), + ), + }, + }, + }) +} diff --git a/aws/provider.go b/aws/provider.go index c44cbf810ca..1b6517c583b 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -290,6 +290,7 @@ func Provider() *schema.Provider { "aws_iot_endpoint": dataSourceAwsIotEndpoint(), "aws_ip_ranges": dataSourceAwsIPRanges(), "aws_kinesis_stream": dataSourceAwsKinesisStream(), + "aws_kinesis_stream_consumer": dataSourceAwsKinesisStreamConsumer(), "aws_kms_alias": dataSourceAwsKmsAlias(), "aws_kms_ciphertext": dataSourceAwsKmsCiphertext(), "aws_kms_key": dataSourceAwsKmsKey(), @@ -770,6 +771,7 @@ func Provider() *schema.Provider { "aws_kinesisanalyticsv2_application": resourceAwsKinesisAnalyticsV2Application(), "aws_kinesis_firehose_delivery_stream": resourceAwsKinesisFirehoseDeliveryStream(), "aws_kinesis_stream": resourceAwsKinesisStream(), + "aws_kinesis_stream_consumer": resourceAwsKinesisStreamConsumer(), "aws_kinesis_video_stream": resourceAwsKinesisVideoStream(), "aws_kms_alias": resourceAwsKmsAlias(), "aws_kms_external_key": resourceAwsKmsExternalKey(), diff --git a/aws/resource_aws_kinesis_stream_consumer.go b/aws/resource_aws_kinesis_stream_consumer.go new file mode 100644 index 00000000000..9dc34e75147 --- /dev/null +++ b/aws/resource_aws_kinesis_stream_consumer.go @@ -0,0 +1,229 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" +) + +func resourceAwsKinesisStreamConsumer() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsKinesisStreamConsumerCreate, + Read: resourceAwsKinesisStreamConsumerRead, + Delete: resourceAwsKinesisStreamConsumerDelete, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(5 * time.Minute), + Delete: schema.DefaultTimeout(120 * time.Minute), + }, + + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + importParts, err := validateResourceAwsKinesisStreamConsumerImportString(d.Id()) + if err != nil { + return nil, err + } + d.Set("name", importParts[0]) + d.Set("stream_arn", importParts[1]) + return []*schema.ResourceData{d}, nil + }, + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "stream_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "arn": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func resourceAwsKinesisStreamConsumerCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).kinesisconn + cn := d.Get("name").(string) + sa := d.Get("stream_arn").(string) + + createOpts := &kinesis.RegisterStreamConsumerInput{ + ConsumerName: aws.String(cn), + StreamARN: aws.String(sa), + } + + createOutput, err := conn.RegisterStreamConsumer(createOpts) + if err != nil { + return fmt.Errorf("Unable to create stream consumer: %s", err) + } + + arn := aws.StringValue(createOutput.Consumer.ConsumerARN) + + d.SetId(arn) + d.Set("arn", arn) + + // No error, wait for ACTIVE state + stateConf := &resource.StateChangeConf{ + Pending: []string{"CREATING"}, + Target: []string{"ACTIVE"}, + Refresh: streamConsumerStateRefreshFunc(conn, cn, sa), + Timeout: d.Timeout(schema.TimeoutCreate), + Delay: 10 * time.Second, + MinTimeout: 3 * time.Second, + } + + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf( + "Error waiting for Kinesis Stream Consumer (%s) to become active: %s", + cn, err) + } + + return resourceAwsKinesisStreamConsumerRead(d, meta) +} + +func resourceAwsKinesisStreamConsumerRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).kinesisconn + cn := d.Get("name").(string) + sa := d.Get("stream_arn").(string) + + state, err := readKinesisStreamConsumerState(conn, cn, sa) + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "ResourceNotFoundException" { + log.Printf("[WARN] Kinesis Stream Consumer (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("Error reading Kinesis Stream Consumer: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) + } + return err + + } + d.SetId(state.arn) + d.Set("arn", state.arn) + return nil +} + +func resourceAwsKinesisStreamConsumerDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).kinesisconn + cn := d.Get("name").(string) + sa := d.Get("stream_arn").(string) + + log.Printf("[DEBUG] Deregister Stream Consumer: %s", cn) + _, err := conn.DeregisterStreamConsumer(&kinesis.DeregisterStreamConsumerInput{ + ConsumerName: aws.String(cn), + StreamARN: aws.String(sa), + }) + if err != nil { + // Missing Stream Consumer or Stream (API error) + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "ResourceNotFoundException" { + log.Printf("[WARN] No Stream Consumer found: %v", cn) + return nil + } + } + return err + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{"DELETING"}, + Target: []string{"DESTROYED"}, + Refresh: streamConsumerStateRefreshFunc(conn, cn, sa), + Timeout: d.Timeout(schema.TimeoutDelete), + Delay: 10 * time.Second, + MinTimeout: 3 * time.Second, + } + + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf( + "Error waiting for Stream Consumer (%s) to be destroyed: %s", + cn, err) + } + + return nil +} + +type kinesisStreamConsumerState struct { + arn string + streamArn string + creationTimestamp int64 + status string +} + +func validateResourceAwsKinesisStreamConsumerImportString(importStr string) ([]string, error) { + // example: my_consumer@arn:aws:kinesis:us-west-2:123456789012:stream/my-stream + importParts := strings.Split(strings.ToLower(importStr), "@") + errStr := "unexpected format of import string (%q), expected @: %s" + if len(importParts) != 2 { + return nil, fmt.Errorf(errStr, importStr, "invalid no. of parts") + } + + consumerName := importParts[0] + streamArn := importParts[1] + + consumerNameRe := regexp.MustCompile(`(^[a-zA-Z0-9_.-]+$)`) + streamArnRe := regexp.MustCompile(`arn:aws.*:kinesis:.*:\d{12}:stream/.+`) + + if !consumerNameRe.MatchString(consumerName) { + return nil, fmt.Errorf(errStr, importStr, "invalid consumer name") + } + + if !streamArnRe.MatchString(streamArn) { + return nil, fmt.Errorf(errStr, importStr, "invalid stream arn") + } + + return importParts, nil +} + +func readKinesisStreamConsumerState(conn *kinesis.Kinesis, cn string, sa string) (*kinesisStreamConsumerState, error) { + input := &kinesis.DescribeStreamConsumerInput{ + ConsumerName: aws.String(cn), + StreamARN: aws.String(sa), + } + + state := &kinesisStreamConsumerState{} + response, err := conn.DescribeStreamConsumer(input) + if err == nil { + state.arn = aws.StringValue(response.ConsumerDescription.ConsumerARN) + state.streamArn = aws.StringValue(response.ConsumerDescription.StreamARN) + state.creationTimestamp = aws.TimeValue(response.ConsumerDescription.ConsumerCreationTimestamp).Unix() + state.status = aws.StringValue(response.ConsumerDescription.ConsumerStatus) + } + + return state, err +} + +func streamConsumerStateRefreshFunc(conn *kinesis.Kinesis, cn string, sa string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + state, err := readKinesisStreamConsumerState(conn, cn, sa) + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "ResourceNotFoundException" { + return 42, "DESTROYED", nil + } + return nil, awsErr.Code(), err + } + return nil, "failed", err + } + + return state, state.status, nil + } +} diff --git a/aws/resource_aws_kinesis_stream_consumer_test.go b/aws/resource_aws_kinesis_stream_consumer_test.go new file mode 100644 index 00000000000..88ade1522ad --- /dev/null +++ b/aws/resource_aws_kinesis_stream_consumer_test.go @@ -0,0 +1,258 @@ +package aws + +import ( + "fmt" + "strings" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccAWSKinesisStreamConsumer_basic(t *testing.T) { + var stream kinesis.StreamDescription + var consumer kinesis.ConsumerDescription + config := createAccKinesisStreamConsumerConfig() + resourceName := config.getName() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + Steps: []resource.TestStep{ + { + Config: config.single(), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisStreamExists(config.stream.getName(), &stream), + testAccCheckKinesisStreamConsumerExists(config, -1, &consumer), + testAccCheckAWSKinesisStreamConsumerAttributes(config, &consumer), + ), + }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccKinesisStreamConsumerImportStateIdFunc(config), + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccKinesisStreamConsumerImportStateIdFunc(config *accKinesisStreamConsumerConfig) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return fmt.Sprintf("%s@arn:aws:kinesis:%s:%s:stream/%s", config.getConsumerName(), testAccGetRegion(), testAccGetAccountID(), config.stream.getStreamName()), nil + } +} + +func TestAccAWSKinesisStreamConsumer_createMultipleConcurrentStreamConsumers(t *testing.T) { + var stream kinesis.StreamDescription + var consumer kinesis.ConsumerDescription + config := createAccKinesisStreamConsumerConfig() + + var checkFunctions []resource.TestCheckFunc + + checkFunctions = append( + checkFunctions, + testAccCheckKinesisStreamExists(config.stream.getName(), &stream)) + + for i := 0; i < config.count; i++ { + checkFunctions = append( + checkFunctions, + testAccCheckKinesisStreamConsumerExists(config, i, &consumer)) + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + Steps: []resource.TestStep{ + { + Config: config.multiple(), + Check: resource.ComposeTestCheckFunc(checkFunctions...), + }, + }, + }) +} + +func testAccCheckKinesisStreamConsumerExists(c *accKinesisStreamConsumerConfig, + index int, consumer *kinesis.ConsumerDescription) resource.TestCheckFunc { + var resourceName string + if index > -1 { + resourceName = c.getIndexedName(index) + } else { + resourceName = c.getName() + } + + 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("No Kinesis Stream Consumer ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).kinesisconn + describeOpts := &kinesis.DescribeStreamConsumerInput{ + ConsumerName: aws.String(rs.Primary.Attributes["name"]), + StreamARN: aws.String(rs.Primary.Attributes["stream_arn"]), + } + resp, err := conn.DescribeStreamConsumer(describeOpts) + if err != nil { + return err + } + + *consumer = *resp.ConsumerDescription + + return nil + } +} + +func testAccCheckAWSKinesisStreamConsumerAttributes( + c *accKinesisStreamConsumerConfig, consumer *kinesis.ConsumerDescription) resource.TestCheckFunc { + return func(s *terraform.State) error { + if !strings.HasPrefix(*consumer.ConsumerName, c.getConsumerName()) { + return fmt.Errorf("Bad Stream Consumer name: %s", *consumer.ConsumerName) + } + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_kinesis_stream_consumer" { + continue + } + + if *consumer.ConsumerARN != rs.Primary.Attributes["arn"] { + return fmt.Errorf("Bad Stream Consumer(%s) ARN\n\t expected: %s\n\tgot: %s\n", rs.Type, rs.Primary.Attributes["arn"], *consumer.ConsumerARN) + } + } + return nil + } +} + +func testAccCheckKinesisStreamConsumerDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_kinesis_stream_consumer" { + continue + } + conn := testAccProvider.Meta().(*AWSClient).kinesisconn + describeOpts := &kinesis.DescribeStreamConsumerInput{ + ConsumerName: aws.String(rs.Primary.Attributes["name"]), + StreamARN: aws.String(rs.Primary.Attributes["stream_arn"]), + } + resp, err := conn.DescribeStreamConsumer(describeOpts) + if err == nil { + if resp.ConsumerDescription != nil && *resp.ConsumerDescription.ConsumerStatus != "DELETING" { + return fmt.Errorf("Error: Stream Consumer still exists") + } + } + + return nil + + } + + return nil +} + +type accKinesisStreamConfig struct { + resourceType string + resourceLocalName string + streamBasename string + randInt int +} + +func (r *accKinesisStreamConfig) getName() string { + return fmt.Sprintf("%s.%s", r.resourceType, r.resourceLocalName) +} + +func (r *accKinesisStreamConfig) getStreamName() string { + return fmt.Sprintf("%s-%d", r.streamBasename, r.randInt) +} + +func (r *accKinesisStreamConfig) single() string { + + return fmt.Sprintf(` +resource "%s" "%s" { + name = "%s" + shard_count = 2 + enforce_consumer_deletion = true + + tags = { + Name = "tf-test" + } +}`, r.resourceType, r.resourceLocalName, r.getStreamName()) +} + +type accKinesisStreamConsumerConfig struct { + stream *accKinesisStreamConfig + resourceType string + resourceLocalName string + consumerBasename string + count int + randInt int +} + +func (r *accKinesisStreamConsumerConfig) getName() string { + return fmt.Sprintf("%s.%s", r.resourceType, r.resourceLocalName) +} + +func (r *accKinesisStreamConsumerConfig) getIndexedName(index int) string { + return fmt.Sprintf("%s.%s.%d", r.resourceType, r.resourceLocalName, index) +} + +func (r *accKinesisStreamConsumerConfig) getConsumerName() string { + return fmt.Sprintf("%s-%d", r.consumerBasename, r.randInt) +} + +func (r *accKinesisStreamConsumerConfig) data() string { + return fmt.Sprintf(` +%s + +data "%s" "%s" { + name = "${%s.name}" + stream_arn = "${%s.arn}" +}`, r.single(), r.resourceType, r.resourceLocalName, r.getName(), r.stream.getName()) +} + +func (r *accKinesisStreamConsumerConfig) single() string { + + return fmt.Sprintf(` +%s + +resource "%s" "%s" { + name = "%s" + stream_arn = "${%s.arn}" +} + +`, r.stream.single(), r.resourceType, r.resourceLocalName, r.getConsumerName(), r.stream.getName()) +} + +func (r *accKinesisStreamConsumerConfig) multiple() string { + + return fmt.Sprintf(` +%s + +resource "%s" "%s" { + count = %d + name = "%s-${count.index}" + stream_arn = "${%s.arn}" +}`, r.stream.single(), r.resourceType, r.resourceLocalName, r.count, r.getConsumerName(), r.stream.getName()) +} + +func createAccKinesisStreamConsumerConfig() *accKinesisStreamConsumerConfig { + iRnd := acctest.RandInt() + return &accKinesisStreamConsumerConfig{ + stream: &accKinesisStreamConfig{ + resourceType: "aws_kinesis_stream", + resourceLocalName: "test_stream", + streamBasename: "terraform-kinesis-stream-test", + randInt: iRnd, + }, + resourceType: "aws_kinesis_stream_consumer", + resourceLocalName: "test_stream_consumer", + consumerBasename: "terraform-kinesis-stream-consumer-test", + count: 2, + randInt: iRnd, + } +} diff --git a/website/docs/d/kinesis_stream_consumer.html.markdown b/website/docs/d/kinesis_stream_consumer.html.markdown new file mode 100644 index 00000000000..2ecd1b277de --- /dev/null +++ b/website/docs/d/kinesis_stream_consumer.html.markdown @@ -0,0 +1,41 @@ +--- +subcategory: "Kinesis" +layout: "aws" +page_title: "AWS: aws_kinesis_stream_consumer" +description: |- + Provides a Kinesis Stream Consumer data source. +--- + +# Data Source: aws_kinesis_stream_consumer + +Use this data source to get information about a Kinesis Stream Consumer for use in other +resources. + +For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. + +## Example Usage + +```hcl +data "aws_kinesis_stream_consumer" "stream_consumer" { + name = "stream-consumer-name" + stream_arn = "${aws_kinesis_stream.stream.arn}" +} +``` + +## Argument Reference + +* `name` - (Required) The name of the Kinesis Stream Consumer. +* `stream_arn` - (Required) The Amazon Resource Name (ARN) of the Kinesis Stream. + +## Attributes Reference + +`id` is set to the Amazon Resource Name (ARN) of the Kinesis Stream Consumer. In addition, the following attributes +are exported: + +* `arn` - The Amazon Resource Name (ARN) of the Kinesis Stream Consumer (same as id). +* `name` - The name of the Kinesis Stream Consumer. +* `creation_timestamp` - The approximate UNIX timestamp that the stream consumer was created. +* `status` - The current status of the stream consumer. The stream status is one of CREATING, DELETING, ACTIVE, or UPDATING. +* `stream_arn` - The Amazon Resource Name (ARN) of the Kinesis Stream. + +[1]: https://docs.aws.amazon.com/streams/latest/dev/introduction-to-enhanced-consumers.html diff --git a/website/docs/r/kinesis_stream_consumer.html.markdown b/website/docs/r/kinesis_stream_consumer.html.markdown new file mode 100644 index 00000000000..f2e380c4867 --- /dev/null +++ b/website/docs/r/kinesis_stream_consumer.html.markdown @@ -0,0 +1,68 @@ +--- +subcategory: "Kinesis" +layout: "aws" +page_title: "AWS: aws_kinesis_stream_consumer" +description: |- + Provides a AWS Kinesis Stream Consumer +--- + +# aws_kinesis_stream_consumer + +Provides a Kinesis Stream Consumer resource. A consumer is an application that processes all data from a Kinesis data stream. +When a consumer uses enhanced fan-out, it gets its own 2 MiB/sec allotment of read throughput, allowing multiple consumers to +read data from the same stream in parallel, without contending for read throughput with other consumers. [Reading Data from Kinesis][1] + +You can register up to 20 consumers per stream. However, you can request a limit increase using the [Kinesis Data Streams limits form][2]. A given consumer can only be registered with one stream at a time. + +For more details, see the [Amazon Kinesis Stream Consumer Documentation][3]. + +## Example Usage + +```hcl +resource "aws_kinesis_stream" "test_stream" { + name = "terraform-kinesis-test" + shard_count = 1 +} + +resource "aws_lambda_event_source_mapping" "example" { + event_source_arn = "${aws_kinesis_stream_consumer.test_stream_consumer.arn}" + function_name = "${aws_lambda_function.example.arn}" + starting_position = "LATEST" +} + +resource "aws_kinesis_stream_consumer" "test_stream_consumer" { + name = "terraform-kinesis-stream-consumer-test" + stream_arn = "${aws_kinesis_stream.test_stream.arn}" +} +``` + +## Argument Reference + +The following arguments are supported: + +* `name` - (Required) A name to identify the stream. This is unique to the +AWS account and region the Stream Consumer is created in. +* `stream_arn` – (Required) The Amazon Resource Name (ARN) of the Kinesis Stream, the Consumer is connected to. + +## Attributes Reference + +* `id` - The unique Stream Consumer id +* `name` - The unique Stream Consumer name +* `arn` - The Amazon Resource Name (ARN) specifying the Stream Consumer (same as `id`) + +## Timeouts + +`aws_kinesis_stream_consumer` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: + +- `create` - (Default `5 minutes`) Used for Creating a Kinesis Stream Consumer +- `delete` - (Default `120 minutes`) Used for Destroying a Kinesis Stream Consumer + +Kinesis Streams can be imported using the `name@stream_arn`, e.g. + +``` +$ terraform import aws_kinesis_stream_consumer.test_stream_consumer terraform-kinesis-stream-consumer-test@arn:aws:kinesis:us-west-2:123456789012:stream/my-stream +``` + +[1]: https://docs.aws.amazon.com/streams/latest/dev/building-consumers.html +[2]: https://console.aws.amazon.com/support/v1?#/ +[3]: https://docs.aws.amazon.com/streams/latest/dev/introduction-to-enhanced-consumers.html From 06941533596050e9720ea74202ec40b657c7e96f Mon Sep 17 00:00:00 2001 From: Anthony Roach Date: Sat, 16 Jan 2021 18:21:37 -0500 Subject: [PATCH 0233/1252] lint fixes --- aws/resource_aws_kinesis_stream_consumer_test.go | 2 +- .../docs/d/kinesis_stream_consumer.html.markdown | 4 ++-- .../docs/r/kinesis_stream_consumer.html.markdown | 16 ++++++++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/aws/resource_aws_kinesis_stream_consumer_test.go b/aws/resource_aws_kinesis_stream_consumer_test.go index 88ade1522ad..518b9534586 100644 --- a/aws/resource_aws_kinesis_stream_consumer_test.go +++ b/aws/resource_aws_kinesis_stream_consumer_test.go @@ -43,7 +43,7 @@ func TestAccAWSKinesisStreamConsumer_basic(t *testing.T) { func testAccKinesisStreamConsumerImportStateIdFunc(config *accKinesisStreamConsumerConfig) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { - return fmt.Sprintf("%s@arn:aws:kinesis:%s:%s:stream/%s", config.getConsumerName(), testAccGetRegion(), testAccGetAccountID(), config.stream.getStreamName()), nil + return fmt.Sprintf("%s@arn:aws:kinesis:%s:%s:stream/%s", config.getConsumerName(), testAccGetRegion(), testAccGetAccountID(), config.stream.getStreamName()), nil //lintignore:AWSAT005 } } diff --git a/website/docs/d/kinesis_stream_consumer.html.markdown b/website/docs/d/kinesis_stream_consumer.html.markdown index 2ecd1b277de..c7442ed3fcf 100644 --- a/website/docs/d/kinesis_stream_consumer.html.markdown +++ b/website/docs/d/kinesis_stream_consumer.html.markdown @@ -17,8 +17,8 @@ For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. ```hcl data "aws_kinesis_stream_consumer" "stream_consumer" { - name = "stream-consumer-name" - stream_arn = "${aws_kinesis_stream.stream.arn}" + name = "stream-consumer-name" + stream_arn = aws_kinesis_stream.stream.arn } ``` diff --git a/website/docs/r/kinesis_stream_consumer.html.markdown b/website/docs/r/kinesis_stream_consumer.html.markdown index f2e380c4867..e379a290772 100644 --- a/website/docs/r/kinesis_stream_consumer.html.markdown +++ b/website/docs/r/kinesis_stream_consumer.html.markdown @@ -8,8 +8,8 @@ description: |- # aws_kinesis_stream_consumer -Provides a Kinesis Stream Consumer resource. A consumer is an application that processes all data from a Kinesis data stream. -When a consumer uses enhanced fan-out, it gets its own 2 MiB/sec allotment of read throughput, allowing multiple consumers to +Provides a Kinesis Stream Consumer resource. A consumer is an application that processes all data from a Kinesis data stream. +When a consumer uses enhanced fan-out, it gets its own 2 MiB/sec allotment of read throughput, allowing multiple consumers to read data from the same stream in parallel, without contending for read throughput with other consumers. [Reading Data from Kinesis][1] You can register up to 20 consumers per stream. However, you can request a limit increase using the [Kinesis Data Streams limits form][2]. A given consumer can only be registered with one stream at a time. @@ -20,19 +20,19 @@ For more details, see the [Amazon Kinesis Stream Consumer Documentation][3]. ```hcl resource "aws_kinesis_stream" "test_stream" { - name = "terraform-kinesis-test" - shard_count = 1 + name = "terraform-kinesis-test" + shard_count = 1 } resource "aws_lambda_event_source_mapping" "example" { - event_source_arn = "${aws_kinesis_stream_consumer.test_stream_consumer.arn}" - function_name = "${aws_lambda_function.example.arn}" + event_source_arn = aws_kinesis_stream_consumer.test_stream_consumer.arn + function_name = aws_lambda_function.example.arn starting_position = "LATEST" } resource "aws_kinesis_stream_consumer" "test_stream_consumer" { - name = "terraform-kinesis-stream-consumer-test" - stream_arn = "${aws_kinesis_stream.test_stream.arn}" + name = "terraform-kinesis-stream-consumer-test" + stream_arn = aws_kinesis_stream.test_stream.arn } ``` From b39b23012f97d02366bfe15eda59e391c99d4b0d Mon Sep 17 00:00:00 2001 From: stp Date: Sun, 13 Oct 2019 05:33:43 +0200 Subject: [PATCH 0234/1252] add aws_kinesis_stream_consumer documentation --- website/aws.erb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 website/aws.erb diff --git a/website/aws.erb b/website/aws.erb new file mode 100644 index 00000000000..e69de29bb2d From aa89b5ac00ca5ff13c9a8d2e04e593e56ee05395 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:44:13 -0400 Subject: [PATCH 0235/1252] tests/r/mq_broker: Add ErrorCheck --- aws/resource_aws_mq_broker_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_mq_broker_test.go b/aws/resource_aws_mq_broker_test.go index d0fa5141d23..6bc9289b45c 100644 --- a/aws/resource_aws_mq_broker_test.go +++ b/aws/resource_aws_mq_broker_test.go @@ -263,6 +263,7 @@ func TestAccAWSMqBroker_basic(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -335,6 +336,7 @@ func TestAccAWSMqBroker_throughputOptimized(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -413,6 +415,7 @@ func TestAccAWSMqBroker_allFieldsDefaultVpc(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -536,6 +539,7 @@ func TestAccAWSMqBroker_allFieldsCustomVpc(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -647,6 +651,7 @@ func TestAccAWSMqBroker_EncryptionOptions_KmsKeyId(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -680,6 +685,7 @@ func TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Disabled(t *testing.T) testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -712,6 +718,7 @@ func TestAccAWSMqBroker_EncryptionOptions_UseAwsOwnedKey_Enabled(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -744,6 +751,7 @@ func TestAccAWSMqBroker_updateUsers(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -816,6 +824,7 @@ func TestAccAWSMqBroker_tags(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -865,6 +874,7 @@ func TestAccAWSMqBroker_updateSecurityGroup(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -917,6 +927,7 @@ func TestAccAWSMqBroker_updateEngineVersion(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -955,6 +966,7 @@ func TestAccAWSMqBroker_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -981,6 +993,7 @@ func TestAccAWSMqBroker_rabbitmq(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -1018,6 +1031,7 @@ func TestAccAWSMqBroker_clusterRabbitMQ(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ @@ -1078,6 +1092,7 @@ func TestAccAWSMqBroker_ldap(t *testing.T) { testAccPartitionHasServicePreCheck(mq.EndpointsID, t) testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqBrokerDestroy, Steps: []resource.TestStep{ From 919ebb04eb2618e893421e117d5a21383531d6b2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:44:31 -0400 Subject: [PATCH 0236/1252] tests/ds/mq_broker: Add ErrorCheck --- aws/data_source_aws_mq_broker_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_mq_broker_test.go b/aws/data_source_aws_mq_broker_test.go index 051225180ad..089d4bcefcd 100644 --- a/aws/data_source_aws_mq_broker_test.go +++ b/aws/data_source_aws_mq_broker_test.go @@ -19,8 +19,9 @@ func TestAccDataSourceAWSMqBroker_basic(t *testing.T) { resourceName := "aws_mq_broker.acctest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(mq.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(mq.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSMqBrokerConfig_byId(brokerName, prefix), From 3eadd2e825d55d7ffe0d0c00f453d293f9efff1f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:45:05 -0400 Subject: [PATCH 0237/1252] tests/r/mq_configuration: Add ErrorCheck --- aws/resource_aws_mq_configuration_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index 8d3c507fc7d..b013163bfff 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -18,6 +18,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ @@ -90,6 +92,7 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ From e243b5b9dfc78339ad0f746c816d28d538858bc4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:50:16 -0400 Subject: [PATCH 0238/1252] tests/ds/autoscaling_group: Add ErrorCheck --- aws/data_source_aws_autoscaling_group_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_autoscaling_group_test.go b/aws/data_source_aws_autoscaling_group_test.go index 8378e7754b2..77c8fb57a0f 100644 --- a/aws/data_source_aws_autoscaling_group_test.go +++ b/aws/data_source_aws_autoscaling_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAwsAutoScalingGroupDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAutoScalingGroupDataResourceConfig(rName), @@ -46,8 +48,9 @@ func TestAccAwsAutoScalingGroupDataSource_launchTemplate(t *testing.T) { resourceName := "aws_autoscaling_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAutoScalingGroupDataResourceConfig_launchTemplate(), From c2e7341c9592cf8bfa38496750d4b2e13dce70d6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:50:29 -0400 Subject: [PATCH 0239/1252] tests/ds/autoscaling_groups: Add ErrorCheck --- aws/data_source_aws_autoscaling_groups_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_autoscaling_groups_test.go b/aws/data_source_aws_autoscaling_groups_test.go index 7059048cb15..b022e8435a2 100644 --- a/aws/data_source_aws_autoscaling_groups_test.go +++ b/aws/data_source_aws_autoscaling_groups_test.go @@ -7,6 +7,7 @@ import ( "strconv" "testing" + "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -14,8 +15,9 @@ import ( func TestAccAWSAutoscalingGroups_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAutoscalingGroupsConfig(acctest.RandInt(), acctest.RandInt(), acctest.RandInt()), From 9f09f993b582e98ad3257aa41f16486cc223b45e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:50:48 -0400 Subject: [PATCH 0240/1252] tests/r/autoscaling_attachment: Add ErrorCheck --- aws/resource_aws_autoscaling_attachment_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_autoscaling_attachment_test.go b/aws/resource_aws_autoscaling_attachment_test.go index a954d9576c6..7c5c63b2110 100644 --- a/aws/resource_aws_autoscaling_attachment_test.go +++ b/aws/resource_aws_autoscaling_attachment_test.go @@ -17,6 +17,7 @@ func TestAccAWSAutoscalingAttachment_elb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutocalingAttachmentDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSAutoscalingAttachment_albTargetGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutocalingAttachmentDestroy, Steps: []resource.TestStep{ From 605fa49380b69cc6972e87b663e633828ed388bf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:53:08 -0400 Subject: [PATCH 0241/1252] tests/r/autoscaling_group: Add ErrorCheck --- aws/resource_aws_autoscaling_group_test.go | 41 ++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/aws/resource_aws_autoscaling_group_test.go b/aws/resource_aws_autoscaling_group_test.go index 121dcd95a2c..a2bdcbf09c1 100644 --- a/aws/resource_aws_autoscaling_group_test.go +++ b/aws/resource_aws_autoscaling_group_test.go @@ -87,6 +87,7 @@ func TestAccAWSAutoScalingGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -176,6 +177,7 @@ func TestAccAWSAutoScalingGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -211,6 +213,7 @@ func TestAccAWSAutoScalingGroup_autoGeneratedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -244,6 +247,7 @@ func TestAccAWSAutoScalingGroup_autoGeneratedName(t *testing.T) { func TestAccAWSAutoScalingGroup_terminationPolicies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -318,6 +322,7 @@ func TestAccAWSAutoScalingGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -381,6 +386,7 @@ func TestAccAWSAutoScalingGroup_VpcUpdates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -430,6 +436,7 @@ func TestAccAWSAutoScalingGroup_WithLoadBalancer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -464,6 +471,7 @@ func TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -543,6 +551,7 @@ func TestAccAWSAutoScalingGroup_withPlacementGroup(t *testing.T) { randName := fmt.Sprintf("tf-test-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -577,6 +586,7 @@ func TestAccAWSAutoScalingGroup_enablingMetrics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -620,6 +630,7 @@ func TestAccAWSAutoScalingGroup_suspendingProcesses(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -670,6 +681,7 @@ func TestAccAWSAutoScalingGroup_withMetrics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -712,6 +724,7 @@ func TestAccAWSAutoScalingGroup_serviceLinkedRoleARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -746,6 +759,7 @@ func TestAccAWSAutoScalingGroup_MaxInstanceLifetime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -812,6 +826,7 @@ func TestAccAWSAutoScalingGroup_ALB_TargetGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -872,6 +887,7 @@ func TestAccAWSAutoScalingGroup_TargetGroupArns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -921,6 +937,7 @@ func TestAccAWSAutoScalingGroup_initialLifecycleHook(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -963,6 +980,7 @@ func TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -998,6 +1016,7 @@ func TestAccAWSAutoScalingGroup_InstanceRefresh_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1049,6 +1068,7 @@ func TestAccAWSAutoScalingGroup_InstanceRefresh_Start(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1089,6 +1109,7 @@ func TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1383,6 +1404,7 @@ func TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1416,6 +1438,7 @@ func TestAccAWSAutoScalingGroup_launchTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1450,6 +1473,7 @@ func TestAccAWSAutoScalingGroup_launchTemplate_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1529,6 +1553,7 @@ func TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1564,6 +1589,7 @@ func TestAccAWSAutoScalingGroup_LoadBalancers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1613,6 +1639,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1656,6 +1683,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1700,6 +1728,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDem resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1737,6 +1766,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDem resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1793,6 +1823,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_Updat resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1853,6 +1884,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDem resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1899,6 +1931,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotA resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1936,6 +1969,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotI resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -1982,6 +2016,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotM resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2037,6 +2072,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTempla resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2075,6 +2111,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTempla resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2123,6 +2160,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_Ins resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2174,6 +2212,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_Ins resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2215,6 +2254,7 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_Wei resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ @@ -2256,6 +2296,7 @@ func TestAccAWSAutoScalingGroup_launchTempPartitionNum(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, Steps: []resource.TestStep{ From a6e9e6494a46743bee1e39eacaecee57928de9af Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:53:56 -0400 Subject: [PATCH 0242/1252] tests/r/autoscaling_lifecycle_hook: Add ErrorCheck --- aws/resource_aws_autoscaling_lifecycle_hook_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_autoscaling_lifecycle_hook_test.go b/aws/resource_aws_autoscaling_lifecycle_hook_test.go index bbd99ceb542..384167f7c22 100644 --- a/aws/resource_aws_autoscaling_lifecycle_hook_test.go +++ b/aws/resource_aws_autoscaling_lifecycle_hook_test.go @@ -16,6 +16,7 @@ func TestAccAWSAutoscalingLifecycleHook_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingLifecycleHookDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAWSAutoscalingLifecycleHook_omitDefaultResult(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingLifecycleHookDestroy, Steps: []resource.TestStep{ From fdf108947a1e03d6336b8d29f7703f41cfdc95e0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:54:17 -0400 Subject: [PATCH 0243/1252] tests/r/autoscaling_notification: Add ErrorCheck --- aws/resource_aws_autoscaling_notification_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_autoscaling_notification_test.go b/aws/resource_aws_autoscaling_notification_test.go index d1a462a0d10..cc716434969 100644 --- a/aws/resource_aws_autoscaling_notification_test.go +++ b/aws/resource_aws_autoscaling_notification_test.go @@ -19,6 +19,7 @@ func TestAccAWSASGNotification_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckASGNDestroy, Steps: []resource.TestStep{ @@ -40,6 +41,7 @@ func TestAccAWSASGNotification_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckASGNDestroy, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAWSASGNotification_Pagination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckASGNDestroy, Steps: []resource.TestStep{ From dc135d8ef398f8fd61b29dcbe912ca5f1821bc1b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:54:39 -0400 Subject: [PATCH 0244/1252] tests/r/autoscaling_policy: Add ErrorCheck --- aws/resource_aws_autoscaling_policy_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_autoscaling_policy_test.go b/aws/resource_aws_autoscaling_policy_test.go index 306b26b3b1a..c8f795f6654 100644 --- a/aws/resource_aws_autoscaling_policy_test.go +++ b/aws/resource_aws_autoscaling_policy_test.go @@ -24,6 +24,7 @@ func TestAccAWSAutoscalingPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAWSAutoscalingPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -172,6 +174,7 @@ func TestAccAWSAutoscalingPolicy_SimpleScalingStepAdjustment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -200,6 +203,7 @@ func TestAccAWSAutoscalingPolicy_TargetTrack_Predefined(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -226,6 +230,7 @@ func TestAccAWSAutoscalingPolicy_TargetTrack_Custom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -254,6 +259,7 @@ func TestAccAWSAutoscalingPolicy_zerovalue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingPolicyDestroy, Steps: []resource.TestStep{ From af0c28a215a48d0c4cf0ef26c99862bc20811e09 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:54:56 -0400 Subject: [PATCH 0245/1252] tests/r/autoscaling_schedule: Add ErrorCheck --- aws/resource_aws_autoscaling_schedule_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_autoscaling_schedule_test.go b/aws/resource_aws_autoscaling_schedule_test.go index 998491428b5..7bf5d59c890 100644 --- a/aws/resource_aws_autoscaling_schedule_test.go +++ b/aws/resource_aws_autoscaling_schedule_test.go @@ -25,6 +25,7 @@ func TestAccAWSAutoscalingSchedule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingScheduleDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSAutoscalingSchedule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingScheduleDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSAutoscalingSchedule_recurrence(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingScheduleDestroy, Steps: []resource.TestStep{ @@ -130,6 +133,7 @@ func TestAccAWSAutoscalingSchedule_zeroValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingScheduleDestroy, Steps: []resource.TestStep{ @@ -162,6 +166,7 @@ func TestAccAWSAutoscalingSchedule_negativeOne(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAutoscalingScheduleDestroy, Steps: []resource.TestStep{ From 224b8e1f10ec5ffdd07de57f96d096686e899cdb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:55:31 -0400 Subject: [PATCH 0246/1252] tests/r/launch_configuration: Add ErrorCheck --- aws/resource_aws_launch_configuration_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_launch_configuration_test.go b/aws/resource_aws_launch_configuration_test.go index 28a699e3791..6b7f79deb07 100644 --- a/aws/resource_aws_launch_configuration_test.go +++ b/aws/resource_aws_launch_configuration_test.go @@ -69,6 +69,7 @@ func TestAccAWSLaunchConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func TestAccAWSLaunchConfiguration_withBlockDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -134,6 +136,7 @@ func TestAccAWSLaunchConfiguration_withInstanceStoreAMI(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -162,6 +165,7 @@ func TestAccAWSLaunchConfiguration_RootBlockDevice_AmiDisappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -191,6 +195,7 @@ func TestAccAWSLaunchConfiguration_RootBlockDevice_VolumeSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -225,6 +230,7 @@ func TestAccAWSLaunchConfiguration_encryptedRootBlockDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -251,6 +257,7 @@ func TestAccAWSLaunchConfiguration_withSpotPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -280,6 +287,7 @@ func TestAccAWSLaunchConfiguration_withVpcClassicLink(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -307,6 +315,7 @@ func TestAccAWSLaunchConfiguration_withIAMProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -332,6 +341,7 @@ func TestAccAWSLaunchConfiguration_withEncryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -358,6 +368,7 @@ func TestAccAWSLaunchConfiguration_updateEbsBlockDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -396,6 +407,7 @@ func TestAccAWSLaunchConfiguration_metadataOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -425,6 +437,7 @@ func TestAccAWSLaunchConfiguration_ebs_noDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ @@ -448,12 +461,14 @@ func TestAccAWSLaunchConfiguration_ebs_noDevice(t *testing.T) { }, }) } + func TestAccAWSLaunchConfiguration_userData(t *testing.T) { var conf autoscaling.LaunchConfiguration resourceName := "aws_launch_configuration.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ From a65aa1c0fef23f9fbe6d95cf6591ce4d614cdc7a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:55:52 -0400 Subject: [PATCH 0247/1252] tests/r/launch_template: Add ErrorCheck --- aws/resource_aws_launch_template_test.go | 33 ++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/aws/resource_aws_launch_template_test.go b/aws/resource_aws_launch_template_test.go index 187050cfb8f..63efc89596e 100644 --- a/aws/resource_aws_launch_template_test.go +++ b/aws/resource_aws_launch_template_test.go @@ -81,6 +81,7 @@ func TestAccAWSLaunchTemplate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAWSLaunchTemplate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -133,6 +135,7 @@ func TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -163,6 +166,7 @@ func TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_DeleteOnTermination(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -204,6 +208,7 @@ func TestAccAWSLaunchTemplate_BlockDeviceMappings_EBS_Gp3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -236,6 +241,7 @@ func TestAccAWSLaunchTemplate_EbsOptimized(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -290,6 +296,7 @@ func TestAccAWSLaunchTemplate_ElasticInferenceAccelerator(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -325,6 +332,7 @@ func TestAccAWSLaunchTemplate_NetworkInterfaces_DeleteOnTermination(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -380,6 +388,7 @@ func TestAccAWSLaunchTemplate_data(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -424,6 +433,7 @@ func TestAccAWSLaunchTemplate_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -456,6 +466,7 @@ func TestAccAWSLaunchTemplate_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -497,6 +508,7 @@ func TestAccAWSLaunchTemplate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -532,6 +544,7 @@ func TestAccAWSLaunchTemplate_capacityReservation_preference(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -557,6 +570,7 @@ func TestAccAWSLaunchTemplate_capacityReservation_target(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -582,6 +596,7 @@ func TestAccAWSLaunchTemplate_cpuOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -602,6 +617,7 @@ func TestAccAWSLaunchTemplate_creditSpecification_nonBurstable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -628,6 +644,7 @@ func TestAccAWSLaunchTemplate_creditSpecification_t2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -655,6 +672,7 @@ func TestAccAWSLaunchTemplate_creditSpecification_t3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -683,6 +701,7 @@ func TestAccAWSLaunchTemplate_IamInstanceProfile_EmptyConfigurationBlock(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -704,6 +723,7 @@ func TestAccAWSLaunchTemplate_networkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -734,6 +754,7 @@ func TestAccAWSLaunchTemplate_networkInterfaceAddresses(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -763,6 +784,7 @@ func TestAccAWSLaunchTemplate_associatePublicIPAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -812,6 +834,7 @@ func TestAccAWSLaunchTemplate_associateCarrierIPAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -861,6 +884,7 @@ func TestAccAWSLaunchTemplate_placement_partitionNum(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -894,6 +918,7 @@ func TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -921,6 +946,7 @@ func TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -949,6 +975,7 @@ func TestAccAWSLaunchTemplate_instanceMarketOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -991,6 +1018,7 @@ func TestAccAWSLaunchTemplate_licenseSpecification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -1017,6 +1045,7 @@ func TestAccAWSLaunchTemplate_metadataOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -1046,6 +1075,7 @@ func TestAccAWSLaunchTemplate_enclaveOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -1086,6 +1116,7 @@ func TestAccAWSLaunchTemplate_hibernation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -1127,6 +1158,7 @@ func TestAccAWSLaunchTemplate_defaultVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -1172,6 +1204,7 @@ func TestAccAWSLaunchTemplate_updateDefaultVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ From 6da4ea1334c3d8a9b05769cf8377969ec35cccc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 02:56:37 -0400 Subject: [PATCH 0248/1252] tests/ds/launch_configuration: Add ErrorCheck --- ...data_source_aws_launch_configuration_test.go | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_launch_configuration_test.go b/aws/data_source_aws_launch_configuration_test.go index 5c7d826acff..e482d551d08 100644 --- a/aws/data_source_aws_launch_configuration_test.go +++ b/aws/data_source_aws_launch_configuration_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSLaunchConfigurationDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccLaunchConfigurationDataSourceConfig_basic(rName), @@ -42,8 +44,9 @@ func TestAccAWSLaunchConfigurationDataSource_securityGroups(t *testing.T) { rName := "data.aws_launch_configuration.foo" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccLaunchConfigurationDataSourceConfig_securityGroups(rInt), @@ -61,8 +64,9 @@ func TestAccAWSLaunchConfigurationDataSource_ebsNoDevice(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccLaunchConfigurationDataSourceConfigEbsNoDevice(rName), @@ -84,6 +88,7 @@ func TestAccLaunchConfigurationDataSource_metadataOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchConfigurationDestroy, Steps: []resource.TestStep{ From 8c0c45bd8bc607fff1f099a265bfd9f2792d7974 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:01:41 -0400 Subject: [PATCH 0249/1252] tests/ds/db_cluster_snapshot: Add ErrorCheck --- aws/data_source_aws_db_cluster_snapshot_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_db_cluster_snapshot_test.go b/aws/data_source_aws_db_cluster_snapshot_test.go index f83d4b7632c..8f62b6e23a6 100644 --- a/aws/data_source_aws_db_cluster_snapshot_test.go +++ b/aws/data_source_aws_db_cluster_snapshot_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -15,8 +16,9 @@ func TestAccAWSDbClusterSnapshotDataSource_DbClusterSnapshotIdentifier(t *testin resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbClusterSnapshotDataSourceConfig_DbClusterSnapshotIdentifier(rName), @@ -51,8 +53,9 @@ func TestAccAWSDbClusterSnapshotDataSource_DbClusterIdentifier(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbClusterSnapshotDataSourceConfig_DbClusterIdentifier(rName), @@ -87,8 +90,9 @@ func TestAccAWSDbClusterSnapshotDataSource_MostRecent(t *testing.T) { resourceName := "aws_db_cluster_snapshot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbClusterSnapshotDataSourceConfig_MostRecent(rName), From 8f25811e4bdd241e470313fbe74a6fdff98c93e6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:02:02 -0400 Subject: [PATCH 0250/1252] tests/ds/db_event_categories: Add ErrorCheck --- aws/data_source_aws_db_event_categories_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_db_event_categories_test.go b/aws/data_source_aws_db_event_categories_test.go index 0550386f554..628c1ce9094 100644 --- a/aws/data_source_aws_db_event_categories_test.go +++ b/aws/data_source_aws_db_event_categories_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ func TestAccAWSDbEventCategories_basic(t *testing.T) { dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbEventCategoriesConfig(), @@ -41,8 +43,9 @@ func TestAccAWSDbEventCategories_SourceType(t *testing.T) { dataSourceName := "data.aws_db_event_categories.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbEventCategoriesConfigSourceType("db-snapshot"), From 5d2f444af661b9ffe56e115c908e654f4a905a15 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:02:21 -0400 Subject: [PATCH 0251/1252] tests/ds/db_instance: Add ErrorCheck --- aws/data_source_aws_db_instance_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_db_instance_test.go b/aws/data_source_aws_db_instance_test.go index d98d5912588..af024079def 100644 --- a/aws/data_source_aws_db_instance_test.go +++ b/aws/data_source_aws_db_instance_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ import ( func TestAccAWSDbInstanceDataSource_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDBInstanceDataSourceConfig(rInt), @@ -45,6 +47,7 @@ func TestAccAWSDbInstanceDataSource_ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { From f87b0f955d266bbd6503671eda83fed017be0013 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:02:37 -0400 Subject: [PATCH 0252/1252] tests/ds/db_snapshot: Add ErrorCheck --- aws/data_source_aws_db_snapshot_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_db_snapshot_test.go b/aws/data_source_aws_db_snapshot_test.go index bd5629f8df2..c983080a9ab 100644 --- a/aws/data_source_aws_db_snapshot_test.go +++ b/aws/data_source_aws_db_snapshot_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -12,8 +13,9 @@ import ( func TestAccAWSDbSnapshotDataSource_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsDbSnapshotDataSourceConfig(rInt), From 8b4fef35df65bac68ce8cea43b424985a49a16bb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:03:02 -0400 Subject: [PATCH 0253/1252] tests/ds/db_subnet_group: Add ErrorCheck --- aws/data_source_aws_db_subnet_group_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_db_subnet_group_test.go b/aws/data_source_aws_db_subnet_group_test.go index d4c3837d93f..1186876c4cb 100644 --- a/aws/data_source_aws_db_subnet_group_test.go +++ b/aws/data_source_aws_db_subnet_group_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSDbSubnetGroupDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { @@ -36,6 +38,7 @@ func TestAccAWSDbSubnetGroupDataSource_basic(t *testing.T) { func TestAccAWSDbSubnetGroupDataSource_nonexistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { From 312c281ce0cf0449bc1ae73fc0308829267b01e8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:03:29 -0400 Subject: [PATCH 0254/1252] tests/ds/rds_certificate: Add ErrorCheck --- aws/data_source_aws_rds_certificate_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_rds_certificate_test.go b/aws/data_source_aws_rds_certificate_test.go index 0d3a630217d..31aca530c24 100644 --- a/aws/data_source_aws_rds_certificate_test.go +++ b/aws/data_source_aws_rds_certificate_test.go @@ -13,6 +13,7 @@ func TestAccAWSRDSCertificateDataSource_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSCertificatePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -31,6 +32,7 @@ func TestAccAWSRDSCertificateDataSource_LatestValidTill(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSCertificatePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From b8740cf00692f19e2bf86350c4c2251f3576d600 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:03:45 -0400 Subject: [PATCH 0255/1252] tests/ds/rds_cluster: Add ErrorCheck --- aws/data_source_aws_rds_cluster_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_rds_cluster_test.go b/aws/data_source_aws_rds_cluster_test.go index fe4d956d078..701ca1ad547 100644 --- a/aws/data_source_aws_rds_cluster_test.go +++ b/aws/data_source_aws_rds_cluster_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAWSRDSCluster_basic(t *testing.T) { resourceName := "aws_rds_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRdsClusterConfigBasic(clusterName), From a11c9198614b5437b9cc8021a6c98e17800a7a9d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:04:01 -0400 Subject: [PATCH 0256/1252] tests/ds/rds_engine_version: Add ErrorCheck --- aws/data_source_aws_rds_engine_version_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_rds_engine_version_test.go b/aws/data_source_aws_rds_engine_version_test.go index ae24f8358fb..cfe939a6970 100644 --- a/aws/data_source_aws_rds_engine_version_test.go +++ b/aws/data_source_aws_rds_engine_version_test.go @@ -18,6 +18,7 @@ func TestAccAWSRDSEngineVersionDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSRDSEngineVersionDataSource_upgradeTargets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -70,6 +72,7 @@ func TestAccAWSRDSEngineVersionDataSource_preferred(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -88,6 +91,7 @@ func TestAccAWSRDSEngineVersionDataSource_defaultOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRDSEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 2628b36ba2381f0e535c74718404c8e1b68a1a47 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:04:20 -0400 Subject: [PATCH 0257/1252] tests/ds/rds_orderable_db_instance: Add ErrorCheck --- aws/data_source_aws_rds_orderable_db_instance_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/data_source_aws_rds_orderable_db_instance_test.go b/aws/data_source_aws_rds_orderable_db_instance_test.go index 0e7cacd6829..faa7622eb77 100644 --- a/aws/data_source_aws_rds_orderable_db_instance_test.go +++ b/aws/data_source_aws_rds_orderable_db_instance_test.go @@ -19,6 +19,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_preferredClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -61,6 +63,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_preferredVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -81,6 +84,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_preferredClassAndVersion(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -100,6 +104,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsEnhancedMonitoring(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -118,6 +123,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsIAMDatabaseAuthenticatio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -136,6 +142,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsIops(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -154,6 +161,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsKerberosAuthentication(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -176,6 +184,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsPerformanceInsights(t *t testAccAWSRdsOrderableDbInstancePreCheck(t) testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -194,6 +203,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsStorageAutoscaling(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -212,6 +222,7 @@ func TestAccAWSRdsOrderableDbInstanceDataSource_supportsStorageEncryption(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRdsOrderableDbInstancePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From a2aecc40fc075f82fb65e9b86a4c9ba6f78d4b03 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:05:55 -0400 Subject: [PATCH 0258/1252] tests/r/db_cluster_snapshot: Add ErrorCheck --- aws/resource_aws_db_cluster_snapshot_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_db_cluster_snapshot_test.go b/aws/resource_aws_db_cluster_snapshot_test.go index dbd5c026661..2ccf3047b3c 100644 --- a/aws/resource_aws_db_cluster_snapshot_test.go +++ b/aws/resource_aws_db_cluster_snapshot_test.go @@ -81,6 +81,7 @@ func TestAccAWSDBClusterSnapshot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDbClusterSnapshotDestroy, Steps: []resource.TestStep{ @@ -120,6 +121,7 @@ func TestAccAWSDBClusterSnapshot_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDbClusterSnapshotDestroy, Steps: []resource.TestStep{ From 476ab3558f93881884382897f3511c6736f2fd96 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:06:13 -0400 Subject: [PATCH 0259/1252] tests/r/db_event_subscription: Add ErrorCheck --- aws/resource_aws_db_event_subscription_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_db_event_subscription_test.go b/aws/resource_aws_db_event_subscription_test.go index c6fa6dcf082..db381a4b233 100644 --- a/aws/resource_aws_db_event_subscription_test.go +++ b/aws/resource_aws_db_event_subscription_test.go @@ -86,6 +86,7 @@ func TestAccAWSDBEventSubscription_basicUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -128,6 +129,7 @@ func TestAccAWSDBEventSubscription_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -151,6 +153,7 @@ func TestAccAWSDBEventSubscription_withPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -176,6 +179,7 @@ func TestAccAWSDBEventSubscription_withSourceIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -217,6 +221,7 @@ func TestAccAWSDBEventSubscription_categoryUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, Steps: []resource.TestStep{ From 2971a73c7cb857d7c01b6fef27abef3e21d29abe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:06:30 -0400 Subject: [PATCH 0260/1252] tests/r/db_instance_role_association: Add ErrorCheck --- aws/resource_aws_db_instance_role_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_db_instance_role_association_test.go b/aws/resource_aws_db_instance_role_association_test.go index 98ee389287e..0dfe53d5a2e 100644 --- a/aws/resource_aws_db_instance_role_association_test.go +++ b/aws/resource_aws_db_instance_role_association_test.go @@ -20,6 +20,7 @@ func TestAccAWSDbInstanceRoleAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDbInstanceRoleAssociationDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSDbInstanceRoleAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDbInstanceRoleAssociationDestroy, Steps: []resource.TestStep{ From cbae771dc164860db034188877ccb13b83c76d46 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:06:48 -0400 Subject: [PATCH 0261/1252] tests/r/db_instance: Add ErrorCheck --- aws/resource_aws_db_instance_test.go | 95 +++++++++++++++++++++++++++- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_db_instance_test.go b/aws/resource_aws_db_instance_test.go index 6ba19de785a..d68ce4d4256 100644 --- a/aws/resource_aws_db_instance_test.go +++ b/aws/resource_aws_db_instance_test.go @@ -69,6 +69,7 @@ func TestAccAWSDBInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -131,6 +132,7 @@ func TestAccAWSDBInstance_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -152,6 +154,7 @@ func TestAccAWSDBInstance_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSDBInstance_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -206,6 +210,7 @@ func TestAccAWSDBInstance_subnetGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -236,6 +241,7 @@ func TestAccAWSDBInstance_optionGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -257,6 +263,7 @@ func TestAccAWSDBInstance_iamAuth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -281,6 +288,7 @@ func TestAccAWSDBInstance_AllowMajorVersionUpgrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -324,6 +332,7 @@ func TestAccAWSDBInstance_DbSubnetGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -354,6 +363,7 @@ func TestAccAWSDBInstance_DbSubnetGroupName_RamShared(t *testing.T) { testAccAlternateAccountPreCheck(t) testAccOrganizationsEnabledPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -379,6 +389,7 @@ func TestAccAWSDBInstance_DbSubnetGroupName_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -402,6 +413,7 @@ func TestAccAWSDBInstance_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -440,8 +452,9 @@ func TestAccAWSDBInstance_FinalSnapshotIdentifier(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), + Providers: testAccProviders, // testAccCheckAWSDBInstanceSnapshot verifies a database snapshot is // created, and subsequently deletes it CheckDestroy: testAccCheckAWSDBInstanceSnapshot, @@ -461,6 +474,7 @@ func TestAccAWSDBInstance_FinalSnapshotIdentifier_SkipFinalSnapshot(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceNoSnapshot, Steps: []resource.TestStep{ @@ -482,6 +496,7 @@ func TestAccAWSDBInstance_IsAlreadyBeingDeleted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -519,6 +534,7 @@ func TestAccAWSDBInstance_MaxAllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -562,6 +578,7 @@ func TestAccAWSDBInstance_Password(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -601,6 +618,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -625,6 +643,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_AllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -650,6 +669,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_AllowMajorVersionUpgrade(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -675,6 +695,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_AutoMinorVersionUpgrade(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -700,6 +721,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_AvailabilityZone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -724,6 +746,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_BackupRetentionPeriod(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -749,6 +772,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_BackupWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -779,6 +803,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -810,6 +835,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_RamShared(t *testi testAccAlternateAccountPreCheck(t) testAccOrganizationsEnabledPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternateAccountAndAlternateRegion(&providers), CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -839,6 +865,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_DbSubnetGroupName_VpcSecurityGroupId testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -875,6 +902,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -910,6 +938,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_IamDatabaseAuthenticationEnabled(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -935,6 +964,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_MaintenanceWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -960,6 +990,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_MaxAllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -985,6 +1016,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_Monitoring(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1010,6 +1042,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_MultiAZ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1035,6 +1068,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_ParameterGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1061,6 +1095,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1086,6 +1121,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1112,6 +1148,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_CACertificateIdentifier(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1137,6 +1174,7 @@ func TestAccAWSDBInstance_S3Import(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1161,6 +1199,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1184,6 +1223,7 @@ func TestAccAWSDBInstance_SnapshotIdentifierRemoved(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1215,6 +1255,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_AllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1242,6 +1283,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_Io1Storage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1269,6 +1311,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_AllowMajorVersionUpgrade(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1296,6 +1339,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_AutoMinorVersionUpgrade(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1323,6 +1367,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_AvailabilityZone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1349,6 +1394,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1376,6 +1422,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_BackupRetentionPeriod_Unset(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1403,6 +1450,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_BackupWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1432,6 +1480,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1467,6 +1516,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName_RamShared(t *test testAccAlternateAccountPreCheck(t) testAccOrganizationsEnabledPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1497,6 +1547,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_DbSubnetGroupName_VpcSecurityGroupI resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1525,6 +1576,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1562,6 +1614,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_IamDatabaseAuthenticationEnabled(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1589,6 +1642,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_MaintenanceWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1616,6 +1670,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_MaxAllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1643,6 +1698,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_Monitoring(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1670,6 +1726,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1697,6 +1754,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_MultiAZ_SQLServer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1724,6 +1782,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_ParameterGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1752,6 +1811,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1779,6 +1839,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1811,6 +1872,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_Tags_Unset(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1838,6 +1900,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1868,6 +1931,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_VpcSecurityGroupIds_Tags(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1892,6 +1956,7 @@ func TestAccAWSDBInstance_MonitoringInterval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1946,6 +2011,7 @@ func TestAccAWSDBInstance_MonitoringRoleArn_EnabledToDisabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1986,6 +2052,7 @@ func TestAccAWSDBInstance_MonitoringRoleArn_EnabledToRemoved(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2025,6 +2092,7 @@ func TestAccAWSDBInstance_MonitoringRoleArn_RemovedToEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2066,6 +2134,7 @@ func TestAccAWSDBInstance_separateIopsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2095,6 +2164,7 @@ func TestAccAWSDBInstance_portUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2125,6 +2195,7 @@ func TestAccAWSDBInstance_MSSQL_TZ(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2161,6 +2232,7 @@ func TestAccAWSDBInstance_MSSQL_Domain(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2196,6 +2268,7 @@ func TestAccAWSDBInstance_MSSQL_DomainSnapshotRestore(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2221,6 +2294,7 @@ func TestAccAWSDBInstance_MySQL_SnapshotRestoreWithEngineVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2242,6 +2316,7 @@ func TestAccAWSDBInstance_MinorVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2262,6 +2337,7 @@ func TestAccAWSDBInstance_ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSDBInstanceEc2ClassicDestroy, Steps: []resource.TestStep{ @@ -2282,6 +2358,7 @@ func TestAccAWSDBInstance_cloudwatchLogsExportConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2314,6 +2391,7 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_MySQL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2365,6 +2443,7 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_MSSQL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2398,6 +2477,7 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Oracle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2432,6 +2512,7 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Postgresql(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2466,6 +2547,7 @@ func TestAccAWSDBInstance_NoDeleteAutomatedBackups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceAutomatedBackups, Steps: []resource.TestStep{ @@ -2846,6 +2928,7 @@ func TestAccAWSDBInstance_PerformanceInsightsEnabled_DisabledToEnabled(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -2884,6 +2967,7 @@ func TestAccAWSDBInstance_PerformanceInsightsEnabled_EnabledToDisabled(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -2923,6 +3007,7 @@ func TestAccAWSDBInstance_PerformanceInsightsKmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -2971,6 +3056,7 @@ func TestAccAWSDBInstance_PerformanceInsightsRetentionPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -3014,6 +3100,7 @@ func TestAccAWSDBInstance_ReplicateSourceDb_PerformanceInsightsEnabled(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -3044,6 +3131,7 @@ func TestAccAWSDBInstance_SnapshotIdentifier_PerformanceInsightsEnabled(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, "mysql") }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -3070,6 +3158,7 @@ func TestAccAWSDBInstance_CACertificateIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -3091,6 +3180,7 @@ func TestAccAWSDBInstance_RestoreToPointInTime_SourceIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -3126,6 +3216,7 @@ func TestAccAWSDBInstance_RestoreToPointInTime_SourceResourceID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ From 53ef2e852707e703abae7e6bc402c5c5ee05df45 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:07:13 -0400 Subject: [PATCH 0262/1252] tests/r/db_option_group: Add ErrorCheck --- aws/resource_aws_db_option_group_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_db_option_group_test.go b/aws/resource_aws_db_option_group_test.go index 7c12280ecc1..c5c8f431960 100644 --- a/aws/resource_aws_db_option_group_test.go +++ b/aws/resource_aws_db_option_group_test.go @@ -77,6 +77,7 @@ func TestAccAWSDBOptionGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAWSDBOptionGroup_timeoutBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSDBOptionGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -161,6 +164,7 @@ func TestAccAWSDBOptionGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -187,6 +191,7 @@ func TestAccAWSDBOptionGroupConfig_OptionGroupDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -212,6 +217,7 @@ func TestAccAWSDBOptionGroup_basicDestroyWithInstance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -234,6 +240,7 @@ func TestAccAWSDBOptionGroup_Option_OptionSettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -288,6 +295,7 @@ func TestAccAWSDBOptionGroup_Option_OptionSettings_IAMRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -318,6 +326,7 @@ func TestAccAWSDBOptionGroup_sqlServerOptionsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -355,6 +364,7 @@ func TestAccAWSDBOptionGroup_OracleOptionsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -399,6 +409,7 @@ func TestAccAWSDBOptionGroup_Option_OptionSettings_MultipleNonDefault(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -432,6 +443,7 @@ func TestAccAWSDBOptionGroup_multipleOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -462,6 +474,7 @@ func TestAccAWSDBOptionGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ @@ -508,6 +521,7 @@ func TestAccAWSDBOptionGroup_Tags_WithOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBOptionGroupDestroy, Steps: []resource.TestStep{ From e2ade0391509f71d6a6dafab04f86a1915f27a5c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:07:31 -0400 Subject: [PATCH 0263/1252] tests/r/db_parameter_group: Add ErrorCheck --- aws/resource_aws_db_parameter_group_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_db_parameter_group_test.go b/aws/resource_aws_db_parameter_group_test.go index 74ff03b9b5e..1cd8d9a5c09 100644 --- a/aws/resource_aws_db_parameter_group_test.go +++ b/aws/resource_aws_db_parameter_group_test.go @@ -80,6 +80,7 @@ func TestAccAWSDBParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -173,6 +174,7 @@ func TestAccAWSDBParameterGroup_limit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -540,6 +542,7 @@ func TestAccAWSDBParameterGroup_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -560,6 +563,7 @@ func TestAccAWSDBParameterGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -579,6 +583,7 @@ func TestAccAWSDBParameterGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -599,6 +604,7 @@ func TestAccAWSDBParameterGroup_withApplyMethod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -638,6 +644,7 @@ func TestAccAWSDBParameterGroup_Only(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -666,6 +673,7 @@ func TestAccAWSDBParameterGroup_MatchDefault(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ @@ -694,6 +702,7 @@ func TestAccAWSDBParameterGroup_updateParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ From 243cb3c62644190bdb577a7a66bd6e14c705e108 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:07:54 -0400 Subject: [PATCH 0264/1252] tests/r/db_proxy_default_target_group: Add ErrorCheck --- aws/resource_aws_db_proxy_default_target_group_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_db_proxy_default_target_group_test.go b/aws/resource_aws_db_proxy_default_target_group_test.go index 06623fe222e..2ba4b92b536 100644 --- a/aws/resource_aws_db_proxy_default_target_group_test.go +++ b/aws/resource_aws_db_proxy_default_target_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_EmptyConnectionPoolConfig(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_ConnectionBorrowTimeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -120,6 +123,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_InitQuery(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -153,6 +157,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_MaxConnectionsPercent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -186,6 +191,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_MaxIdleConnectionsPercent(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -220,6 +226,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_SessionPinningFilters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ @@ -254,6 +261,7 @@ func TestAccAWSDBProxyDefaultTargetGroup_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetGroupDestroy, Steps: []resource.TestStep{ From 48bf2609f8790d7d476680d41f4d16ae12b40640 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 03:08:01 -0400 Subject: [PATCH 0265/1252] CR updates; refactor to service package and update test coverage --- .changelog/17149.txt | 7 + ...data_source_aws_kinesis_stream_consumer.go | 92 ++++-- ...source_aws_kinesis_stream_consumer_test.go | 131 +++++++- aws/internal/service/kinesis/finder/finder.go | 25 ++ aws/internal/service/kinesis/waiter/status.go | 30 ++ aws/internal/service/kinesis/waiter/waiter.go | 49 +++ aws/resource_aws_kinesis_stream_consumer.go | 219 ++++--------- ...source_aws_kinesis_stream_consumer_test.go | 303 +++++++----------- aws/resource_aws_kinesis_stream_test.go | 19 +- website/aws.erb | 0 .../d/kinesis_stream_consumer.html.markdown | 29 +- .../r/kinesis_stream_consumer.html.markdown | 54 ++-- 12 files changed, 529 insertions(+), 429 deletions(-) create mode 100644 .changelog/17149.txt create mode 100644 aws/internal/service/kinesis/finder/finder.go create mode 100644 aws/internal/service/kinesis/waiter/status.go create mode 100644 aws/internal/service/kinesis/waiter/waiter.go delete mode 100644 website/aws.erb diff --git a/.changelog/17149.txt b/.changelog/17149.txt new file mode 100644 index 00000000000..8d6f8cf48f1 --- /dev/null +++ b/.changelog/17149.txt @@ -0,0 +1,7 @@ +```release-note:new-data-source +aws_kinesis_stream_consumer +``` + +```release-note:new-resource +aws_kinesis_stream_consumer +``` diff --git a/aws/data_source_aws_kinesis_stream_consumer.go b/aws/data_source_aws_kinesis_stream_consumer.go index 3bc611881a2..fe8bdac2d3f 100644 --- a/aws/data_source_aws_kinesis_stream_consumer.go +++ b/aws/data_source_aws_kinesis_stream_consumer.go @@ -1,6 +1,11 @@ package aws import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/kinesis" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" ) @@ -9,23 +14,21 @@ func dataSourceAwsKinesisStreamConsumer() *schema.Resource { Read: dataSourceAwsKinesisStreamConsumerRead, Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - }, - - "stream_arn": { - Type: schema.TypeString, - Required: true, + "arn": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateArn, }, - "arn": { + "creation_timestamp": { Type: schema.TypeString, Computed: true, }, - "creation_timestamp": { - Type: schema.TypeInt, + "name": { + Type: schema.TypeString, + Optional: true, Computed: true, }, @@ -33,25 +36,72 @@ func dataSourceAwsKinesisStreamConsumer() *schema.Resource { Type: schema.TypeString, Computed: true, }, + + "stream_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + }, }, } } func dataSourceAwsKinesisStreamConsumerRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kinesisconn - cn := d.Get("name").(string) - sa := d.Get("stream_arn").(string) - state, err := readKinesisStreamConsumerState(conn, cn, sa) + streamArn := d.Get("stream_arn").(string) + + input := &kinesis.ListStreamConsumersInput{ + StreamARN: aws.String(streamArn), + } + + var results []*kinesis.Consumer + + err := conn.ListStreamConsumersPages(input, func(page *kinesis.ListStreamConsumersOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, consumer := range page.Consumers { + if consumer == nil { + continue + } + + if v, ok := d.GetOk("name"); ok && v.(string) != aws.StringValue(consumer.ConsumerName) { + continue + } + + if v, ok := d.GetOk("arn"); ok && v.(string) != aws.StringValue(consumer.ConsumerARN) { + continue + } + + results = append(results, consumer) + + } + + return !lastPage + }) + if err != nil { - return err + return fmt.Errorf("error listing Kinesis Stream Consumers: %w", err) + } + + if len(results) == 0 { + return fmt.Errorf("no Kinesis Stream Consumer found matching criteria; try different search") } - d.SetId(state.arn) - d.Set("arn", state.arn) - d.Set("name", cn) - d.Set("stream_arn", sa) - d.Set("status", state.status) - d.Set("creation_timestamp", state.creationTimestamp) + + if len(results) > 1 { + return fmt.Errorf("multiple Kinesis Stream Consumers found matching criteria; try different search") + } + + consumer := results[0] + + d.SetId(aws.StringValue(consumer.ConsumerARN)) + d.Set("arn", consumer.ConsumerARN) + d.Set("name", consumer.ConsumerName) + d.Set("status", consumer.ConsumerStatus) + d.Set("stream_arn", streamArn) + d.Set("creation_timestamp", aws.TimeValue(consumer.ConsumerCreationTimestamp).Format(time.RFC3339)) return nil } diff --git a/aws/data_source_aws_kinesis_stream_consumer_test.go b/aws/data_source_aws_kinesis_stream_consumer_test.go index d0a0e952b88..20c07c136de 100644 --- a/aws/data_source_aws_kinesis_stream_consumer_test.go +++ b/aws/data_source_aws_kinesis_stream_consumer_test.go @@ -4,32 +4,137 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccAWSKinesisStreamConsumerDataSource_basic(t *testing.T) { - var stream kinesis.StreamDescription - var consumer kinesis.ConsumerDescription - config := createAccKinesisStreamConsumerConfig() + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_kinesis_stream_consumer.test" + resourceName := "aws_kinesis_stream_consumer.test" + streamName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + CheckDestroy: nil, Steps: []resource.TestStep{ { - Config: config.data(), + Config: testAccAWSKinesisStreamConsumerDataSourceConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckKinesisStreamExists(config.stream.getName(), &stream), - testAccCheckKinesisStreamConsumerExists(config, -1, &consumer), - resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "arn"), - resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "stream_arn"), - resource.TestCheckResourceAttr(fmt.Sprintf("data.%s", config.getName()), "name", config.getConsumerName()), - resource.TestCheckResourceAttr(fmt.Sprintf("data.%s", config.getName()), "status", "ACTIVE"), - resource.TestCheckResourceAttrSet(fmt.Sprintf("data.%s", config.getName()), "creation_timestamp"), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(dataSourceName, "stream_arn", streamName, "arn"), + resource.TestCheckResourceAttrSet(dataSourceName, "creation_timestamp"), + resource.TestCheckResourceAttrSet(dataSourceName, "status"), ), }, }, }) } + +func TestAccAWSKinesisStreamConsumerDataSource_Name(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_kinesis_stream_consumer.test" + resourceName := "aws_kinesis_stream_consumer.test" + streamName := "aws_kinesis_stream.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSKinesisStreamConsumerDataSourceConfigName(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(dataSourceName, "stream_arn", streamName, "arn"), + resource.TestCheckResourceAttrSet(dataSourceName, "creation_timestamp"), + resource.TestCheckResourceAttrSet(dataSourceName, "status"), + ), + }, + }, + }) +} + +func TestAccAWSKinesisStreamConsumerDataSource_Arn(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_kinesis_stream_consumer.test" + resourceName := "aws_kinesis_stream_consumer.test" + streamName := "aws_kinesis_stream.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSKinesisStreamConsumerDataSourceConfigArn(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(dataSourceName, "stream_arn", streamName, "arn"), + resource.TestCheckResourceAttrSet(dataSourceName, "creation_timestamp"), + resource.TestCheckResourceAttrSet(dataSourceName, "status"), + ), + }, + }, + }) +} + +func testAccAWSKinesisStreamConsumerDataSourceBaseConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_kinesis_stream" "test" { + name = %q + shard_count = 2 +} +`, rName) +} + +func testAccAWSKinesisStreamConsumerDataSourceConfig(rName string) string { + return composeConfig( + testAccAWSKinesisStreamConsumerDataSourceBaseConfig(rName), + fmt.Sprintf(` +data "aws_kinesis_stream_consumer" "test" { + stream_arn = aws_kinesis_stream_consumer.test.stream_arn +} + +resource "aws_kinesis_stream_consumer" "test" { + name = %q + stream_arn = aws_kinesis_stream.test.arn +} +`, rName)) +} + +func testAccAWSKinesisStreamConsumerDataSourceConfigName(rName string) string { + return composeConfig( + testAccAWSKinesisStreamConsumerDataSourceBaseConfig(rName), + fmt.Sprintf(` +data "aws_kinesis_stream_consumer" "test" { + name = aws_kinesis_stream_consumer.test.name + stream_arn = aws_kinesis_stream_consumer.test.stream_arn +} + +resource "aws_kinesis_stream_consumer" "test" { + name = %q + stream_arn = aws_kinesis_stream.test.arn +} +`, rName)) +} + +func testAccAWSKinesisStreamConsumerDataSourceConfigArn(rName string) string { + return composeConfig( + testAccAWSKinesisStreamConsumerDataSourceBaseConfig(rName), + fmt.Sprintf(` +data "aws_kinesis_stream_consumer" "test" { + arn = aws_kinesis_stream_consumer.test.arn + stream_arn = aws_kinesis_stream_consumer.test.stream_arn +} + +resource "aws_kinesis_stream_consumer" "test" { + name = %q + stream_arn = aws_kinesis_stream.test.arn +} +`, rName)) +} diff --git a/aws/internal/service/kinesis/finder/finder.go b/aws/internal/service/kinesis/finder/finder.go new file mode 100644 index 00000000000..ac13b1b0d05 --- /dev/null +++ b/aws/internal/service/kinesis/finder/finder.go @@ -0,0 +1,25 @@ +package finder + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/kinesis" +) + +// StreamConsumerByARN returns the stream consumer corresponding to the specified ARN. +// Returns nil if no stream consumer is found. +func StreamConsumerByARN(conn *kinesis.Kinesis, arn string) (*kinesis.ConsumerDescription, error) { + input := &kinesis.DescribeStreamConsumerInput{ + ConsumerARN: aws.String(arn), + } + + output, err := conn.DescribeStreamConsumer(input) + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + return output.ConsumerDescription, nil +} diff --git a/aws/internal/service/kinesis/waiter/status.go b/aws/internal/service/kinesis/waiter/status.go new file mode 100644 index 00000000000..b8403ac6e27 --- /dev/null +++ b/aws/internal/service/kinesis/waiter/status.go @@ -0,0 +1,30 @@ +package waiter + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesis/finder" +) + +const ( + StreamConsumerStatusNotFound = "NotFound" + StreamConsumerStatusUnknown = "Unknown" +) + +// StreamConsumerStatus fetches the StreamConsumer and its Status +func StreamConsumerStatus(conn *kinesis.Kinesis, arn string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + consumer, err := finder.StreamConsumerByARN(conn, arn) + + if err != nil { + return nil, StreamConsumerStatusUnknown, err + } + + if consumer == nil { + return nil, StreamConsumerStatusNotFound, nil + } + + return consumer, aws.StringValue(consumer.ConsumerStatus), nil + } +} diff --git a/aws/internal/service/kinesis/waiter/waiter.go b/aws/internal/service/kinesis/waiter/waiter.go new file mode 100644 index 00000000000..1e3814bcd65 --- /dev/null +++ b/aws/internal/service/kinesis/waiter/waiter.go @@ -0,0 +1,49 @@ +package waiter + +import ( + "time" + + "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +const ( + StreamConsumerCreatedTimeout = 5 * time.Minute + StreamConsumerDeletedTimeout = 5 * time.Minute +) + +// StreamConsumerCreated waits for an Stream Consumer to return Active +func StreamConsumerCreated(conn *kinesis.Kinesis, arn string) (*kinesis.ConsumerDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{kinesis.ConsumerStatusCreating}, + Target: []string{kinesis.ConsumerStatusActive}, + Refresh: StreamConsumerStatus(conn, arn), + Timeout: StreamConsumerCreatedTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if v, ok := outputRaw.(*kinesis.ConsumerDescription); ok { + return v, err + } + + return nil, err +} + +// StreamConsumerDeleted waits for a Stream Consumer to be deleted +func StreamConsumerDeleted(conn *kinesis.Kinesis, arn string) (*kinesis.ConsumerDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{kinesis.ConsumerStatusDeleting}, + Target: []string{}, + Refresh: StreamConsumerStatus(conn, arn), + Timeout: StreamConsumerDeletedTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if v, ok := outputRaw.(*kinesis.ConsumerDescription); ok { + return v, err + } + + return nil, err +} diff --git a/aws/resource_aws_kinesis_stream_consumer.go b/aws/resource_aws_kinesis_stream_consumer.go index 9dc34e75147..cefb1202ac6 100644 --- a/aws/resource_aws_kinesis_stream_consumer.go +++ b/aws/resource_aws_kinesis_stream_consumer.go @@ -3,15 +3,14 @@ package aws import ( "fmt" "log" - "regexp" - "strings" "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/kinesis" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesis/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/kinesis/waiter" ) func resourceAwsKinesisStreamConsumer() *schema.Resource { @@ -20,39 +19,32 @@ func resourceAwsKinesisStreamConsumer() *schema.Resource { Read: resourceAwsKinesisStreamConsumerRead, Delete: resourceAwsKinesisStreamConsumerDelete, - Timeouts: &schema.ResourceTimeout{ - Create: schema.DefaultTimeout(5 * time.Minute), - Delete: schema.DefaultTimeout(120 * time.Minute), - }, - Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - importParts, err := validateResourceAwsKinesisStreamConsumerImportString(d.Id()) - if err != nil { - return nil, err - } - d.Set("name", importParts[0]) - d.Set("stream_arn", importParts[1]) - return []*schema.ResourceData{d}, nil - }, + State: schema.ImportStatePassthrough, }, Schema: map[string]*schema.Schema{ - "name": { + "arn": { Type: schema.TypeString, - Required: true, - ForceNew: true, + Computed: true, }, - "stream_arn": { + "creation_timestamp": { + Type: schema.TypeString, + Computed: true, + }, + + "name": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "arn": { - Type: schema.TypeString, - Computed: true, + "stream_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateArn, }, }, } @@ -60,39 +52,28 @@ func resourceAwsKinesisStreamConsumer() *schema.Resource { func resourceAwsKinesisStreamConsumerCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kinesisconn - cn := d.Get("name").(string) - sa := d.Get("stream_arn").(string) - createOpts := &kinesis.RegisterStreamConsumerInput{ - ConsumerName: aws.String(cn), - StreamARN: aws.String(sa), + name := d.Get("name").(string) + streamArn := d.Get("stream_arn").(string) + + input := &kinesis.RegisterStreamConsumerInput{ + ConsumerName: aws.String(name), + StreamARN: aws.String(streamArn), } - createOutput, err := conn.RegisterStreamConsumer(createOpts) + output, err := conn.RegisterStreamConsumer(input) if err != nil { - return fmt.Errorf("Unable to create stream consumer: %s", err) + return fmt.Errorf("error creating Kinesis Stream Consumer (%s): %w", name, err) } - arn := aws.StringValue(createOutput.Consumer.ConsumerARN) - - d.SetId(arn) - d.Set("arn", arn) - - // No error, wait for ACTIVE state - stateConf := &resource.StateChangeConf{ - Pending: []string{"CREATING"}, - Target: []string{"ACTIVE"}, - Refresh: streamConsumerStateRefreshFunc(conn, cn, sa), - Timeout: d.Timeout(schema.TimeoutCreate), - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, + if output == nil || output.Consumer == nil { + return fmt.Errorf("error creating Kinesis Stream Consumer (%s): empty output", name) } - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Kinesis Stream Consumer (%s) to become active: %s", - cn, err) + d.SetId(aws.StringValue(output.Consumer.ConsumerARN)) + + if _, err := waiter.StreamConsumerCreated(conn, d.Id()); err != nil { + return fmt.Errorf("error waiting for Kinesis Stream Consumer (%s) creation: %w", d.Id(), err) } return resourceAwsKinesisStreamConsumerRead(d, meta) @@ -100,130 +81,58 @@ func resourceAwsKinesisStreamConsumerCreate(d *schema.ResourceData, meta interfa func resourceAwsKinesisStreamConsumerRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kinesisconn - cn := d.Get("name").(string) - sa := d.Get("stream_arn").(string) - state, err := readKinesisStreamConsumerState(conn, cn, sa) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] Kinesis Stream Consumer (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error reading Kinesis Stream Consumer: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) - } - return err + consumer, err := finder.StreamConsumerByARN(conn, d.Id()) + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, kinesis.ErrCodeResourceNotFoundException) { + log.Printf("[WARN] Kinesis Stream Consumer (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } - d.SetId(state.arn) - d.Set("arn", state.arn) - return nil -} -func resourceAwsKinesisStreamConsumerDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).kinesisconn - cn := d.Get("name").(string) - sa := d.Get("stream_arn").(string) - - log.Printf("[DEBUG] Deregister Stream Consumer: %s", cn) - _, err := conn.DeregisterStreamConsumer(&kinesis.DeregisterStreamConsumerInput{ - ConsumerName: aws.String(cn), - StreamARN: aws.String(sa), - }) if err != nil { - // Missing Stream Consumer or Stream (API error) - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - log.Printf("[WARN] No Stream Consumer found: %v", cn) - return nil - } - } - return err + return fmt.Errorf("error reading Kinesis Stream Consumer (%s): %w", d.Id(), err) } - stateConf := &resource.StateChangeConf{ - Pending: []string{"DELETING"}, - Target: []string{"DESTROYED"}, - Refresh: streamConsumerStateRefreshFunc(conn, cn, sa), - Timeout: d.Timeout(schema.TimeoutDelete), - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, + if consumer == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading Kinesis Stream Consumer (%s): empty output after creation", d.Id()) + } + log.Printf("[WARN] Kinesis Stream Consumer (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf( - "Error waiting for Stream Consumer (%s) to be destroyed: %s", - cn, err) - } + d.Set("arn", consumer.ConsumerARN) + d.Set("name", consumer.ConsumerName) + d.Set("creation_timestamp", aws.TimeValue(consumer.ConsumerCreationTimestamp).Format(time.RFC3339)) + d.Set("stream_arn", consumer.StreamARN) return nil } -type kinesisStreamConsumerState struct { - arn string - streamArn string - creationTimestamp int64 - status string -} - -func validateResourceAwsKinesisStreamConsumerImportString(importStr string) ([]string, error) { - // example: my_consumer@arn:aws:kinesis:us-west-2:123456789012:stream/my-stream - importParts := strings.Split(strings.ToLower(importStr), "@") - errStr := "unexpected format of import string (%q), expected @: %s" - if len(importParts) != 2 { - return nil, fmt.Errorf(errStr, importStr, "invalid no. of parts") - } - - consumerName := importParts[0] - streamArn := importParts[1] - - consumerNameRe := regexp.MustCompile(`(^[a-zA-Z0-9_.-]+$)`) - streamArnRe := regexp.MustCompile(`arn:aws.*:kinesis:.*:\d{12}:stream/.+`) - - if !consumerNameRe.MatchString(consumerName) { - return nil, fmt.Errorf(errStr, importStr, "invalid consumer name") - } +func resourceAwsKinesisStreamConsumerDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).kinesisconn - if !streamArnRe.MatchString(streamArn) { - return nil, fmt.Errorf(errStr, importStr, "invalid stream arn") + input := &kinesis.DeregisterStreamConsumerInput{ + ConsumerARN: aws.String(d.Id()), } - return importParts, nil -} + _, err := conn.DeregisterStreamConsumer(input) -func readKinesisStreamConsumerState(conn *kinesis.Kinesis, cn string, sa string) (*kinesisStreamConsumerState, error) { - input := &kinesis.DescribeStreamConsumerInput{ - ConsumerName: aws.String(cn), - StreamARN: aws.String(sa), - } - - state := &kinesisStreamConsumerState{} - response, err := conn.DescribeStreamConsumer(input) - if err == nil { - state.arn = aws.StringValue(response.ConsumerDescription.ConsumerARN) - state.streamArn = aws.StringValue(response.ConsumerDescription.StreamARN) - state.creationTimestamp = aws.TimeValue(response.ConsumerDescription.ConsumerCreationTimestamp).Unix() - state.status = aws.StringValue(response.ConsumerDescription.ConsumerStatus) + if err != nil { + if tfawserr.ErrCodeEquals(err, kinesis.ErrCodeResourceNotFoundException) { + return nil + } + return fmt.Errorf("error deleting Kinesis Stream Consumer (%s): %w", d.Id(), err) } - return state, err -} - -func streamConsumerStateRefreshFunc(conn *kinesis.Kinesis, cn string, sa string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - state, err := readKinesisStreamConsumerState(conn, cn, sa) - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return 42, "DESTROYED", nil - } - return nil, awsErr.Code(), err - } - return nil, "failed", err + if _, err := waiter.StreamConsumerDeleted(conn, d.Id()); err != nil { + if tfawserr.ErrCodeEquals(err, kinesis.ErrCodeResourceNotFoundException) { + return nil } - - return state, state.status, nil + return fmt.Errorf("error waiting for Kinesis Stream Consumer (%s) deletion: %w", d.Id(), err) } + + return nil } diff --git a/aws/resource_aws_kinesis_stream_consumer_test.go b/aws/resource_aws_kinesis_stream_consumer_test.go index 518b9534586..16818dba9ed 100644 --- a/aws/resource_aws_kinesis_stream_consumer_test.go +++ b/aws/resource_aws_kinesis_stream_consumer_test.go @@ -2,38 +2,39 @@ package aws import ( "fmt" - "strings" + "regexp" "testing" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/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/terraform-providers/terraform-provider-aws/aws/internal/service/kinesis/finder" ) func TestAccAWSKinesisStreamConsumer_basic(t *testing.T) { - var stream kinesis.StreamDescription - var consumer kinesis.ConsumerDescription - config := createAccKinesisStreamConsumerConfig() - resourceName := config.getName() + resourceName := "aws_kinesis_stream_consumer.test" + streamName := "aws_kinesis_stream.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, Steps: []resource.TestStep{ { - Config: config.single(), + Config: testAccAWSKinesisStreamConsumerConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckKinesisStreamExists(config.stream.getName(), &stream), - testAccCheckKinesisStreamConsumerExists(config, -1, &consumer), - testAccCheckAWSKinesisStreamConsumerAttributes(config, &consumer), + testAccAWSKinesisStreamConsumerExists(resourceName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "kinesis", regexp.MustCompile(fmt.Sprintf("stream/%[1]s/consumer/%[1]s", rName))), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrPair(resourceName, "stream_arn", streamName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "creation_timestamp"), ), }, { ResourceName: resourceName, - ImportStateIdFunc: testAccKinesisStreamConsumerImportStateIdFunc(config), ImportState: true, ImportStateVerify: true, }, @@ -41,218 +42,162 @@ func TestAccAWSKinesisStreamConsumer_basic(t *testing.T) { }) } -func testAccKinesisStreamConsumerImportStateIdFunc(config *accKinesisStreamConsumerConfig) resource.ImportStateIdFunc { - return func(s *terraform.State) (string, error) { - return fmt.Sprintf("%s@arn:aws:kinesis:%s:%s:stream/%s", config.getConsumerName(), testAccGetRegion(), testAccGetAccountID(), config.stream.getStreamName()), nil //lintignore:AWSAT005 - } -} +func TestAccAWSKinesisStreamConsumer_disappears(t *testing.T) { + resourceName := "aws_kinesis_stream_consumer.test" + rName := acctest.RandomWithPrefix("tf-acc-test") -func TestAccAWSKinesisStreamConsumer_createMultipleConcurrentStreamConsumers(t *testing.T) { - var stream kinesis.StreamDescription - var consumer kinesis.ConsumerDescription - config := createAccKinesisStreamConsumerConfig() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSKinesisStreamConsumerConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccAWSKinesisStreamConsumerExists(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsKinesisStreamConsumer(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} - var checkFunctions []resource.TestCheckFunc +func TestAccAWSKinesisStreamConsumer_MaxConcurrentConsumers(t *testing.T) { + resourceName := "aws_kinesis_stream_consumer.test" + rName := acctest.RandomWithPrefix("tf-acc-test") - checkFunctions = append( - checkFunctions, - testAccCheckKinesisStreamExists(config.stream.getName(), &stream)) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, + Steps: []resource.TestStep{ + { + // Test creation of max number (5 according to AWS API docs) of concurrent consumers for a single stream + Config: testAccAWSKinesisStreamConsumerConfig_multiple(rName, 5), + Check: resource.ComposeTestCheckFunc( + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.0", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.1", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.2", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.3", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.4", resourceName)), + ), + }, + }, + }) +} - for i := 0; i < config.count; i++ { - checkFunctions = append( - checkFunctions, - testAccCheckKinesisStreamConsumerExists(config, i, &consumer)) - } +func TestAccAWSKinesisStreamConsumer_ExceedMaxConcurrentConsumers(t *testing.T) { + resourceName := "aws_kinesis_stream_consumer.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckKinesisStreamConsumerDestroy, + CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, Steps: []resource.TestStep{ { - Config: config.multiple(), - Check: resource.ComposeTestCheckFunc(checkFunctions...), + // Test creation of more than the max number (5 according to AWS API docs) of concurrent consumers for a single stream + Config: testAccAWSKinesisStreamConsumerConfig_multiple(rName, 10), + Check: resource.ComposeTestCheckFunc( + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.0", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.1", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.2", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.3", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.4", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.5", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.6", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.7", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.8", resourceName)), + testAccAWSKinesisStreamConsumerExists(fmt.Sprintf("%s.9", resourceName)), + ), }, }, }) } -func testAccCheckKinesisStreamConsumerExists(c *accKinesisStreamConsumerConfig, - index int, consumer *kinesis.ConsumerDescription) resource.TestCheckFunc { - var resourceName string - if index > -1 { - resourceName = c.getIndexedName(index) - } else { - resourceName = c.getName() - } +func testAccCheckAWSKinesisStreamConsumerDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).kinesisconn - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[resourceName] - if !ok { - return fmt.Errorf("Not found: %s", resourceName) + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_kinesis_stream_consumer" { + continue } - if rs.Primary.ID == "" { - return fmt.Errorf("No Kinesis Stream Consumer ID is set") - } + consumer, err := finder.StreamConsumerByARN(conn, rs.Primary.ID) - conn := testAccProvider.Meta().(*AWSClient).kinesisconn - describeOpts := &kinesis.DescribeStreamConsumerInput{ - ConsumerName: aws.String(rs.Primary.Attributes["name"]), - StreamARN: aws.String(rs.Primary.Attributes["stream_arn"]), + if tfawserr.ErrCodeEquals(err, kinesis.ErrCodeResourceNotFoundException) { + continue } - resp, err := conn.DescribeStreamConsumer(describeOpts) + if err != nil { - return err + return fmt.Errorf("error reading Kinesis Stream Consumer (%s): %w", rs.Primary.ID, err) } - *consumer = *resp.ConsumerDescription - - return nil + if consumer != nil { + return fmt.Errorf("Kinesis Stream Consumer (%s) still exists", rs.Primary.ID) + } } + + return nil } -func testAccCheckAWSKinesisStreamConsumerAttributes( - c *accKinesisStreamConsumerConfig, consumer *kinesis.ConsumerDescription) resource.TestCheckFunc { +func testAccAWSKinesisStreamConsumerExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { - if !strings.HasPrefix(*consumer.ConsumerName, c.getConsumerName()) { - return fmt.Errorf("Bad Stream Consumer name: %s", *consumer.ConsumerName) - } - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_kinesis_stream_consumer" { - continue - } + rs, ok := s.RootModule().Resources[resourceName] - if *consumer.ConsumerARN != rs.Primary.Attributes["arn"] { - return fmt.Errorf("Bad Stream Consumer(%s) ARN\n\t expected: %s\n\tgot: %s\n", rs.Type, rs.Primary.Attributes["arn"], *consumer.ConsumerARN) - } + if !ok { + return fmt.Errorf("resource %s not found", resourceName) } - return nil - } -} -func testAccCheckKinesisStreamConsumerDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_kinesis_stream_consumer" { - continue + if rs.Primary.ID == "" { + return fmt.Errorf("resource %s has not set its id", resourceName) } + conn := testAccProvider.Meta().(*AWSClient).kinesisconn - describeOpts := &kinesis.DescribeStreamConsumerInput{ - ConsumerName: aws.String(rs.Primary.Attributes["name"]), - StreamARN: aws.String(rs.Primary.Attributes["stream_arn"]), + + consumer, err := finder.StreamConsumerByARN(conn, rs.Primary.ID) + + if err != nil { + return fmt.Errorf("error reading Kinesis Stream Consumer (%s): %w", rs.Primary.ID, err) } - resp, err := conn.DescribeStreamConsumer(describeOpts) - if err == nil { - if resp.ConsumerDescription != nil && *resp.ConsumerDescription.ConsumerStatus != "DELETING" { - return fmt.Errorf("Error: Stream Consumer still exists") - } + + if consumer == nil { + return fmt.Errorf("Kinesis Stream Consumer (%s) not found", rs.Primary.ID) } return nil - } - - return nil -} - -type accKinesisStreamConfig struct { - resourceType string - resourceLocalName string - streamBasename string - randInt int } -func (r *accKinesisStreamConfig) getName() string { - return fmt.Sprintf("%s.%s", r.resourceType, r.resourceLocalName) -} - -func (r *accKinesisStreamConfig) getStreamName() string { - return fmt.Sprintf("%s-%d", r.streamBasename, r.randInt) -} - -func (r *accKinesisStreamConfig) single() string { - +func testAccAWSKinesisStreamConsumerBaseConfig(rName string) string { return fmt.Sprintf(` -resource "%s" "%s" { - name = "%s" - shard_count = 2 - enforce_consumer_deletion = true - - tags = { - Name = "tf-test" - } -}`, r.resourceType, r.resourceLocalName, r.getStreamName()) -} - -type accKinesisStreamConsumerConfig struct { - stream *accKinesisStreamConfig - resourceType string - resourceLocalName string - consumerBasename string - count int - randInt int +resource "aws_kinesis_stream" "test" { + name = %q + shard_count = 2 } - -func (r *accKinesisStreamConsumerConfig) getName() string { - return fmt.Sprintf("%s.%s", r.resourceType, r.resourceLocalName) -} - -func (r *accKinesisStreamConsumerConfig) getIndexedName(index int) string { - return fmt.Sprintf("%s.%s.%d", r.resourceType, r.resourceLocalName, index) -} - -func (r *accKinesisStreamConsumerConfig) getConsumerName() string { - return fmt.Sprintf("%s-%d", r.consumerBasename, r.randInt) -} - -func (r *accKinesisStreamConsumerConfig) data() string { - return fmt.Sprintf(` -%s - -data "%s" "%s" { - name = "${%s.name}" - stream_arn = "${%s.arn}" -}`, r.single(), r.resourceType, r.resourceLocalName, r.getName(), r.stream.getName()) +`, rName) } -func (r *accKinesisStreamConsumerConfig) single() string { - - return fmt.Sprintf(` -%s - -resource "%s" "%s" { - name = "%s" - stream_arn = "${%s.arn}" +func testAccAWSKinesisStreamConsumerConfig_basic(rName string) string { + return composeConfig( + testAccAWSKinesisStreamConsumerBaseConfig(rName), + fmt.Sprintf(` +resource "aws_kinesis_stream_consumer" "test" { + name = %q + stream_arn = aws_kinesis_stream.test.arn } - -`, r.stream.single(), r.resourceType, r.resourceLocalName, r.getConsumerName(), r.stream.getName()) +`, rName)) } -func (r *accKinesisStreamConsumerConfig) multiple() string { - - return fmt.Sprintf(` -%s - -resource "%s" "%s" { - count = %d - name = "%s-${count.index}" - stream_arn = "${%s.arn}" -}`, r.stream.single(), r.resourceType, r.resourceLocalName, r.count, r.getConsumerName(), r.stream.getName()) +func testAccAWSKinesisStreamConsumerConfig_multiple(rName string, count int) string { + return composeConfig( + testAccAWSKinesisStreamConsumerBaseConfig(rName), + fmt.Sprintf(` +resource "aws_kinesis_stream_consumer" "test" { + count = %d + name = "%s-${count.index}" + stream_arn = aws_kinesis_stream.test.arn } - -func createAccKinesisStreamConsumerConfig() *accKinesisStreamConsumerConfig { - iRnd := acctest.RandInt() - return &accKinesisStreamConsumerConfig{ - stream: &accKinesisStreamConfig{ - resourceType: "aws_kinesis_stream", - resourceLocalName: "test_stream", - streamBasename: "terraform-kinesis-stream-test", - randInt: iRnd, - }, - resourceType: "aws_kinesis_stream_consumer", - resourceLocalName: "test_stream_consumer", - consumerBasename: "terraform-kinesis-stream-consumer-test", - count: 2, - randInt: iRnd, - } +`, count, rName)) } diff --git a/aws/resource_aws_kinesis_stream_test.go b/aws/resource_aws_kinesis_stream_test.go index f080ad624ae..16623fc4c51 100644 --- a/aws/resource_aws_kinesis_stream_test.go +++ b/aws/resource_aws_kinesis_stream_test.go @@ -33,23 +33,20 @@ func testSweepKinesisStreams(region string) error { var sweeperErrs *multierror.Error err = conn.ListStreamsPages(input, func(page *kinesis.ListStreamsOutput, lastPage bool) bool { - for _, streamNamePtr := range page.StreamNames { - if streamNamePtr == nil { + for _, streamName := range page.StreamNames { + if streamName == nil { continue } - streamName := aws.StringValue(streamNamePtr) - input := &kinesis.DeleteStreamInput{ - EnforceConsumerDeletion: aws.Bool(false), - StreamName: streamNamePtr, - } - - log.Printf("[INFO] Deleting Kinesis Stream: %s", streamName) + r := resourceAwsKinesisStream() + d := r.Data(nil) + d.Set("name", streamName) + d.Set("enforce_consumer_deletion", true) - _, err := conn.DeleteStream(input) + err := r.Delete(d, client) if err != nil { - sweeperErr := fmt.Errorf("error deleting Kinesis Stream (%s): %w", streamName, err) + sweeperErr := fmt.Errorf("error deleting Kinesis Stream (%s): %w", aws.StringValue(streamName), err) log.Printf("[ERROR] %s", sweeperErr) sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) } diff --git a/website/aws.erb b/website/aws.erb deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/website/docs/d/kinesis_stream_consumer.html.markdown b/website/docs/d/kinesis_stream_consumer.html.markdown index c7442ed3fcf..eec1bd5acf6 100644 --- a/website/docs/d/kinesis_stream_consumer.html.markdown +++ b/website/docs/d/kinesis_stream_consumer.html.markdown @@ -3,39 +3,36 @@ subcategory: "Kinesis" layout: "aws" page_title: "AWS: aws_kinesis_stream_consumer" description: |- - Provides a Kinesis Stream Consumer data source. + Provides details about a Kinesis Stream Consumer. --- # Data Source: aws_kinesis_stream_consumer -Use this data source to get information about a Kinesis Stream Consumer for use in other -resources. +Provides details about a Kinesis Stream Consumer. For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. ## Example Usage ```hcl -data "aws_kinesis_stream_consumer" "stream_consumer" { - name = "stream-consumer-name" - stream_arn = aws_kinesis_stream.stream.arn +data "aws_kinesis_stream_consumer" "example" { + name = "example-consumer" + stream_arn = aws_kinesis_stream.example.arn } ``` ## Argument Reference -* `name` - (Required) The name of the Kinesis Stream Consumer. -* `stream_arn` - (Required) The Amazon Resource Name (ARN) of the Kinesis Stream. +* `arn` - (Optional) Amazon Resource Name (ARN) of the stream consumer. +* `name` - (Optional) Name of the stream consumer. +* `stream_arn` - (Required) Amazon Resource Name (ARN) of the data stream the consumer is registered with. ## Attributes Reference -`id` is set to the Amazon Resource Name (ARN) of the Kinesis Stream Consumer. In addition, the following attributes -are exported: +In addition to all arguments above, the following attributes are exported: -* `arn` - The Amazon Resource Name (ARN) of the Kinesis Stream Consumer (same as id). -* `name` - The name of the Kinesis Stream Consumer. -* `creation_timestamp` - The approximate UNIX timestamp that the stream consumer was created. -* `status` - The current status of the stream consumer. The stream status is one of CREATING, DELETING, ACTIVE, or UPDATING. -* `stream_arn` - The Amazon Resource Name (ARN) of the Kinesis Stream. +* `creation_timestamp` - Approximate timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of when the stream consumer was created. +* `id` - Amazon Resource Name (ARN) of the stream consumer. +* `status` - The current status of the stream consumer. -[1]: https://docs.aws.amazon.com/streams/latest/dev/introduction-to-enhanced-consumers.html +[1]: https://docs.aws.amazon.com/streams/latest/dev/amazon-kinesis-consumers.html diff --git a/website/docs/r/kinesis_stream_consumer.html.markdown b/website/docs/r/kinesis_stream_consumer.html.markdown index e379a290772..dd204b1e6bb 100644 --- a/website/docs/r/kinesis_stream_consumer.html.markdown +++ b/website/docs/r/kinesis_stream_consumer.html.markdown @@ -3,36 +3,28 @@ subcategory: "Kinesis" layout: "aws" page_title: "AWS: aws_kinesis_stream_consumer" description: |- - Provides a AWS Kinesis Stream Consumer + Manages a Kinesis Stream Consumer. --- -# aws_kinesis_stream_consumer +# Resource: aws_kinesis_stream_consumer -Provides a Kinesis Stream Consumer resource. A consumer is an application that processes all data from a Kinesis data stream. -When a consumer uses enhanced fan-out, it gets its own 2 MiB/sec allotment of read throughput, allowing multiple consumers to -read data from the same stream in parallel, without contending for read throughput with other consumers. [Reading Data from Kinesis][1] +Provides a resource to manage a Kinesis Stream Consumer. -You can register up to 20 consumers per stream. However, you can request a limit increase using the [Kinesis Data Streams limits form][2]. A given consumer can only be registered with one stream at a time. +-> **Note:** You can register up to 20 consumers per stream. A given consumer can only be registered with one stream at a time. -For more details, see the [Amazon Kinesis Stream Consumer Documentation][3]. +For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. ## Example Usage ```hcl -resource "aws_kinesis_stream" "test_stream" { - name = "terraform-kinesis-test" +resource "aws_kinesis_stream" "example" { + name = "example-stream" shard_count = 1 } -resource "aws_lambda_event_source_mapping" "example" { - event_source_arn = aws_kinesis_stream_consumer.test_stream_consumer.arn - function_name = aws_lambda_function.example.arn - starting_position = "LATEST" -} - -resource "aws_kinesis_stream_consumer" "test_stream_consumer" { - name = "terraform-kinesis-stream-consumer-test" - stream_arn = aws_kinesis_stream.test_stream.arn +resource "aws_kinesis_stream_consumer" "example" { + name = "example-consumer" + stream_arn = aws_kinesis_stream.example.arn } ``` @@ -40,29 +32,23 @@ resource "aws_kinesis_stream_consumer" "test_stream_consumer" { The following arguments are supported: -* `name` - (Required) A name to identify the stream. This is unique to the -AWS account and region the Stream Consumer is created in. -* `stream_arn` – (Required) The Amazon Resource Name (ARN) of the Kinesis Stream, the Consumer is connected to. +* `name` - (Required, Forces new resource) Name of the stream consumer. +* `stream_arn` – (Required, Forces new resource) Amazon Resource Name (ARN) of the data stream the consumer is registered with. ## Attributes Reference -* `id` - The unique Stream Consumer id -* `name` - The unique Stream Consumer name -* `arn` - The Amazon Resource Name (ARN) specifying the Stream Consumer (same as `id`) - -## Timeouts +In addition to all arguments above, the following attributes are exported: -`aws_kinesis_stream_consumer` provides the following [Timeouts](/docs/configuration/resources.html#timeouts) configuration options: +* `arn` - Amazon Resource Name (ARN) of the stream consumer. +* `creation_timestamp` - Approximate timestamp in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) of when the stream consumer was created. +* `id` - Amazon Resource Name (ARN) of the stream consumer. -- `create` - (Default `5 minutes`) Used for Creating a Kinesis Stream Consumer -- `delete` - (Default `120 minutes`) Used for Destroying a Kinesis Stream Consumer +## Import -Kinesis Streams can be imported using the `name@stream_arn`, e.g. +Kinesis Stream Consumers can be imported using the Amazon Resource Name (ARN) e.g. ``` -$ terraform import aws_kinesis_stream_consumer.test_stream_consumer terraform-kinesis-stream-consumer-test@arn:aws:kinesis:us-west-2:123456789012:stream/my-stream +$ terraform import aws_kinesis_stream_consumer.example arn:aws:kinesis:us-west-2:123456789012:stream/example/consumer/example:1616044553 ``` -[1]: https://docs.aws.amazon.com/streams/latest/dev/building-consumers.html -[2]: https://console.aws.amazon.com/support/v1?#/ -[3]: https://docs.aws.amazon.com/streams/latest/dev/introduction-to-enhanced-consumers.html +[1]: https://docs.aws.amazon.com/streams/latest/dev/amazon-kinesis-consumers.html \ No newline at end of file From 49049b88233712ab013ac830bc2bbabe51fc7f34 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:08:18 -0400 Subject: [PATCH 0266/1252] tests/r/db_proxy_target: Add ErrorCheck --- aws/resource_aws_db_proxy_target_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_db_proxy_target_test.go b/aws/resource_aws_db_proxy_target_test.go index 23dc928561b..3f584bae529 100644 --- a/aws/resource_aws_db_proxy_target_test.go +++ b/aws/resource_aws_db_proxy_target_test.go @@ -19,6 +19,7 @@ func TestAccAWSDBProxyTarget_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSDBProxyTarget_Cluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetDestroy, Steps: []resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccAWSDBProxyTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyTargetDestroy, Steps: []resource.TestStep{ From bdbc6326affc3f5413bbd0c6fa7f0c3674e691b5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:08:40 -0400 Subject: [PATCH 0267/1252] tests/r/db_proxy: Add ErrorCheck --- aws/resource_aws_db_proxy_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_db_proxy_test.go b/aws/resource_aws_db_proxy_test.go index 95af3ccef75..ad09d0487b5 100644 --- a/aws/resource_aws_db_proxy_test.go +++ b/aws/resource_aws_db_proxy_test.go @@ -70,6 +70,7 @@ func TestAccAWSDBProxy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSDBProxy_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -145,6 +147,7 @@ func TestAccAWSDBProxy_DebugLogging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -178,6 +181,7 @@ func TestAccAWSDBProxy_IdleClientTimeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -211,6 +215,7 @@ func TestAccAWSDBProxy_RequireTls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -245,6 +250,7 @@ func TestAccAWSDBProxy_RoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -279,6 +285,7 @@ func TestAccAWSDBProxy_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -315,6 +322,7 @@ func TestAccAWSDBProxy_AuthDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -349,6 +357,7 @@ func TestAccAWSDBProxy_AuthIamAuth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -383,6 +392,7 @@ func TestAccAWSDBProxy_AuthSecretArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -418,6 +428,7 @@ func TestAccAWSDBProxy_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ @@ -450,6 +461,7 @@ func TestAccAWSDBProxy_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccDBProxyPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBProxyDestroy, Steps: []resource.TestStep{ From ff3c0b7436948061de39f8fb95a68aa79a053422 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:09:17 -0400 Subject: [PATCH 0268/1252] tests/r/db_security_group: Add ErrorCheck --- aws/resource_aws_db_security_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_db_security_group_test.go b/aws/resource_aws_db_security_group_test.go index a23192e6a36..ff00941815a 100644 --- a/aws/resource_aws_db_security_group_test.go +++ b/aws/resource_aws_db_security_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSDBSecurityGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSDBSecurityGroupDestroy, Steps: []resource.TestStep{ From 389a00bcbe33f6e3ccfeea280606698f8fe986ee Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:10:41 -0400 Subject: [PATCH 0269/1252] tests/r/db_snapshot: Add ErrorCheck --- aws/resource_aws_db_snapshot_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_db_snapshot_test.go b/aws/resource_aws_db_snapshot_test.go index 2b1d785c502..568daecd11a 100644 --- a/aws/resource_aws_db_snapshot_test.go +++ b/aws/resource_aws_db_snapshot_test.go @@ -91,6 +91,7 @@ func TestAccAWSDBSnapshot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDbSnapshotDestroy, Steps: []resource.TestStep{ @@ -118,6 +119,7 @@ func TestAccAWSDBSnapshot_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDbSnapshotDestroy, Steps: []resource.TestStep{ @@ -162,6 +164,7 @@ func TestAccAWSDBSnapshot_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDbSnapshotDestroy, Steps: []resource.TestStep{ From 2c43b09d158fb6e2cfca86f8f5f3eda36782b864 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:11:04 -0400 Subject: [PATCH 0270/1252] tests/r/db_subnet_group: Add ErrorCheck --- aws/resource_aws_db_subnet_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_db_subnet_group_test.go b/aws/resource_aws_db_subnet_group_test.go index f9155622148..58bde9beef2 100644 --- a/aws/resource_aws_db_subnet_group_test.go +++ b/aws/resource_aws_db_subnet_group_test.go @@ -72,6 +72,7 @@ func TestAccAWSDBSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -100,6 +101,7 @@ func TestAccAWSDBSubnetGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -120,6 +122,7 @@ func TestAccAWSDBSubnetGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -145,6 +148,7 @@ func TestAccAWSDBSubnetGroup_withUndocumentedCharacters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -174,6 +178,7 @@ func TestAccAWSDBSubnetGroup_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDBSubnetGroupDestroy, Steps: []resource.TestStep{ From a3964c1acd814048ab522261684ef26498b998d0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:11:31 -0400 Subject: [PATCH 0271/1252] tests/r/rds_cluster_endpoint: Add ErrorCheck --- aws/resource_aws_rds_cluster_endpoint_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_rds_cluster_endpoint_test.go b/aws/resource_aws_rds_cluster_endpoint_test.go index f4daa296078..8b750576978 100644 --- a/aws/resource_aws_rds_cluster_endpoint_test.go +++ b/aws/resource_aws_rds_cluster_endpoint_test.go @@ -24,6 +24,7 @@ func TestAccAWSRDSClusterEndpoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterEndpointDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func TestAccAWSRDSClusterEndpoint_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterEndpointDestroy, Steps: []resource.TestStep{ @@ -170,6 +172,7 @@ func testAccCheckAWSClusterEndpointDestroyWithProvider(s *terraform.State, provi return nil } + func testAccCheckAWSRDSClusterEndpointExists(resourceName string, endpoint *rds.DBClusterEndpoint) resource.TestCheckFunc { return testAccCheckAWSRDSClusterEndpointExistsWithProvider(resourceName, endpoint, testAccProvider) } From 4dfb029188f5af938ae3f7f935be412f25e9800e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:11:54 -0400 Subject: [PATCH 0272/1252] tests/r/rds_cluster_instance: Add ErrorCheck --- aws/resource_aws_rds_cluster_instance_test.go | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aws/resource_aws_rds_cluster_instance_test.go b/aws/resource_aws_rds_cluster_instance_test.go index 74400d149ae..1edc28ebe52 100644 --- a/aws/resource_aws_rds_cluster_instance_test.go +++ b/aws/resource_aws_rds_cluster_instance_test.go @@ -21,6 +21,7 @@ func TestAccAWSRDSClusterInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -68,6 +69,7 @@ func TestAccAWSRDSClusterInstance_isAlreadyBeingDeleted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -104,6 +106,7 @@ func TestAccAWSRDSClusterInstance_az(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -135,6 +138,7 @@ func TestAccAWSRDSClusterInstance_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -166,6 +170,7 @@ func TestAccAWSRDSClusterInstance_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -197,6 +202,7 @@ func TestAccAWSRDSClusterInstance_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -227,6 +233,7 @@ func TestAccAWSRDSClusterInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -250,6 +257,7 @@ func TestAccAWSRDSClusterInstance_PubliclyAccessible(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -287,6 +295,7 @@ func TestAccAWSRDSClusterInstance_CopyTagsToSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -397,6 +406,7 @@ func TestAccAWSRDSClusterInstance_MonitoringInterval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -449,6 +459,7 @@ func TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToDisabled(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -487,6 +498,7 @@ func TestAccAWSRDSClusterInstance_MonitoringRoleArn_EnabledToRemoved(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -524,6 +536,7 @@ func TestAccAWSRDSClusterInstance_MonitoringRoleArn_RemovedToEnabled(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -561,6 +574,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql1(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -593,6 +607,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraMysql2(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsPreCheck(t, engine, engineVersion) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -624,6 +639,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsEnabled_AuroraPostgresql(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -656,6 +672,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -688,6 +705,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql1_Defau resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -725,6 +743,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsPreCheck(t, engine, engineVersion) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -758,6 +777,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraMysql2_Defau resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsPreCheck(t, engine, engineVersion) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -794,6 +814,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -826,6 +847,7 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql_D resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRDSPerformanceInsightsDefaultVersionPreCheck(t, engine) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -861,6 +883,7 @@ func TestAccAWSRDSClusterInstance_CACertificateIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ From 4af80b2ffeadf563ec51c79aee71d32a86a185c2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:12:12 -0400 Subject: [PATCH 0273/1252] tests/r/rds_cluster_parameter_group: Add ErrorCheck --- aws/resource_aws_rds_cluster_parameter_group_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_rds_cluster_parameter_group_test.go b/aws/resource_aws_rds_cluster_parameter_group_test.go index b79393341f7..7978f96bb4e 100644 --- a/aws/resource_aws_rds_cluster_parameter_group_test.go +++ b/aws/resource_aws_rds_cluster_parameter_group_test.go @@ -90,6 +90,7 @@ func TestAccAWSDBClusterParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -186,6 +187,7 @@ func TestAccAWSDBClusterParameterGroup_withApplyMethod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -225,6 +227,7 @@ func TestAccAWSDBClusterParameterGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -252,6 +255,7 @@ func TestAccAWSDBClusterParameterGroup_namePrefix_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -279,6 +283,7 @@ func TestAccAWSDBClusterParameterGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -303,6 +308,7 @@ func TestAccAWSDBClusterParameterGroup_generatedName_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -328,6 +334,7 @@ func TestAccAWSDBClusterParameterGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -350,6 +357,7 @@ func TestAccAWSDBClusterParameterGroup_only(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -382,6 +390,7 @@ func TestAccAWSDBClusterParameterGroup_updateParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ From 437c287327bf6a88960bd167009126d9e6738b3d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:12:30 -0400 Subject: [PATCH 0274/1252] tests/r/rds_cluster: Add ErrorCheck --- aws/resource_aws_rds_cluster_test.go | 56 ++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/aws/resource_aws_rds_cluster_test.go b/aws/resource_aws_rds_cluster_test.go index cc582f1a012..e19e5489181 100644 --- a/aws/resource_aws_rds_cluster_test.go +++ b/aws/resource_aws_rds_cluster_test.go @@ -106,6 +106,7 @@ func TestAccAWSRDSCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -158,6 +159,7 @@ func TestAccAWSRDSCluster_AllowMajorVersionUpgrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -202,6 +204,7 @@ func TestAccAWSRDSCluster_AvailabilityZones(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -232,6 +235,7 @@ func TestAccAWSRDSCluster_BacktrackWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -270,6 +274,7 @@ func TestAccAWSRDSCluster_ClusterIdentifierPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -304,6 +309,7 @@ func TestAccAWSRDSCluster_DbSubnetGroupName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -337,6 +343,7 @@ func TestAccAWSRDSCluster_s3Restore(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -372,6 +379,7 @@ func TestAccAWSRDSCluster_PointInTimeRestore(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -397,6 +405,7 @@ func TestAccAWSRDSCluster_PointInTimeRestore_EnabledCloudwatchLogsExports(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -421,6 +430,7 @@ func TestAccAWSRDSCluster_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -455,6 +465,7 @@ func TestAccAWSRDSCluster_takeFinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterSnapshot(rInt), Steps: []resource.TestStep{ @@ -487,6 +498,7 @@ func TestAccAWSRDSCluster_takeFinalSnapshot(t *testing.T) { func TestAccAWSRDSCluster_missingUserNameCausesError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -505,6 +517,7 @@ func TestAccAWSRDSCluster_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -556,6 +569,7 @@ func TestAccAWSRDSCluster_EnabledCloudwatchLogsExports_MySQL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -607,6 +621,7 @@ func TestAccAWSRDSCluster_EnabledCloudwatchLogsExports_Postgresql(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -641,6 +656,7 @@ func TestAccAWSRDSCluster_updateIamRoles(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -689,6 +705,7 @@ func TestAccAWSRDSCluster_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -721,6 +738,7 @@ func TestAccAWSRDSCluster_encrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -757,6 +775,7 @@ func TestAccAWSRDSCluster_copyTagsToSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -813,6 +832,7 @@ func TestAccAWSRDSCluster_ReplicationSourceIdentifier_KmsKeyId(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSClusterDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -847,6 +867,7 @@ func TestAccAWSRDSCluster_backupsUpdate(t *testing.T) { ri := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -896,6 +917,7 @@ func TestAccAWSRDSCluster_iamAuth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -930,6 +952,7 @@ func TestAccAWSRDSCluster_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -971,6 +994,7 @@ func TestAccAWSRDSCluster_EngineMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1027,6 +1051,7 @@ func TestAccAWSRDSCluster_EngineMode_Global(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1061,6 +1086,7 @@ func TestAccAWSRDSCluster_EngineMode_Multimaster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1095,6 +1121,7 @@ func TestAccAWSRDSCluster_EngineMode_ParallelQuery(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1129,6 +1156,7 @@ func TestAccAWSRDSCluster_EngineVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1169,6 +1197,7 @@ func TestAccAWSRDSCluster_EngineVersionWithPrimaryInstance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1213,6 +1242,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1247,6 +1277,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Add(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1286,6 +1317,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Remove(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1329,6 +1361,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Global_Update(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1368,6 +1401,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_EngineMode_Provisioned(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1412,6 +1446,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_PrimarySecondaryClusters(t *te testAccMultipleRegionPreCheck(t, 2) testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1441,6 +1476,7 @@ func TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier(t testAccMultipleRegionPreCheck(t, 2) testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1462,6 +1498,7 @@ func TestAccAWSRDSCluster_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1504,6 +1541,7 @@ func TestAccAWSRDSCluster_ScalingConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1556,6 +1594,7 @@ func TestAccAWSRDSCluster_ScalingConfiguration_DefaultMinCapacity(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ @@ -1598,6 +1637,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1636,6 +1676,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1685,6 +1726,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_ParallelQuery(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1724,6 +1766,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Provisioned(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1767,6 +1810,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EngineMode_Serverless(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1808,6 +1852,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Different(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1849,6 +1894,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EngineVersion_Equal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1889,6 +1935,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1928,6 +1975,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_MasterPassword(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -1967,6 +2015,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_MasterUsername(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2008,6 +2057,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_PreferredBackupWindow(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2047,6 +2097,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_PreferredMaintenanceWindow(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2086,6 +2137,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2126,6 +2178,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2168,6 +2221,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_VpcSecurityGroupIds_Tags(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2209,6 +2263,7 @@ func TestAccAWSRDSCluster_SnapshotIdentifier_EncryptedRestore(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBInstanceDestroy, Steps: []resource.TestStep{ @@ -2381,6 +2436,7 @@ func TestAccAWSRDSCluster_EnableHttpEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSClusterDestroy, Steps: []resource.TestStep{ From faaedec7a6deb1f5a948709457aac5da9298d1a5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 03:12:46 -0400 Subject: [PATCH 0275/1252] tests/r/rds_global_cluster: Add ErrorCheck --- aws/resource_aws_rds_global_cluster_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_rds_global_cluster_test.go b/aws/resource_aws_rds_global_cluster_test.go index 0ee42f146f4..839404824ec 100644 --- a/aws/resource_aws_rds_global_cluster_test.go +++ b/aws/resource_aws_rds_global_cluster_test.go @@ -76,6 +76,7 @@ func TestAccAWSRdsGlobalCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAWSRdsGlobalCluster_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -131,6 +133,7 @@ func TestAccAWSRdsGlobalCluster_DatabaseName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -165,6 +168,7 @@ func TestAccAWSRdsGlobalCluster_DeletionProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -199,6 +203,7 @@ func TestAccAWSRdsGlobalCluster_Engine_Aurora(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -225,6 +230,7 @@ func TestAccAWSRdsGlobalCluster_EngineVersion_Aurora(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -251,6 +257,7 @@ func TestAccAWSRdsGlobalCluster_EngineVersion_AuroraMySQL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -277,6 +284,7 @@ func TestAccAWSRdsGlobalCluster_EngineVersion_AuroraPostgresql(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -304,6 +312,7 @@ func TestAccAWSRdsGlobalCluster_SourceDbClusterIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -332,6 +341,7 @@ func TestAccAWSRdsGlobalCluster_SourceDbClusterIdentifier_StorageEncrypted(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ @@ -359,6 +369,7 @@ func TestAccAWSRdsGlobalCluster_StorageEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, Steps: []resource.TestStep{ From c5135621335fdf356d5dd35efca453a654f8161d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 18 Mar 2021 10:20:41 -0400 Subject: [PATCH 0276/1252] docs/service/globalaccelerator: Add 'Timeouts' heading for Global Accelerator resource timeout documentation. (#18173) --- website/docs/r/globalaccelerator_endpoint_group.html.markdown | 2 ++ website/docs/r/globalaccelerator_listener.markdown | 2 ++ 2 files changed, 4 insertions(+) diff --git a/website/docs/r/globalaccelerator_endpoint_group.html.markdown b/website/docs/r/globalaccelerator_endpoint_group.html.markdown index be74e0fbbda..18de65748c7 100644 --- a/website/docs/r/globalaccelerator_endpoint_group.html.markdown +++ b/website/docs/r/globalaccelerator_endpoint_group.html.markdown @@ -58,6 +58,8 @@ In addition to all arguments above, the following attributes are exported: * `id` - The Amazon Resource Name (ARN) of the endpoint group. * `arn` - The Amazon Resource Name (ARN) of the endpoint group. +## Timeouts + `aws_globalaccelerator_endpoint_group` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: diff --git a/website/docs/r/globalaccelerator_listener.markdown b/website/docs/r/globalaccelerator_listener.markdown index 1e61ee3e15a..e225364b367 100644 --- a/website/docs/r/globalaccelerator_listener.markdown +++ b/website/docs/r/globalaccelerator_listener.markdown @@ -57,6 +57,8 @@ In addition to all arguments above, the following attributes are exported: * `id` - The Amazon Resource Name (ARN) of the listener. +## Timeouts + `aws_globalaccelerator_listener` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: From 9a2a1d19b6ce2338902f96f406d5f171f12e3cb3 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 14:27:22 +0000 Subject: [PATCH 0277/1252] Update CHANGELOG.md for #17974 --- CHANGELOG.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 922929fd9d1..9d07bea6083 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,33 @@ NOTES: +* provider: New `default_tags` argument as a public preview for applying tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) +* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) + +FEATURES: + +* **New Data Source:** `aws_kinesis_stream_consumer` ([#17149](https://github.com/hashicorp/terraform-provider-aws/issues/17149)) +* **New Resource:** `aws_kinesis_stream_consumer` ([#17149](https://github.com/hashicorp/terraform-provider-aws/issues/17149)) + +ENHANCEMENTS: + +* provider: Add `default_tags` argument (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) +* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) +* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) +* resource/aws_vpc: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) + +BUG FIXES: + +* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) +* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) +* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) + +## 3.32.0 (March 12, 2021) + +NOTES: + * resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) ENHANCEMENTS: From 3ea4ed2709e4642b5f1666a08044b712e9937b50 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Thu, 18 Mar 2021 10:40:44 -0400 Subject: [PATCH 0278/1252] Update CHANGELOG for 3.33.0 release --- CHANGELOG.md | 135 +-------------------------------------------------- 1 file changed, 2 insertions(+), 133 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d07bea6083..5b9ba8a3e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.32.0 (March 12, 2021) +## 3.33.0 (Unreleased) NOTES: @@ -15,6 +15,7 @@ ENHANCEMENTS: * provider: Add `default_tags` argument (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) * resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) +* resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_vpc: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) BUG FIXES: @@ -27,138 +28,6 @@ BUG FIXES: ## 3.32.0 (March 12, 2021) -NOTES: - -* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) -* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -NOTES: - -* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) -* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -NOTES: - -* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) -* resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -NOTES: - -* resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -ENHANCEMENTS: - -* resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) - -BUG FIXES: - -* resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - -BUG FIXES: - -* resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) -* resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) - -## 3.32.0 (March 12, 2021) - FEATURES: * **New Data Source:** `aws_acmpca_certificate` ([#10213](https://github.com/hashicorp/terraform-provider-aws/issues/10213)) From 837904025dfd178de65b64564a2e5416e89d751b Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Thu, 18 Mar 2021 10:58:48 -0400 Subject: [PATCH 0279/1252] tests/provider: update pointer conversions (#18177) --- aws/provider_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 7268599300b..8f0923f2d61 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1842,7 +1842,7 @@ func testAccCheckProviderDefaultTags_Tags(providers *[]*schema.Provider, expecte var found bool for _, actualElement := range actualTags { - if *actualElement.Value == expectedElement { + if aws.StringValue(actualElement.Value) == expectedElement { found = true break } @@ -1857,7 +1857,7 @@ func testAccCheckProviderDefaultTags_Tags(providers *[]*schema.Provider, expecte var found bool for _, expectedElement := range expectedTags { - if *actualElement.Value == expectedElement { + if aws.StringValue(actualElement.Value) == expectedElement { found = true break } From bb7226beb84b0beb457fb75032818f05efc49d91 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 15:00:39 +0000 Subject: [PATCH 0280/1252] Update CHANGELOG.md for #18177 --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b9ba8a3e53..1194c25c119 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,7 +15,6 @@ ENHANCEMENTS: * provider: Add `default_tags` argument (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) * resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) -* resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_vpc: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) BUG FIXES: From 61e5497fc881035305f6349d8e096c6a867c2382 Mon Sep 17 00:00:00 2001 From: angie pinilla Date: Thu, 18 Mar 2021 11:13:36 -0400 Subject: [PATCH 0281/1252] Update .changelog/17974.txt --- .changelog/17974.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/17974.txt b/.changelog/17974.txt index 6370c123b4e..c854905099e 100644 --- a/.changelog/17974.txt +++ b/.changelog/17974.txt @@ -4,7 +4,7 @@ provider: New `default_tags` argument as a public preview for applying tags acro ```release-note:enhancement provider: Add `default_tags` argument (in public preview, see note above) - +``` ```release-note:enhancement resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) From 712460e6057aa45131878a10800a253dbadf163a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:19:15 -0400 Subject: [PATCH 0282/1252] tests/r/waf_byte_match_set: Add ErrorCheck --- aws/resource_aws_waf_byte_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_waf_byte_match_set_test.go b/aws/resource_aws_waf_byte_match_set_test.go index 917c33adbc4..d68ceaa8418 100644 --- a/aws/resource_aws_waf_byte_match_set_test.go +++ b/aws/resource_aws_waf_byte_match_set_test.go @@ -97,6 +97,7 @@ func TestAccAWSWafByteMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -141,6 +142,7 @@ func TestAccAWSWafByteMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -176,6 +178,7 @@ func TestAccAWSWafByteMatchSet_changeTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -243,6 +246,7 @@ func TestAccAWSWafByteMatchSet_noTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -270,6 +274,7 @@ func TestAccAWSWafByteMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafByteMatchSetDestroy, Steps: []resource.TestStep{ From 4abfd9ac28631dcb42d76727bd22f4cfe71aaa24 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:19:33 -0400 Subject: [PATCH 0283/1252] tests/r/waf_geo_match_set: Add ErrorCheck --- aws/resource_aws_waf_geo_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_waf_geo_match_set_test.go b/aws/resource_aws_waf_geo_match_set_test.go index 2dd04ba452e..2646dafc162 100644 --- a/aws/resource_aws_waf_geo_match_set_test.go +++ b/aws/resource_aws_waf_geo_match_set_test.go @@ -97,6 +97,7 @@ func TestAccAWSWafGeoMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -134,6 +135,7 @@ func TestAccAWSWafGeoMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -169,6 +171,7 @@ func TestAccAWSWafGeoMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -191,6 +194,7 @@ func TestAccAWSWafGeoMatchSet_changeConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -242,6 +246,7 @@ func TestAccAWSWafGeoMatchSet_noConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafGeoMatchSetDestroy, Steps: []resource.TestStep{ From 63ebecd33c64f43d2d8c9eda81e295638f0659e8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:19:55 -0400 Subject: [PATCH 0284/1252] tests/r/waf_ipset: Add ErrorCheck --- aws/resource_aws_waf_ipset_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_waf_ipset_test.go b/aws/resource_aws_waf_ipset_test.go index a64d03a442f..2adb16a2bcc 100644 --- a/aws/resource_aws_waf_ipset_test.go +++ b/aws/resource_aws_waf_ipset_test.go @@ -100,6 +100,7 @@ func TestAccAWSWafIPSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -131,6 +132,7 @@ func TestAccAWSWafIPSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAWSWafIPSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSWafIPSet_changeDescriptors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -238,6 +242,7 @@ func TestAccAWSWafIPSet_noDescriptors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -284,6 +289,7 @@ func TestAccAWSWafIPSet_IpSetDescriptors_1000UpdateLimit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -415,6 +421,7 @@ func TestAccAWSWafIPSet_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ From 940f9a0ba47095e07b243c152f2fed02f6690b27 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:21:11 -0400 Subject: [PATCH 0285/1252] tests/r/waf_rate_based_rule: Add ErrorCheck --- aws/resource_aws_waf_rate_based_rule_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_waf_rate_based_rule_test.go b/aws/resource_aws_waf_rate_based_rule_test.go index 281f47005c5..049831b9478 100644 --- a/aws/resource_aws_waf_rate_based_rule_test.go +++ b/aws/resource_aws_waf_rate_based_rule_test.go @@ -97,6 +97,7 @@ func TestAccAWSWafRateBasedRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -127,6 +128,7 @@ func TestAccAWSWafRateBasedRule_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -164,6 +166,7 @@ func TestAccAWSWafRateBasedRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -189,6 +192,7 @@ func TestAccAWSWafRateBasedRule_changePredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -236,6 +240,7 @@ func TestAccAWSWafRateBasedRule_changeRateLimit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -283,6 +288,7 @@ func TestAccAWSWafRateBasedRule_noPredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -310,6 +316,7 @@ func TestAccAWSWafRateBasedRule_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRateBasedRuleDestroy, Steps: []resource.TestStep{ From 8d64a6646ab20e1a8410f2e61f86fc74e81bd37b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:21:41 -0400 Subject: [PATCH 0286/1252] tests/r/waf_regex_match_set: Add ErrorCheck --- aws/resource_aws_waf_regex_match_set_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_waf_regex_match_set_test.go b/aws/resource_aws_waf_regex_match_set_test.go index 4da2710a3e8..22c813c75a2 100644 --- a/aws/resource_aws_waf_regex_match_set_test.go +++ b/aws/resource_aws_waf_regex_match_set_test.go @@ -124,6 +124,7 @@ func testAccAWSWafRegexMatchSet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -164,6 +165,7 @@ func testAccAWSWafRegexMatchSet_changePatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -215,6 +217,7 @@ func testAccAWSWafRegexMatchSet_noPatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -243,6 +246,7 @@ func testAccAWSWafRegexMatchSet_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexMatchSetDestroy, Steps: []resource.TestStep{ From 9fc431ede1510b779c4fdc97b1326c322397bb17 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:22:10 -0400 Subject: [PATCH 0287/1252] tests/r/waf_regex_pattern_set: Add ErrorCheck --- aws/resource_aws_waf_regex_pattern_set_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_waf_regex_pattern_set_test.go b/aws/resource_aws_waf_regex_pattern_set_test.go index a04061fa0c1..cf60a8407ed 100644 --- a/aws/resource_aws_waf_regex_pattern_set_test.go +++ b/aws/resource_aws_waf_regex_pattern_set_test.go @@ -115,6 +115,7 @@ func testAccAWSWafRegexPatternSet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -145,6 +146,7 @@ func testAccAWSWafRegexPatternSet_changePatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -185,6 +187,7 @@ func testAccAWSWafRegexPatternSet_noPatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -212,6 +215,7 @@ func testAccAWSWafRegexPatternSet_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegexPatternSetDestroy, Steps: []resource.TestStep{ From 99de624bc959c0a59468180c99c8d7e38a902cb4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:22:41 -0400 Subject: [PATCH 0288/1252] tests/r/waf_rule_group: Add ErrorCheck --- aws/resource_aws_waf_rule_group_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_waf_rule_group_test.go b/aws/resource_aws_waf_rule_group_test.go index 16452fd813a..3e76773659d 100644 --- a/aws/resource_aws_waf_rule_group_test.go +++ b/aws/resource_aws_waf_rule_group_test.go @@ -100,6 +100,7 @@ func TestAccAWSWafRuleGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleGroupDestroy, Steps: []resource.TestStep{ @@ -139,6 +140,7 @@ func TestAccAWSWafRuleGroup_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleGroupDestroy, Steps: []resource.TestStep{ @@ -177,6 +179,7 @@ func TestAccAWSWafRuleGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleGroupDestroy, Steps: []resource.TestStep{ @@ -205,6 +208,7 @@ func TestAccAWSWafRuleGroup_changeActivatedRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleGroupDestroy, Steps: []resource.TestStep{ @@ -295,6 +299,7 @@ func TestAccAWSWafRuleGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -345,6 +350,7 @@ func TestAccAWSWafRuleGroup_noActivatedRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleGroupDestroy, Steps: []resource.TestStep{ From 547897acd448e76b935bbb172dd123407c953d1c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:23:07 -0400 Subject: [PATCH 0289/1252] tests/r/waf_rule: Add ErrorCheck --- aws/resource_aws_waf_rule_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_waf_rule_test.go b/aws/resource_aws_waf_rule_test.go index 1ab79ee6f3e..2e31b441277 100644 --- a/aws/resource_aws_waf_rule_test.go +++ b/aws/resource_aws_waf_rule_test.go @@ -100,6 +100,7 @@ func TestAccAWSWafRule_basic(t *testing.T) { resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSWafRule_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafIPSetDestroy, Steps: []resource.TestStep{ @@ -162,6 +164,7 @@ func TestAccAWSWafRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -229,6 +233,7 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -258,6 +263,7 @@ func TestAccAWSWafRule_webACL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -281,6 +287,7 @@ func TestAccAWSWafRule_noPredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ @@ -303,6 +310,7 @@ func TestAccAWSWafRule_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ From 9381048221c9b42ed7b0a9e2a274bf71c75ef882 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:23:48 -0400 Subject: [PATCH 0290/1252] tests/r/waf_size_constraint_set: Add ErrorCheck --- aws/resource_aws_waf_size_constraint_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_waf_size_constraint_set_test.go b/aws/resource_aws_waf_size_constraint_set_test.go index 7938aeffc16..b577de19ad6 100644 --- a/aws/resource_aws_waf_size_constraint_set_test.go +++ b/aws/resource_aws_waf_size_constraint_set_test.go @@ -98,6 +98,7 @@ func TestAccAWSWafSizeConstraintSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -137,6 +138,7 @@ func TestAccAWSWafSizeConstraintSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -172,6 +174,7 @@ func TestAccAWSWafSizeConstraintSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -194,6 +197,7 @@ func TestAccAWSWafSizeConstraintSet_changeConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -249,6 +253,7 @@ func TestAccAWSWafSizeConstraintSet_noConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSizeConstraintSetDestroy, Steps: []resource.TestStep{ From 201b28a675e6a572d7c70508e828bd77465464b1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:24:14 -0400 Subject: [PATCH 0291/1252] tests/r/waf_sql_injection_match_set: Add ErrorCheck --- aws/resource_aws_waf_sql_injection_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_waf_sql_injection_match_set_test.go b/aws/resource_aws_waf_sql_injection_match_set_test.go index 764815d422a..9b007fe1384 100644 --- a/aws/resource_aws_waf_sql_injection_match_set_test.go +++ b/aws/resource_aws_waf_sql_injection_match_set_test.go @@ -96,6 +96,7 @@ func TestAccAWSWafSqlInjectionMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSWafSqlInjectionMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -165,6 +167,7 @@ func TestAccAWSWafSqlInjectionMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSWafSqlInjectionMatchSet_changeTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -228,6 +232,7 @@ func TestAccAWSWafSqlInjectionMatchSet_noTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ From c6a201162f90dc5df181c7ddef1ab9882a42beff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:46:53 -0400 Subject: [PATCH 0292/1252] tests/r/waf_web_acl: Add ErrorCheck --- aws/resource_aws_waf_web_acl_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_waf_web_acl_test.go b/aws/resource_aws_waf_web_acl_test.go index 4c089b219f6..8846f552e92 100644 --- a/aws/resource_aws_waf_web_acl_test.go +++ b/aws/resource_aws_waf_web_acl_test.go @@ -97,6 +97,7 @@ func TestAccAWSWafWebAcl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSWafWebAcl_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -173,6 +175,7 @@ func TestAccAWSWafWebAcl_DefaultAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -208,6 +211,7 @@ func TestAccAWSWafWebAcl_Rules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -256,6 +260,7 @@ func TestAccAWSWafWebAcl_LoggingConfiguration(t *testing.T) { testAccPreCheckAWSWaf(t) testAccPreCheckWafLoggingConfiguration(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -303,6 +308,7 @@ func TestAccAWSWafWebAcl_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ @@ -325,6 +331,7 @@ func TestAccAWSWafWebAcl_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafWebAclDestroy, Steps: []resource.TestStep{ From c60547110749232d8a8085cd4866700345588d4d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:47:26 -0400 Subject: [PATCH 0293/1252] tests/r/waf_xss_match_set: Add ErrorCheck --- aws/resource_aws_waf_xss_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_waf_xss_match_set_test.go b/aws/resource_aws_waf_xss_match_set_test.go index 7bde4a3b528..ec2a494f545 100644 --- a/aws/resource_aws_waf_xss_match_set_test.go +++ b/aws/resource_aws_waf_xss_match_set_test.go @@ -97,6 +97,7 @@ func TestAccAWSWafXssMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -138,6 +139,7 @@ func TestAccAWSWafXssMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -173,6 +175,7 @@ func TestAccAWSWafXssMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSWafXssMatchSet_changeTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -254,6 +258,7 @@ func TestAccAWSWafXssMatchSet_noTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafXssMatchSetDestroy, Steps: []resource.TestStep{ From 88c95493ae95223b95bb10efe0bf9d9edac8f73c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:47:54 -0400 Subject: [PATCH 0294/1252] tests/ds/waf_ipset: Add ErrorCheck --- aws/data_source_aws_waf_ipset_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_waf_ipset_test.go b/aws/data_source_aws_waf_ipset_test.go index 813acb19318..9a7fefb4596 100644 --- a/aws/data_source_aws_waf_ipset_test.go +++ b/aws/data_source_aws_waf_ipset_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafIPSet_basic(t *testing.T) { datasourceName := "data.aws_waf_ipset.ipset" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafIPSet_NonExistent, From 817014b7b0192355845641294e8676a63de0e8aa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:48:08 -0400 Subject: [PATCH 0295/1252] tests/ds/waf_rate_based_rule: Add ErrorCheck --- aws/data_source_aws_waf_rate_based_rule_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_waf_rate_based_rule_test.go b/aws/data_source_aws_waf_rate_based_rule_test.go index bf86b5c1409..3cfa56c6745 100644 --- a/aws/data_source_aws_waf_rate_based_rule_test.go +++ b/aws/data_source_aws_waf_rate_based_rule_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRateBasedRule_basic(t *testing.T) { datasourceName := "data.aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRateBasedRuleConfig_NonExistent, From e9333f31e41a31a76fd5be5c28c64c05cd3d296d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:48:22 -0400 Subject: [PATCH 0296/1252] tests/ds/waf_rule: Add ErrorCheck --- aws/data_source_aws_waf_rule_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_waf_rule_test.go b/aws/data_source_aws_waf_rule_test.go index 5d28f6f420d..3dfe62431f7 100644 --- a/aws/data_source_aws_waf_rule_test.go +++ b/aws/data_source_aws_waf_rule_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRule_basic(t *testing.T) { datasourceName := "data.aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRuleConfig_NonExistent, From 99fbbec714133b672b886c8f5700c69f96f71e8f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:48:38 -0400 Subject: [PATCH 0297/1252] tests/ds/waf_web_acl: Add ErrorCheck --- aws/data_source_aws_waf_web_acl_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_waf_web_acl_test.go b/aws/data_source_aws_waf_web_acl_test.go index 604fb14019c..ca520476783 100644 --- a/aws/data_source_aws_waf_web_acl_test.go +++ b/aws/data_source_aws_waf_web_acl_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafWebAcl_basic(t *testing.T) { datasourceName := "data.aws_waf_web_acl.web_acl" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(waf.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, waf.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafWebAclConfig_NonExistent, From d077057b0dfceebbbc9a7ea897c05cc3965d468c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:52:07 -0400 Subject: [PATCH 0298/1252] tests/r/api_gateway_account: Add ErrorCheck --- aws/resource_aws_api_gateway_account_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_api_gateway_account_test.go b/aws/resource_aws_api_gateway_account_test.go index 2c47a9b7c06..a44e1ef2fa4 100644 --- a/aws/resource_aws_api_gateway_account_test.go +++ b/aws/resource_aws_api_gateway_account_test.go @@ -24,6 +24,7 @@ func TestAccAWSAPIGatewayAccount_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAccountDestroy, Steps: []resource.TestStep{ From 1b68e2308138141461d021a234d819aeb741f7f4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:52:30 -0400 Subject: [PATCH 0299/1252] tests/r/api_gateway_api_key: Add ErrorCheck --- aws/resource_aws_api_gateway_api_key_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_api_gateway_api_key_test.go b/aws/resource_aws_api_gateway_api_key_test.go index 44116b1fefa..d97ec60f7d4 100644 --- a/aws/resource_aws_api_gateway_api_key_test.go +++ b/aws/resource_aws_api_gateway_api_key_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayApiKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSAPIGatewayApiKey_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ @@ -96,6 +98,7 @@ func TestAccAWSAPIGatewayApiKey_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ @@ -130,6 +133,7 @@ func TestAccAWSAPIGatewayApiKey_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ @@ -164,6 +168,7 @@ func TestAccAWSAPIGatewayApiKey_Value(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ @@ -190,6 +195,7 @@ func TestAccAWSAPIGatewayApiKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, Steps: []resource.TestStep{ From 934befacf81e67d69f6c67f3c35057a52c8ee4b5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:52:50 -0400 Subject: [PATCH 0300/1252] tests/r/api_gateway_authorizer: Add ErrorCheck --- aws/resource_aws_api_gateway_authorizer_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_api_gateway_authorizer_test.go b/aws/resource_aws_api_gateway_authorizer_test.go index aaf8293087f..9d11a29236d 100644 --- a/aws/resource_aws_api_gateway_authorizer_test.go +++ b/aws/resource_aws_api_gateway_authorizer_test.go @@ -23,6 +23,7 @@ func TestAccAWSAPIGatewayAuthorizer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -68,6 +69,7 @@ func TestAccAWSAPIGatewayAuthorizer_cognito(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -105,6 +107,7 @@ func TestAccAWSAPIGatewayAuthorizer_cognito_authorizerCredentials(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -135,6 +138,7 @@ func TestAccAWSAPIGatewayAuthorizer_switchAuthType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -181,6 +185,7 @@ func TestAccAWSAPIGatewayAuthorizer_switchAuthorizerTTL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -227,6 +232,7 @@ func TestAccAWSAPIGatewayAuthorizer_authTypeValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -253,6 +259,7 @@ func TestAccAWSAPIGatewayAuthorizer_zero_ttl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ @@ -280,6 +287,7 @@ func TestAccAWSAPIGatewayAuthorizer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, Steps: []resource.TestStep{ From 06bf1ea00ad22604ed4660a2d5086153ea0854ee Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:53:09 -0400 Subject: [PATCH 0301/1252] tests/r/api_gateway_base_path_mapping: Add ErrorCheck --- aws/resource_aws_api_gateway_base_path_mapping_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_api_gateway_base_path_mapping_test.go b/aws/resource_aws_api_gateway_base_path_mapping_test.go index 0686ef72da0..0462b29e55e 100644 --- a/aws/resource_aws_api_gateway_base_path_mapping_test.go +++ b/aws/resource_aws_api_gateway_base_path_mapping_test.go @@ -73,6 +73,7 @@ func TestAccAWSAPIGatewayBasePathMapping_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ @@ -102,6 +103,7 @@ func TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ @@ -130,6 +132,7 @@ func TestAccAWSAPIGatewayBasePathMapping_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ @@ -180,6 +183,7 @@ func TestAccAWSAPIGatewayBasePathMapping_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ From b1c5bda5a8da8b3ccdb87662fce8dde0c5454e8f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:53:31 -0400 Subject: [PATCH 0302/1252] tests/r/api_gateway_client_certificate: Add ErrorCheck --- aws/resource_aws_api_gateway_client_certificate_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_client_certificate_test.go b/aws/resource_aws_api_gateway_client_certificate_test.go index d1a5c20c334..875e5f904bb 100644 --- a/aws/resource_aws_api_gateway_client_certificate_test.go +++ b/aws/resource_aws_api_gateway_client_certificate_test.go @@ -18,6 +18,7 @@ func TestAccAWSAPIGatewayClientCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayClientCertificateDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSAPIGatewayClientCertificate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayClientCertificateDestroy, Steps: []resource.TestStep{ @@ -95,6 +97,7 @@ func TestAccAWSAPIGatewayClientCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayClientCertificateDestroy, Steps: []resource.TestStep{ From 0778b95213d5093e2fc68ea6b5963caa571a9bef Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:54:06 -0400 Subject: [PATCH 0303/1252] tests/r/api_gateway_deployment: Add ErrorCheck --- aws/resource_aws_api_gateway_deployment_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_api_gateway_deployment_test.go b/aws/resource_aws_api_gateway_deployment_test.go index fc43116f73b..dfb0121c787 100644 --- a/aws/resource_aws_api_gateway_deployment_test.go +++ b/aws/resource_aws_api_gateway_deployment_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayDeployment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSAPIGatewayDeployment_disappears_RestApi(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSAPIGatewayDeployment_Triggers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -128,6 +131,7 @@ func TestAccAWSAPIGatewayDeployment_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -156,6 +160,7 @@ func TestAccAWSAPIGatewayDeployment_StageDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -178,6 +183,7 @@ func TestAccAWSAPIGatewayDeployment_StageName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -205,6 +211,7 @@ func TestAccAWSAPIGatewayDeployment_StageName_EmptyString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ @@ -225,6 +232,7 @@ func TestAccAWSAPIGatewayDeployment_Variables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, Steps: []resource.TestStep{ From 03ed98021d5cc68078a44d2c750264d49d655b0f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:54:30 -0400 Subject: [PATCH 0304/1252] tests/r/api_gateway_documentation_part: Add ErrorCheck --- aws/resource_aws_api_gateway_documentation_part_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_api_gateway_documentation_part_test.go b/aws/resource_aws_api_gateway_documentation_part_test.go index 90ac8f6fb6d..67d58935508 100644 --- a/aws/resource_aws_api_gateway_documentation_part_test.go +++ b/aws/resource_aws_api_gateway_documentation_part_test.go @@ -24,6 +24,7 @@ func TestAccAWSAPIGatewayDocumentationPart_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy, Steps: []resource.TestStep{ @@ -68,6 +69,7 @@ func TestAccAWSAPIGatewayDocumentationPart_method(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy, Steps: []resource.TestStep{ @@ -116,6 +118,7 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy, Steps: []resource.TestStep{ @@ -167,6 +170,7 @@ func TestAccAWSAPIGatewayDocumentationPart_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy, Steps: []resource.TestStep{ From 9d4389636f6bae14f49ec2ebed6fb95e5939a1e3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:54:58 -0400 Subject: [PATCH 0305/1252] tests/r/api_gateway_documentation_version: Add ErrorCheck --- aws/resource_aws_api_gateway_documentation_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_documentation_version_test.go b/aws/resource_aws_api_gateway_documentation_version_test.go index 9508ee86161..2c95d55395f 100644 --- a/aws/resource_aws_api_gateway_documentation_version_test.go +++ b/aws/resource_aws_api_gateway_documentation_version_test.go @@ -22,6 +22,7 @@ func TestAccAWSAPIGatewayDocumentationVersion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSAPIGatewayDocumentationVersion_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy, Steps: []resource.TestStep{ From 81f2902732cb28b928f5dc10d113c0f601bdd89b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:55:23 -0400 Subject: [PATCH 0306/1252] tests/r/api_gateway_domain_name: Add ErrorCheck --- aws/resource_aws_api_gateway_domain_name_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_api_gateway_domain_name_test.go b/aws/resource_aws_api_gateway_domain_name_test.go index 1a2b4740767..b0e7e33dcd4 100644 --- a/aws/resource_aws_api_gateway_domain_name_test.go +++ b/aws/resource_aws_api_gateway_domain_name_test.go @@ -24,6 +24,7 @@ func TestAccAWSAPIGatewayDomainName_CertificateArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckApigatewayEdgeDomainName(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSAPIGatewayEdgeDomainNameDestroy, Steps: []resource.TestStep{ @@ -85,6 +86,7 @@ func TestAccAWSAPIGatewayDomainName_CertificateName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -120,6 +122,7 @@ func TestAccAWSAPIGatewayDomainName_RegionalCertificateArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -163,6 +166,7 @@ func TestAccAWSAPIGatewayDomainName_RegionalCertificateName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -195,6 +199,7 @@ func TestAccAWSAPIGatewayDomainName_SecurityPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -224,6 +229,7 @@ func TestAccAWSAPIGatewayDomainName_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -271,6 +277,7 @@ func TestAccAWSAPIGatewayDomainName_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ @@ -298,6 +305,7 @@ func TestAccAWSAPIGatewayDomainName_MutualTlsAuthentication(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ From 676774c60ba4c9884a6cabd00ebfceec4ff69f16 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 11:55:45 -0400 Subject: [PATCH 0307/1252] tests/r/api_gateway_gateway_response: Add ErrorCheck --- aws/resource_aws_api_gateway_gateway_response_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_api_gateway_gateway_response_test.go b/aws/resource_aws_api_gateway_gateway_response_test.go index 91f16f273bc..5374d21e92f 100644 --- a/aws/resource_aws_api_gateway_gateway_response_test.go +++ b/aws/resource_aws_api_gateway_gateway_response_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayGatewayResponse_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayGatewayResponseDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func TestAccAWSAPIGatewayGatewayResponse_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayGatewayResponseDestroy, Steps: []resource.TestStep{ From 0de4ca99f08deac0d43af5c3b7392468105fd1f3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:36:55 -0400 Subject: [PATCH 0308/1252] tests/r/api_gateway_integration: Add ErrorCheck --- aws/resource_aws_api_gateway_integration_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_api_gateway_integration_test.go b/aws/resource_aws_api_gateway_integration_test.go index 4f07224dbf0..959f4bd8cbc 100644 --- a/aws/resource_aws_api_gateway_integration_test.go +++ b/aws/resource_aws_api_gateway_integration_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ @@ -135,6 +136,7 @@ func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ @@ -210,6 +212,7 @@ func TestAccAWSAPIGatewayIntegration_cache_key_parameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ @@ -252,6 +255,7 @@ func TestAccAWSAPIGatewayIntegration_integrationType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ @@ -296,6 +300,7 @@ func TestAccAWSAPIGatewayIntegration_TlsConfig_InsecureSkipVerification(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ @@ -332,6 +337,7 @@ func TestAccAWSAPIGatewayIntegration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ From 2219252a29fe04544536e6dbbea2054e7a0be518 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:37:18 -0400 Subject: [PATCH 0309/1252] tests/r/api_gateway_integration_response: Add ErrorCheck --- aws/resource_aws_api_gateway_integration_response_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_api_gateway_integration_response_test.go b/aws/resource_aws_api_gateway_integration_response_test.go index c08533b7598..d0ebb075eb6 100644 --- a/aws/resource_aws_api_gateway_integration_response_test.go +++ b/aws/resource_aws_api_gateway_integration_response_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayIntegrationResponse_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationResponseDestroy, Steps: []resource.TestStep{ @@ -66,6 +67,7 @@ func TestAccAWSAPIGatewayIntegrationResponse_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayIntegrationResponseDestroy, Steps: []resource.TestStep{ From 287271b009f0c31a83deb7c676e1aef0e67727fb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:37:55 -0400 Subject: [PATCH 0310/1252] tests/r/api_gateway_method: Add ErrorCheck --- aws/resource_aws_api_gateway_method_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_api_gateway_method_test.go b/aws/resource_aws_api_gateway_method_test.go index 72394641032..414d1369a1f 100644 --- a/aws/resource_aws_api_gateway_method_test.go +++ b/aws/resource_aws_api_gateway_method_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayMethod_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ @@ -58,6 +59,7 @@ func TestAccAWSAPIGatewayMethod_customauthorizer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ @@ -99,6 +101,7 @@ func TestAccAWSAPIGatewayMethod_cognitoauthorizer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ @@ -143,6 +146,7 @@ func TestAccAWSAPIGatewayMethod_customrequestvalidator(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ @@ -183,6 +187,7 @@ func TestAccAWSAPIGatewayMethod_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ @@ -205,6 +210,7 @@ func TestAccAWSAPIGatewayMethod_OperationName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodDestroy, Steps: []resource.TestStep{ From d24eefbc84e49e586187424091ca243bbae7192f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:38:23 -0400 Subject: [PATCH 0311/1252] tests/r/api_gateway_method_response: Add ErrorCheck --- aws/resource_aws_api_gateway_method_response_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_api_gateway_method_response_test.go b/aws/resource_aws_api_gateway_method_response_test.go index 3c8e31741f0..0f453085818 100644 --- a/aws/resource_aws_api_gateway_method_response_test.go +++ b/aws/resource_aws_api_gateway_method_response_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayMethodResponse_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodResponseDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func TestAccAWSAPIGatewayMethodResponse_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodResponseDestroy, Steps: []resource.TestStep{ From 52535a445c2aae5163e9725cfef21ecfcb1e57cd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:38:54 -0400 Subject: [PATCH 0312/1252] tests/r/api_gateway_method_settings: Add ErrorCheck --- ...source_aws_api_gateway_method_settings_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_api_gateway_method_settings_test.go b/aws/resource_aws_api_gateway_method_settings_test.go index 1fe37b10ba7..4454e011657 100644 --- a/aws/resource_aws_api_gateway_method_settings_test.go +++ b/aws/resource_aws_api_gateway_method_settings_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayMethodSettings_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_CacheDataEncrypted(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_CacheTtlInSeconds(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -127,6 +130,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_CachingEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -163,6 +167,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_DataTraceEnabled(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -199,6 +204,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_LoggingLevel(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -237,6 +243,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_MetricsEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -275,6 +282,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -317,6 +325,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_RequireAuthorizationForCacheCon resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -353,6 +362,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingBurstLimit(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -390,6 +400,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingBurstLimitDisabledByD resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -426,6 +437,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingRateLimit(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -463,6 +475,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_ThrottlingRateLimitDisabledByDe resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -499,6 +512,7 @@ func TestAccAWSAPIGatewayMethodSettings_Settings_UnauthorizedCacheControlHeaderS resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ @@ -568,6 +582,7 @@ func TestAccAWSAPIGatewayMethodSettings_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayMethodSettingsDestroy, Steps: []resource.TestStep{ From 2a20b380b9a66b62ebdcab42c028bf1aadaddc33 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:39:18 -0400 Subject: [PATCH 0313/1252] tests/r/api_gateway_model: Add ErrorCheck --- aws/resource_aws_api_gateway_model_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_api_gateway_model_test.go b/aws/resource_aws_api_gateway_model_test.go index f0d812f9d54..08c5097704b 100644 --- a/aws/resource_aws_api_gateway_model_test.go +++ b/aws/resource_aws_api_gateway_model_test.go @@ -21,6 +21,7 @@ func TestAccAWSAPIGatewayModel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayModelDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSAPIGatewayModel_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayModelDestroy, Steps: []resource.TestStep{ From 3c301f82d2e9176f9bce59bdbbe297f0d09dfdc4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:39:41 -0400 Subject: [PATCH 0314/1252] tests/r/api_gateway_request_validator: Add ErrorCheck --- aws/resource_aws_api_gateway_request_validator_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_api_gateway_request_validator_test.go b/aws/resource_aws_api_gateway_request_validator_test.go index 3dbf820e19d..77877dc92dd 100644 --- a/aws/resource_aws_api_gateway_request_validator_test.go +++ b/aws/resource_aws_api_gateway_request_validator_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayRequestValidator_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRequestValidatorDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSAPIGatewayRequestValidator_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRequestValidatorDestroy, Steps: []resource.TestStep{ From 896a39e3fe5cad21ec0480f030fbe6bf53c12f1e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:40:04 -0400 Subject: [PATCH 0315/1252] tests/r/api_gateway_resource: Add ErrorCheck --- aws/resource_aws_api_gateway_resource_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_resource_test.go b/aws/resource_aws_api_gateway_resource_test.go index d18f6932b98..ac33c4336da 100644 --- a/aws/resource_aws_api_gateway_resource_test.go +++ b/aws/resource_aws_api_gateway_resource_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayResource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayResourceDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSAPIGatewayResource_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayResourceDestroy, Steps: []resource.TestStep{ @@ -93,6 +95,7 @@ func TestAccAWSAPIGatewayResource_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayResourceDestroy, Steps: []resource.TestStep{ From 2515c78a7d12af00f33d84a09ba49f81ec5ee45d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:40:31 -0400 Subject: [PATCH 0316/1252] tests/r/api_gateway_rest_api: Add ErrorCheck --- aws/resource_aws_api_gateway_rest_api_test.go | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/aws/resource_aws_api_gateway_rest_api_test.go b/aws/resource_aws_api_gateway_rest_api_test.go index 2efa40cd621..7c788fbaafa 100644 --- a/aws/resource_aws_api_gateway_rest_api_test.go +++ b/aws/resource_aws_api_gateway_rest_api_test.go @@ -71,6 +71,7 @@ func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -110,6 +111,7 @@ func TestAccAWSAPIGatewayRestApi_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -159,6 +161,7 @@ func TestAccAWSAPIGatewayRestApi_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -181,6 +184,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -256,6 +260,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -308,6 +313,7 @@ func TestAccAWSAPIGatewayRestApi_ApiKeySource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -345,6 +351,7 @@ func TestAccAWSAPIGatewayRestApi_ApiKeySource_OverrideBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -388,6 +395,7 @@ func TestAccAWSAPIGatewayRestApi_ApiKeySource_SetByBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -415,6 +423,7 @@ func TestAccAWSAPIGatewayRestApi_BinaryMediaTypes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -451,6 +460,7 @@ func TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_OverrideBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -497,6 +507,7 @@ func TestAccAWSAPIGatewayRestApi_BinaryMediaTypes_SetByBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -525,6 +536,7 @@ func TestAccAWSAPIGatewayRestApi_Body(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -568,6 +580,7 @@ func TestAccAWSAPIGatewayRestApi_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -602,6 +615,7 @@ func TestAccAWSAPIGatewayRestApi_Description_OverrideBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -645,6 +659,7 @@ func TestAccAWSAPIGatewayRestApi_Description_SetByBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -671,6 +686,7 @@ func TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -708,6 +724,7 @@ func TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_OverrideBody(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -751,6 +768,7 @@ func TestAccAWSAPIGatewayRestApi_DisableExecuteApiEndpoint_SetByBody(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -780,6 +798,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -837,6 +856,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_OverrideBo resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -887,6 +907,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VpcEndpointIds_SetByBody( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -916,6 +937,7 @@ func TestAccAWSAPIGatewayRestApi_MinimumCompressionSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -957,6 +979,7 @@ func TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_OverrideBody(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1000,6 +1023,7 @@ func TestAccAWSAPIGatewayRestApi_MinimumCompressionSize_SetByBody(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1030,6 +1054,7 @@ func TestAccAWSAPIGatewayRestApi_Name_OverrideBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1073,6 +1098,7 @@ func TestAccAWSAPIGatewayRestApi_Parameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1108,6 +1134,7 @@ func TestAccAWSAPIGatewayRestApi_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1139,6 +1166,7 @@ func TestAccAWSAPIGatewayRestApi_Policy_OverrideBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ @@ -1185,6 +1213,7 @@ func TestAccAWSAPIGatewayRestApi_Policy_SetByBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ From 59b551e9a86f7418f62949914b572c3b551583b5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:41:18 -0400 Subject: [PATCH 0317/1252] tests/r/api_gateway_rest_api_policy: Add ErrorCheck --- aws/resource_aws_api_gateway_rest_api_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_rest_api_policy_test.go b/aws/resource_aws_api_gateway_rest_api_policy_test.go index 1e667919e85..a308e84af85 100644 --- a/aws/resource_aws_api_gateway_rest_api_policy_test.go +++ b/aws/resource_aws_api_gateway_rest_api_policy_test.go @@ -21,6 +21,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ @@ -75,6 +77,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_disappears_restApi(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ From e084ddb6af9234a9364a3c83975510335861fe2a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:47:22 -0400 Subject: [PATCH 0318/1252] tests/r/api_gateway_rest_api_policy: Add ErrorCheck --- aws/resource_aws_api_gateway_rest_api_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_rest_api_policy_test.go b/aws/resource_aws_api_gateway_rest_api_policy_test.go index 1e667919e85..a308e84af85 100644 --- a/aws/resource_aws_api_gateway_rest_api_policy_test.go +++ b/aws/resource_aws_api_gateway_rest_api_policy_test.go @@ -21,6 +21,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ @@ -75,6 +77,7 @@ func TestAccAWSAPIGatewayRestApiPolicy_disappears_restApi(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestApiPolicyDestroy, Steps: []resource.TestStep{ From 4380378919f90ee7870002c3504e7c01295c031e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:47:50 -0400 Subject: [PATCH 0319/1252] tests/r/api_gateway_stage: Add ErrorCheck --- aws/resource_aws_api_gateway_stage_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_api_gateway_stage_test.go b/aws/resource_aws_api_gateway_stage_test.go index 40e497378b5..fa99189e966 100644 --- a/aws/resource_aws_api_gateway_stage_test.go +++ b/aws/resource_aws_api_gateway_stage_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayStage_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, Steps: []resource.TestStep{ @@ -85,6 +86,7 @@ func TestAccAWSAPIGatewayStage_disappears_ReferencingDeployment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, Steps: []resource.TestStep{ @@ -111,6 +113,7 @@ func TestAccAWSAPIGatewayStage_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, Steps: []resource.TestStep{ @@ -138,6 +141,7 @@ func TestAccAWSAPIGatewayStage_accessLogSettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, Steps: []resource.TestStep{ @@ -205,6 +209,7 @@ func TestAccAWSAPIGatewayStage_accessLogSettings_kinesis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, Steps: []resource.TestStep{ From 93eb390fdc91a1c3d80c3e6182973fd872fe8037 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:48:26 -0400 Subject: [PATCH 0320/1252] tests/r/api_gateway_usage_plan: Add ErrorCheck --- aws/resource_aws_api_gateway_usage_plan_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_api_gateway_usage_plan_test.go b/aws/resource_aws_api_gateway_usage_plan_test.go index 400eca31391..bfa231af497 100644 --- a/aws/resource_aws_api_gateway_usage_plan_test.go +++ b/aws/resource_aws_api_gateway_usage_plan_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayUsagePlan_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSAPIGatewayUsagePlan_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -105,6 +107,7 @@ func TestAccAWSAPIGatewayUsagePlan_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -158,6 +161,7 @@ func TestAccAWSAPIGatewayUsagePlan_productCode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -205,6 +209,7 @@ func TestAccAWSAPIGatewayUsagePlan_throttling(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -259,6 +264,7 @@ func TestAccAWSAPIGatewayUsagePlan_throttlingInitialRateLimit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -285,6 +291,7 @@ func TestAccAWSAPIGatewayUsagePlan_quota(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -340,6 +347,7 @@ func TestAccAWSAPIGatewayUsagePlan_apiStages(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -423,6 +431,7 @@ func TestAccAWSAPIGatewayUsagePlan_apiStages_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ @@ -455,6 +464,7 @@ func TestAccAWSAPIGatewayUsagePlan_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanDestroy, Steps: []resource.TestStep{ From fd7e01e405f3f0b92cae0e4f3fbebcd933a89a37 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:48:57 -0400 Subject: [PATCH 0321/1252] tests/r/api_gateway_usage_plan_key: Add ErrorCheck --- aws/resource_aws_api_gateway_usage_plan_key_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_usage_plan_key_test.go b/aws/resource_aws_api_gateway_usage_plan_key_test.go index a76d39fa33a..11bfca8be4c 100644 --- a/aws/resource_aws_api_gateway_usage_plan_key_test.go +++ b/aws/resource_aws_api_gateway_usage_plan_key_test.go @@ -22,6 +22,7 @@ func TestAccAWSAPIGatewayUsagePlanKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanKeyDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSAPIGatewayUsagePlanKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanKeyDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAWSAPIGatewayUsagePlanKey_KeyId_Concurrency(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayUsagePlanKeyDestroy, Steps: []resource.TestStep{ From f74b784790da1fc3beb10bdf821f51030831d9e7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:49:32 -0400 Subject: [PATCH 0322/1252] tests/r/api_gateway_vpc_link: Add ErrorCheck --- aws/resource_aws_api_gateway_vpc_link_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_api_gateway_vpc_link_test.go b/aws/resource_aws_api_gateway_vpc_link_test.go index 0cb2d3bcebf..253cf639529 100644 --- a/aws/resource_aws_api_gateway_vpc_link_test.go +++ b/aws/resource_aws_api_gateway_vpc_link_test.go @@ -67,6 +67,7 @@ func TestAccAWSAPIGatewayVpcLink_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAPIGatewayVpcLinkDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSAPIGatewayVpcLink_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAPIGatewayVpcLinkDestroy, Steps: []resource.TestStep{ @@ -159,6 +161,7 @@ func TestAccAWSAPIGatewayVpcLink_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAPIGatewayVpcLinkDestroy, Steps: []resource.TestStep{ From 9a7ce6a376d3e4e399425aa232cc8b990c4e71c1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:50:15 -0400 Subject: [PATCH 0323/1252] tests/ds/api_gateway_api_key: Add ErrorCheck --- aws/data_source_aws_api_gateway_api_key_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_api_gateway_api_key_test.go b/aws/data_source_aws_api_gateway_api_key_test.go index fc7b2374311..0777ea58587 100644 --- a/aws/data_source_aws_api_gateway_api_key_test.go +++ b/aws/data_source_aws_api_gateway_api_key_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsApiGatewayApiKey_basic(t *testing.T) { dataSourceName1 := "data.aws_api_gateway_api_key.test_key" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsApiGatewayApiKeyConfig(rName), From 0fa8f9178d2e2b89a3e5c987e47f6ecf60ee0c81 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:50:43 -0400 Subject: [PATCH 0324/1252] tests/ds/api_gateway_domain_name: Add ErrorCheck --- aws/data_source_aws_api_gateway_domain_name_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_api_gateway_domain_name_test.go b/aws/data_source_aws_api_gateway_domain_name_test.go index 830b69f9b6e..a415f2becc0 100644 --- a/aws/data_source_aws_api_gateway_domain_name_test.go +++ b/aws/data_source_aws_api_gateway_domain_name_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -18,6 +19,7 @@ func TestAccDataSourceAwsApiGatewayDomainName_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ From 5004a96333fd280cc5973d5d6ae364f5b2f2f0a0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:51:05 -0400 Subject: [PATCH 0325/1252] tests/ds/api_gateway_resource: Add ErrorCheck --- aws/data_source_aws_api_gateway_resource_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_api_gateway_resource_test.go b/aws/data_source_aws_api_gateway_resource_test.go index 147bb02e319..f7c4aaf3f40 100644 --- a/aws/data_source_aws_api_gateway_resource_test.go +++ b/aws/data_source_aws_api_gateway_resource_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,8 +17,9 @@ func TestAccDataSourceAwsApiGatewayResource_basic(t *testing.T) { dataSourceName2 := "data.aws_api_gateway_resource.example_v1_endpoint" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsApiGatewayResourceConfig(rName), From 44712bd3cd2de60404224893ac1aa02ee455afa4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:51:31 -0400 Subject: [PATCH 0326/1252] tests/ds/api_gateway_rest_api: Add ErrorCheck --- aws/data_source_aws_api_gateway_rest_api_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_api_gateway_rest_api_test.go b/aws/data_source_aws_api_gateway_rest_api_test.go index 3489e700e5d..a7e70231020 100644 --- a/aws/data_source_aws_api_gateway_rest_api_test.go +++ b/aws/data_source_aws_api_gateway_rest_api_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccDataSourceAwsApiGatewayRestApi_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() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( @@ -43,8 +45,9 @@ func TestAccDataSourceAwsApiGatewayRestApi_EndpointConfiguration_VpcEndpointIds( dataSourceName := "data.aws_api_gateway_rest_api.test" resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( From 88f9d032984a78645818e3ef57d61e9800fa5d1e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 12:51:51 -0400 Subject: [PATCH 0327/1252] tests/ds/api_gateway_vpc_link: Add ErrorCheck --- aws/data_source_aws_api_gateway_vpc_link_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_api_gateway_vpc_link_test.go b/aws/data_source_aws_api_gateway_vpc_link_test.go index 7c66203e32f..dc726221e62 100644 --- a/aws/data_source_aws_api_gateway_vpc_link_test.go +++ b/aws/data_source_aws_api_gateway_vpc_link_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsApiGatewayVpcLink_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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigateway.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsApiGatewayVpcLinkConfig(rName), From aa413a6483158cee42cfe7c313cc42a30d1209ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:00:41 -0400 Subject: [PATCH 0328/1252] tests/ds/iam_group: Add ErrorCheck --- aws/data_source_aws_iam_group_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_iam_group_test.go b/aws/data_source_aws_iam_group_test.go index cd85d7ea53a..1ac35b1bb51 100644 --- a/aws/data_source_aws_iam_group_test.go +++ b/aws/data_source_aws_iam_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSDataSourceIAMGroup_basic(t *testing.T) { groupName := fmt.Sprintf("test-datasource-user-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsIAMGroupConfig(groupName), @@ -35,8 +37,9 @@ func TestAccAWSDataSourceIAMGroup_users(t *testing.T) { userCount := 101 resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsIAMGroupConfigWithUser(groupName, userName, groupMemberShipName, userCount), From 679d103ad19dd8a3a5e25a5812b99b9d4e18ada6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:00:51 -0400 Subject: [PATCH 0329/1252] tests/ds/iam_instance_profile: Add ErrorCheck --- aws/data_source_aws_iam_instance_profile_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_iam_instance_profile_test.go b/aws/data_source_aws_iam_instance_profile_test.go index 078f47347a7..be2f36b2b26 100644 --- a/aws/data_source_aws_iam_instance_profile_test.go +++ b/aws/data_source_aws_iam_instance_profile_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSDataSourceIAMInstanceProfile_basic(t *testing.T) { profileName := fmt.Sprintf("tf-acc-ds-instance-profile-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDatasourceAwsIamInstanceProfileConfig(roleName, profileName), From f3932d872840c0aacdbe3ab48e449b4f6b90f782 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:01 -0400 Subject: [PATCH 0330/1252] tests/ds/iam_role: Add ErrorCheck --- aws/data_source_aws_iam_role_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_iam_role_test.go b/aws/data_source_aws_iam_role_test.go index 4293d877c67..b4525df232e 100644 --- a/aws/data_source_aws_iam_role_test.go +++ b/aws/data_source_aws_iam_role_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSDataSourceIAMRole_basic(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsIAMRoleConfig(roleName), @@ -41,8 +43,9 @@ func TestAccAWSDataSourceIAMRole_tags(t *testing.T) { resourceName := "aws_iam_role.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsIAMRoleConfig_tags(roleName), From 526e740565e11faf11aea1b91cc3e98159172366 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:02 -0400 Subject: [PATCH 0331/1252] tests/ds/iam_server_certificate: Add ErrorCheck --- aws/data_source_aws_iam_server_certificate_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_iam_server_certificate_test.go b/aws/data_source_aws_iam_server_certificate_test.go index f809d519192..10494cf5b1f 100644 --- a/aws/data_source_aws_iam_server_certificate_test.go +++ b/aws/data_source_aws_iam_server_certificate_test.go @@ -42,6 +42,7 @@ func TestAccAWSDataSourceIAMServerCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -65,6 +66,7 @@ func TestAccAWSDataSourceIAMServerCertificate_basic(t *testing.T) { func TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -86,6 +88,7 @@ func TestAccAWSDataSourceIAMServerCertificate_path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ From fa6658aa0a54ceef58e7a01a68b0af1f9a7a83e4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:12 -0400 Subject: [PATCH 0332/1252] tests/ds/iam_user: Add ErrorCheck --- aws/data_source_aws_iam_user_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_iam_user_test.go b/aws/data_source_aws_iam_user_test.go index 8c14098822e..868467fbfe9 100644 --- a/aws/data_source_aws_iam_user_test.go +++ b/aws/data_source_aws_iam_user_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSDataSourceIAMUser_basic(t *testing.T) { userName := fmt.Sprintf("test-datasource-user-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsDataSourceIAMUserConfig(userName), @@ -40,8 +42,9 @@ func TestAccAWSDataSourceIAMUser_tags(t *testing.T) { userName := fmt.Sprintf("test-datasource-user-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsDataSourceIAMUserConfig_tags(userName), From 6fbe24baaccff8e7ab057b181b980abc198fb8e6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:22 -0400 Subject: [PATCH 0333/1252] tests/r/iam_access_key: Add ErrorCheck --- aws/resource_aws_iam_access_key_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_iam_access_key_test.go b/aws/resource_aws_iam_access_key_test.go index 3881ab8ba4b..f22bf919cc2 100644 --- a/aws/resource_aws_iam_access_key_test.go +++ b/aws/resource_aws_iam_access_key_test.go @@ -22,6 +22,7 @@ func TestAccAWSAccessKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAccessKeyDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSAccessKey_encrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAccessKeyDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func TestAccAWSAccessKey_Status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAccessKeyDestroy, Steps: []resource.TestStep{ From 6a04542cd80e58b8357888da884c86ec56a84bc3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:33 -0400 Subject: [PATCH 0334/1252] tests/r/iam_account_alias: Add ErrorCheck --- aws/resource_aws_iam_account_alias_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_account_alias_test.go b/aws/resource_aws_iam_account_alias_test.go index 59654ea8353..2e5ae401698 100644 --- a/aws/resource_aws_iam_account_alias_test.go +++ b/aws/resource_aws_iam_account_alias_test.go @@ -41,6 +41,7 @@ func testAccAWSIAMAccountAlias_importBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMAccountAliasDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func testAccAWSIAMAccountAlias_basic_with_datasource(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMAccountAliasDestroy, Steps: []resource.TestStep{ From f0c2be4f5f1ca3a0664c3e68d2eb80047baf7c9a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:43 -0400 Subject: [PATCH 0335/1252] tests/r/iam_account_password_policy: Add ErrorCheck --- aws/resource_aws_iam_account_password_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iam_account_password_policy_test.go b/aws/resource_aws_iam_account_password_policy_test.go index 041e40cfb06..65e859471b1 100644 --- a/aws/resource_aws_iam_account_password_policy_test.go +++ b/aws/resource_aws_iam_account_password_policy_test.go @@ -16,6 +16,7 @@ func TestAccAWSIAMAccountPasswordPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMAccountPasswordPolicyDestroy, Steps: []resource.TestStep{ From dda7c67222ea12d86fc2f981fb319f67bbbd7506 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:01:54 -0400 Subject: [PATCH 0336/1252] tests/r/iam_group_membership: Add ErrorCheck --- aws/resource_aws_iam_group_membership_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_group_membership_test.go b/aws/resource_aws_iam_group_membership_test.go index d350fc72bc0..5f633752ae8 100644 --- a/aws/resource_aws_iam_group_membership_test.go +++ b/aws/resource_aws_iam_group_membership_test.go @@ -25,6 +25,7 @@ func TestAccAWSGroupMembership_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGroupMembershipDestroy, Steps: []resource.TestStep{ @@ -65,6 +66,7 @@ func TestAccAWSGroupMembership_paginatedUserList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGroupMembershipDestroy, Steps: []resource.TestStep{ From da3a25b924a5231c316561a17eb21a96d1999d02 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:00 -0400 Subject: [PATCH 0337/1252] tests/r/iam_group_policy_attachment: Add ErrorCheck --- aws/resource_aws_iam_group_policy_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_iam_group_policy_attachment_test.go b/aws/resource_aws_iam_group_policy_attachment_test.go index 98a31430d3b..ee226df1e99 100644 --- a/aws/resource_aws_iam_group_policy_attachment_test.go +++ b/aws/resource_aws_iam_group_policy_attachment_test.go @@ -23,6 +23,7 @@ func TestAccAWSIAMGroupPolicyAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGroupPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -61,6 +62,7 @@ func TestAccAWSIAMGroupPolicyAttachment_basic(t *testing.T) { }, }) } + func testAccCheckAWSGroupPolicyAttachmentDestroy(s *terraform.State) error { return nil } @@ -93,6 +95,7 @@ func testAccCheckAWSGroupPolicyAttachmentExists(n string, c int, out *iam.ListAt return nil } } + func testAccCheckAWSGroupPolicyAttachmentAttributes(policies []string, out *iam.ListAttachedGroupPoliciesOutput) resource.TestCheckFunc { return func(s *terraform.State) error { matched := 0 From c1eae4693b219ac54245e33d48412474377b8a54 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:11 -0400 Subject: [PATCH 0338/1252] tests/r/iam_group_policy: Add ErrorCheck --- aws/resource_aws_iam_group_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_group_policy_test.go b/aws/resource_aws_iam_group_policy_test.go index 10084541513..417afe3dd7b 100644 --- a/aws/resource_aws_iam_group_policy_test.go +++ b/aws/resource_aws_iam_group_policy_test.go @@ -17,6 +17,7 @@ func TestAccAWSIAMGroupPolicy_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMGroupPolicyDestroy, Steps: []resource.TestStep{ @@ -61,6 +62,7 @@ func TestAccAWSIAMGroupPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMGroupPolicyDestroy, Steps: []resource.TestStep{ From 7bc189f4c60d691df79d46405abbbfae830a8044 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:21 -0400 Subject: [PATCH 0339/1252] tests/r/iam_group: Add ErrorCheck --- aws/resource_aws_iam_group_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_group_test.go b/aws/resource_aws_iam_group_test.go index d1c152a7881..a83cf346479 100644 --- a/aws/resource_aws_iam_group_test.go +++ b/aws/resource_aws_iam_group_test.go @@ -151,6 +151,7 @@ func TestAccAWSIAMGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGroupDestroy, Steps: []resource.TestStep{ @@ -186,6 +187,7 @@ func TestAccAWSIAMGroup_nameChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGroupDestroy, Steps: []resource.TestStep{ From cac6bc47b895bef76d7d6e581386bec28029291a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:31 -0400 Subject: [PATCH 0340/1252] tests/r/iam_instance_profile: Add ErrorCheck --- aws/resource_aws_iam_instance_profile_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_iam_instance_profile_test.go b/aws/resource_aws_iam_instance_profile_test.go index 0bc63b918c5..cffed921976 100644 --- a/aws/resource_aws_iam_instance_profile_test.go +++ b/aws/resource_aws_iam_instance_profile_test.go @@ -19,6 +19,7 @@ func TestAccAWSIAMInstanceProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInstanceProfileDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSIAMInstanceProfile_withoutRole(t *testing.T) { rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInstanceProfileDestroy, Steps: []resource.TestStep{ @@ -102,6 +104,7 @@ func TestAccAWSIAMInstanceProfile_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInstanceProfileDestroy, Steps: []resource.TestStep{ @@ -124,6 +127,7 @@ func TestAccAWSIAMInstanceProfile_disappears_role(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInstanceProfileDestroy, Steps: []resource.TestStep{ From 791e2946853994c89d1f01424e2908fe733d7a7b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:41 -0400 Subject: [PATCH 0341/1252] tests/r/iam_openid_connect_provider: Add ErrorCheck --- aws/resource_aws_iam_openid_connect_provider_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_openid_connect_provider_test.go b/aws/resource_aws_iam_openid_connect_provider_test.go index 03455670936..c34cdba9bc6 100644 --- a/aws/resource_aws_iam_openid_connect_provider_test.go +++ b/aws/resource_aws_iam_openid_connect_provider_test.go @@ -19,6 +19,7 @@ func TestAccAWSIAMOpenIDConnectProvider_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMOpenIDConnectProviderDestroy, Steps: []resource.TestStep{ @@ -61,6 +62,7 @@ func TestAccAWSIAMOpenIDConnectProvider_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMOpenIDConnectProviderDestroy, Steps: []resource.TestStep{ From f01bf71658b8a4f7b7764d34d057ff6c8e6dc7e7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:05:52 -0400 Subject: [PATCH 0342/1252] tests/r/iam_policy_attachment: Add ErrorCheck --- aws/resource_aws_iam_policy_attachment_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_iam_policy_attachment_test.go b/aws/resource_aws_iam_policy_attachment_test.go index e990d93184b..7c9530b01e9 100644 --- a/aws/resource_aws_iam_policy_attachment_test.go +++ b/aws/resource_aws_iam_policy_attachment_test.go @@ -29,6 +29,7 @@ func TestAccAWSIAMPolicyAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func TestAccAWSIAMPolicyAttachment_paginatedEntities(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSIAMPolicyAttachment_Groups_RenamedGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func TestAccAWSIAMPolicyAttachment_Roles_RenamedRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -149,6 +153,7 @@ func TestAccAWSIAMPolicyAttachment_Users_RenamedUser(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSPolicyAttachmentDestroy, Steps: []resource.TestStep{ From c746c775069fd0e30f4c6f966ec5d6d856606ff5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:06:03 -0400 Subject: [PATCH 0343/1252] tests/r/iam_policy: Add ErrorCheck --- aws/resource_aws_iam_policy_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_iam_policy_test.go b/aws/resource_aws_iam_policy_test.go index e933219344a..8335b961744 100644 --- a/aws/resource_aws_iam_policy_test.go +++ b/aws/resource_aws_iam_policy_test.go @@ -113,6 +113,7 @@ func TestAccAWSIAMPolicy_basic(t *testing.T) { ` resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ @@ -143,6 +144,7 @@ func TestAccAWSIAMPolicy_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ @@ -169,6 +171,7 @@ func TestAccAWSIAMPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ @@ -191,6 +194,7 @@ func TestAccAWSIAMPolicy_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ @@ -218,6 +222,7 @@ func TestAccAWSIAMPolicy_path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ @@ -246,6 +251,7 @@ func TestAccAWSIAMPolicy_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMPolicyDestroy, Steps: []resource.TestStep{ From 66e65e4f498345e873e62680cedf04d2610f4cf5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:06:15 -0400 Subject: [PATCH 0344/1252] tests/r/iam_role_policy_attachment: Add ErrorCheck --- aws/resource_aws_iam_role_policy_attachment_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_iam_role_policy_attachment_test.go b/aws/resource_aws_iam_role_policy_attachment_test.go index bcfb5b0c6ce..47e543836c7 100644 --- a/aws/resource_aws_iam_role_policy_attachment_test.go +++ b/aws/resource_aws_iam_role_policy_attachment_test.go @@ -21,6 +21,7 @@ func TestAccAWSRolePolicyAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRolePolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -71,6 +72,7 @@ func TestAccAWSRolePolicyAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRolePolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -96,6 +98,7 @@ func TestAccAWSRolePolicyAttachment_disappears_Role(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRolePolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -171,6 +174,7 @@ func testAccCheckAWSRolePolicyAttachmentExists(n string, c int, out *iam.ListAtt return nil } } + func testAccCheckAWSRolePolicyAttachmentAttributes(policies []string, out *iam.ListAttachedRolePoliciesOutput) resource.TestCheckFunc { return func(s *terraform.State) error { matched := 0 From 807fbf2792a28331650e3d8b136c5b969f37767b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:06:26 -0400 Subject: [PATCH 0345/1252] tests/r/iam_role_policy: Add ErrorCheck --- aws/resource_aws_iam_role_policy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_iam_role_policy_test.go b/aws/resource_aws_iam_role_policy_test.go index f257ab80ed6..c09270ad839 100644 --- a/aws/resource_aws_iam_role_policy_test.go +++ b/aws/resource_aws_iam_role_policy_test.go @@ -25,6 +25,7 @@ func TestAccAWSIAMRolePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, Steps: []resource.TestStep{ @@ -72,6 +73,7 @@ func TestAccAWSIAMRolePolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, Steps: []resource.TestStep{ @@ -185,6 +187,7 @@ func TestAccAWSIAMRolePolicy_invalidJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, Steps: []resource.TestStep{ @@ -201,6 +204,7 @@ func TestAccAWSIAMRolePolicy_Policy_InvalidResource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, Steps: []resource.TestStep{ From 59eca2393301d7e32e6500827a5b6fc0b7ff8f8a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:06:37 -0400 Subject: [PATCH 0346/1252] tests/r/iam_role: Add ErrorCheck --- aws/resource_aws_iam_role_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aws/resource_aws_iam_role_test.go b/aws/resource_aws_iam_role_test.go index 3549c937777..13b90656f6d 100644 --- a/aws/resource_aws_iam_role_test.go +++ b/aws/resource_aws_iam_role_test.go @@ -149,6 +149,7 @@ func TestAccAWSIAMRole_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -176,6 +177,7 @@ func TestAccAWSIAMRole_basicWithDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -249,6 +251,7 @@ func TestAccAWSIAMRole_testNameChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -278,6 +281,7 @@ func TestAccAWSIAMRole_badJSON(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -297,6 +301,7 @@ func TestAccAWSIAMRole_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -319,6 +324,7 @@ func TestAccAWSIAMRole_force_detach_policies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -346,6 +352,7 @@ func TestAccAWSIAMRole_MaxSessionDuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -396,6 +403,7 @@ func TestAccAWSIAMRole_PermissionsBoundary(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -464,6 +472,7 @@ func TestAccAWSIAMRole_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -503,6 +512,7 @@ func TestAccAWSIAMRole_policyBasicInline(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -547,6 +557,7 @@ func TestAccAWSIAMRole_policyBasicInlineEmpty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -570,6 +581,7 @@ func TestAccAWSIAMRole_policyBasicManaged(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -614,6 +626,7 @@ func TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_managedNonEmpty(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -646,6 +659,7 @@ func TestAccAWSIAMRole_policyOutOfBandRemovalAddedBack_inlineNonEmpty(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -679,6 +693,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedNonEmpty(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -712,6 +727,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineNonEmpty(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -746,6 +762,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_inlineNonExistent(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -785,6 +802,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionIgnored_managedNonExistent(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -816,6 +834,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_inlineEmpty(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ @@ -847,6 +866,7 @@ func TestAccAWSIAMRole_policyOutOfBandAdditionRemoved_managedEmpty(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRoleDestroy, Steps: []resource.TestStep{ From 6a7cc912643b98c15158d95b154889a40aa862b4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:08:46 -0400 Subject: [PATCH 0347/1252] tests/r/iam_saml_provider: Add ErrorCheck --- aws/resource_aws_iam_saml_provider_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_saml_provider_test.go b/aws/resource_aws_iam_saml_provider_test.go index 53b278bdf1c..90cf09ca139 100644 --- a/aws/resource_aws_iam_saml_provider_test.go +++ b/aws/resource_aws_iam_saml_provider_test.go @@ -65,6 +65,7 @@ func TestAccAWSIAMSamlProvider_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMSamlProviderDestroy, Steps: []resource.TestStep{ @@ -101,6 +102,7 @@ func TestAccAWSIAMSamlProvider_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMSamlProviderDestroy, Steps: []resource.TestStep{ From 689c56a6a00031f9f89ca9184fef48019f6df05d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:08:57 -0400 Subject: [PATCH 0348/1252] tests/r/iam_server_certificate: Add ErrorCheck --- aws/resource_aws_iam_server_certificate_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_iam_server_certificate_test.go b/aws/resource_aws_iam_server_certificate_test.go index d27cd8c3c07..75df8ef3d22 100644 --- a/aws/resource_aws_iam_server_certificate_test.go +++ b/aws/resource_aws_iam_server_certificate_test.go @@ -64,6 +64,7 @@ func TestAccAWSIAMServerCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -96,6 +97,7 @@ func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -133,6 +135,7 @@ func TestAccAWSIAMServerCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -159,6 +162,7 @@ func TestAccAWSIAMServerCertificate_file(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ @@ -197,6 +201,7 @@ func TestAccAWSIAMServerCertificate_Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ From ad97f3595dd6fb2a32e0bb6c11826f06b45bf52e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:09:07 -0400 Subject: [PATCH 0349/1252] tests/r/iam_service_linked_role: Add ErrorCheck --- ...source_aws_iam_service_linked_role_test.go | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/aws/resource_aws_iam_service_linked_role_test.go b/aws/resource_aws_iam_service_linked_role_test.go index d90cf651bae..e941548463f 100644 --- a/aws/resource_aws_iam_service_linked_role_test.go +++ b/aws/resource_aws_iam_service_linked_role_test.go @@ -143,9 +143,8 @@ func TestAccAWSIAMServiceLinkedRole_basic(t *testing.T) { path := fmt.Sprintf("/aws-service-role/%s/", awsServiceName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMServiceLinkedRoleDestroy, Steps: []resource.TestStep{ @@ -195,9 +194,8 @@ func TestAccAWSIAMServiceLinkedRole_CustomSuffix(t *testing.T) { path := fmt.Sprintf("/aws-service-role/%s/", awsServiceName) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMServiceLinkedRoleDestroy, Steps: []resource.TestStep{ @@ -225,9 +223,8 @@ func TestAccAWSIAMServiceLinkedRole_CustomSuffix_DiffSuppressFunc(t *testing.T) name := "AWSServiceRoleForApplicationAutoScaling_CustomResource" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMServiceLinkedRoleDestroy, Steps: []resource.TestStep{ @@ -255,9 +252,8 @@ func TestAccAWSIAMServiceLinkedRole_Description(t *testing.T) { customSuffix := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIAMServiceLinkedRoleDestroy, Steps: []resource.TestStep{ From 4f33ce8ee677f03c34930f4168163655bbda311c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:09:16 -0400 Subject: [PATCH 0350/1252] tests/r/iam_user_group_membership: Add ErrorCheck --- aws/resource_aws_iam_user_group_membership_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iam_user_group_membership_test.go b/aws/resource_aws_iam_user_group_membership_test.go index 633232191e4..3a23cbd3639 100644 --- a/aws/resource_aws_iam_user_group_membership_test.go +++ b/aws/resource_aws_iam_user_group_membership_test.go @@ -24,6 +24,7 @@ func TestAccAWSUserGroupMembership_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSUserGroupMembershipDestroy, Steps: []resource.TestStep{ From 5bea42aab4cf2b64a37c1b4be3ec16a7f19a8af0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:09:26 -0400 Subject: [PATCH 0351/1252] tests/r/iam_user_login_profile: Add ErrorCheck --- aws/resource_aws_iam_user_login_profile_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_iam_user_login_profile_test.go b/aws/resource_aws_iam_user_login_profile_test.go index d509cbd877d..15b4d425885 100644 --- a/aws/resource_aws_iam_user_login_profile_test.go +++ b/aws/resource_aws_iam_user_login_profile_test.go @@ -66,6 +66,7 @@ func TestAccAWSUserLoginProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserLoginProfileDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSUserLoginProfile_keybase(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserLoginProfileDestroy, Steps: []resource.TestStep{ @@ -139,6 +141,7 @@ func TestAccAWSUserLoginProfile_keybaseDoesntExist(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserLoginProfileDestroy, Steps: []resource.TestStep{ @@ -156,6 +159,7 @@ func TestAccAWSUserLoginProfile_notAKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserLoginProfileDestroy, Steps: []resource.TestStep{ @@ -175,6 +179,7 @@ func TestAccAWSUserLoginProfile_PasswordLength(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserLoginProfileDestroy, Steps: []resource.TestStep{ From adcea380dd2e7c101a4aee9ea2f807bd4a617f25 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:09:37 -0400 Subject: [PATCH 0352/1252] tests/r/iam_user_policy_attachment: Add ErrorCheck --- aws/resource_aws_iam_user_policy_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_iam_user_policy_attachment_test.go b/aws/resource_aws_iam_user_policy_attachment_test.go index 3d8e9f6c519..67a02e8cecc 100644 --- a/aws/resource_aws_iam_user_policy_attachment_test.go +++ b/aws/resource_aws_iam_user_policy_attachment_test.go @@ -21,6 +21,7 @@ func TestAccAWSUserPolicyAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func TestAccAWSUserPolicyAttachment_basic(t *testing.T) { }, }) } + func testAccCheckAWSUserPolicyAttachmentDestroy(s *terraform.State) error { return nil } @@ -94,6 +96,7 @@ func testAccCheckAWSUserPolicyAttachmentExists(n string, c int, out *iam.ListAtt return nil } } + func testAccCheckAWSUserPolicyAttachmentAttributes(policies []string, out *iam.ListAttachedUserPoliciesOutput) resource.TestCheckFunc { return func(s *terraform.State) error { matched := 0 From f8bbc31b39d32e3c3c329831931e96a08c9f8c34 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:09:48 -0400 Subject: [PATCH 0353/1252] tests/r/iam_user_policy: Add ErrorCheck --- aws/resource_aws_iam_user_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_iam_user_policy_test.go b/aws/resource_aws_iam_user_policy_test.go index d0339514aae..47954c6cd9d 100644 --- a/aws/resource_aws_iam_user_policy_test.go +++ b/aws/resource_aws_iam_user_policy_test.go @@ -25,6 +25,7 @@ func TestAccAWSIAMUserPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMUserPolicyDestroy, Steps: []resource.TestStep{ @@ -67,6 +68,7 @@ func TestAccAWSIAMUserPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMUserPolicyDestroy, Steps: []resource.TestStep{ @@ -177,6 +179,7 @@ func TestAccAWSIAMUserPolicy_multiplePolicies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMUserPolicyDestroy, Steps: []resource.TestStep{ From 1502568af601ff22179e388d343cf3b34526d557 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:10:00 -0400 Subject: [PATCH 0354/1252] tests/r/iam_user_ssh_key: Add ErrorCheck --- aws/resource_aws_iam_user_ssh_key_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iam_user_ssh_key_test.go b/aws/resource_aws_iam_user_ssh_key_test.go index ba81861ad4b..635f816f9be 100644 --- a/aws/resource_aws_iam_user_ssh_key_test.go +++ b/aws/resource_aws_iam_user_ssh_key_test.go @@ -21,6 +21,7 @@ func TestAccAWSUserSSHKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserSSHKeyDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSUserSSHKey_pemEncoding(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserSSHKeyDestroy, Steps: []resource.TestStep{ From 2a2a05614a3ff1e4dd220eba7a3ef7df5abced30 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:10:11 -0400 Subject: [PATCH 0355/1252] tests/r/iam_user: Add ErrorCheck --- aws/resource_aws_iam_user_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_iam_user_test.go b/aws/resource_aws_iam_user_test.go index 0c47d0dee91..533f498b00b 100644 --- a/aws/resource_aws_iam_user_test.go +++ b/aws/resource_aws_iam_user_test.go @@ -205,6 +205,7 @@ func TestAccAWSUser_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -241,6 +242,7 @@ func TestAccAWSUser_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -264,6 +266,7 @@ func TestAccAWSUser_ForceDestroy_AccessKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -293,6 +296,7 @@ func TestAccAWSUser_ForceDestroy_LoginProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -322,6 +326,7 @@ func TestAccAWSUser_ForceDestroy_MFADevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -351,6 +356,7 @@ func TestAccAWSUser_ForceDestroy_SSHKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -380,6 +386,7 @@ func TestAccAWSUser_ForceDestroy_SigningCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -411,6 +418,7 @@ func TestAccAWSUser_nameChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -447,6 +455,7 @@ func TestAccAWSUser_pathChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -484,6 +493,7 @@ func TestAccAWSUser_permissionsBoundary(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ @@ -558,6 +568,7 @@ func TestAccAWSUser_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSUserDestroy, Steps: []resource.TestStep{ From 8690310d924c0c166162b874a7837c04f09021dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:17:36 -0400 Subject: [PATCH 0356/1252] tests/ds/dx_gateway: Add ErrorCheck --- aws/data_source_aws_dx_gateway_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_dx_gateway_test.go b/aws/data_source_aws_dx_gateway_test.go index d197da217e8..4c57614f03d 100644 --- a/aws/data_source_aws_dx_gateway_test.go +++ b/aws/data_source_aws_dx_gateway_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsDxGateway_basic(t *testing.T) { datasourceName := "data.aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsDxGatewayConfig_NonExistent, From 7ce65eba7bc9e9d15934c0eaac8932a38f2df3b9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:17:46 -0400 Subject: [PATCH 0357/1252] tests/r/dx_bgp_peer: Add ErrorCheck --- aws/resource_aws_dx_bgp_peer_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_dx_bgp_peer_test.go b/aws/resource_aws_dx_bgp_peer_test.go index 50df4947115..ca33dc9d22a 100644 --- a/aws/resource_aws_dx_bgp_peer_test.go +++ b/aws/resource_aws_dx_bgp_peer_test.go @@ -23,6 +23,7 @@ func TestAccAwsDxBgpPeer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxBgpPeerDestroy, Steps: []resource.TestStep{ From 2e57896f7e815175c1e3283a4b572bf532bf1e7e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:17:56 -0400 Subject: [PATCH 0358/1252] tests/r/dx_connection_association: Add ErrorCheck --- aws/resource_aws_dx_connection_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_connection_association_test.go b/aws/resource_aws_dx_connection_association_test.go index 8dc9584bd82..9339889eca3 100644 --- a/aws/resource_aws_dx_connection_association_test.go +++ b/aws/resource_aws_dx_connection_association_test.go @@ -14,6 +14,7 @@ import ( func TestAccAWSDxConnectionAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxConnectionAssociationDestroy, Steps: []resource.TestStep{ @@ -30,6 +31,7 @@ func TestAccAWSDxConnectionAssociation_basic(t *testing.T) { func TestAccAWSDxConnectionAssociation_multiConns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxConnectionAssociationDestroy, Steps: []resource.TestStep{ From 36df18abe95d2121f5745bcce30290bc982d3c70 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:18:07 -0400 Subject: [PATCH 0359/1252] tests/r/dx_connection: Add ErrorCheck --- aws/resource_aws_dx_connection_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_connection_test.go b/aws/resource_aws_dx_connection_test.go index d134834767a..e8c52c5bb59 100644 --- a/aws/resource_aws_dx_connection_test.go +++ b/aws/resource_aws_dx_connection_test.go @@ -83,6 +83,7 @@ func TestAccAWSDxConnection_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxConnectionDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAWSDxConnection_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxConnectionDestroy, Steps: []resource.TestStep{ From dda52b551ec3f734430637528ec9ec550cbc9b7b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:18:18 -0400 Subject: [PATCH 0360/1252] tests/r/dx_gateway_association_proposal: Add ErrorCheck --- aws/resource_aws_dx_gateway_association_proposal_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_dx_gateway_association_proposal_test.go b/aws/resource_aws_dx_gateway_association_proposal_test.go index 5a8ddf79380..bf834a4897a 100644 --- a/aws/resource_aws_dx_gateway_association_proposal_test.go +++ b/aws/resource_aws_dx_gateway_association_proposal_test.go @@ -91,6 +91,7 @@ func TestAccAwsDxGatewayAssociationProposal_basicVpnGateway(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy, Steps: []resource.TestStep{ @@ -129,6 +130,7 @@ func TestAccAwsDxGatewayAssociationProposal_basicTransitGateway(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy, Steps: []resource.TestStep{ @@ -167,6 +169,7 @@ func TestAccAwsDxGatewayAssociationProposal_disappears(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy, Steps: []resource.TestStep{ @@ -194,6 +197,7 @@ func TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy, Steps: []resource.TestStep{ From f15698fb2eba5c423d7b8677f4e8ac1488c79adf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:18:29 -0400 Subject: [PATCH 0361/1252] tests/r/dx_gateway: Add ErrorCheck --- aws/resource_aws_dx_gateway_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_gateway_test.go b/aws/resource_aws_dx_gateway_test.go index 54462b8e1f9..4809545c442 100644 --- a/aws/resource_aws_dx_gateway_test.go +++ b/aws/resource_aws_dx_gateway_test.go @@ -119,6 +119,7 @@ func TestAccAwsDxGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayDestroy, Steps: []resource.TestStep{ @@ -145,6 +146,7 @@ func TestAccAwsDxGateway_complex(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayDestroy, Steps: []resource.TestStep{ From bb263a8259a94286846a28c8e0c16b43d03067e4 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Fri, 28 Aug 2020 11:01:47 -0400 Subject: [PATCH 0362/1252] update redacted_fields arg and add apply-time error handling --- aws/resource_aws_wafv2_rule_group.go | 20 +- ...aws_wafv2_web_acl_logging_configuration.go | 208 +++++++++- ...afv2_web_acl_logging_configuration_test.go | 373 +++++++++++++++++- aws/wafv2_helper.go | 268 +++++++++---- website/docs/r/wafv2_rule_group.html.markdown | 5 +- website/docs/r/wafv2_web_acl.html.markdown | 11 +- ...eb_acl_logging_configuration.html.markdown | 10 +- 7 files changed, 777 insertions(+), 118 deletions(-) diff --git a/aws/resource_aws_wafv2_rule_group.go b/aws/resource_aws_wafv2_rule_group.go index b523161891a..bea165b1b04 100644 --- a/aws/resource_aws_wafv2_rule_group.go +++ b/aws/resource_aws_wafv2_rule_group.go @@ -120,10 +120,16 @@ func resourceAwsWafv2RuleGroupCreate(d *schema.ResourceData, meta interface{}) e Name: aws.String(d.Get("name").(string)), Scope: aws.String(d.Get("scope").(string)), Capacity: aws.Int64(int64(d.Get("capacity").(int))), - Rules: expandWafv2Rules(d.Get("rule").(*schema.Set).List()), VisibilityConfig: expandWafv2VisibilityConfig(d.Get("visibility_config").([]interface{})), } + rules, err := expandWafv2Rules(d.Get("rule").(*schema.Set).List()) + if err != nil { + return err + } + + params.Rules = rules + if v, ok := d.GetOk("description"); ok { params.Description = aws.String(v.(string)) } @@ -132,7 +138,7 @@ func resourceAwsWafv2RuleGroupCreate(d *schema.ResourceData, meta interface{}) e params.Tags = keyvaluetags.New(v).IgnoreAws().Wafv2Tags() } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { + err = resource.Retry(5*time.Minute, func() *resource.RetryError { var err error resp, err = conn.CreateRuleGroup(params) if err != nil { @@ -222,15 +228,21 @@ func resourceAwsWafv2RuleGroupUpdate(d *schema.ResourceData, meta interface{}) e Name: aws.String(d.Get("name").(string)), Scope: aws.String(d.Get("scope").(string)), LockToken: aws.String(d.Get("lock_token").(string)), - Rules: expandWafv2Rules(d.Get("rule").(*schema.Set).List()), VisibilityConfig: expandWafv2VisibilityConfig(d.Get("visibility_config").([]interface{})), } + rules, err := expandWafv2Rules(d.Get("rule").(*schema.Set).List()) + if err != nil { + return err + } + + u.Rules = rules + if v, ok := d.GetOk("description"); ok { u.Description = aws.String(v.(string)) } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { + err = resource.Retry(5*time.Minute, func() *resource.RetryError { _, err := conn.UpdateRuleGroup(u) if err != nil { if isAWSErr(err, wafv2.ErrCodeWAFUnavailableEntityException, "") { diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index a1285ec62c5..84ced141911 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" @@ -34,11 +35,66 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { Description: "AWS Kinesis Firehose Delivery Stream ARNs", }, "redacted_fields": { - Type: schema.TypeSet, - Optional: true, - MaxItems: 100, - Elem: wafv2FieldToMatchBaseSchema(), - Description: "Parts of the request to exclude from logs", + // To allow this argument and its nested fields with Empty Schemas (e.g. "method") + // to be correctly interpreted, this argument must be of type List, + // otherwise, at apply-time a field configured as an empty block + // (e.g. body {}) will result in a nil redacted_fields attribute + Type: schema.TypeList, + Optional: true, + MaxItems: 100, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + // TODO: remove attributes marked as Deprecated + // as they are not supported by the WAFv2 API + // in the context of WebACL Logging Configurations + "all_query_arguments": wafv2EmptySchemaDeprecated(), + "body": wafv2EmptySchemaDeprecated(), + "method": wafv2EmptySchema(), + "query_string": wafv2EmptySchema(), + "single_header": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 40), + // The value is returned in lower case by the API. + // Trying to solve it with StateFunc and/or DiffSuppressFunc resulted in hash problem of the rule field or didn't work. + validation.StringMatch(regexp.MustCompile(`^[a-z0-9-_]+$`), "must contain only lowercase alphanumeric characters, underscores, and hyphens"), + ), + }, + }, + }, + }, + "single_query_argument": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 30), + // The value is returned in lower case by the API. + // Trying to solve it with StateFunc and/or DiffSuppressFunc resulted in hash problem of the rule field or didn't work. + validation.StringMatch(regexp.MustCompile(`^[a-z0-9-_]+$`), "must contain only lowercase alphanumeric characters, underscores, and hyphens"), + ), + }, + }, + }, + Deprecated: "Not supported by WAFv2 API", + }, + "uri_path": wafv2EmptySchema(), + }, + }, + Description: "Parts of the request to exclude from logs", + DiffSuppressFunc: suppressEquivalentRedactedFields, }, "resource_arn": { Type: schema.TypeString, @@ -51,6 +107,62 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { } } +// suppressEquivalentRedactedFields is required to +// handle shifts in List ordering returned from the API +func suppressEquivalentRedactedFields(k, old, new string, d *schema.ResourceData) bool { + o, n := d.GetChange("redacted_fields") + if o != nil && n != nil { + oldFields := o.([]interface{}) + newFields := n.([]interface{}) + if len(oldFields) != len(newFields) { + // account for case where the empty block {} is used as input + return !d.IsNewResource() && len(oldFields) == 0 && len(newFields) == 1 && newFields[0] == nil + } + + for _, oldField := range oldFields { + om := oldField.(map[string]interface{}) + found := false + for _, newField := range newFields { + nm := newField.(map[string]interface{}) + if len(om) != len(nm) { + continue + } + for k, newVal := range nm { + if oldVal, ok := om[k]; ok { + if k == "method" || k == "query_string" || k == "uri_path" { + if len(oldVal.([]interface{})) == len(newVal.([]interface{})) { + found = true + break + } + } else if k == "single_header" { + oldHeader := oldVal.([]interface{}) + newHeader := newVal.([]interface{}) + if len(oldHeader) > 0 && oldHeader[0] != nil { + if len(newHeader) > 0 && newHeader[0] != nil { + oldName := oldVal.([]interface{})[0].(map[string]interface{})["name"].(string) + newName := newVal.([]interface{})[0].(map[string]interface{})["name"].(string) + if oldName == newName { + found = true + break + } + } + } + } + } + } + if found { + break + } + } + if !found { + return false + } + } + return true + } + return false +} + func resourceAwsWafv2WebACLLoggingConfigurationPut(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafv2conn @@ -60,8 +172,12 @@ func resourceAwsWafv2WebACLLoggingConfigurationPut(d *schema.ResourceData, meta ResourceArn: aws.String(resourceArn), } - if v, ok := d.GetOk("redacted_fields"); ok && v.(*schema.Set).Len() > 0 { - config.RedactedFields = expandWafv2RedactedFields(v.(*schema.Set).List()) + if v, ok := d.GetOk("redacted_fields"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + fields, err := expandWafv2RedactedFields(v.([]interface{})) + if err != nil { + return err + } + config.RedactedFields = fields } else { config.RedactedFields = []*wafv2.FieldToMatch{} } @@ -126,18 +242,84 @@ func resourceAwsWafv2WebACLLoggingConfigurationDelete(d *schema.ResourceData, me return nil } +func expandWafv2RedactedFields(fields []interface{}) ([]*wafv2.FieldToMatch, error) { + redactedFields := make([]*wafv2.FieldToMatch, 0, len(fields)) + for _, field := range fields { + f, err := expandWafv2RedactedField(field) + if err != nil { + return nil, err + } + redactedFields = append(redactedFields, f) + } + return redactedFields, nil +} + +func expandWafv2RedactedField(field interface{}) (*wafv2.FieldToMatch, error) { + m := field.(map[string]interface{}) + + f := &wafv2.FieldToMatch{} + + // While the FieldToMatch struct allows more than 1 of its fields to be set, + // the WAFv2 API does not. In addition, in the context of Logging Configuration requests, + // the WAFv2 API only supports the following redacted fields. + // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14244 + nFields := 0 + for _, v := range m { + if len(v.([]interface{})) > 0 { + nFields++ + } + if nFields > 1 { + return nil, fmt.Errorf(`error expanding redacted_field: only one of "method", "query_string", + "single_header", or "uri_path" is valid`) + } + } + + if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { + f.Method = &wafv2.Method{} + } else if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { + f.QueryString = &wafv2.QueryString{} + } else if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { + f.SingleHeader = expandWafv2SingleHeader(m["single_header"].([]interface{})) + } else if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { + f.UriPath = &wafv2.UriPath{} + } + + return f, nil +} + func flattenWafv2RedactedFields(fields []*wafv2.FieldToMatch) []map[string]interface{} { redactedFields := make([]map[string]interface{}, 0, len(fields)) for _, field := range fields { - redactedFields = append(redactedFields, flattenWafv2FieldToMatch(field).([]interface{})[0].(map[string]interface{})) + redactedFields = append(redactedFields, flattenWafv2RedactedField(field)) } return redactedFields } -func expandWafv2RedactedFields(fields []interface{}) []*wafv2.FieldToMatch { - redactedFields := make([]*wafv2.FieldToMatch, 0, len(fields)) - for _, field := range fields { - redactedFields = append(redactedFields, expandWafv2FieldToMatch([]interface{}{field})) +func flattenWafv2RedactedField(f *wafv2.FieldToMatch) map[string]interface{} { + m := map[string]interface{}{} + + if f == nil { + return m } - return redactedFields + + // In the context of Logging Configuration requests, + // the WAFv2 API only supports the following redacted fields. + // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14244 + if f.Method != nil { + m["method"] = make([]map[string]interface{}, 1) + } + + if f.QueryString != nil { + m["query_string"] = make([]map[string]interface{}, 1) + } + + if f.SingleHeader != nil { + m["single_header"] = flattenWafv2SingleHeader(f.SingleHeader) + } + + if f.UriPath != nil { + m["uri_path"] = make([]map[string]interface{}, 1) + } + + return m } diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go index bce42080a91..fdc96d6e70c 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go @@ -40,7 +40,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_basic(t *testing.T) { }) } -func TestAccAwsWafv2WebACLLoggingConfiguration_update(t *testing.T) { +func TestAccAwsWafv2WebACLLoggingConfiguration_updateSingleHeaderRedactedField(t *testing.T) { var v wafv2.LoggingConfiguration rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_wafv2_web_acl_logging_configuration.test" @@ -61,7 +61,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_update(t *testing.T) { ), }, { - Config: testAccAwsWafv2WebACLLoggingConfiguration_updateTwoRedactedFields(rName), + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateTwoSingleHeaderRedactedFields(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), @@ -76,13 +76,206 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_update(t *testing.T) { ), }, { - Config: testAccAwsWafv2WebACLLoggingConfiguration_updateOneRedactedField(rName), + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateSingleHeaderRedactedField(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "single_header.0.name": "user-agent", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14248 +func TestAccAwsWafv2WebACLLoggingConfiguration_updateMethodRedactedField(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "0"), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateRedactedField(rName, "method"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "method.#": "1", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14248 +func TestAccAwsWafv2WebACLLoggingConfiguration_updateQueryStringRedactedField(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "0"), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateRedactedField(rName, "query_string"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "query_string.#": "1", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14248 +func TestAccAwsWafv2WebACLLoggingConfiguration_updateUriPathRedactedField(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "0"), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateRedactedField(rName, "uri_path"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "uri_path.#": "1", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14248 +func TestAccAwsWafv2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateRedactedField(rName, "uri_path"), Check: resource.ComposeTestCheckFunc( testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "uri_path.#": "1", + }), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateTwoRedactedFields(rName, "uri_path", "method"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "2"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "uri_path.#": "1", + }), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "method.#": "1", + }), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateThreeRedactedFields(rName, "uri_path", "query_string"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "3"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "uri_path.#": "1", + }), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "query_string.#": "1", + }), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "single_header.0.name": "user-agent", }), ), @@ -201,6 +394,76 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_disappears(t *testing.T) { }) } +func TestAccAwsWafv2WebACLLoggingConfiguration_emptyRedactedFields(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_emptyRedactedField(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAwsWafv2WebACLLoggingConfiguration_updateEmptyRedactedFields(t *testing.T) { + var v wafv2.LoggingConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafv2_web_acl_logging_configuration.test" + webACLResourceName := "aws_wafv2_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_emptyRedactedField(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "0"), + ), + }, + { + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateRedactedField(rName, "uri_path"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), + tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + "uri_path.#": "1", + }), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAwsWafv2WebACLLoggingConfiguration_disappears_WebAcl(t *testing.T) { var v wafv2.LoggingConfiguration rName := acctest.RandomWithPrefix("tf-acc-test") @@ -295,8 +558,7 @@ data "aws_partition" "current" {} data "aws_caller_identity" "current" {} resource "aws_iam_role" "firehose" { - name = "%[1]s" - + name = "%[1]s" assume_role_policy = < 0 { - f.AllQueryArguments = &wafv2.AllQueryArguments{} + // While the FieldToMatch struct allows more than 1 of its fields to be set, + // the WAFv2 API does not. + // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14248 + nFields := 0 + for _, v := range m { + if len(v.([]interface{})) > 0 { + nFields++ + } + if nFields > 1 { + return nil, fmt.Errorf(`error expanding field_to_match: only one of "all_query_arguments", "body", method", + "query_string", "single_header", "single_query_argument", or "uri_path" is valid`) + } } - if v, ok := m["body"]; ok && len(v.([]interface{})) > 0 { + if v, ok := m["all_query_arguments"]; ok && len(v.([]interface{})) > 0 { + f.AllQueryArguments = &wafv2.AllQueryArguments{} + } else if v, ok := m["body"]; ok && len(v.([]interface{})) > 0 { f.Body = &wafv2.Body{} - } - - if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { + } else if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { f.Method = &wafv2.Method{} - } - - if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { + } else if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { f.QueryString = &wafv2.QueryString{} - } - - if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { + } else if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { f.SingleHeader = expandWafv2SingleHeader(m["single_header"].([]interface{})) - } - - if v, ok := m["single_query_argument"]; ok && len(v.([]interface{})) > 0 { + } else if v, ok := m["single_query_argument"]; ok && len(v.([]interface{})) > 0 { f.SingleQueryArgument = expandWafv2SingleQueryArgument(m["single_query_argument"].([]interface{})) - } - - if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { + } else if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { f.UriPath = &wafv2.UriPath{} } - return f + return f, nil } func expandWafv2ForwardedIPConfig(l []interface{}) *wafv2.ForwardedIPConfig { @@ -741,90 +814,127 @@ func expandWafv2GeoMatchStatement(l []interface{}) *wafv2.GeoMatchStatement { return statement } -func expandWafv2NotStatement(l []interface{}) *wafv2.NotStatement { +func expandWafv2NotStatement(l []interface{}) (*wafv2.NotStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) s := m["statement"].([]interface{}) if len(s) == 0 || s[0] == nil { - return nil + return nil, nil } m = s[0].(map[string]interface{}) - return &wafv2.NotStatement{ - Statement: expandWafv2Statement(m), + statement, err := expandWafv2Statement(m) + if err != nil { + return nil, err } + return &wafv2.NotStatement{Statement: statement}, nil } -func expandWafv2OrStatement(l []interface{}) *wafv2.OrStatement { +func expandWafv2OrStatement(l []interface{}) (*wafv2.OrStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) - return &wafv2.OrStatement{ - Statements: expandWafv2Statements(m["statement"].([]interface{})), + s, err := expandWafv2Statements(m["statement"].([]interface{})) + if err != nil { + return nil, err } + + return &wafv2.OrStatement{Statements: s}, nil } -func expandWafv2RegexPatternSetReferenceStatement(l []interface{}) *wafv2.RegexPatternSetReferenceStatement { +func expandWafv2RegexPatternSetReferenceStatement(l []interface{}) (*wafv2.RegexPatternSetReferenceStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) - return &wafv2.RegexPatternSetReferenceStatement{ + s := &wafv2.RegexPatternSetReferenceStatement{ ARN: aws.String(m["arn"].(string)), - FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } + + fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) + if err != nil { + return nil, err + } + + s.FieldToMatch = fieldToMatch + + return s, nil } -func expandWafv2SizeConstraintStatement(l []interface{}) *wafv2.SizeConstraintStatement { +func expandWafv2SizeConstraintStatement(l []interface{}) (*wafv2.SizeConstraintStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) - return &wafv2.SizeConstraintStatement{ + s := &wafv2.SizeConstraintStatement{ ComparisonOperator: aws.String(m["comparison_operator"].(string)), - FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), Size: aws.Int64(int64(m["size"].(int))), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } + + fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) + if err != nil { + return nil, err + } + + s.FieldToMatch = fieldToMatch + + return s, nil } -func expandWafv2SqliMatchStatement(l []interface{}) *wafv2.SqliMatchStatement { +func expandWafv2SqliMatchStatement(l []interface{}) (*wafv2.SqliMatchStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) - return &wafv2.SqliMatchStatement{ - FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), + s := &wafv2.SqliMatchStatement{ TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } + + fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) + if err != nil { + return nil, err + } + + s.FieldToMatch = fieldToMatch + + return s, nil } -func expandWafv2XssMatchStatement(l []interface{}) *wafv2.XssMatchStatement { +func expandWafv2XssMatchStatement(l []interface{}) (*wafv2.XssMatchStatement, error) { if len(l) == 0 || l[0] == nil { - return nil + return nil, nil } m := l[0].(map[string]interface{}) - return &wafv2.XssMatchStatement{ - FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), + s := &wafv2.XssMatchStatement{ TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } + + fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) + if err != nil { + return nil, err + } + + s.FieldToMatch = fieldToMatch + + return s, nil } func flattenWafv2Rules(r []*wafv2.Rule) interface{} { diff --git a/website/docs/r/wafv2_rule_group.html.markdown b/website/docs/r/wafv2_rule_group.html.markdown index ca47b030c7e..c6cfd3208a3 100644 --- a/website/docs/r/wafv2_rule_group.html.markdown +++ b/website/docs/r/wafv2_rule_group.html.markdown @@ -307,7 +307,7 @@ Each `rule` supports the following arguments: The `action` block supports the following arguments: -~> **NOTE**: One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action` +~> **NOTE:** One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action` * `allow` - (Optional) Instructs AWS WAF to allow the web request. * `block` - (Optional) Instructs AWS WAF to block the web request. @@ -429,7 +429,8 @@ The part of a web request that you want AWS WAF to inspect. Include the single ` The `field_to_match` block supports the following arguments: -~> **NOTE**: An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes +~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. +An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes. * `all_query_arguments` - (Optional) Inspect all query arguments. * `body` - (Optional) Inspect the request body, which immediately follows the request headers. diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index f3a91cb8d71..77a0d8c6a72 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -267,14 +267,14 @@ The following arguments are supported: The `default_action` block supports the following arguments: -~> **NOTE**: One of `allow` or `block`, expressed as an empty configuration block `{}`, is required when specifying a `default_action` +~> **NOTE:** One of `allow` or `block`, expressed as an empty configuration block `{}`, is required when specifying a `default_action` * `allow` - (Optional) Specifies that AWS WAF should allow requests by default. * `block` - (Optional) Specifies that AWS WAF should block requests by default. ### Rules -~> **NOTE**: One of `action` or `override_action` is required when specifying a rule +~> **NOTE:** One of `action` or `override_action` is required when specifying a rule Each `rule` supports the following arguments: @@ -289,7 +289,7 @@ Each `rule` supports the following arguments: The `action` block supports the following arguments: -~> **NOTE**: One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action` +~> **NOTE:** One of `allow`, `block`, or `count`, expressed as an empty configuration block `{}`, is required when specifying an `action` * `allow` - (Optional) Instructs AWS WAF to allow the web request. Configure as an empty block `{}`. * `block` - (Optional) Instructs AWS WAF to block the web request. Configure as an empty block `{}`. @@ -299,7 +299,7 @@ The `action` block supports the following arguments: The `override_action` block supports the following arguments: -~> **NOTE**: One of `count` or `none`, expressed as an empty configuration block `{}`, is required when specifying an `override_action` +~> **NOTE:** One of `count` or `none`, expressed as an empty configuration block `{}`, is required when specifying an `override_action` * `count` - (Optional) Override the rule action setting to count (i.e. only count matches). Configured as an empty block `{}`. * `none` - (Optional) Don't override the rule action setting. Configured as an empty block `{}`. @@ -466,7 +466,8 @@ The part of a web request that you want AWS WAF to inspect. Include the single ` The `field_to_match` block supports the following arguments: -~> **NOTE**: An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, `query_string`, or `uri_path` attributes +~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. +An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes. * `all_query_arguments` - (Optional) Inspect all query arguments. * `body` - (Optional) Inspect the request body, which immediately follows the request headers. diff --git a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown index 62955499241..b2e926ef7ab 100644 --- a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown +++ b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown @@ -38,12 +38,14 @@ The following arguments are supported: The `redacted_fields` block supports the following arguments: -* `all_query_arguments` - (Optional) Redact all query arguments. -* `body` - (Optional) Redact the request body, which immediately follows the request headers. +~> **NOTE:** Only one of `method`, `query_string`, `single_header` or `uri_path` can be specified. + +* `all_query_arguments` - (Optional, **DEPRECATED**) Redact all query arguments. +* `body` - (Optional, **DEPRECATED**) Redact the request body, which immediately follows the request headers. * `method` - (Optional) Redact the HTTP method. The method indicates the type of operation that the request is asking the origin to perform. * `query_string` - (Optional) Redact the query string. This is the part of a URL that appears after a `?` character, if any. * `single_header` - (Optional) Redact a single header. See [Single Header](#single-header) below for details. -* `single_query_argument` - (Optional) Redact a single query argument. See [Single Query Argument](#single-query-argument) below for details. +* `single_query_argument` - (Optional, **DEPRECATED**) Redact a single query argument. See [Single Query Argument](#single-query-argument) below for details. * `uri_path` - (Optional) Redact the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`. ### Single Header @@ -54,7 +56,7 @@ The `single_header` block supports the following arguments: * `name` - (Optional) The name of the query header to redact. This setting must be provided as lower case characters. -### Single Query Argument +### Single Query Argument (**DEPRECATED**) Redact a single query argument. Provide the name of the query argument to redact, such as `UserName` or `SalesRegion` (provided as lowercase strings). From 1f54e3dd0d78c36e27f3cfda7e884c78c706715d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:19:48 -0400 Subject: [PATCH 0363/1252] tests/r/dx_gateway_association: Add ErrorCheck --- aws/resource_aws_dx_gateway_association_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_dx_gateway_association_test.go b/aws/resource_aws_dx_gateway_association_test.go index ee7f28d5e33..0a4355f702a 100644 --- a/aws/resource_aws_dx_gateway_association_test.go +++ b/aws/resource_aws_dx_gateway_association_test.go @@ -192,6 +192,7 @@ func TestAccAwsDxGatewayAssociation_V0StateUpgrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -217,6 +218,7 @@ func TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -259,6 +261,7 @@ func TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -292,6 +295,7 @@ func TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -335,6 +339,7 @@ func TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount(t *testing.T testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -368,6 +373,7 @@ func TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -399,6 +405,7 @@ func TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewaySingleAccount(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -447,6 +454,7 @@ func TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount(t *tes testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ @@ -492,6 +500,7 @@ func TestAccAwsDxGatewayAssociation_recreateProposal(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy, Steps: []resource.TestStep{ From 541ae0d102ce163476c5d4e85f26326c1694b82a Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 3 Dec 2020 11:13:41 -0500 Subject: [PATCH 0364/1252] mark update field suppress func needed --- ...aws_wafv2_web_acl_logging_configuration.go | 103 +++++++++++++----- ...afv2_web_acl_logging_configuration_test.go | 2 +- 2 files changed, 74 insertions(+), 31 deletions(-) diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index 84ced141911..1b526176fa8 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -1,6 +1,7 @@ package aws import ( + "bytes" "fmt" "log" "regexp" @@ -8,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { @@ -41,6 +43,30 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // (e.g. body {}) will result in a nil redacted_fields attribute Type: schema.TypeList, Optional: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + o, n := d.GetChange("redacted_fields") + oList := o.([]interface{}) + nList := n.([]interface{}) + if len(oList) == 0 && len(nList) == 0 { + return true + } + if len(oList) == 0 && len(nList) != 0 { + if nList[0] == nil { + return true + } + return false + } + if len(oList) != 0 && len(nList) == 0 { + if oList[0] == nil { + return true + } + return false + } + + oldSet := schema.NewSet(redactedFieldsHash, oList) + newSet := schema.NewSet(redactedFieldsHash, nList) + return oldSet.Equal(newSet) + }, MaxItems: 100, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -173,11 +199,7 @@ func resourceAwsWafv2WebACLLoggingConfigurationPut(d *schema.ResourceData, meta } if v, ok := d.GetOk("redacted_fields"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { - fields, err := expandWafv2RedactedFields(v.([]interface{})) - if err != nil { - return err - } - config.RedactedFields = fields + config.RedactedFields = expandWafv2RedactedFields(v.([]interface{})) } else { config.RedactedFields = []*wafv2.FieldToMatch{} } @@ -242,19 +264,15 @@ func resourceAwsWafv2WebACLLoggingConfigurationDelete(d *schema.ResourceData, me return nil } -func expandWafv2RedactedFields(fields []interface{}) ([]*wafv2.FieldToMatch, error) { +func expandWafv2RedactedFields(fields []interface{}) []*wafv2.FieldToMatch { redactedFields := make([]*wafv2.FieldToMatch, 0, len(fields)) for _, field := range fields { - f, err := expandWafv2RedactedField(field) - if err != nil { - return nil, err - } - redactedFields = append(redactedFields, f) + redactedFields = append(redactedFields, expandWafv2RedactedField(field)) } - return redactedFields, nil + return redactedFields } -func expandWafv2RedactedField(field interface{}) (*wafv2.FieldToMatch, error) { +func expandWafv2RedactedField(field interface{}) *wafv2.FieldToMatch { m := field.(map[string]interface{}) f := &wafv2.FieldToMatch{} @@ -263,32 +281,27 @@ func expandWafv2RedactedField(field interface{}) (*wafv2.FieldToMatch, error) { // the WAFv2 API does not. In addition, in the context of Logging Configuration requests, // the WAFv2 API only supports the following redacted fields. // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/14244 - nFields := 0 - for _, v := range m { - if len(v.([]interface{})) > 0 { - nFields++ - } - if nFields > 1 { - return nil, fmt.Errorf(`error expanding redacted_field: only one of "method", "query_string", - "single_header", or "uri_path" is valid`) - } - } - if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { f.Method = &wafv2.Method{} - } else if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { f.QueryString = &wafv2.QueryString{} - } else if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { f.SingleHeader = expandWafv2SingleHeader(m["single_header"].([]interface{})) - } else if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { f.UriPath = &wafv2.UriPath{} } - return f, nil + return f } -func flattenWafv2RedactedFields(fields []*wafv2.FieldToMatch) []map[string]interface{} { - redactedFields := make([]map[string]interface{}, 0, len(fields)) +func flattenWafv2RedactedFields(fields []*wafv2.FieldToMatch) []interface{} { + redactedFields := make([]interface{}, 0, len(fields)) for _, field := range fields { redactedFields = append(redactedFields, flattenWafv2RedactedField(field)) } @@ -323,3 +336,33 @@ func flattenWafv2RedactedField(f *wafv2.FieldToMatch) map[string]interface{} { return m } + +// redactedFieldsHash takes a map[string]interface{} as input and generates a +// unique hashcode, taking into account keys defined in the resource's schema +// are present even if not explicitly configured +func redactedFieldsHash(v interface{}) int { + var buf bytes.Buffer + m, ok := v.(map[string]interface{}) + if !ok { + return 0 + } + if v, ok := m["method"].([]interface{}); ok && len(v) > 0 { + buf.WriteString("method-") + } + if v, ok := m["query_string"].([]interface{}); ok && len(v) > 0 { + buf.WriteString("query_string-") + } + if v, ok := m["uri_path"].([]interface{}); ok && len(v) > 0 { + buf.WriteString("uri_path-") + } + if v, ok := m["single_header"].([]interface{}); ok && len(v) > 0 { + sh, ok := v[0].(map[string]interface{}) + if ok { + if name, ok := sh["name"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", name)) + } + } + } + + return hashcode.String(buf.String()) +} diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go index fdc96d6e70c..4c09913e8f4 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go @@ -263,7 +263,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *t ), }, { - Config: testAccAwsWafv2WebACLLoggingConfiguration_updateThreeRedactedFields(rName, "uri_path", "query_string"), + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateThreeRedactedFields(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), From 3e77086f2a631b13238491ba2048bba8011032bc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:14 -0400 Subject: [PATCH 0365/1252] tests/r/dx_hosted_private_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_hosted_private_virtual_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_hosted_private_virtual_interface_test.go b/aws/resource_aws_dx_hosted_private_virtual_interface_test.go index 733a065a44f..68d0e58791e 100644 --- a/aws/resource_aws_dx_hosted_private_virtual_interface_test.go +++ b/aws/resource_aws_dx_hosted_private_virtual_interface_test.go @@ -36,6 +36,7 @@ func TestAccAwsDxHostedPrivateVirtualInterface_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -94,6 +95,7 @@ func TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ From 8cb23ff40d2b932b3128bf38da36bed85cc1bb49 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:15 -0400 Subject: [PATCH 0366/1252] tests/r/dx_hosted_public_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_hosted_public_virtual_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_hosted_public_virtual_interface_test.go b/aws/resource_aws_dx_hosted_public_virtual_interface_test.go index 4fe2926f1da..75340a861f9 100644 --- a/aws/resource_aws_dx_hosted_public_virtual_interface_test.go +++ b/aws/resource_aws_dx_hosted_public_virtual_interface_test.go @@ -37,6 +37,7 @@ func TestAccAwsDxHostedPublicVirtualInterface_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -97,6 +98,7 @@ func TestAccAwsDxHostedPublicVirtualInterface_AccepterTags(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ From 2dd45e93374c33b9a33bde523e8483f7c6e15bbe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:15 -0400 Subject: [PATCH 0367/1252] tests/r/dx_hosted_transit_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_hosted_transit_virtual_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go b/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go index cd2ff5978cc..a164976c209 100644 --- a/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go +++ b/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go @@ -51,6 +51,7 @@ func testAccAwsDxHostedTransitVirtualInterface_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedTransitVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -110,6 +111,7 @@ func testAccAwsDxHostedTransitVirtualInterface_accepterTags(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDxHostedTransitVirtualInterfaceDestroy, Steps: []resource.TestStep{ From 6f0d528acf25a4e84113c0c115be49e0d5d7118a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:26 -0400 Subject: [PATCH 0368/1252] tests/r/dx_lag: Add ErrorCheck --- aws/resource_aws_dx_lag_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_lag_test.go b/aws/resource_aws_dx_lag_test.go index 82efc88f761..eb28934f7d1 100644 --- a/aws/resource_aws_dx_lag_test.go +++ b/aws/resource_aws_dx_lag_test.go @@ -85,6 +85,7 @@ func TestAccAWSDxLag_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxLagDestroy, Steps: []resource.TestStep{ @@ -124,6 +125,7 @@ func TestAccAWSDxLag_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxLagDestroy, Steps: []resource.TestStep{ From f3cbf739204ed670c9c694f91e35ddde44210f8f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:26 -0400 Subject: [PATCH 0369/1252] tests/r/dx_private_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_private_virtual_interface_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_dx_private_virtual_interface_test.go b/aws/resource_aws_dx_private_virtual_interface_test.go index 71a61cf5006..31db597ad7b 100644 --- a/aws/resource_aws_dx_private_virtual_interface_test.go +++ b/aws/resource_aws_dx_private_virtual_interface_test.go @@ -30,6 +30,7 @@ func TestAccAwsDxPrivateVirtualInterface_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -101,6 +102,7 @@ func TestAccAwsDxPrivateVirtualInterface_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -179,6 +181,7 @@ func TestAccAwsDxPrivateVirtualInterface_DxGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ From eb64ff7f9a98705fd2d0bef03fc38904f10510ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:26 -0400 Subject: [PATCH 0370/1252] tests/r/dx_public_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_public_virtual_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_public_virtual_interface_test.go b/aws/resource_aws_dx_public_virtual_interface_test.go index 47e867b05c7..b7f0cbd0c01 100644 --- a/aws/resource_aws_dx_public_virtual_interface_test.go +++ b/aws/resource_aws_dx_public_virtual_interface_test.go @@ -35,6 +35,7 @@ func TestAccAwsDxPublicVirtualInterface_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -86,6 +87,7 @@ func TestAccAwsDxPublicVirtualInterface_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ From 9f95d7d8b3346f30ebbc4f4900063f883dd94cbf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 13:22:26 -0400 Subject: [PATCH 0371/1252] tests/r/dx_transit_virtual_interface: Add ErrorCheck --- aws/resource_aws_dx_transit_virtual_interface_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dx_transit_virtual_interface_test.go b/aws/resource_aws_dx_transit_virtual_interface_test.go index 55640330ccd..76e33c8e8cb 100644 --- a/aws/resource_aws_dx_transit_virtual_interface_test.go +++ b/aws/resource_aws_dx_transit_virtual_interface_test.go @@ -45,6 +45,7 @@ func testAccAwsDxTransitVirtualInterface_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxTransitVirtualInterfaceDestroy, Steps: []resource.TestStep{ @@ -117,6 +118,7 @@ func testAccAwsDxTransitVirtualInterface_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directconnect.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDxTransitVirtualInterfaceDestroy, Steps: []resource.TestStep{ From 82b90d44e88821d0404c8f4e59bd0dc7e1ff0a6a Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 3 Dec 2020 11:46:44 -0500 Subject: [PATCH 0372/1252] mark update field suppress func needed --- ...aws_wafv2_web_acl_logging_configuration.go | 116 +++++------------- 1 file changed, 31 insertions(+), 85 deletions(-) diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index 1b526176fa8..1ed6e8e0cca 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" ) func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { @@ -41,33 +42,9 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // to be correctly interpreted, this argument must be of type List, // otherwise, at apply-time a field configured as an empty block // (e.g. body {}) will result in a nil redacted_fields attribute - Type: schema.TypeList, - Optional: true, - DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { - o, n := d.GetChange("redacted_fields") - oList := o.([]interface{}) - nList := n.([]interface{}) - if len(oList) == 0 && len(nList) == 0 { - return true - } - if len(oList) == 0 && len(nList) != 0 { - if nList[0] == nil { - return true - } - return false - } - if len(oList) != 0 && len(nList) == 0 { - if oList[0] == nil { - return true - } - return false - } - - oldSet := schema.NewSet(redactedFieldsHash, oList) - newSet := schema.NewSet(redactedFieldsHash, nList) - return oldSet.Equal(newSet) - }, - MaxItems: 100, + Type: schema.TypeList, + Optional: true, + MaxItems: 100, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // TODO: remove attributes marked as Deprecated @@ -111,6 +88,7 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // Trying to solve it with StateFunc and/or DiffSuppressFunc resulted in hash problem of the rule field or didn't work. validation.StringMatch(regexp.MustCompile(`^[a-z0-9-_]+$`), "must contain only lowercase alphanumeric characters, underscores, and hyphens"), ), + Deprecated: "Not supported by WAFv2 API", }, }, }, @@ -119,8 +97,8 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { "uri_path": wafv2EmptySchema(), }, }, - Description: "Parts of the request to exclude from logs", - DiffSuppressFunc: suppressEquivalentRedactedFields, + Description: "Parts of the request to exclude from logs", + DiffSuppressFunc: suppressRedactedFieldsDiff, }, "resource_arn": { Type: schema.TypeString, @@ -133,62 +111,6 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { } } -// suppressEquivalentRedactedFields is required to -// handle shifts in List ordering returned from the API -func suppressEquivalentRedactedFields(k, old, new string, d *schema.ResourceData) bool { - o, n := d.GetChange("redacted_fields") - if o != nil && n != nil { - oldFields := o.([]interface{}) - newFields := n.([]interface{}) - if len(oldFields) != len(newFields) { - // account for case where the empty block {} is used as input - return !d.IsNewResource() && len(oldFields) == 0 && len(newFields) == 1 && newFields[0] == nil - } - - for _, oldField := range oldFields { - om := oldField.(map[string]interface{}) - found := false - for _, newField := range newFields { - nm := newField.(map[string]interface{}) - if len(om) != len(nm) { - continue - } - for k, newVal := range nm { - if oldVal, ok := om[k]; ok { - if k == "method" || k == "query_string" || k == "uri_path" { - if len(oldVal.([]interface{})) == len(newVal.([]interface{})) { - found = true - break - } - } else if k == "single_header" { - oldHeader := oldVal.([]interface{}) - newHeader := newVal.([]interface{}) - if len(oldHeader) > 0 && oldHeader[0] != nil { - if len(newHeader) > 0 && newHeader[0] != nil { - oldName := oldVal.([]interface{})[0].(map[string]interface{})["name"].(string) - newName := newVal.([]interface{})[0].(map[string]interface{})["name"].(string) - if oldName == newName { - found = true - break - } - } - } - } - } - } - if found { - break - } - } - if !found { - return false - } - } - return true - } - return false -} - func resourceAwsWafv2WebACLLoggingConfigurationPut(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafv2conn @@ -366,3 +288,27 @@ func redactedFieldsHash(v interface{}) int { return hashcode.String(buf.String()) } + +func suppressRedactedFieldsDiff(k, old, new string, d *schema.ResourceData) bool { + o, n := d.GetChange("redacted_fields") + oList := o.([]interface{}) + nList := n.([]interface{}) + + if len(oList) == 0 && len(nList) == 0 { + return true + } + + if len(oList) == 0 && len(nList) != 0 { + // account for empty block + return nList[0] == nil + } + + if len(oList) != 0 && len(nList) == 0 { + // account for empty block + return oList[0] == nil + } + + oldSet := schema.NewSet(redactedFieldsHash, oList) + newSet := schema.NewSet(redactedFieldsHash, nList) + return oldSet.Equal(newSet) +} \ No newline at end of file From 2ab6b80cedbfcab8e486ce85848a274dbfa3fbcc Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 13:01:12 -0400 Subject: [PATCH 0373/1252] add additional deprecation message; update documentation; add changelog entries --- .changelog/14319.txt | 7 +++++++ aws/resource_aws_wafv2_web_acl_logging_configuration.go | 1 + .../r/wafv2_web_acl_logging_configuration.html.markdown | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 .changelog/14319.txt diff --git a/.changelog/14319.txt b/.changelog/14319.txt new file mode 100644 index 00000000000..71d707d9f4d --- /dev/null +++ b/.changelog/14319.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_wafv2_web_acl_logging_configuration: Ensure `redacted_fields` are applied to the resource +``` + +```release-note:note +resource/aws_wafv2_web_acl_logging_configuration: The `redacted_fields` configuration block `all_query_arguments`, `body`, and `single_query_argument` arguments have been deprecated to match the WAF API documentation +``` \ No newline at end of file diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index 1ed6e8e0cca..7b196ee4a51 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -69,6 +69,7 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // Trying to solve it with StateFunc and/or DiffSuppressFunc resulted in hash problem of the rule field or didn't work. validation.StringMatch(regexp.MustCompile(`^[a-z0-9-_]+$`), "must contain only lowercase alphanumeric characters, underscores, and hyphens"), ), + Deprecated: "Not supported by WAFv2 API", }, }, }, diff --git a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown index b2e926ef7ab..56537095307 100644 --- a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown +++ b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown @@ -42,11 +42,11 @@ The `redacted_fields` block supports the following arguments: * `all_query_arguments` - (Optional, **DEPRECATED**) Redact all query arguments. * `body` - (Optional, **DEPRECATED**) Redact the request body, which immediately follows the request headers. -* `method` - (Optional) Redact the HTTP method. The method indicates the type of operation that the request is asking the origin to perform. -* `query_string` - (Optional) Redact the query string. This is the part of a URL that appears after a `?` character, if any. +* `method` - (Optional) Redact the HTTP method. Must be specified as an empty configuration block `{}`. The method indicates the type of operation that the request is asking the origin to perform. +* `query_string` - (Optional) Redact the query string. Must be specified as an empty configuration block `{}`. This is the part of a URL that appears after a `?` character, if any. * `single_header` - (Optional) Redact a single header. See [Single Header](#single-header) below for details. * `single_query_argument` - (Optional, **DEPRECATED**) Redact a single query argument. See [Single Query Argument](#single-query-argument) below for details. -* `uri_path` - (Optional) Redact the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`. +* `uri_path` - (Optional) Redact the request URI path. Must be specified as an empty configuration block `{}`. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`. ### Single Header From 405337c1f0ae4a7cfa0d9c414ba14ada6b43a30d Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 13:31:52 -0400 Subject: [PATCH 0374/1252] changes after rebase --- ...aws_wafv2_web_acl_logging_configuration.go | 10 +- ...afv2_web_acl_logging_configuration_test.go | 67 ++--- aws/wafv2_helper.go | 256 ++++++------------ 3 files changed, 120 insertions(+), 213 deletions(-) diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index 7b196ee4a51..b9b0e65f909 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -42,9 +42,9 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // to be correctly interpreted, this argument must be of type List, // otherwise, at apply-time a field configured as an empty block // (e.g. body {}) will result in a nil redacted_fields attribute - Type: schema.TypeList, - Optional: true, - MaxItems: 100, + Type: schema.TypeList, + Optional: true, + MaxItems: 100, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ // TODO: remove attributes marked as Deprecated @@ -98,7 +98,7 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { "uri_path": wafv2EmptySchema(), }, }, - Description: "Parts of the request to exclude from logs", + Description: "Parts of the request to exclude from logs", DiffSuppressFunc: suppressRedactedFieldsDiff, }, "resource_arn": { @@ -312,4 +312,4 @@ func suppressRedactedFieldsDiff(k, old, new string, d *schema.ResourceData) bool oldSet := schema.NewSet(redactedFieldsHash, oList) newSet := schema.NewSet(redactedFieldsHash, nList) return oldSet.Equal(newSet) -} \ No newline at end of file +} diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go index 4c09913e8f4..a9b16c2a7d4 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go @@ -82,7 +82,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateSingleHeaderRedactedField(t resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "single_header.0.name": "user-agent", }), ), @@ -124,7 +124,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMethodRedactedField(t *test resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "method.#": "1", }), ), @@ -166,7 +166,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateQueryStringRedactedField(t resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "query_string.#": "1", }), ), @@ -208,7 +208,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateUriPathRedactedField(t *tes resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "uri_path.#": "1", }), ), @@ -242,22 +242,21 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *t resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "uri_path.#": "1", }), ), }, { - Config: testAccAwsWafv2WebACLLoggingConfiguration_updateTwoRedactedFields(rName, "uri_path", "method"), + Config: testAccAwsWafv2WebACLLoggingConfiguration_updateTwoRedactedFields(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsWafv2WebACLLoggingConfigurationExists(resourceName, &v), resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "2"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "uri_path.#": "1", }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "method.#": "1", }), ), @@ -269,13 +268,13 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *t resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "3"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "uri_path.#": "1", }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "query_string.#": "1", }), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "single_header.0.name": "user-agent", }), ), @@ -450,7 +449,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateEmptyRedactedFields(t *test resource.TestCheckResourceAttrPair(resourceName, "resource_arn", webACLResourceName, "arn"), resource.TestCheckResourceAttr(resourceName, "log_destination_configs.#", "1"), resource.TestCheckResourceAttr(resourceName, "redacted_fields.#", "1"), - tfawsresource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "redacted_fields.*", map[string]string{ "uri_path.#": "1", }), ), @@ -558,7 +557,8 @@ data "aws_partition" "current" {} data "aws_caller_identity" "current" {} resource "aws_iam_role" "firehose" { - name = "%[1]s" + name = "%[1]s" + assume_role_policy = < 0 { - nFields++ - } - if nFields > 1 { - return nil, fmt.Errorf(`error expanding field_to_match: only one of "all_query_arguments", "body", method", - "query_string", "single_header", "single_query_argument", or "uri_path" is valid`) - } - } - if v, ok := m["all_query_arguments"]; ok && len(v.([]interface{})) > 0 { f.AllQueryArguments = &wafv2.AllQueryArguments{} - } else if v, ok := m["body"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["body"]; ok && len(v.([]interface{})) > 0 { f.Body = &wafv2.Body{} - } else if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["method"]; ok && len(v.([]interface{})) > 0 { f.Method = &wafv2.Method{} - } else if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["query_string"]; ok && len(v.([]interface{})) > 0 { f.QueryString = &wafv2.QueryString{} - } else if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["single_header"]; ok && len(v.([]interface{})) > 0 { f.SingleHeader = expandWafv2SingleHeader(m["single_header"].([]interface{})) - } else if v, ok := m["single_query_argument"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["single_query_argument"]; ok && len(v.([]interface{})) > 0 { f.SingleQueryArgument = expandWafv2SingleQueryArgument(m["single_query_argument"].([]interface{})) - } else if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { + } + + if v, ok := m["uri_path"]; ok && len(v.([]interface{})) > 0 { f.UriPath = &wafv2.UriPath{} } - return f, nil + return f } func expandWafv2ForwardedIPConfig(l []interface{}) *wafv2.ForwardedIPConfig { @@ -814,127 +753,90 @@ func expandWafv2GeoMatchStatement(l []interface{}) *wafv2.GeoMatchStatement { return statement } -func expandWafv2NotStatement(l []interface{}) (*wafv2.NotStatement, error) { +func expandWafv2NotStatement(l []interface{}) *wafv2.NotStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) s := m["statement"].([]interface{}) if len(s) == 0 || s[0] == nil { - return nil, nil + return nil } m = s[0].(map[string]interface{}) - statement, err := expandWafv2Statement(m) - if err != nil { - return nil, err + return &wafv2.NotStatement{ + Statement: expandWafv2Statement(m), } - return &wafv2.NotStatement{Statement: statement}, nil } -func expandWafv2OrStatement(l []interface{}) (*wafv2.OrStatement, error) { +func expandWafv2OrStatement(l []interface{}) *wafv2.OrStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) - s, err := expandWafv2Statements(m["statement"].([]interface{})) - if err != nil { - return nil, err + return &wafv2.OrStatement{ + Statements: expandWafv2Statements(m["statement"].([]interface{})), } - - return &wafv2.OrStatement{Statements: s}, nil } -func expandWafv2RegexPatternSetReferenceStatement(l []interface{}) (*wafv2.RegexPatternSetReferenceStatement, error) { +func expandWafv2RegexPatternSetReferenceStatement(l []interface{}) *wafv2.RegexPatternSetReferenceStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) - s := &wafv2.RegexPatternSetReferenceStatement{ + return &wafv2.RegexPatternSetReferenceStatement{ ARN: aws.String(m["arn"].(string)), + FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } - - fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) - if err != nil { - return nil, err - } - - s.FieldToMatch = fieldToMatch - - return s, nil } -func expandWafv2SizeConstraintStatement(l []interface{}) (*wafv2.SizeConstraintStatement, error) { +func expandWafv2SizeConstraintStatement(l []interface{}) *wafv2.SizeConstraintStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) - s := &wafv2.SizeConstraintStatement{ + return &wafv2.SizeConstraintStatement{ ComparisonOperator: aws.String(m["comparison_operator"].(string)), + FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), Size: aws.Int64(int64(m["size"].(int))), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } - - fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) - if err != nil { - return nil, err - } - - s.FieldToMatch = fieldToMatch - - return s, nil } -func expandWafv2SqliMatchStatement(l []interface{}) (*wafv2.SqliMatchStatement, error) { +func expandWafv2SqliMatchStatement(l []interface{}) *wafv2.SqliMatchStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) - s := &wafv2.SqliMatchStatement{ + return &wafv2.SqliMatchStatement{ + FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } - - fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) - if err != nil { - return nil, err - } - - s.FieldToMatch = fieldToMatch - - return s, nil } -func expandWafv2XssMatchStatement(l []interface{}) (*wafv2.XssMatchStatement, error) { +func expandWafv2XssMatchStatement(l []interface{}) *wafv2.XssMatchStatement { if len(l) == 0 || l[0] == nil { - return nil, nil + return nil } m := l[0].(map[string]interface{}) - s := &wafv2.XssMatchStatement{ + return &wafv2.XssMatchStatement{ + FieldToMatch: expandWafv2FieldToMatch(m["field_to_match"].([]interface{})), TextTransformations: expandWafv2TextTransformations(m["text_transformation"].(*schema.Set).List()), } - - fieldToMatch, err := expandWafv2FieldToMatch(m["field_to_match"].([]interface{})) - if err != nil { - return nil, err - } - - s.FieldToMatch = fieldToMatch - - return s, nil } func flattenWafv2Rules(r []*wafv2.Rule) interface{} { From 68ef691e55fb1f9fe12c10bec01833dc29f49930 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 13:33:22 -0400 Subject: [PATCH 0375/1252] revert unneeded changes --- aws/resource_aws_wafv2_rule_group.go | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/aws/resource_aws_wafv2_rule_group.go b/aws/resource_aws_wafv2_rule_group.go index bea165b1b04..b523161891a 100644 --- a/aws/resource_aws_wafv2_rule_group.go +++ b/aws/resource_aws_wafv2_rule_group.go @@ -120,16 +120,10 @@ func resourceAwsWafv2RuleGroupCreate(d *schema.ResourceData, meta interface{}) e Name: aws.String(d.Get("name").(string)), Scope: aws.String(d.Get("scope").(string)), Capacity: aws.Int64(int64(d.Get("capacity").(int))), + Rules: expandWafv2Rules(d.Get("rule").(*schema.Set).List()), VisibilityConfig: expandWafv2VisibilityConfig(d.Get("visibility_config").([]interface{})), } - rules, err := expandWafv2Rules(d.Get("rule").(*schema.Set).List()) - if err != nil { - return err - } - - params.Rules = rules - if v, ok := d.GetOk("description"); ok { params.Description = aws.String(v.(string)) } @@ -138,7 +132,7 @@ func resourceAwsWafv2RuleGroupCreate(d *schema.ResourceData, meta interface{}) e params.Tags = keyvaluetags.New(v).IgnoreAws().Wafv2Tags() } - err = resource.Retry(5*time.Minute, func() *resource.RetryError { + err := resource.Retry(5*time.Minute, func() *resource.RetryError { var err error resp, err = conn.CreateRuleGroup(params) if err != nil { @@ -228,21 +222,15 @@ func resourceAwsWafv2RuleGroupUpdate(d *schema.ResourceData, meta interface{}) e Name: aws.String(d.Get("name").(string)), Scope: aws.String(d.Get("scope").(string)), LockToken: aws.String(d.Get("lock_token").(string)), + Rules: expandWafv2Rules(d.Get("rule").(*schema.Set).List()), VisibilityConfig: expandWafv2VisibilityConfig(d.Get("visibility_config").([]interface{})), } - rules, err := expandWafv2Rules(d.Get("rule").(*schema.Set).List()) - if err != nil { - return err - } - - u.Rules = rules - if v, ok := d.GetOk("description"); ok { u.Description = aws.String(v.(string)) } - err = resource.Retry(5*time.Minute, func() *resource.RetryError { + err := resource.Retry(5*time.Minute, func() *resource.RetryError { _, err := conn.UpdateRuleGroup(u) if err != nil { if isAWSErr(err, wafv2.ErrCodeWAFUnavailableEntityException, "") { From 917f3fe41b8318b9f55006e5d36764fba481ffef Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 13:38:38 -0400 Subject: [PATCH 0376/1252] website linting --- website/docs/r/wafv2_rule_group.html.markdown | 2 +- website/docs/r/wafv2_web_acl.html.markdown | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/wafv2_rule_group.html.markdown b/website/docs/r/wafv2_rule_group.html.markdown index c6cfd3208a3..b10a5f7b002 100644 --- a/website/docs/r/wafv2_rule_group.html.markdown +++ b/website/docs/r/wafv2_rule_group.html.markdown @@ -429,7 +429,7 @@ The part of a web request that you want AWS WAF to inspect. Include the single ` The `field_to_match` block supports the following arguments: -~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. +~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes. * `all_query_arguments` - (Optional) Inspect all query arguments. diff --git a/website/docs/r/wafv2_web_acl.html.markdown b/website/docs/r/wafv2_web_acl.html.markdown index 77a0d8c6a72..2ce8e49de23 100644 --- a/website/docs/r/wafv2_web_acl.html.markdown +++ b/website/docs/r/wafv2_web_acl.html.markdown @@ -466,7 +466,7 @@ The part of a web request that you want AWS WAF to inspect. Include the single ` The `field_to_match` block supports the following arguments: -~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. +~> **NOTE:** Only one of `all_query_arguments`, `body`, `method`, `query_string`, `single_header`, `single_query_argument`, or `uri_path` can be specified. An empty configuration block `{}` should be used when specifying `all_query_arguments`, `body`, `method`, or `query_string` attributes. * `all_query_arguments` - (Optional) Inspect all query arguments. From f6b7b5abdc3840e9c1dd3d5ed4de55f436c54fed Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 17:48:17 +0000 Subject: [PATCH 0377/1252] Update CHANGELOG.md for #18154 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1194c25c119..5b9ba8a3e53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ ENHANCEMENTS: * provider: Add `default_tags` argument (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) * resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) +* resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_vpc: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) BUG FIXES: From 062605f52a808aea89380460365595cecece5a68 Mon Sep 17 00:00:00 2001 From: Bill Rich Date: Thu, 18 Mar 2021 10:56:12 -0700 Subject: [PATCH 0378/1252] Update .changelog/17909.txt Co-authored-by: Dirk Avery <31492422+YakDriver@users.noreply.github.com> --- .changelog/17909.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/17909.txt b/.changelog/17909.txt index 367f7ef6b32..3eb85dae46c 100644 --- a/.changelog/17909.txt +++ b/.changelog/17909.txt @@ -1,3 +1,3 @@ -```release-note:bug +```release-note:enhancement resource/aws_db_parameter_group: Store all values in lowercase to prevent unexpected diffs ``` From dfa55e6071d1591ea4f0a03be3b483c96649e674 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 17:59:18 +0000 Subject: [PATCH 0379/1252] Update CHANGELOG.md for #17909 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b9ba8a3e53..0009e4af229 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ FEATURES: ENHANCEMENTS: * provider: Add `default_tags` argument (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) +* resource/aws_db_parameter_group: Store all values in lowercase to prevent unexpected diffs ([#17909](https://github.com/hashicorp/terraform-provider-aws/issues/17909)) * resource/aws_ssm_parameter: Add support for `Intelligent-Tiering` ([#11967](https://github.com/hashicorp/terraform-provider-aws/issues/11967)) * resource/aws_storagegateway_gateway: Add support for `smb_file_share_visibility`. ([#18076](https://github.com/hashicorp/terraform-provider-aws/issues/18076)) * resource/aws_subnet: Support provider-wide default tags (in public preview, see note above) ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) From f4ef68f68477d19cf93e0a9dbe012be64de8c0c9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:01:18 -0400 Subject: [PATCH 0380/1252] tests/ds/glue_script: Add ErrorCheck --- aws/data_source_aws_glue_script_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_glue_script_test.go b/aws/data_source_aws_glue_script_test.go index d369141d38d..f43fa461e6d 100644 --- a/aws/data_source_aws_glue_script_test.go +++ b/aws/data_source_aws_glue_script_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ func TestAccDataSourceAWSGlueScript_Language_Python(t *testing.T) { dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSGlueScriptConfigPython(), @@ -28,8 +30,9 @@ func TestAccDataSourceAWSGlueScript_Language_Scala(t *testing.T) { dataSourceName := "data.aws_glue_script.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSGlueScriptConfigScala(), From 2c97d183d8fe579c481a7ace3350cb922c8bb36e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:01:28 -0400 Subject: [PATCH 0381/1252] tests/r/glue_catalog_database: Add ErrorCheck --- aws/resource_aws_glue_catalog_database_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_glue_catalog_database_test.go b/aws/resource_aws_glue_catalog_database_test.go index 46388f318b9..08a31c36b8e 100644 --- a/aws/resource_aws_glue_catalog_database_test.go +++ b/aws/resource_aws_glue_catalog_database_test.go @@ -67,6 +67,7 @@ func TestAccAWSGlueCatalogDatabase_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueDatabaseDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAWSGlueCatalogDatabase_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueDatabaseDestroy, Steps: []resource.TestStep{ From b0cad70960b6d22da05a01fddbca07d1b1679745 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:01:38 -0400 Subject: [PATCH 0382/1252] tests/r/glue_catalog_table: Add ErrorCheck --- aws/resource_aws_glue_catalog_table_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_glue_catalog_table_test.go b/aws/resource_aws_glue_catalog_table_test.go index 2abbb94bc1d..10b06abcbac 100644 --- a/aws/resource_aws_glue_catalog_table_test.go +++ b/aws/resource_aws_glue_catalog_table_test.go @@ -18,6 +18,7 @@ func TestAccAWSGlueCatalogTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSGlueCatalogTable_columnParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSGlueCatalogTable_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -141,6 +144,7 @@ func TestAccAWSGlueCatalogTable_update_addValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -213,6 +217,7 @@ func TestAccAWSGlueCatalogTable_update_replaceValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -326,6 +331,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_EmptyConfigurationBlock(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -346,6 +352,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SerDeInfo_EmptyConfigurationBl resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -367,6 +374,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SerDeInfo_UpdateValues(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -407,6 +415,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_SkewedInfo_EmptyConfigurationB resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -428,6 +437,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_schemaReference(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -458,6 +468,7 @@ func TestAccAWSGlueCatalogTable_StorageDescriptor_schemaReferenceArn(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -487,6 +498,7 @@ func TestAccAWSGlueCatalogTable_partitionIndexesSingle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -517,6 +529,7 @@ func TestAccAWSGlueCatalogTable_partitionIndexesMultiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -550,6 +563,7 @@ func TestAccAWSGlueCatalogTable_disappears_database(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ @@ -572,6 +586,7 @@ func TestAccAWSGlueCatalogTable_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueTableDestroy, Steps: []resource.TestStep{ From e141323ebf561deb2cd487dbeb42826444f2b1f1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:01:49 -0400 Subject: [PATCH 0383/1252] tests/r/glue_classifier: Add ErrorCheck --- aws/resource_aws_glue_classifier_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_glue_classifier_test.go b/aws/resource_aws_glue_classifier_test.go index 34e88dab803..ed8026e27bd 100644 --- a/aws/resource_aws_glue_classifier_test.go +++ b/aws/resource_aws_glue_classifier_test.go @@ -75,6 +75,7 @@ func TestAccAWSGlueClassifier_CsvClassifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -129,6 +130,7 @@ func TestAccAWSGlueClassifier_CsvClassifier_quoteSymbol(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -165,6 +167,7 @@ func TestAccAWSGlueClassifier_GrokClassifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -213,6 +216,7 @@ func TestAccAWSGlueClassifier_GrokClassifier_CustomPatterns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -261,6 +265,7 @@ func TestAccAWSGlueClassifier_JsonClassifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -305,6 +310,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -373,6 +379,7 @@ func TestAccAWSGlueClassifier_XmlClassifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ @@ -419,6 +426,7 @@ func TestAccAWSGlueClassifier_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueClassifierDestroy, Steps: []resource.TestStep{ From 465ea251976c17f03872f63483da683ec108580d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:02:01 -0400 Subject: [PATCH 0384/1252] tests/r/glue_connection: Add ErrorCheck --- aws/resource_aws_glue_connection_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_glue_connection_test.go b/aws/resource_aws_glue_connection_test.go index 755a4a85413..916a63a7980 100644 --- a/aws/resource_aws_glue_connection_test.go +++ b/aws/resource_aws_glue_connection_test.go @@ -65,6 +65,7 @@ func TestAccAWSGlueConnection_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -98,6 +99,7 @@ func TestAccAWSGlueConnection_MongoDB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -131,6 +133,7 @@ func TestAccAWSGlueConnection_Kafka(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -162,6 +165,7 @@ func TestAccAWSGlueConnection_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -196,6 +200,7 @@ func TestAccAWSGlueConnection_MatchCriteria(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -245,6 +250,7 @@ func TestAccAWSGlueConnection_PhysicalConnectionRequirements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ @@ -281,6 +287,7 @@ func TestAccAWSGlueConnection_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueConnectionDestroy, Steps: []resource.TestStep{ From 5f60a338920b56adcab98cd89aa038e6cb477974 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:02:11 -0400 Subject: [PATCH 0385/1252] tests/r/glue_crawler: Add ErrorCheck --- aws/resource_aws_glue_crawler_test.go | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/aws/resource_aws_glue_crawler_test.go b/aws/resource_aws_glue_crawler_test.go index 37f9e9fd335..bc59b615e49 100644 --- a/aws/resource_aws_glue_crawler_test.go +++ b/aws/resource_aws_glue_crawler_test.go @@ -66,6 +66,7 @@ func TestAccAWSGlueCrawler_DynamodbTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -133,6 +134,7 @@ func TestAccAWSGlueCrawler_DynamodbTarget_scanAll(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -176,6 +178,7 @@ func TestAccAWSGlueCrawler_DynamodbTarget_scanRate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -219,6 +222,7 @@ func TestAccAWSGlueCrawler_JdbcTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -288,6 +292,7 @@ func TestAccAWSGlueCrawler_JdbcTarget_Exclusions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -328,6 +333,7 @@ func TestAccAWSGlueCrawler_JdbcTarget_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -386,6 +392,7 @@ func TestAccAWSGlueCrawler_mongoDBTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -425,6 +432,7 @@ func TestAccAWSGlueCrawler_mongoDBTarget_scan_all(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -474,6 +482,7 @@ func TestAccAWSGlueCrawler_mongoDBTarget_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -529,6 +538,7 @@ func TestAccAWSGlueCrawler_S3Target(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -597,6 +607,7 @@ func TestAccAWSGlueCrawler_S3Target_ConnectionName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -625,6 +636,7 @@ func TestAccAWSGlueCrawler_S3Target_Exclusions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -665,6 +677,7 @@ func TestAccAWSGlueCrawler_S3Target_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -718,6 +731,7 @@ func TestAccAWSGlueCrawler_CatalogTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -790,6 +804,7 @@ func TestAccAWSGlueCrawler_CatalogTarget_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -845,6 +860,7 @@ func TestAccAWSGlueCrawler_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -867,6 +883,7 @@ func TestAccAWSGlueCrawler_Classifiers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -913,6 +930,7 @@ func TestAccAWSGlueCrawler_Configuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -946,6 +964,7 @@ func TestAccAWSGlueCrawler_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -980,6 +999,7 @@ func TestAccAWSGlueCrawler_Role_ARN_NoPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1006,6 +1026,7 @@ func TestAccAWSGlueCrawler_Role_ARN_Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1032,6 +1053,7 @@ func TestAccAWSGlueCrawler_Role_Name_Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1058,6 +1080,7 @@ func TestAccAWSGlueCrawler_Schedule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1098,6 +1121,7 @@ func TestAccAWSGlueCrawler_SchemaChangePolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1135,6 +1159,7 @@ func TestAccAWSGlueCrawler_TablePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1168,6 +1193,7 @@ func TestAccAWSGlueCrawler_RemoveTablePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1201,6 +1227,7 @@ func TestAccAWSGlueCrawler_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1245,6 +1272,7 @@ func TestAccAWSGlueCrawler_SecurityConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1278,6 +1306,7 @@ func TestAccAWSGlueCrawler_lineageConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ @@ -1320,6 +1349,7 @@ func TestAccAWSGlueCrawler_recrawlPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, Steps: []resource.TestStep{ From 17ddde247b2e0d7c658f0a5d48375f8afa692d90 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:02:23 -0400 Subject: [PATCH 0386/1252] tests/r/glue_data_catalog_encryption_settings: Add ErrorCheck --- aws/resource_aws_glue_data_catalog_encryption_settings_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_glue_data_catalog_encryption_settings_test.go b/aws/resource_aws_glue_data_catalog_encryption_settings_test.go index e258ee7df5a..f4cd477591c 100644 --- a/aws/resource_aws_glue_data_catalog_encryption_settings_test.go +++ b/aws/resource_aws_glue_data_catalog_encryption_settings_test.go @@ -20,6 +20,7 @@ func TestAccAWSDataCatalogEncryptionSettings_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 74c4f2b1ff26e8f9e9d9ef229847603bdb2c3fbc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:02:34 -0400 Subject: [PATCH 0387/1252] tests/r/glue_dev_endpoint: Add ErrorCheck --- aws/resource_aws_glue_dev_endpoint_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_glue_dev_endpoint_test.go b/aws/resource_aws_glue_dev_endpoint_test.go index 8fb2cc10cb9..6167f05894c 100644 --- a/aws/resource_aws_glue_dev_endpoint_test.go +++ b/aws/resource_aws_glue_dev_endpoint_test.go @@ -79,6 +79,7 @@ func TestAccGlueDevEndpoint_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccGlueDevEndpoint_Arguments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -159,6 +161,7 @@ func TestAccGlueDevEndpoint_ExtraJarsS3Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccGlueDevEndpoint_ExtraPythonLibsS3Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -229,6 +233,7 @@ func TestAccGlueDevEndpoint_GlueVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -267,6 +272,7 @@ func TestAccGlueDevEndpoint_NumberOfNodes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -305,6 +311,7 @@ func TestAccGlueDevEndpoint_NumberOfWorkers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -343,6 +350,7 @@ func TestAccGlueDevEndpoint_PublicKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -377,6 +385,7 @@ func TestAccGlueDevEndpoint_PublicKeys(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -418,6 +427,7 @@ func TestAccGlueDevEndpoint_SecurityConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -446,6 +456,7 @@ func TestAccGlueDevEndpoint_SubnetID_SecurityGroupIDs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -476,6 +487,7 @@ func TestAccGlueDevEndpoint_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -521,6 +533,7 @@ func TestAccGlueDevEndpoint_WorkerType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ @@ -562,6 +575,7 @@ func TestAccGlueDevEndpoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueDevEndpointDestroy, Steps: []resource.TestStep{ From 306c0f1002b2ec517faf8ae3d07839e93a9a9017 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:02:47 -0400 Subject: [PATCH 0388/1252] tests/r/glue_job: Add ErrorCheck --- aws/resource_aws_glue_job_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aws/resource_aws_glue_job_test.go b/aws/resource_aws_glue_job_test.go index 4e0d36e1e3e..5c23d6a64d0 100644 --- a/aws/resource_aws_glue_job_test.go +++ b/aws/resource_aws_glue_job_test.go @@ -64,6 +64,7 @@ func TestAccAWSGlueJob_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -99,6 +100,7 @@ func TestAccAWSGlueJob_Command(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSGlueJob_DefaultArguments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSGlueJob_nonOverridableArguments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -211,6 +215,7 @@ func TestAccAWSGlueJob_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -245,6 +250,7 @@ func TestAccAWSGlueJob_GlueVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -286,6 +292,7 @@ func TestAccAWSGlueJob_ExecutionProperty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -326,6 +333,7 @@ func TestAccAWSGlueJob_MaxRetries(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -364,6 +372,7 @@ func TestAccAWSGlueJob_NotificationProperty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -404,6 +413,7 @@ func TestAccAWSGlueJob_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -449,6 +459,7 @@ func TestAccAWSGlueJob_Timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -483,6 +494,7 @@ func TestAccAWSGlueJob_SecurityConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -517,6 +529,7 @@ func TestAccAWSGlueJob_WorkerType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -558,6 +571,7 @@ func TestAccAWSGlueJob_PythonShell(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -613,6 +627,7 @@ func TestAccAWSGlueJob_MaxCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ @@ -650,6 +665,7 @@ func TestAccAWSGlueJob_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueJobDestroy, Steps: []resource.TestStep{ From b36742a471f95b44c24b9a6f966097853bf890bd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:05:08 -0400 Subject: [PATCH 0389/1252] tests/r/glue_ml_transform: Add ErrorCheck --- aws/resource_aws_glue_ml_transform_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_glue_ml_transform_test.go b/aws/resource_aws_glue_ml_transform_test.go index 68336cbbd18..43f055441f4 100644 --- a/aws/resource_aws_glue_ml_transform_test.go +++ b/aws/resource_aws_glue_ml_transform_test.go @@ -74,6 +74,7 @@ func TestAccAWSGlueMLTransform_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSGlueMLTransform_typeFindMatchesFull(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -180,6 +182,7 @@ func TestAccAWSGlueMLTransform_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -214,6 +217,7 @@ func TestAccAWSGlueMLTransform_glueVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -248,6 +252,7 @@ func TestAccAWSGlueMLTransform_maxRetries(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -286,6 +291,7 @@ func TestAccAWSGlueMLTransform_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -331,6 +337,7 @@ func TestAccAWSGlueMLTransform_timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -365,6 +372,7 @@ func TestAccAWSGlueMLTransform_workerType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -401,6 +409,7 @@ func TestAccAWSGlueMLTransform_maxCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ @@ -435,6 +444,7 @@ func TestAccAWSGlueMLTransform_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueMLTransformDestroy, Steps: []resource.TestStep{ From c9c8a4224047ed2506a204d54db6f6088d5532e7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:05:18 -0400 Subject: [PATCH 0390/1252] tests/r/glue_partition: Add ErrorCheck --- aws/resource_aws_glue_partition_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_glue_partition_test.go b/aws/resource_aws_glue_partition_test.go index e4cece3c9ea..2aa50029fd3 100644 --- a/aws/resource_aws_glue_partition_test.go +++ b/aws/resource_aws_glue_partition_test.go @@ -18,6 +18,7 @@ func TestAccAWSGluePartition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGluePartitionDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSGluePartition_multipleValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGluePartitionDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSGluePartition_parameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGluePartitionDestroy, Steps: []resource.TestStep{ @@ -122,6 +125,7 @@ func TestAccAWSGluePartition_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGluePartitionDestroy, Steps: []resource.TestStep{ @@ -144,6 +148,7 @@ func TestAccAWSGluePartition_disappears_table(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGluePartitionDestroy, Steps: []resource.TestStep{ From f656083f3c3dc7f671f811aa7fff6a24237406f8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:05:28 -0400 Subject: [PATCH 0391/1252] tests/r/glue_registry: Add ErrorCheck --- aws/resource_aws_glue_registry_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_glue_registry_test.go b/aws/resource_aws_glue_registry_test.go index 56b044967b5..b7e28a0353f 100644 --- a/aws/resource_aws_glue_registry_test.go +++ b/aws/resource_aws_glue_registry_test.go @@ -58,6 +58,7 @@ func TestAccAWSGlueRegistry_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueRegistry(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueRegistryDestroy, Steps: []resource.TestStep{ @@ -88,6 +89,7 @@ func TestAccAWSGlueRegistry_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueRegistry(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueRegistryDestroy, Steps: []resource.TestStep{ @@ -121,6 +123,7 @@ func TestAccAWSGlueRegistry_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueRegistry(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueRegistryDestroy, Steps: []resource.TestStep{ @@ -166,6 +169,7 @@ func TestAccAWSGlueRegistry_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueRegistry(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueRegistryDestroy, Steps: []resource.TestStep{ From e2652167844f3103cce625b74a1b4284eae052f2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:05:39 -0400 Subject: [PATCH 0392/1252] tests/r/glue_resource_policy: Add ErrorCheck --- aws/resource_aws_glue_resource_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_glue_resource_policy_test.go b/aws/resource_aws_glue_resource_policy_test.go index 6e179a19852..d629590d15c 100644 --- a/aws/resource_aws_glue_resource_policy_test.go +++ b/aws/resource_aws_glue_resource_policy_test.go @@ -32,6 +32,7 @@ func testAccAWSGlueResourcePolicy_basic(t *testing.T) { resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func testAccAWSGlueResourcePolicy_disappears(t *testing.T) { resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func testAccAWSGlueResourcePolicy_update(t *testing.T) { resourceName := "aws_glue_resource_policy.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueResourcePolicyDestroy, Steps: []resource.TestStep{ From 26522ba045d4883239e5ed0f9dbb064857f69045 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:05:49 -0400 Subject: [PATCH 0393/1252] tests/r/glue_schema: Add ErrorCheck --- aws/resource_aws_glue_schema_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_glue_schema_test.go b/aws/resource_aws_glue_schema_test.go index 706a5f6d481..808d4361e97 100644 --- a/aws/resource_aws_glue_schema_test.go +++ b/aws/resource_aws_glue_schema_test.go @@ -59,6 +59,7 @@ func TestAccAWSGlueSchema_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -97,6 +98,7 @@ func TestAccAWSGlueSchema_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -131,6 +133,7 @@ func TestAccAWSGlueSchema_compatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -164,6 +167,7 @@ func TestAccAWSGlueSchema_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -209,6 +213,7 @@ func TestAccAWSGlueSchema_schemaDefUpdated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -247,6 +252,7 @@ func TestAccAWSGlueSchema_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ @@ -270,6 +276,7 @@ func TestAccAWSGlueSchema_disappears_registry(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueSchema(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSchemaDestroy, Steps: []resource.TestStep{ From 791c94aceee7f30546276911d064c3e24b96346e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:06:00 -0400 Subject: [PATCH 0394/1252] tests/r/glue_security_configuration: Add ErrorCheck --- aws/resource_aws_glue_security_configuration_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_glue_security_configuration_test.go b/aws/resource_aws_glue_security_configuration_test.go index 48171716700..c6fe723704f 100644 --- a/aws/resource_aws_glue_security_configuration_test.go +++ b/aws/resource_aws_glue_security_configuration_test.go @@ -68,6 +68,7 @@ func TestAccAWSGlueSecurityConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSecurityConfigurationDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAWSGlueSecurityConfiguration_CloudWatchEncryption_CloudWatchEncrypti resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSecurityConfigurationDestroy, Steps: []resource.TestStep{ @@ -137,6 +139,7 @@ func TestAccAWSGlueSecurityConfiguration_JobBookmarksEncryption_JobBookmarksEncr resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSecurityConfigurationDestroy, Steps: []resource.TestStep{ @@ -168,6 +171,7 @@ func TestAccAWSGlueSecurityConfiguration_S3Encryption_S3EncryptionMode_SSEKMS(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSecurityConfigurationDestroy, Steps: []resource.TestStep{ @@ -198,6 +202,7 @@ func TestAccAWSGlueSecurityConfiguration_S3Encryption_S3EncryptionMode_SSES3(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueSecurityConfigurationDestroy, Steps: []resource.TestStep{ From 5eb19afe9d31358eb3409d0ff5103315fd683661 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:06:11 -0400 Subject: [PATCH 0395/1252] tests/r/glue_trigger: Add ErrorCheck --- aws/resource_aws_glue_trigger_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_glue_trigger_test.go b/aws/resource_aws_glue_trigger_test.go index 0c6b837d52b..80dfb311d8c 100644 --- a/aws/resource_aws_glue_trigger_test.go +++ b/aws/resource_aws_glue_trigger_test.go @@ -66,6 +66,7 @@ func TestAccAWSGlueTrigger_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -105,6 +106,7 @@ func TestAccAWSGlueTrigger_Crawler(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -152,6 +154,7 @@ func TestAccAWSGlueTrigger_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSGlueTrigger_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -229,6 +233,7 @@ func TestAccAWSGlueTrigger_Predicate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -272,6 +277,7 @@ func TestAccAWSGlueTrigger_Schedule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -307,6 +313,7 @@ func TestAccAWSGlueTrigger_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -353,6 +360,7 @@ func TestAccAWSGlueTrigger_WorkflowName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -381,6 +389,7 @@ func TestAccAWSGlueTrigger_actions_notify(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -432,6 +441,7 @@ func TestAccAWSGlueTrigger_actions_securityConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -462,6 +472,7 @@ func TestAccAWSGlueTrigger_onDemandDisable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ @@ -507,6 +518,7 @@ func TestAccAWSGlueTrigger_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueTriggerDestroy, Steps: []resource.TestStep{ From c35700a9c6c366fe92fc137f4dca09dd7e4efde1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:06:22 -0400 Subject: [PATCH 0396/1252] tests/r/glue_user_defined_function: Add ErrorCheck --- aws/resource_aws_glue_user_defined_function_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_glue_user_defined_function_test.go b/aws/resource_aws_glue_user_defined_function_test.go index c9e83ce8b83..a2a437ca458 100644 --- a/aws/resource_aws_glue_user_defined_function_test.go +++ b/aws/resource_aws_glue_user_defined_function_test.go @@ -18,6 +18,7 @@ func TestAccAWSGlueUserDefinedFunction_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueUDFDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSGlueUserDefinedFunction_resource_uri(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueUDFDestroy, Steps: []resource.TestStep{ @@ -96,6 +98,7 @@ func TestAccAWSGlueUserDefinedFunction_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlueUDFDestroy, Steps: []resource.TestStep{ From c5784d09812e40af4e29c409df5a0fa1d0125582 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:06:34 -0400 Subject: [PATCH 0397/1252] tests/r/glue_workflow: Add ErrorCheck --- aws/resource_aws_glue_workflow_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_glue_workflow_test.go b/aws/resource_aws_glue_workflow_test.go index 12bdd1fcfd6..49fbc7c2ea9 100644 --- a/aws/resource_aws_glue_workflow_test.go +++ b/aws/resource_aws_glue_workflow_test.go @@ -52,6 +52,7 @@ func TestAccAWSGlueWorkflow_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -81,6 +82,7 @@ func TestAccAWSGlueWorkflow_maxConcurrentRuns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -122,6 +124,7 @@ func TestAccAWSGlueWorkflow_DefaultRunProperties(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -151,6 +154,7 @@ func TestAccAWSGlueWorkflow_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -184,6 +188,7 @@ func TestAccAWSGlueWorkflow_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -229,6 +234,7 @@ func TestAccAWSGlueWorkflow_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + ErrorCheck: testAccErrorCheck(t, glue.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ From d6bf66717d435685f3e05dad952d24a4bab1fbde Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 14:10:32 -0400 Subject: [PATCH 0398/1252] build(deps): bump github.com/bflad/tfproviderlint from 0.22.0 to 0.23.0 in /awsproviderlint (#18192) * build(deps): bump github.com/bflad/tfproviderlint in /awsproviderlint Bumps [github.com/bflad/tfproviderlint](https://github.com/bflad/tfproviderlint) from 0.22.0 to 0.23.0. - [Release notes](https://github.com/bflad/tfproviderlint/releases) - [Changelog](https://github.com/bflad/tfproviderlint/blob/main/CHANGELOG.md) - [Commits](https://github.com/bflad/tfproviderlint/compare/v0.22.0...v0.23.0) Signed-off-by: dependabot[bot] * tests/provider: Disable tfproviderlint XAT001 until we are ready to enable it Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18175 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian Flad --- GNUmakefile | 1 + awsproviderlint/go.mod | 6 +- awsproviderlint/go.sum | 84 +- .../vendor/cloud.google.com/go/CHANGES.md | 78 +- .../cloud.google.com/go/CONTRIBUTING.md | 14 +- .../go/compute/metadata/metadata.go | 1 + .../vendor/cloud.google.com/go/go.mod | 16 +- .../vendor/cloud.google.com/go/go.sum | 30 +- .../go/internal/.repo-metadata-full.json | 58 +- .../go/internal/version/version.go | 2 +- .../go-textseg/textseg/generate.go | 7 - .../go-textseg/textseg/grapheme_clusters.go | 5276 ----------------- .../go-textseg/{ => v12}/LICENSE | 0 .../{ => v12}/textseg/all_tokens.go | 0 .../go-textseg/v12/textseg/emoji_table.rl | 290 + .../go-textseg/v12/textseg/generate.go | 8 + .../v12/textseg/grapheme_clusters.go | 4078 +++++++++++++ .../{ => v12}/textseg/grapheme_clusters.rl | 11 +- .../textseg/grapheme_clusters_table.rl | 130 +- .../go-textseg/{ => v12}/textseg/tables.go | 595 +- .../{ => v12}/textseg/unicode2ragel.rb | 2 +- .../go-textseg/{ => v12}/textseg/utf8_seqs.go | 0 .../helper/resource/type_testcase.go | 1 + .../tfproviderlint/xpasses/XAT001/README.md | 69 + .../tfproviderlint/xpasses/XAT001/XAT001.go | 46 + .../bflad/tfproviderlint/xpasses/checks.go | 2 + .../hashicorp/go-getter/.goreleaser.yml | 50 + .../github.com/hashicorp/go-getter/README.md | 4 +- .../hashicorp/go-getter/checksum.go | 5 +- .../hashicorp/go-getter/decompress.go | 4 + .../hashicorp/go-getter/decompress_tzst.go | 39 + .../hashicorp/go-getter/decompress_zstd.go | 40 + .../github.com/hashicorp/go-getter/get_s3.go | 53 +- .../github.com/hashicorp/go-getter/go.mod | 1 + .../github.com/hashicorp/go-getter/go.sum | 2 + .../github.com/hashicorp/hcl/v2/CHANGELOG.md | 90 + .../github.com/hashicorp/hcl/v2/README.md | 16 +- .../github.com/hashicorp/hcl/v2/appveyor.yml | 13 - .../github.com/hashicorp/hcl/v2/diagnostic.go | 4 +- .../vendor/github.com/hashicorp/hcl/v2/go.mod | 4 +- .../vendor/github.com/hashicorp/hcl/v2/go.sum | 2 + .../hashicorp/hcl/v2/hclsyntax/expression.go | 145 +- .../hcl/v2/hclsyntax/expression_template.go | 31 +- .../hashicorp/hcl/v2/hclsyntax/parser.go | 17 +- .../hcl/v2/hclsyntax/parser_template.go | 2 +- .../hashicorp/hcl/v2/hclsyntax/spec.md | 2 +- .../hashicorp/hcl/v2/hclsyntax/token.go | 27 +- .../vendor/github.com/hashicorp/hcl/v2/ops.go | 12 +- .../hashicorp/hcl/v2/pos_scanner.go | 2 +- .../v2/helper/schema/grpc_provider.go | 3 + .../v2/internal/plugin/convert/diagnostics.go | 3 + .../terraform-plugin-sdk/v2/meta/meta.go | 2 +- .../github.com/klauspost/compress/LICENSE | 28 + .../klauspost/compress/fse/README.md | 79 + .../klauspost/compress/fse/bitreader.go | 122 + .../klauspost/compress/fse/bitwriter.go | 168 + .../klauspost/compress/fse/bytereader.go | 47 + .../klauspost/compress/fse/compress.go | 684 +++ .../klauspost/compress/fse/decompress.go | 374 ++ .../github.com/klauspost/compress/fse/fse.go | 144 + .../klauspost/compress/huff0/.gitignore | 1 + .../klauspost/compress/huff0/README.md | 87 + .../klauspost/compress/huff0/bitreader.go | 329 + .../klauspost/compress/huff0/bitwriter.go | 210 + .../klauspost/compress/huff0/bytereader.go | 54 + .../klauspost/compress/huff0/compress.go | 657 ++ .../klauspost/compress/huff0/decompress.go | 1164 ++++ .../klauspost/compress/huff0/huff0.go | 273 + .../klauspost/compress/snappy/.gitignore | 16 + .../klauspost/compress/snappy/AUTHORS | 15 + .../klauspost/compress/snappy/CONTRIBUTORS | 37 + .../klauspost/compress/snappy/LICENSE | 27 + .../klauspost/compress/snappy/README | 107 + .../klauspost/compress/snappy/decode.go | 237 + .../klauspost/compress/snappy/decode_amd64.go | 14 + .../klauspost/compress/snappy/decode_amd64.s | 482 ++ .../klauspost/compress/snappy/decode_other.go | 115 + .../klauspost/compress/snappy/encode.go | 285 + .../klauspost/compress/snappy/encode_amd64.go | 29 + .../klauspost/compress/snappy/encode_amd64.s | 730 +++ .../klauspost/compress/snappy/encode_other.go | 238 + .../klauspost/compress/snappy/runbench.cmd | 2 + .../klauspost/compress/snappy/snappy.go | 98 + .../klauspost/compress/zstd/README.md | 406 ++ .../klauspost/compress/zstd/bitreader.go | 136 + .../klauspost/compress/zstd/bitwriter.go | 169 + .../klauspost/compress/zstd/blockdec.go | 739 +++ .../klauspost/compress/zstd/blockenc.go | 854 +++ .../compress/zstd/blocktype_string.go | 85 + .../klauspost/compress/zstd/bytebuf.go | 127 + .../klauspost/compress/zstd/bytereader.go | 88 + .../klauspost/compress/zstd/decoder.go | 546 ++ .../compress/zstd/decoder_options.go | 84 + .../klauspost/compress/zstd/dict.go | 122 + .../klauspost/compress/zstd/enc_base.go | 155 + .../klauspost/compress/zstd/enc_better.go | 595 ++ .../klauspost/compress/zstd/enc_dfast.go | 713 +++ .../klauspost/compress/zstd/enc_fast.go | 661 +++ .../klauspost/compress/zstd/encoder.go | 570 ++ .../compress/zstd/encoder_options.go | 282 + .../klauspost/compress/zstd/framedec.go | 494 ++ .../klauspost/compress/zstd/frameenc.go | 137 + .../klauspost/compress/zstd/fse_decoder.go | 385 ++ .../klauspost/compress/zstd/fse_encoder.go | 726 +++ .../klauspost/compress/zstd/fse_predefined.go | 158 + .../klauspost/compress/zstd/hash.go | 77 + .../klauspost/compress/zstd/history.go | 89 + .../compress/zstd/internal/xxhash/LICENSE.txt | 22 + .../compress/zstd/internal/xxhash/README.md | 58 + .../compress/zstd/internal/xxhash/xxhash.go | 238 + .../zstd/internal/xxhash/xxhash_amd64.go | 13 + .../zstd/internal/xxhash/xxhash_amd64.s | 215 + .../zstd/internal/xxhash/xxhash_other.go | 76 + .../zstd/internal/xxhash/xxhash_safe.go | 11 + .../klauspost/compress/zstd/seqdec.go | 485 ++ .../klauspost/compress/zstd/seqenc.go | 115 + .../klauspost/compress/zstd/snappy.go | 436 ++ .../klauspost/compress/zstd/zstd.go | 144 + .../zclconf/go-cty/cty/convert/conversion.go | 9 + .../cty/convert/conversion_collection.go | 281 +- .../go-cty/cty/convert/conversion_object.go | 19 + .../go-cty/cty/convert/mismatch_msg.go | 8 +- .../zclconf/go-cty/cty/convert/unify.go | 43 + .../zclconf/go-cty/cty/function/function.go | 44 +- .../go-cty/cty/function/stdlib/collection.go | 1199 ++++ .../go-cty/cty/function/stdlib/conversion.go | 87 + .../go-cty/cty/function/stdlib/datetime.go | 55 +- .../go-cty/cty/function/stdlib/format.go | 4 +- .../go-cty/cty/function/stdlib/json.go | 5 + .../go-cty/cty/function/stdlib/number.go | 215 + .../zclconf/go-cty/cty/function/stdlib/set.go | 41 +- .../go-cty/cty/function/stdlib/string.go | 315 +- .../cty/function/stdlib/string_replace.go | 80 + .../github.com/zclconf/go-cty/cty/json.go | 25 +- .../zclconf/go-cty/cty/json/marshal.go | 2 +- .../github.com/zclconf/go-cty/cty/marks.go | 82 +- .../zclconf/go-cty/cty/object_type.go | 89 +- .../github.com/zclconf/go-cty/cty/path.go | 20 + .../github.com/zclconf/go-cty/cty/path_set.go | 6 + .../zclconf/go-cty/cty/set/rules.go | 4 + .../github.com/zclconf/go-cty/cty/set/set.go | 4 +- .../zclconf/go-cty/cty/set_internals.go | 11 + .../github.com/zclconf/go-cty/cty/type.go | 5 +- .../github.com/zclconf/go-cty/cty/unknown.go | 3 +- .../github.com/zclconf/go-cty/cty/value.go | 34 + .../zclconf/go-cty/cty/value_init.go | 5 - .../zclconf/go-cty/cty/value_ops.go | 150 +- .../github.com/zclconf/go-cty/cty/walk.go | 59 +- .../vendor/golang.org/x/oauth2/go.mod | 7 +- .../vendor/golang.org/x/oauth2/go.sum | 359 +- .../x/tools/go/analysis/analysis.go | 13 +- .../go/analysis/analysistest/analysistest.go | 155 +- .../golang.org/x/tools/go/analysis/doc.go | 21 +- .../go/analysis/internal/checker/checker.go | 1 + .../go/analysis/unitchecker/unitchecker.go | 2 + .../tools/go/internal/packagesdriver/sizes.go | 26 +- .../golang.org/x/tools/go/packages/golist.go | 289 +- .../x/tools/go/packages/golist_overlay.go | 4 + .../x/tools/go/packages/packages.go | 23 +- .../x/tools/internal/gocommand/invoke.go | 37 +- .../x/tools/internal/gocommand/version.go | 40 + .../x/tools/internal/imports/fix.go | 34 +- .../x/tools/internal/imports/mod.go | 26 +- .../internal/packagesinternal/packages.go | 3 + .../google.golang.org/api/internal/creds.go | 26 + .../api/internal/gensupport/media.go | 4 +- .../api/internal/impersonate/impersonate.go | 128 + .../api/internal/service-account.json | 12 - .../api/internal/settings.go | 10 +- .../option/internaloption/internaloption.go | 16 +- .../google.golang.org/api/option/option.go | 55 + .../api/storage/v1/storage-api.json | 20 +- .../api/storage/v1/storage-gen.go | 134 +- .../api/transport/http/dial.go | 100 +- .../api/transport/internal/dca/dca.go | 145 + .../api/annotations/annotations.pb.go | 14 +- .../googleapis/api/annotations/client.pb.go | 20 +- .../api/annotations/field_behavior.pb.go | 14 +- .../googleapis/api/annotations/http.pb.go | 4 +- .../googleapis/api/annotations/resource.pb.go | 30 +- .../googleapis/iam/v1/iam_policy.pb.go | 4 +- .../genproto/googleapis/iam/v1/options.pb.go | 4 +- .../genproto/googleapis/iam/v1/policy.pb.go | 4 +- .../genproto/googleapis/rpc/code/code.pb.go | 4 +- .../googleapis/rpc/status/status.pb.go | 14 +- .../genproto/googleapis/type/expr/expr.pb.go | 4 +- awsproviderlint/vendor/modules.txt | 33 +- 187 files changed, 26835 insertions(+), 6350 deletions(-) delete mode 100644 awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/generate.go delete mode 100644 awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.go rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/LICENSE (100%) rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/all_tokens.go (100%) create mode 100644 awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/emoji_table.rl create mode 100644 awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/generate.go create mode 100644 awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.go rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/grapheme_clusters.rl (92%) rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/grapheme_clusters_table.rl (95%) rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/tables.go (93%) rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/unicode2ragel.rb (99%) rename awsproviderlint/vendor/github.com/apparentlymart/go-textseg/{ => v12}/textseg/utf8_seqs.go (100%) create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/XAT001.go create mode 100644 awsproviderlint/vendor/github.com/hashicorp/go-getter/.goreleaser.yml create mode 100644 awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_tzst.go create mode 100644 awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_zstd.go delete mode 100644 awsproviderlint/vendor/github.com/hashicorp/hcl/v2/appveyor.yml create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/LICENSE create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/README.md create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/bitreader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/bitwriter.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/bytereader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/compress.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/decompress.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/fse/fse.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/.gitignore create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/README.md create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitreader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitwriter.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/bytereader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/compress.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/decompress.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/huff0/huff0.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/.gitignore create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/AUTHORS create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/LICENSE create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/README create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.s create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_other.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.s create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_other.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/runbench.cmd create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/snappy/snappy.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/README.md create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitreader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitwriter.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockdec.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockenc.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/blocktype_string.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytebuf.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytereader.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder_options.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/dict.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_base.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_better.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_dfast.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_fast.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder_options.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/framedec.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/frameenc.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_decoder.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_encoder.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_predefined.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/hash.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/history.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqdec.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqenc.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/snappy.go create mode 100644 awsproviderlint/vendor/github.com/klauspost/compress/zstd/zstd.go create mode 100644 awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/conversion.go create mode 100644 awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string_replace.go create mode 100644 awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/version.go create mode 100644 awsproviderlint/vendor/google.golang.org/api/internal/impersonate/impersonate.go delete mode 100644 awsproviderlint/vendor/google.golang.org/api/internal/service-account.json create mode 100644 awsproviderlint/vendor/google.golang.org/api/transport/internal/dca/dca.go diff --git a/GNUmakefile b/GNUmakefile index 61a0304aa75..d0eb270662a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -104,6 +104,7 @@ awsproviderlint: -XR003=false \ -XR004=false \ -XR005=false \ + -XAT001=false \ -XS001=false \ -XS002=false \ ./$(PKG_NAME) diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index 357effe0b84..f8b2754a25d 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/aws/aws-sdk-go v1.37.4 - github.com/bflad/tfproviderlint v0.22.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 - golang.org/x/tools v0.0.0-20200928201943-a0ef9b62deab + github.com/bflad/tfproviderlint v0.23.0 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 + golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb ) diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index af28b481f36..ce29a272b6d 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -11,8 +11,10 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= -cloud.google.com/go v0.61.0 h1:NLQf5e1OMspfNT1RAHOB3ublr1TW3YTXO8OiWwVjK2U= cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -42,23 +44,26 @@ github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/g github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0/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.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.37.4 h1:tWxrpMK/oRSXVnjUzhGeCWLR00fW0WF4V4sycYPPrJ8= github.com/aws/aws-sdk-go v1.37.4/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= 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.22.0 h1:rn7jBBhBE6HXY980NKP6YzCcGP1UGDNDZr6z7o5V0ZQ= -github.com/bflad/tfproviderlint v0.22.0/go.mod h1:0fdh7JywihC58Io8AZ+gpcmQtJggse0MCOXF2tMmnAQ= +github.com/bflad/tfproviderlint v0.23.0 h1:Hj024L2wjqqsI0ISJIfWua14r4VlBkLoZDQFmpOTEn4= +github.com/bflad/tfproviderlint v0.23.0/go.mod h1:hvNY+Nthz7T/LHmycyyBfgfHvtmkHVgZTwfVD89er3U= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -106,6 +111,7 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -130,6 +136,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= @@ -158,9 +165,9 @@ github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 h1:1/D3zfFHttUKaCaGKZ/dR2roBXv0vKbSCnssIldfQdI= github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320/go.mod h1:EiZBMaudVLy8fmjf9Npq1dq9RalhveqZG5w/yz3mHWs= github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= -github.com/hashicorp/go-getter v1.5.0 h1:ciWJaeZWSMbc5OiLMpKp40MKFPqO44i0h3uyfXPBkkk= github.com/hashicorp/go-getter v1.5.0/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= +github.com/hashicorp/go-getter v1.5.2 h1:XDo8LiAcDisiqZdv0TKgz+HtX3WN7zA2JD1R1tjsabE= +github.com/hashicorp/go-getter v1.5.2/go.mod h1:orNH3BTYLu/fIxGIdLjLoAJHWMDQ/UKQr5O4m3iBuoo= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= @@ -168,7 +175,6 @@ github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0 github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= @@ -186,28 +192,26 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= +github.com/hashicorp/hcl/v2 v2.8.2 h1:wmFle3D1vu0okesm8BTLVDyJ6/OL9DCLUwn0b2OptiY= +github.com/hashicorp/hcl/v2 v2.8.2/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= -github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= -github.com/hashicorp/terraform-exec v0.3.0/go.mod h1:yKWvMPtkTaHpeAmllw+1qdHZ7E5u+pAZ+x8e2jQF6gM= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= github.com/hashicorp/terraform-exec v0.13.0 h1:1Pth+pdWJAufJuWWjaVOVNEkoRTOjGn3hQpAqj4aPdg= github.com/hashicorp/terraform-exec v0.13.0/go.mod h1:SGhto91bVRlgXQWcJ5znSz+29UZIa8kpBbkGwQ+g9E8= -github.com/hashicorp/terraform-json v0.4.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8ebSW0vztc= github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= -github.com/hashicorp/terraform-plugin-sdk v1.9.0 h1:WBHHIX/RgF6/lbfMCzx0qKl96BbQy3bexWFvDqt1bhE= -github.com/hashicorp/terraform-plugin-sdk v1.9.0/go.mod h1:C/AXwmDHqbc3h6URiHpIsVKrwV4PS0Sh0+VTaeEkShw= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.0.0/go.mod h1:xOf85UtHJ0/9/EF3eKgZFlJ6feN8sDtjQRWRHhimCUw= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 h1:DGnxpIYRHXQZb2TOlQ1OCEYxoRQrAcbLIcYm8kvbFuU= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3/go.mod h1:5wrrTcxbSaQXamCDbHZTHk6yTF9OEZaOvQ9fvLXBE3o= -github.com/hashicorp/terraform-plugin-test v1.2.0/go.mod h1:QIJHYz8j+xJtdtLrFTlzQVC0ocr3rf/OjIpgZLK56Hs= -github.com/hashicorp/terraform-plugin-test/v2 v2.0.0-20200724200815-faa9931ac59e/go.mod h1:C6VALgUlvaif+PnHyRGKWPTdQkMJK4NQ20VJolxZLI0= -github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= +github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5 h1:ECRaTJhZpRUs7SHB7qHIT4+elRSEWSOYvSx7T4Y0cVo= +github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 h1:6k0WcxFgVqF/GUFHPvAH8FIrCkoA1RInXzSxhkKamPg= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= @@ -232,6 +236,8 @@ github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd h1:Coekwdh0v github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= @@ -252,7 +258,6 @@ github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hd github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= @@ -297,16 +302,17 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -316,10 +322,11 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= +github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= -github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -331,7 +338,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= @@ -397,14 +403,16 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b h1:uwuIcX0g4Yl1NC5XAz37xsr2lTtcqevgzYNVt49waME= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 h1:ld7aEMNHoBnnDAX15v1T6z31v8HwR2A9FYOuAhWqkwc= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -413,9 +421,9 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/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-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -443,6 +451,8 @@ golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -493,8 +503,12 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200928201943-a0ef9b62deab h1:CyH2SDm5ATQiX9gtbMYfvNNed97A9v+TJFnUX/fTaJY= -golang.org/x/tools v0.0.0-20200928201943-a0ef9b62deab/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb h1:KVWk3RW1AZlxWum4tYqegLgwJHb5oouozcGM8HfNQaw= +golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -514,8 +528,10 @@ google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/ google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= -google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.34.0 h1:k40adF3uR+6x/+hO5Dh4ZFUqFp67vxvbpafFiJxl10A= +google.golang.org/api v0.34.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -543,7 +559,6 @@ google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200310143817-43be25429f5a/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= @@ -551,10 +566,13 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d h1:92D1fum1bJLKSdr11OJ+54YeCMCGYIygTA7R/YZxH5M= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -566,6 +584,8 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.32.0 h1:zWTV+LMdc3kaiJMSTOFz2UgSBgx8RNQoTGiZu3fR9S0= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/awsproviderlint/vendor/cloud.google.com/go/CHANGES.md b/awsproviderlint/vendor/cloud.google.com/go/CHANGES.md index 3e9fca4a749..eff3b8a61a1 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/CHANGES.md +++ b/awsproviderlint/vendor/cloud.google.com/go/CHANGES.md @@ -1,5 +1,82 @@ # Changes +## [0.65.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.64.0...v0.65.0) (2020-08-27) + + +### Announcements + +The following changes will be included in an upcoming release and are not +included in this one. + +#### Default Deadlines + +By default, non-streaming methods, like Create or Get methods, will have a +default deadline applied to the context provided at call time, unless a context +deadline is already set. Streaming methods have no default deadline and will run +indefinitely, unless the context provided at call time contains a deadline. + +To opt-out of this behavior, set the environment variable +`GOOGLE_API_GO_EXPERIMENTAL_DISABLE_DEFAULT_DEADLINE` to `true` prior to +initializing a client. This opt-out mechanism will be removed in a later +release, with a notice similar to this one ahead of its removal. + + +### Features + +* **all:** auto-regenerate gapics , refs [#2774](https://www.github.com/googleapis/google-cloud-go/issues/2774) [#2764](https://www.github.com/googleapis/google-cloud-go/issues/2764) + + +### Bug Fixes + +* **all:** correct minor typos ([#2756](https://www.github.com/googleapis/google-cloud-go/issues/2756)) ([03d78b5](https://www.github.com/googleapis/google-cloud-go/commit/03d78b5627819cb64d1f3866f90043f709e825e1)) +* **compute/metadata:** remove leading slash for Get suffix ([#2760](https://www.github.com/googleapis/google-cloud-go/issues/2760)) ([f0d605c](https://www.github.com/googleapis/google-cloud-go/commit/f0d605ccf32391a9da056a2c551158bd076c128d)) + +## [0.64.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.63.0...v0.64.0) (2020-08-18) + + +### Features + +* **all:** auto-regenerate gapics , refs [#2734](https://www.github.com/googleapis/google-cloud-go/issues/2734) [#2731](https://www.github.com/googleapis/google-cloud-go/issues/2731) [#2730](https://www.github.com/googleapis/google-cloud-go/issues/2730) [#2725](https://www.github.com/googleapis/google-cloud-go/issues/2725) [#2722](https://www.github.com/googleapis/google-cloud-go/issues/2722) [#2706](https://www.github.com/googleapis/google-cloud-go/issues/2706) +* **pubsublite:** start generating v1 ([#2700](https://www.github.com/googleapis/google-cloud-go/issues/2700)) ([d2e777f](https://www.github.com/googleapis/google-cloud-go/commit/d2e777f56e08146646b3ffb7a78856795094ab4e)) + +## [0.63.0](https://www.github.com/googleapis/google-cloud-go/compare/v0.62.0...v0.63.0) (2020-08-05) + + +### Features + +* **all:** auto-regenerate gapics ([#2682](https://www.github.com/googleapis/google-cloud-go/issues/2682)) ([63bfd63](https://www.github.com/googleapis/google-cloud-go/commit/63bfd638da169e0f1f4fa4a5125da2955022dc04)) +* **analytics/admin:** start generating apiv1alpha ([#2670](https://www.github.com/googleapis/google-cloud-go/issues/2670)) ([268199e](https://www.github.com/googleapis/google-cloud-go/commit/268199e5350a64a83ecf198e0e0fa4863f00fa6c)) +* **functions/metadata:** Special-case marshaling ([#2669](https://www.github.com/googleapis/google-cloud-go/issues/2669)) ([d8d7fc6](https://www.github.com/googleapis/google-cloud-go/commit/d8d7fc66cbc42f79bec25fb0daaf53d926e3645b)) +* **gaming:** start generate apiv1 ([#2681](https://www.github.com/googleapis/google-cloud-go/issues/2681)) ([1adfd0a](https://www.github.com/googleapis/google-cloud-go/commit/1adfd0aed6b2c0e1dd0c575a5ec0f49388fa5601)) +* **internal/kokoro:** add script to test compatibility with samples ([#2637](https://www.github.com/googleapis/google-cloud-go/issues/2637)) ([f2aa76a](https://www.github.com/googleapis/google-cloud-go/commit/f2aa76a0058e86c1c33bb634d2c084b58f77ab32)) + +## v0.62.0 + +### Announcements + +- There was a breaking change to `cloud.google.com/go/dataproc/apiv1` that was + merged in [this PR](https://github.com/googleapis/google-cloud-go/pull/2606). + This fixed a broken API response for `DiagnoseCluster`. When polling on the + Long Running Operation(LRO), the API now returns + `(*dataprocpb.DiagnoseClusterResults, error)` whereas it only returned an + `error` before. + +### Changes + +- all: + - Updated all direct dependencies. + - Updated contributing guidelines to suggest allowing edits from maintainers. +- billing/budgets: + - Start generating client for apiv1beta1. +- functions: + - Start generating client for apiv1. +- notebooks: + - Start generating client apiv1beta1. +- profiler: + - update proftest to support parsing floating-point backoff durations. + - Fix the regexp used to parse backoff duration. +- Various updates to autogenerated clients. + ## v0.61.0 ### Changes @@ -1563,4 +1640,3 @@ Natural Language. [`cloud.google.com/go/preview/logging`](https://godoc.org/cloud.google.com/go/preview/logging). This client uses gRPC as its transport layer, and supports log reading, sinks and metrics. It will replace the current client at `cloud.google.com/go/logging` shortly. - diff --git a/awsproviderlint/vendor/cloud.google.com/go/CONTRIBUTING.md b/awsproviderlint/vendor/cloud.google.com/go/CONTRIBUTING.md index 109ca5c43c2..d9775744e5c 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/CONTRIBUTING.md +++ b/awsproviderlint/vendor/cloud.google.com/go/CONTRIBUTING.md @@ -21,21 +21,25 @@ `cd google-cloud-go` 1. Fork the repo. - + 1. Set your fork as a remote: `git remote add fork git@github.com:GITHUB_USERNAME/google-cloud-go.git` -1. Make changes (see [Formatting](#formatting) and [Style](#style)), commit to - your fork. +1. Make changes, commit to your fork. Commit messages should follow the - [Go project style](https://github.com/golang/go/wiki/CommitMessage). For example: + [Conventional Commits Style](https://www.conventionalcommits.org). The scope + portion should always be filled with the name of the package affected by the + changes being made. For example: ``` - functions: add gophers codelab + feat(functions): add gophers codelab ``` 1. Send a pull request with your changes. + To minimize friction, consider setting `Allow edits from maintainers` on the + PR, which will enable project committers and automation to update your PR. + 1. A maintainer will review the pull request and make comments. Prefer adding additional commits over amending and force-pushing since it can diff --git a/awsproviderlint/vendor/cloud.google.com/go/compute/metadata/metadata.go b/awsproviderlint/vendor/cloud.google.com/go/compute/metadata/metadata.go index 6b13424fd97..545bd9d379c 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/compute/metadata/metadata.go +++ b/awsproviderlint/vendor/cloud.google.com/go/compute/metadata/metadata.go @@ -296,6 +296,7 @@ func (c *Client) getETag(suffix string) (value, etag string, err error) { // being stable anyway. host = metadataIP } + suffix = strings.TrimLeft(suffix, "/") u := "http://" + host + "/computeMetadata/v1/" + suffix req, err := http.NewRequest("GET", u, nil) if err != nil { diff --git a/awsproviderlint/vendor/cloud.google.com/go/go.mod b/awsproviderlint/vendor/cloud.google.com/go/go.mod index 5bdc67a97f7..81cd801e6e5 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/go.mod +++ b/awsproviderlint/vendor/cloud.google.com/go/go.mod @@ -4,21 +4,21 @@ go 1.11 require ( cloud.google.com/go/storage v1.10.0 - github.com/golang/mock v1.4.3 + github.com/golang/mock v1.4.4 github.com/golang/protobuf v1.4.2 - github.com/google/go-cmp v0.5.0 + github.com/google/go-cmp v0.5.1 github.com/google/martian/v3 v3.0.0 github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99 github.com/googleapis/gax-go/v2 v2.0.5 github.com/jstemmer/go-junit-report v0.9.1 go.opencensus.io v0.22.4 golang.org/x/lint v0.0.0-20200302205851-738671d3881b - golang.org/x/net v0.0.0-20200707034311-ab3426394381 + golang.org/x/net v0.0.0-20200822124328-c89045814202 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/text v0.3.3 - golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed - google.golang.org/api v0.29.0 - google.golang.org/genproto v0.0.0-20200711021454-869866162049 - google.golang.org/grpc v1.30.0 - google.golang.org/protobuf v1.25.0 // indirect + golang.org/x/tools v0.0.0-20200825202427-b303f430e36d + golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect + google.golang.org/api v0.30.0 + google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 + google.golang.org/grpc v1.31.0 ) diff --git a/awsproviderlint/vendor/cloud.google.com/go/go.sum b/awsproviderlint/vendor/cloud.google.com/go/go.sum index 3736901a512..cac94f72837 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/go.sum +++ b/awsproviderlint/vendor/cloud.google.com/go/go.sum @@ -11,6 +11,7 @@ cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6 cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go/bigquery v1.0.1 h1:hL+ycaJpVE9M7nLoiXb/Pn10ENE2u+oddxbD8uu0ZVU= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0 h1:sAbMqjY1PEQKZBWfbu6Y6bsupJ9c4QdHnzg/VvYTLcE= @@ -78,6 +79,8 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3 h1:GV+pQPG/EUUbkh47niozDcADz6go/dUwhVzdUQHIVRw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1 h1:YF8+flBXS5eO826T4nzqPrxfhQThhXl0YzfuUPu4SBg= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -111,6 +114,8 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0 h1:pMen7vLs8nvgEYhywH3KDWJIJTeEr2ULsVWHWYHQyBs= @@ -242,6 +247,8 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344 h1:vGXIOMxbNfDTk/aXCmfdLgkrS golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -295,6 +302,8 @@ golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200523222454-059865788121 h1:rITEj+UZHYC927n8GT97eC3zrpzXdb/voyeOuVKS46o= golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 h1:B6caxRw+hozq68X2MY7jEpZh/cr4/aHLv9xU8Kkadrw= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= @@ -351,12 +360,17 @@ golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88 h1:4j84u0sokprDu3IdSYHJMmo golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed h1:+qzWo37K31KxduIYaBeMqJ8MUOyTayOQKpH9aDPLMSY= -golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d h1:szSOL78iTCl0LF1AMjhSWJj8tIM0KixlUUnBtYXsmd8= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d h1:W07d4xkoAUSNOkOzdzXCdFGxT7o2rW4q8M34tB2i//k= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0 h1:VGGbLNyPF7dvYHhcUGYBBGCRDDK0RRJAI6KCvo0CL+E= @@ -379,6 +393,8 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -423,8 +439,11 @@ google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= -google.golang.org/genproto v0.0.0-20200711021454-869866162049 h1:YFTFpQhgvrLrmxtiIncJxFXeCyq84ixuKWVCaCAi9Oc= -google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c h1:Lq4llNryJoaVFRmvrIwC/ZHH7tNt4tUYIu8+se2aayY= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987 h1:PDIOdWxZ8eRizhKa1AAvY53xsvLB1cWorMjslvY3VA8= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1 h1:Hz2g2wirWK7H0qIIhGIqRGTuMwTE8HEKFnDZZ7lm9NU= @@ -441,8 +460,9 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.30.0 h1:M5a8xTlYTxwMn5ZFkwhRabsygDY5G8TYLyQDBxJNAxE= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0 h1:T7P4R73V3SSDPhH7WW7ATbfViLtmamH0DKrP3f9AuDI= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/awsproviderlint/vendor/cloud.google.com/go/internal/.repo-metadata-full.json b/awsproviderlint/vendor/cloud.google.com/go/internal/.repo-metadata-full.json index 77368c01099..536f89cb36e 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/internal/.repo-metadata-full.json +++ b/awsproviderlint/vendor/cloud.google.com/go/internal/.repo-metadata-full.json @@ -1,4 +1,12 @@ { + "cloud.google.com/go/analytics/admin/apiv1alpha": { + "distribution_name": "cloud.google.com/go/analytics/admin/apiv1alpha", + "description": "", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/analytics/admin/apiv1alpha", + "release_level": "alpha" + }, "cloud.google.com/go/asset/apiv1": { "distribution_name": "cloud.google.com/go/asset/apiv1", "description": "Cloud Asset API", @@ -143,6 +151,14 @@ "docs_url": "https://pkg.go.dev/cloud.google.com/go/billing/apiv1", "release_level": "ga" }, + "cloud.google.com/go/billing/budgets/apiv1beta1": { + "distribution_name": "cloud.google.com/go/billing/budgets/apiv1beta1", + "description": "", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/billing/budgets/apiv1beta1", + "release_level": "beta" + }, "cloud.google.com/go/cloudbuild/apiv1/v2": { "distribution_name": "cloud.google.com/go/cloudbuild/apiv1/v2", "description": "Cloud Build API", @@ -303,6 +319,22 @@ "docs_url": "https://pkg.go.dev/cloud.google.com/go/firestore/apiv1/admin", "release_level": "ga" }, + "cloud.google.com/go/functions/apiv1": { + "distribution_name": "cloud.google.com/go/functions/apiv1", + "description": "", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/functions/apiv1", + "release_level": "beta" + }, + "cloud.google.com/go/gaming/apiv1": { + "distribution_name": "cloud.google.com/go/gaming/apiv1", + "description": "", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/gaming/apiv1", + "release_level": "beta" + }, "cloud.google.com/go/gaming/apiv1beta": { "distribution_name": "cloud.google.com/go/gaming/apiv1beta", "description": "", @@ -407,6 +439,14 @@ "docs_url": "https://pkg.go.dev/cloud.google.com/go/monitoring/dashboard/apiv1", "release_level": "beta" }, + "cloud.google.com/go/notebooks/apiv1beta1": { + "distribution_name": "cloud.google.com/go/notebooks/apiv1beta1", + "description": "Notebooks API", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/notebooks/apiv1beta1", + "release_level": "beta" + }, "cloud.google.com/go/osconfig/agentendpoint/apiv1": { "distribution_name": "cloud.google.com/go/osconfig/agentendpoint/apiv1", "description": "Cloud OS Config API", @@ -471,6 +511,14 @@ "docs_url": "https://pkg.go.dev/cloud.google.com/go/policytroubleshooter/apiv1", "release_level": "beta" }, + "cloud.google.com/go/profiler": { + "distribution_name": "cloud.google.com/go/profiler", + "description": "Cloud Profiler", + "language": "Go", + "client_library_type": "manual", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/profiler", + "release_level": "ga" + }, "cloud.google.com/go/pubsub": { "distribution_name": "cloud.google.com/go/pubsub", "description": "Cloud PubSub", @@ -487,6 +535,14 @@ "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsub/apiv1", "release_level": "ga" }, + "cloud.google.com/go/pubsublite/apiv1": { + "distribution_name": "cloud.google.com/go/pubsublite/apiv1", + "description": "", + "language": "Go", + "client_library_type": "generated", + "docs_url": "https://pkg.go.dev/cloud.google.com/go/pubsublite/apiv1", + "release_level": "beta" + }, "cloud.google.com/go/recaptchaenterprise/apiv1": { "distribution_name": "cloud.google.com/go/recaptchaenterprise/apiv1", "description": "reCAPTCHA Enterprise API", @@ -585,7 +641,7 @@ }, "cloud.google.com/go/securitycenter/apiv1beta1": { "distribution_name": "cloud.google.com/go/securitycenter/apiv1beta1", - "description": "Cloud Security Command Center API", + "description": "Security Command Center API", "language": "Go", "client_library_type": "generated", "docs_url": "https://pkg.go.dev/cloud.google.com/go/securitycenter/apiv1beta1", diff --git a/awsproviderlint/vendor/cloud.google.com/go/internal/version/version.go b/awsproviderlint/vendor/cloud.google.com/go/internal/version/version.go index 3328019a3af..f3dca3d0472 100644 --- a/awsproviderlint/vendor/cloud.google.com/go/internal/version/version.go +++ b/awsproviderlint/vendor/cloud.google.com/go/internal/version/version.go @@ -26,7 +26,7 @@ import ( // Repo is the current version of the client libraries in this // repo. It should be a date in YYYYMMDD format. -const Repo = "20200706" +const Repo = "20200817" // Go returns the Go runtime version. The returned string // has no whitespace. diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/generate.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/generate.go deleted file mode 100644 index 81f3a747178..00000000000 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/generate.go +++ /dev/null @@ -1,7 +0,0 @@ -package textseg - -//go:generate go run make_tables.go -output tables.go -//go:generate go run make_test_tables.go -output tables_test.go -//go:generate ruby unicode2ragel.rb --url=http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakProperty.txt -m GraphemeCluster -p "Prepend,CR,LF,Control,Extend,Regional_Indicator,SpacingMark,L,V,T,LV,LVT,E_Base,E_Modifier,ZWJ,Glue_After_Zwj,E_Base_GAZ" -o grapheme_clusters_table.rl -//go:generate ragel -Z grapheme_clusters.rl -//go:generate gofmt -w grapheme_clusters.go diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.go deleted file mode 100644 index 012bc690aa1..00000000000 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.go +++ /dev/null @@ -1,5276 +0,0 @@ - -// line 1 "grapheme_clusters.rl" -package textseg - -import ( - "errors" - "unicode/utf8" -) - -// Generated from grapheme_clusters.rl. DO NOT EDIT - -// line 13 "grapheme_clusters.go" -var _graphclust_actions []byte = []byte{ - 0, 1, 0, 1, 4, 1, 9, 1, 10, - 1, 11, 1, 12, 1, 13, 1, 14, - 1, 15, 1, 16, 1, 17, 1, 18, - 1, 19, 1, 20, 1, 21, 2, 1, - 7, 2, 1, 8, 2, 2, 3, 2, - 5, 1, 3, 0, 1, 8, 3, 5, - 0, 1, 3, 5, 1, 6, -} - -var _graphclust_key_offsets []int16 = []int16{ - 0, 0, 1, 3, 5, 7, 10, 15, - 17, 20, 28, 31, 33, 35, 37, 67, - 75, 77, 81, 84, 89, 94, 104, 116, - 122, 127, 137, 140, 147, 151, 159, 169, - 173, 181, 183, 191, 194, 196, 201, 203, - 210, 212, 220, 221, 242, 246, 252, 257, - 259, 263, 267, 269, 273, 275, 278, 282, - 284, 291, 293, 297, 301, 305, 307, 309, - 318, 322, 327, 329, 335, 337, 338, 340, - 341, 343, 345, 347, 349, 364, 368, 370, - 372, 377, 381, 385, 387, 389, 393, 397, - 399, 403, 410, 415, 419, 422, 423, 427, - 434, 439, 440, 441, 443, 452, 454, 477, - 481, 483, 487, 491, 492, 496, 500, 503, - 505, 510, 523, 525, 527, 529, 531, 535, - 539, 541, 543, 545, 549, 553, 557, 559, - 561, 563, 565, 566, 568, 574, 580, 586, - 588, 592, 596, 601, 604, 614, 616, 618, - 621, 623, 625, 627, 629, 632, 637, 639, - 642, 650, 653, 655, 657, 659, 690, 698, - 700, 704, 711, 723, 730, 744, 750, 768, - 779, 785, 797, 800, 809, 814, 824, 830, - 844, 850, 862, 874, 878, 880, 886, 888, - 895, 898, 906, 907, 928, 937, 945, 951, - 953, 957, 961, 966, 972, 974, 977, 990, - 995, 1009, 1011, 1020, 1027, 1038, 1048, 1056, - 1067, 1071, 1076, 1078, 1080, 1082, 1083, 1085, - 1087, 1089, 1091, 1106, 1110, 1112, 1114, 1122, - 1130, 1132, 1136, 1147, 1150, 1160, 1164, 1171, - 1179, 1185, 1188, 1189, 1193, 1200, 1205, 1206, - 1207, 1209, 1218, 1220, 1243, 1248, 1250, 1259, - 1264, 1265, 1274, 1280, 1290, 1295, 1302, 1316, - 1320, 1325, 1336, 1339, 1349, 1353, 1362, 1364, - 1372, 1379, 1385, 1392, 1396, 1398, 1400, 1402, - 1403, 1405, 1411, 1419, 1425, 1427, 1431, 1435, - 1440, 1443, 1453, 1455, 1457, 1458, 1460, 1461, - 1467, 1469, 1471, 1471, 1472, 1473, 1474, 1480, - 1482, 1484, 1484, 1490, 1492, 1497, 1502, 1504, - 1506, 1508, 1511, 1516, 1518, 1521, 1529, 1532, - 1534, 1536, 1538, 1568, 1576, 1578, 1582, 1585, - 1590, 1595, 1605, 1617, 1623, 1628, 1638, 1641, - 1648, 1652, 1660, 1670, 1674, 1682, 1684, 1692, - 1695, 1697, 1702, 1704, 1711, 1713, 1721, 1722, - 1743, 1747, 1753, 1758, 1760, 1764, 1768, 1770, - 1774, 1776, 1779, 1783, 1785, 1792, 1794, 1798, - 1802, 1806, 1808, 1810, 1819, 1823, 1828, 1830, - 1836, 1838, 1839, 1841, 1842, 1844, 1846, 1848, - 1850, 1865, 1869, 1871, 1873, 1878, 1882, 1886, - 1888, 1890, 1894, 1898, 1900, 1904, 1911, 1916, - 1920, 1923, 1924, 1928, 1935, 1940, 1941, 1942, - 1944, 1953, 1955, 1978, 1982, 1984, 1988, 1992, - 1993, 1997, 2001, 2004, 2006, 2011, 2024, 2026, - 2028, 2030, 2032, 2036, 2040, 2042, 2044, 2046, - 2050, 2054, 2058, 2060, 2062, 2064, 2066, 2067, - 2069, 2075, 2081, 2087, 2089, 2093, 2097, 2102, - 2105, 2115, 2117, 2119, 2122, 2124, 2126, 2128, - 2130, 2133, 2138, 2140, 2143, 2151, 2154, 2156, - 2158, 2160, 2191, 2199, 2201, 2205, 2212, 2224, - 2231, 2245, 2251, 2269, 2280, 2286, 2298, 2301, - 2310, 2315, 2325, 2331, 2345, 2351, 2363, 2375, - 2379, 2381, 2387, 2389, 2396, 2399, 2407, 2408, - 2429, 2438, 2446, 2452, 2454, 2458, 2462, 2467, - 2473, 2475, 2478, 2491, 2496, 2510, 2512, 2521, - 2528, 2539, 2549, 2557, 2568, 2572, 2577, 2579, - 2581, 2583, 2584, 2586, 2588, 2590, 2592, 2607, - 2611, 2613, 2615, 2623, 2631, 2633, 2637, 2648, - 2651, 2661, 2665, 2672, 2680, 2686, 2689, 2690, - 2694, 2701, 2706, 2707, 2708, 2710, 2719, 2721, - 2744, 2749, 2751, 2760, 2765, 2766, 2775, 2781, - 2791, 2796, 2803, 2817, 2821, 2826, 2837, 2840, - 2850, 2854, 2863, 2865, 2873, 2880, 2886, 2893, - 2897, 2899, 2901, 2903, 2904, 2906, 2912, 2920, - 2926, 2928, 2932, 2936, 2941, 2944, 2954, 2956, - 2958, 2959, 2961, 2962, 2968, 2970, 2972, 2972, - 2973, 2974, 2975, 2981, 2983, 2985, 2985, 2991, - 2993, 2997, 3003, 3006, 3009, 3013, 3016, 3019, - 3026, 3028, 3052, 3054, 3078, 3080, 3082, 3105, - 3107, 3109, 3110, 3112, 3114, 3116, 3122, 3124, - 3156, 3160, 3165, 3188, 3190, 3192, 3194, 3196, - 3199, 3201, 3203, 3207, 3207, 3263, 3319, 3350, - 3355, 3359, 3366, 3374, 3378, 3381, 3384, 3390, - 3392, 3412, 3418, 3423, 3425, 3427, 3430, 3432, - 3434, 3438, 3494, 3550, 3581, 3586, 3594, 3598, - 3600, 3605, 3611, 3615, 3618, 3624, 3627, 3631, - 3634, 3638, 3651, 3655, 3662, 3663, 3665, 3668, - 3678, 3698, 3705, 3709, 3716, 3726, 3733, 3736, - 3751, 3753, 3756, 3761, 3763, 3766, 3769, 3773, - 3776, 3779, 3786, 3788, 3790, 3792, 3794, 3797, - 3802, 3804, 3807, 3815, 3818, 3820, 3822, 3824, - 3854, 3862, 3864, 3868, 3871, 3876, 3881, 3891, - 3903, 3909, 3914, 3924, 3927, 3934, 3938, 3946, - 3956, 3960, 3968, 3970, 3978, 3981, 3983, 3988, - 3990, 3997, 3999, 4007, 4008, 4029, 4033, 4039, - 4044, 4046, 4050, 4054, 4056, 4060, 4062, 4065, - 4069, 4071, 4078, 4080, 4084, 4088, 4092, 4094, - 4096, 4105, 4109, 4114, 4116, 4122, 4124, 4125, - 4127, 4128, 4130, 4132, 4134, 4136, 4151, 4155, - 4157, 4159, 4164, 4168, 4172, 4174, 4176, 4180, - 4184, 4186, 4190, 4197, 4202, 4206, 4209, 4210, - 4214, 4221, 4226, 4227, 4228, 4230, 4239, 4241, - 4264, 4268, 4270, 4274, 4278, 4279, 4283, 4287, - 4290, 4292, 4297, 4310, 4312, 4314, 4316, 4318, - 4322, 4326, 4328, 4330, 4332, 4336, 4340, 4344, - 4346, 4348, 4350, 4352, 4353, 4355, 4361, 4367, - 4373, 4375, 4379, 4383, 4388, 4391, 4401, 4403, - 4405, 4408, 4410, 4412, 4414, 4416, 4419, 4424, - 4426, 4429, 4437, 4440, 4442, 4444, 4446, 4477, - 4485, 4487, 4491, 4498, 4510, 4517, 4531, 4537, - 4555, 4566, 4572, 4584, 4587, 4596, 4601, 4611, - 4617, 4631, 4637, 4649, 4661, 4665, 4667, 4673, - 4675, 4682, 4685, 4693, 4694, 4715, 4724, 4732, - 4738, 4740, 4744, 4748, 4753, 4759, 4761, 4764, - 4777, 4782, 4796, 4798, 4807, 4814, 4825, 4835, - 4843, 4854, 4858, 4863, 4865, 4867, 4869, 4870, - 4872, 4874, 4876, 4878, 4893, 4897, 4899, 4901, - 4909, 4917, 4919, 4923, 4934, 4937, 4947, 4951, - 4958, 4966, 4972, 4975, 4976, 4980, 4987, 4992, - 4993, 4994, 4996, 5005, 5007, 5030, 5035, 5037, - 5046, 5051, 5052, 5061, 5067, 5077, 5082, 5089, - 5103, 5107, 5112, 5123, 5126, 5136, 5140, 5149, - 5151, 5159, 5166, 5172, 5179, 5183, 5185, 5187, - 5189, 5190, 5192, 5198, 5206, 5212, 5214, 5218, - 5222, 5227, 5230, 5240, 5242, 5244, 5245, 5247, - 5248, 5254, 5256, 5258, 5258, 5259, 5260, 5261, - 5267, 5269, 5271, 5271, 5277, 5301, 5303, 5327, - 5329, 5331, 5354, 5356, 5358, 5359, 5361, 5363, - 5365, 5371, 5373, 5405, 5409, 5414, 5437, 5439, - 5441, 5443, 5445, 5448, 5450, 5452, 5456, 5456, - 5512, 5568, 5599, 5604, 5607, 5614, 5626, 5628, - 5630, 5632, 5635, 5640, 5642, 5645, 5653, 5656, - 5658, 5660, 5662, 5692, 5700, 5702, 5706, 5709, - 5714, 5719, 5729, 5741, 5747, 5752, 5762, 5765, - 5772, 5776, 5784, 5794, 5798, 5806, 5808, 5816, - 5819, 5821, 5826, 5828, 5835, 5837, 5845, 5846, - 5867, 5871, 5877, 5882, 5884, 5888, 5892, 5894, - 5898, 5900, 5903, 5907, 5909, 5916, 5918, 5922, - 5926, 5930, 5932, 5934, 5943, 5947, 5952, 5954, - 5956, 5958, 5959, 5961, 5963, 5965, 5967, 5982, - 5986, 5988, 5990, 5995, 5999, 6003, 6005, 6007, - 6011, 6015, 6017, 6021, 6028, 6033, 6037, 6040, - 6041, 6045, 6051, 6056, 6057, 6058, 6060, 6069, - 6071, 6094, 6098, 6100, 6104, 6108, 6109, 6113, - 6117, 6120, 6122, 6127, 6140, 6142, 6144, 6146, - 6148, 6152, 6156, 6158, 6160, 6162, 6166, 6170, - 6174, 6176, 6178, 6180, 6182, 6183, 6185, 6191, - 6197, 6203, 6205, 6209, 6213, 6218, 6221, 6231, - 6233, 6235, 6236, 6242, 6244, 6246, 6246, 6252, - 6253, 6260, 6263, 6265, 6267, 6269, 6271, 6274, - 6279, 6281, 6284, 6292, 6295, 6297, 6299, 6301, - 6332, 6340, 6342, 6346, 6353, 6365, 6372, 6386, - 6392, 6410, 6421, 6427, 6439, 6442, 6451, 6456, - 6466, 6472, 6486, 6492, 6504, 6516, 6520, 6522, - 6528, 6530, 6537, 6540, 6548, 6549, 6570, 6579, - 6587, 6593, 6595, 6599, 6603, 6608, 6614, 6616, - 6619, 6632, 6637, 6651, 6653, 6662, 6669, 6680, - 6690, 6698, 6709, 6713, 6718, 6720, 6722, 6724, - 6725, 6727, 6729, 6731, 6733, 6748, 6752, 6754, - 6756, 6764, 6772, 6774, 6778, 6789, 6792, 6802, - 6806, 6813, 6821, 6827, 6830, 6831, 6835, 6842, - 6847, 6848, 6849, 6851, 6860, 6862, 6885, 6890, - 6892, 6901, 6906, 6907, 6916, 6922, 6932, 6937, - 6944, 6958, 6962, 6967, 6978, 6981, 6991, 6995, - 7004, 7006, 7014, 7021, 7027, 7034, 7038, 7040, - 7042, 7044, 7045, 7047, 7053, 7061, 7067, 7069, - 7073, 7077, 7082, 7085, 7095, 7097, 7099, 7100, - 7102, 7103, 7109, 7111, 7113, 7113, 7114, 7115, - 7121, 7124, 7126, 7128, 7130, 7133, 7138, 7140, - 7143, 7151, 7154, 7156, 7158, 7160, 7191, 7199, - 7201, 7205, 7212, 7214, 7216, 7218, 7221, 7226, - 7228, 7231, 7239, 7242, 7244, 7246, 7248, 7278, - 7286, 7288, 7292, 7295, 7300, 7305, 7315, 7327, - 7333, 7338, 7348, 7351, 7358, 7362, 7370, 7380, - 7384, 7392, 7394, 7402, 7405, 7407, 7412, 7414, - 7421, 7423, 7431, 7432, 7453, 7457, 7463, 7468, - 7470, 7474, 7478, 7480, 7484, 7486, 7489, 7493, - 7495, 7502, 7504, 7508, 7512, 7516, 7518, 7520, - 7529, 7533, 7538, 7540, 7546, 7548, 7549, 7551, - 7552, 7554, 7556, 7558, 7560, 7575, 7579, 7581, - 7583, 7588, 7592, 7596, 7598, 7600, 7604, 7608, - 7610, 7614, 7621, 7626, 7630, 7633, 7634, 7638, - 7645, 7650, 7651, 7652, 7654, 7663, 7665, 7688, - 7692, 7694, 7698, 7702, 7703, 7707, 7711, 7714, - 7716, 7721, 7734, 7736, 7738, 7740, 7742, 7746, - 7750, 7752, 7754, 7756, 7760, 7764, 7768, 7770, - 7772, 7774, 7776, 7777, 7779, 7785, 7791, 7797, - 7799, 7803, 7807, 7812, 7815, 7825, 7827, 7829, - 7832, 7834, 7835, 7836, 7837, 7843, 7845, 7847, - 7847, 7853, 7865, 7872, 7886, 7892, 7910, 7921, - 7927, 7939, 7942, 7951, 7956, 7966, 7972, 7986, - 7992, 8004, 8016, 8020, 8022, 8028, 8030, 8037, - 8040, 8048, 8049, 8070, 8079, 8087, 8093, 8095, - 8099, 8103, 8108, 8114, 8116, 8119, 8132, 8137, - 8151, 8153, 8162, 8169, 8180, 8190, 8198, 8209, - 8213, 8218, 8220, 8222, 8224, 8225, 8227, 8229, - 8231, 8233, 8248, 8252, 8254, 8256, 8264, 8272, - 8274, 8278, 8289, 8292, 8302, 8306, 8313, 8321, - 8327, 8330, 8331, 8335, 8342, 8347, 8348, 8349, - 8351, 8360, 8362, 8385, 8390, 8392, 8401, 8406, - 8407, 8416, 8422, 8432, 8437, 8444, 8458, 8462, - 8467, 8478, 8481, 8491, 8495, 8504, 8506, 8514, - 8521, 8527, 8534, 8538, 8540, 8542, 8544, 8545, - 8547, 8553, 8561, 8567, 8569, 8573, 8577, 8582, - 8585, 8595, 8597, 8599, 8600, 8602, 8603, 8609, - 8611, 8613, 8613, 8616, 8622, 8624, 8644, 8650, - 8655, 8657, 8659, 8662, 8664, 8666, 8670, 8726, - 8782, 8817, 8822, 8830, 8832, 8832, 8834, 8838, - 8841, 8848, 8854, 8858, 8861, 8867, 8870, 8876, - 8879, 8885, 8898, 8902, 8904, 8906, 8908, 8911, - 8916, 8918, 8921, 8929, 8932, 8934, 8936, 8938, - 8968, 8976, 8978, 8982, 8985, 8990, 8995, 9005, - 9017, 9023, 9028, 9038, 9041, 9048, 9052, 9060, - 9070, 9074, 9082, 9084, 9092, 9095, 9097, 9102, - 9104, 9111, 9113, 9121, 9122, 9143, 9147, 9153, - 9158, 9160, 9164, 9168, 9170, 9174, 9176, 9179, - 9183, 9185, 9192, 9194, 9198, 9202, 9206, 9208, - 9210, 9219, 9223, 9228, 9230, 9236, 9238, 9239, - 9241, 9242, 9244, 9246, 9248, 9250, 9265, 9269, - 9271, 9273, 9278, 9282, 9286, 9288, 9290, 9294, - 9298, 9300, 9304, 9311, 9316, 9320, 9323, 9324, - 9328, 9335, 9340, 9341, 9342, 9344, 9353, 9355, - 9378, 9382, 9384, 9388, 9392, 9393, 9397, 9401, - 9404, 9406, 9411, 9424, 9426, 9428, 9430, 9432, - 9436, 9440, 9442, 9444, 9446, 9450, 9454, 9458, - 9460, 9462, 9464, 9466, 9467, 9469, 9475, 9481, - 9487, 9489, 9493, 9497, 9502, 9505, 9515, 9517, - 9519, 9522, 9524, 9526, 9528, 9530, 9533, 9538, - 9540, 9543, 9551, 9554, 9556, 9558, 9560, 9591, - 9599, 9601, 9605, 9612, 9624, 9631, 9645, 9651, - 9669, 9680, 9686, 9698, 9701, 9710, 9715, 9725, - 9731, 9745, 9751, 9763, 9775, 9779, 9781, 9787, - 9789, 9796, 9799, 9807, 9808, 9829, 9838, 9846, - 9852, 9854, 9858, 9862, 9867, 9873, 9875, 9878, - 9891, 9896, 9910, 9912, 9921, 9928, 9939, 9949, - 9957, 9968, 9972, 9977, 9979, 9981, 9983, 9984, - 9986, 9988, 9990, 9992, 10007, 10011, 10013, 10015, - 10023, 10031, 10033, 10037, 10048, 10051, 10061, 10065, - 10072, 10080, 10086, 10089, 10090, 10094, 10101, 10106, - 10107, 10108, 10110, 10119, 10121, 10144, 10149, 10151, - 10160, 10165, 10166, 10175, 10181, 10191, 10196, 10203, - 10217, 10221, 10226, 10237, 10240, 10250, 10254, 10263, - 10265, 10273, 10280, 10286, 10293, 10297, 10299, 10301, - 10303, 10304, 10306, 10312, 10320, 10326, 10328, 10332, - 10336, 10341, 10344, 10354, 10356, 10358, 10359, 10361, - 10362, 10368, 10370, 10372, 10372, 10373, 10374, 10375, - 10381, 10383, 10385, 10385, 10391, 10398, 10399, 10401, - 10404, 10414, 10434, 10441, 10445, 10452, 10462, 10469, - 10472, 10487, 10489, 10492, 10501, 10505, 10509, 10538, - 10558, 10578, 10598, 10620, 10640, 10660, 10680, 10703, - 10724, 10745, 10766, 10786, 10809, 10829, 10849, 10869, - 10890, 10911, 10932, 10952, 10972, 10992, 11012, 11032, - 11052, 11072, 11092, 11112, -} - -var _graphclust_trans_keys []byte = []byte{ - 10, 128, 255, 176, 255, 131, 137, 191, - 145, 189, 135, 129, 130, 132, 133, 144, - 154, 176, 139, 159, 150, 156, 159, 164, - 167, 168, 170, 173, 145, 176, 255, 139, - 255, 166, 176, 171, 179, 160, 161, 163, - 164, 165, 167, 169, 171, 173, 174, 175, - 176, 177, 179, 180, 181, 182, 183, 184, - 185, 186, 187, 188, 189, 190, 191, 166, - 170, 172, 178, 150, 153, 155, 163, 165, - 167, 169, 173, 153, 155, 148, 161, 163, - 255, 189, 132, 185, 144, 152, 161, 164, - 255, 188, 129, 131, 190, 255, 133, 134, - 137, 138, 142, 150, 152, 161, 164, 255, - 131, 134, 137, 138, 142, 144, 146, 175, - 178, 180, 182, 255, 134, 138, 142, 161, - 164, 255, 188, 129, 131, 190, 191, 128, - 132, 135, 136, 139, 141, 150, 151, 162, - 163, 130, 190, 191, 151, 128, 130, 134, - 136, 138, 141, 128, 131, 190, 255, 133, - 137, 142, 148, 151, 161, 164, 255, 128, - 132, 134, 136, 138, 141, 149, 150, 162, - 163, 129, 131, 190, 255, 133, 137, 142, - 150, 152, 161, 164, 255, 130, 131, 138, - 150, 143, 148, 152, 159, 178, 179, 177, - 179, 186, 135, 142, 177, 179, 185, 187, - 188, 136, 141, 181, 183, 185, 152, 153, - 190, 191, 177, 191, 128, 132, 134, 135, - 141, 151, 153, 188, 134, 128, 129, 130, - 141, 156, 157, 158, 159, 160, 162, 164, - 168, 169, 170, 172, 173, 174, 175, 176, - 179, 183, 173, 183, 185, 190, 150, 153, - 158, 160, 177, 180, 130, 141, 157, 132, - 134, 157, 159, 146, 148, 178, 180, 146, - 147, 178, 179, 180, 255, 148, 156, 158, - 255, 139, 141, 169, 133, 134, 160, 171, - 176, 187, 151, 155, 160, 162, 191, 149, - 158, 165, 188, 176, 190, 128, 132, 180, - 255, 133, 170, 180, 255, 128, 130, 161, - 173, 166, 179, 164, 183, 173, 144, 146, - 148, 168, 178, 180, 184, 185, 128, 181, - 187, 191, 128, 131, 179, 181, 183, 140, - 141, 128, 131, 157, 179, 181, 183, 144, - 176, 164, 175, 177, 191, 160, 191, 128, - 130, 170, 175, 153, 154, 153, 154, 155, - 160, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 175, 175, 178, 180, 189, - 158, 159, 176, 177, 130, 134, 139, 163, - 167, 128, 129, 180, 255, 134, 159, 178, - 255, 166, 173, 135, 147, 128, 131, 179, - 255, 129, 164, 166, 255, 169, 182, 131, - 188, 140, 141, 176, 178, 180, 183, 184, - 190, 191, 129, 171, 175, 181, 182, 163, - 170, 172, 173, 172, 184, 190, 158, 128, - 143, 160, 175, 144, 145, 150, 155, 157, - 158, 159, 135, 139, 141, 168, 171, 189, - 160, 182, 186, 191, 129, 131, 133, 134, - 140, 143, 184, 186, 165, 166, 128, 129, - 130, 132, 133, 134, 135, 136, 139, 140, - 141, 144, 145, 146, 147, 150, 151, 152, - 153, 154, 156, 176, 178, 128, 130, 184, - 255, 135, 190, 131, 175, 187, 255, 128, - 130, 167, 180, 179, 128, 130, 179, 255, - 129, 137, 141, 255, 190, 172, 183, 159, - 170, 188, 128, 131, 190, 191, 151, 128, - 132, 135, 136, 139, 141, 162, 163, 166, - 172, 176, 180, 181, 191, 128, 134, 176, - 255, 132, 255, 175, 181, 184, 255, 129, - 155, 158, 255, 129, 255, 171, 183, 157, - 171, 175, 182, 184, 191, 146, 167, 169, - 182, 171, 172, 189, 190, 176, 180, 176, - 182, 145, 190, 143, 146, 178, 157, 158, - 133, 134, 137, 168, 169, 170, 165, 169, - 173, 178, 187, 255, 131, 132, 140, 169, - 174, 255, 130, 132, 128, 182, 187, 255, - 173, 180, 182, 255, 132, 155, 159, 161, - 175, 128, 163, 165, 128, 134, 136, 152, - 155, 161, 163, 164, 166, 170, 144, 150, - 132, 138, 145, 146, 151, 166, 169, 0, - 127, 176, 255, 131, 137, 191, 145, 189, - 135, 129, 130, 132, 133, 144, 154, 176, - 139, 159, 150, 156, 159, 164, 167, 168, - 170, 173, 145, 176, 255, 139, 255, 166, - 176, 171, 179, 160, 161, 163, 164, 165, - 166, 167, 169, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, - 168, 170, 150, 153, 155, 163, 165, 167, - 169, 173, 153, 155, 148, 161, 163, 255, - 131, 187, 189, 132, 185, 190, 255, 141, - 144, 129, 136, 145, 151, 152, 161, 162, - 163, 164, 255, 129, 188, 190, 130, 131, - 191, 255, 141, 151, 129, 132, 133, 134, - 137, 138, 142, 161, 162, 163, 164, 255, - 131, 188, 129, 130, 190, 255, 145, 181, - 129, 130, 131, 134, 135, 136, 137, 138, - 139, 141, 142, 175, 176, 177, 178, 255, - 134, 138, 141, 129, 136, 142, 161, 162, - 163, 164, 255, 129, 188, 130, 131, 190, - 191, 128, 141, 129, 132, 135, 136, 139, - 140, 150, 151, 162, 163, 130, 190, 191, - 128, 141, 151, 129, 130, 134, 136, 138, - 140, 128, 129, 131, 190, 255, 133, 137, - 129, 132, 142, 148, 151, 161, 164, 255, - 129, 188, 190, 191, 130, 131, 130, 134, - 128, 132, 135, 136, 138, 139, 140, 141, - 149, 150, 162, 163, 129, 190, 130, 131, - 191, 255, 133, 137, 141, 151, 129, 132, - 142, 161, 162, 163, 164, 255, 138, 143, - 150, 159, 144, 145, 146, 148, 152, 158, - 178, 179, 177, 179, 180, 186, 135, 142, - 177, 179, 180, 185, 187, 188, 136, 141, - 181, 183, 185, 152, 153, 190, 191, 191, - 177, 190, 128, 132, 134, 135, 141, 151, - 153, 188, 134, 128, 129, 130, 141, 156, - 157, 158, 159, 160, 162, 164, 168, 169, - 170, 172, 173, 174, 175, 176, 179, 183, - 177, 173, 183, 185, 186, 187, 188, 189, - 190, 150, 151, 152, 153, 158, 160, 177, - 180, 130, 132, 141, 157, 133, 134, 157, - 159, 146, 148, 178, 180, 146, 147, 178, - 179, 182, 180, 189, 190, 255, 134, 157, - 137, 147, 148, 255, 139, 141, 169, 133, - 134, 178, 160, 162, 163, 166, 167, 168, - 169, 171, 176, 184, 185, 187, 155, 151, - 152, 153, 154, 150, 160, 162, 191, 149, - 151, 152, 158, 165, 172, 173, 178, 179, - 188, 176, 190, 132, 181, 187, 128, 131, - 180, 188, 189, 255, 130, 133, 170, 171, - 179, 180, 255, 130, 161, 170, 128, 129, - 162, 165, 166, 167, 168, 173, 167, 173, - 166, 169, 170, 174, 175, 177, 178, 179, - 164, 171, 172, 179, 180, 181, 182, 183, - 161, 173, 180, 144, 146, 148, 168, 178, - 179, 184, 185, 128, 181, 187, 191, 128, - 131, 179, 181, 183, 140, 141, 144, 176, - 175, 177, 191, 160, 191, 128, 130, 170, - 175, 153, 154, 153, 154, 155, 160, 162, - 163, 164, 165, 166, 167, 168, 169, 170, - 171, 175, 175, 178, 180, 189, 158, 159, - 176, 177, 130, 134, 139, 167, 163, 164, - 165, 166, 132, 133, 134, 159, 160, 177, - 178, 255, 166, 173, 135, 145, 146, 147, - 131, 179, 188, 128, 130, 180, 181, 182, - 185, 186, 255, 165, 129, 255, 169, 174, - 175, 176, 177, 178, 179, 180, 181, 182, - 131, 140, 141, 188, 176, 178, 180, 183, - 184, 190, 191, 129, 171, 181, 182, 172, - 173, 174, 175, 165, 168, 172, 173, 163, - 170, 172, 184, 190, 158, 128, 143, 160, - 175, 144, 145, 150, 155, 157, 158, 159, - 135, 139, 141, 168, 171, 189, 160, 182, - 186, 191, 129, 131, 133, 134, 140, 143, - 184, 186, 165, 166, 128, 129, 130, 132, - 133, 134, 135, 136, 139, 140, 141, 144, - 145, 146, 147, 150, 151, 152, 153, 154, - 156, 176, 178, 129, 128, 130, 184, 255, - 135, 190, 130, 131, 175, 176, 178, 183, - 184, 187, 255, 172, 128, 130, 167, 180, - 179, 130, 128, 129, 179, 181, 182, 190, - 191, 255, 129, 137, 138, 140, 141, 255, - 180, 190, 172, 174, 175, 177, 178, 181, - 182, 183, 159, 160, 162, 163, 170, 188, - 190, 191, 128, 129, 130, 131, 128, 151, - 129, 132, 135, 136, 139, 141, 162, 163, - 166, 172, 176, 180, 181, 183, 184, 191, - 133, 128, 129, 130, 134, 176, 185, 189, - 177, 178, 179, 186, 187, 190, 191, 255, - 129, 132, 255, 175, 190, 176, 177, 178, - 181, 184, 187, 188, 255, 129, 155, 158, - 255, 189, 176, 178, 179, 186, 187, 190, - 191, 255, 129, 255, 172, 182, 171, 173, - 174, 175, 176, 183, 166, 157, 159, 160, - 161, 162, 171, 175, 190, 176, 182, 184, - 191, 169, 177, 180, 146, 167, 170, 182, - 171, 172, 189, 190, 176, 180, 176, 182, - 143, 146, 178, 157, 158, 133, 134, 137, - 168, 169, 170, 166, 173, 165, 169, 174, - 178, 187, 255, 131, 132, 140, 169, 174, - 255, 130, 132, 128, 182, 187, 255, 173, - 180, 182, 255, 132, 155, 159, 161, 175, - 128, 163, 165, 128, 134, 136, 152, 155, - 161, 163, 164, 166, 170, 144, 150, 132, - 138, 143, 187, 191, 160, 128, 129, 132, - 135, 133, 134, 160, 255, 192, 255, 139, - 168, 160, 128, 129, 132, 135, 133, 134, - 160, 255, 192, 255, 144, 145, 150, 155, - 157, 158, 128, 191, 173, 128, 159, 160, - 191, 156, 128, 133, 134, 191, 0, 127, - 176, 255, 131, 137, 191, 145, 189, 135, - 129, 130, 132, 133, 144, 154, 176, 139, - 159, 150, 156, 159, 164, 167, 168, 170, - 173, 145, 176, 255, 139, 255, 166, 176, - 171, 179, 160, 161, 163, 164, 165, 167, - 169, 171, 173, 174, 175, 176, 177, 179, - 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 166, 170, 172, 178, - 150, 153, 155, 163, 165, 167, 169, 173, - 153, 155, 148, 161, 163, 255, 189, 132, - 185, 144, 152, 161, 164, 255, 188, 129, - 131, 190, 255, 133, 134, 137, 138, 142, - 150, 152, 161, 164, 255, 131, 134, 137, - 138, 142, 144, 146, 175, 178, 180, 182, - 255, 134, 138, 142, 161, 164, 255, 188, - 129, 131, 190, 191, 128, 132, 135, 136, - 139, 141, 150, 151, 162, 163, 130, 190, - 191, 151, 128, 130, 134, 136, 138, 141, - 128, 131, 190, 255, 133, 137, 142, 148, - 151, 161, 164, 255, 128, 132, 134, 136, - 138, 141, 149, 150, 162, 163, 129, 131, - 190, 255, 133, 137, 142, 150, 152, 161, - 164, 255, 130, 131, 138, 150, 143, 148, - 152, 159, 178, 179, 177, 179, 186, 135, - 142, 177, 179, 185, 187, 188, 136, 141, - 181, 183, 185, 152, 153, 190, 191, 177, - 191, 128, 132, 134, 135, 141, 151, 153, - 188, 134, 128, 129, 130, 141, 156, 157, - 158, 159, 160, 162, 164, 168, 169, 170, - 172, 173, 174, 175, 176, 179, 183, 173, - 183, 185, 190, 150, 153, 158, 160, 177, - 180, 130, 141, 157, 132, 134, 157, 159, - 146, 148, 178, 180, 146, 147, 178, 179, - 180, 255, 148, 156, 158, 255, 139, 141, - 169, 133, 134, 160, 171, 176, 187, 151, - 155, 160, 162, 191, 149, 158, 165, 188, - 176, 190, 128, 132, 180, 255, 133, 170, - 180, 255, 128, 130, 161, 173, 166, 179, - 164, 183, 173, 144, 146, 148, 168, 178, - 180, 184, 185, 128, 181, 187, 191, 128, - 131, 179, 181, 183, 140, 141, 128, 131, - 157, 179, 181, 183, 144, 176, 164, 175, - 177, 191, 160, 191, 128, 130, 170, 175, - 153, 154, 153, 154, 155, 160, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, - 175, 175, 178, 180, 189, 158, 159, 176, - 177, 130, 134, 139, 163, 167, 128, 129, - 180, 255, 134, 159, 178, 255, 166, 173, - 135, 147, 128, 131, 179, 255, 129, 164, - 166, 255, 169, 182, 131, 188, 140, 141, - 176, 178, 180, 183, 184, 190, 191, 129, - 171, 175, 181, 182, 163, 170, 172, 173, - 172, 184, 190, 158, 128, 143, 160, 175, - 144, 145, 150, 155, 157, 158, 159, 135, - 139, 141, 168, 171, 189, 160, 182, 186, - 191, 129, 131, 133, 134, 140, 143, 184, - 186, 165, 166, 128, 129, 130, 132, 133, - 134, 135, 136, 139, 140, 141, 144, 145, - 146, 147, 150, 151, 152, 153, 154, 156, - 176, 178, 128, 130, 184, 255, 135, 190, - 131, 175, 187, 255, 128, 130, 167, 180, - 179, 128, 130, 179, 255, 129, 137, 141, - 255, 190, 172, 183, 159, 170, 188, 128, - 131, 190, 191, 151, 128, 132, 135, 136, - 139, 141, 162, 163, 166, 172, 176, 180, - 181, 191, 128, 134, 176, 255, 132, 255, - 175, 181, 184, 255, 129, 155, 158, 255, - 129, 255, 171, 183, 157, 171, 175, 182, - 184, 191, 146, 167, 169, 182, 171, 172, - 189, 190, 176, 180, 176, 182, 145, 190, - 143, 146, 178, 157, 158, 133, 134, 137, - 168, 169, 170, 165, 169, 173, 178, 187, - 255, 131, 132, 140, 169, 174, 255, 130, - 132, 128, 182, 187, 255, 173, 180, 182, - 255, 132, 155, 159, 161, 175, 128, 163, - 165, 128, 134, 136, 152, 155, 161, 163, - 164, 166, 170, 144, 150, 132, 138, 145, - 146, 151, 166, 169, 128, 255, 176, 255, - 131, 137, 191, 145, 189, 135, 129, 130, - 132, 133, 144, 154, 176, 139, 159, 150, - 156, 159, 164, 167, 168, 170, 173, 145, - 176, 255, 139, 255, 166, 176, 171, 179, - 160, 161, 163, 164, 165, 166, 167, 169, - 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 168, 170, 150, - 153, 155, 163, 165, 167, 169, 173, 153, - 155, 148, 161, 163, 255, 131, 187, 189, - 132, 185, 190, 255, 141, 144, 129, 136, - 145, 151, 152, 161, 162, 163, 164, 255, - 129, 188, 190, 130, 131, 191, 255, 141, - 151, 129, 132, 133, 134, 137, 138, 142, - 161, 162, 163, 164, 255, 131, 188, 129, - 130, 190, 255, 145, 181, 129, 130, 131, - 134, 135, 136, 137, 138, 139, 141, 142, - 175, 176, 177, 178, 255, 134, 138, 141, - 129, 136, 142, 161, 162, 163, 164, 255, - 129, 188, 130, 131, 190, 191, 128, 141, - 129, 132, 135, 136, 139, 140, 150, 151, - 162, 163, 130, 190, 191, 128, 141, 151, - 129, 130, 134, 136, 138, 140, 128, 129, - 131, 190, 255, 133, 137, 129, 132, 142, - 148, 151, 161, 164, 255, 129, 188, 190, - 191, 130, 131, 130, 134, 128, 132, 135, - 136, 138, 139, 140, 141, 149, 150, 162, - 163, 129, 190, 130, 131, 191, 255, 133, - 137, 141, 151, 129, 132, 142, 161, 162, - 163, 164, 255, 138, 143, 150, 159, 144, - 145, 146, 148, 152, 158, 178, 179, 177, - 179, 180, 186, 135, 142, 177, 179, 180, - 185, 187, 188, 136, 141, 181, 183, 185, - 152, 153, 190, 191, 191, 177, 190, 128, - 132, 134, 135, 141, 151, 153, 188, 134, - 128, 129, 130, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 177, 173, 183, - 185, 186, 187, 188, 189, 190, 150, 151, - 152, 153, 158, 160, 177, 180, 130, 132, - 141, 157, 133, 134, 157, 159, 146, 148, - 178, 180, 146, 147, 178, 179, 182, 180, - 189, 190, 255, 134, 157, 137, 147, 148, - 255, 139, 141, 169, 133, 134, 178, 160, - 162, 163, 166, 167, 168, 169, 171, 176, - 184, 185, 187, 155, 151, 152, 153, 154, - 150, 160, 162, 191, 149, 151, 152, 158, - 165, 172, 173, 178, 179, 188, 176, 190, - 132, 181, 187, 128, 131, 180, 188, 189, - 255, 130, 133, 170, 171, 179, 180, 255, - 130, 161, 170, 128, 129, 162, 165, 166, - 167, 168, 173, 167, 173, 166, 169, 170, - 174, 175, 177, 178, 179, 164, 171, 172, - 179, 180, 181, 182, 183, 161, 173, 180, - 144, 146, 148, 168, 178, 179, 184, 185, - 128, 181, 187, 191, 128, 131, 179, 181, - 183, 140, 141, 144, 176, 175, 177, 191, - 160, 191, 128, 130, 170, 175, 153, 154, - 153, 154, 155, 160, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 175, 175, - 178, 180, 189, 158, 159, 176, 177, 130, - 134, 139, 167, 163, 164, 165, 166, 132, - 133, 134, 159, 160, 177, 178, 255, 166, - 173, 135, 145, 146, 147, 131, 179, 188, - 128, 130, 180, 181, 182, 185, 186, 255, - 165, 129, 255, 169, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 131, 140, 141, - 188, 176, 178, 180, 183, 184, 190, 191, - 129, 171, 181, 182, 172, 173, 174, 175, - 165, 168, 172, 173, 163, 170, 172, 184, - 190, 158, 128, 143, 160, 175, 144, 145, - 150, 155, 157, 158, 159, 135, 139, 141, - 168, 171, 189, 160, 182, 186, 191, 129, - 131, 133, 134, 140, 143, 184, 186, 165, - 166, 128, 129, 130, 132, 133, 134, 135, - 136, 139, 140, 141, 144, 145, 146, 147, - 150, 151, 152, 153, 154, 156, 176, 178, - 129, 128, 130, 184, 255, 135, 190, 130, - 131, 175, 176, 178, 183, 184, 187, 255, - 172, 128, 130, 167, 180, 179, 130, 128, - 129, 179, 181, 182, 190, 191, 255, 129, - 137, 138, 140, 141, 255, 180, 190, 172, - 174, 175, 177, 178, 181, 182, 183, 159, - 160, 162, 163, 170, 188, 190, 191, 128, - 129, 130, 131, 128, 151, 129, 132, 135, - 136, 139, 141, 162, 163, 166, 172, 176, - 180, 181, 183, 184, 191, 133, 128, 129, - 130, 134, 176, 185, 189, 177, 178, 179, - 186, 187, 190, 191, 255, 129, 132, 255, - 175, 190, 176, 177, 178, 181, 184, 187, - 188, 255, 129, 155, 158, 255, 189, 176, - 178, 179, 186, 187, 190, 191, 255, 129, - 255, 172, 182, 171, 173, 174, 175, 176, - 183, 166, 157, 159, 160, 161, 162, 171, - 175, 190, 176, 182, 184, 191, 169, 177, - 180, 146, 167, 170, 182, 171, 172, 189, - 190, 176, 180, 176, 182, 143, 146, 178, - 157, 158, 133, 134, 137, 168, 169, 170, - 166, 173, 165, 169, 174, 178, 187, 255, - 131, 132, 140, 169, 174, 255, 130, 132, - 128, 182, 187, 255, 173, 180, 182, 255, - 132, 155, 159, 161, 175, 128, 163, 165, - 128, 134, 136, 152, 155, 161, 163, 164, - 166, 170, 144, 150, 132, 138, 143, 187, - 191, 160, 128, 129, 132, 135, 133, 134, - 160, 255, 192, 255, 139, 168, 160, 128, - 129, 132, 135, 133, 134, 160, 255, 192, - 255, 144, 145, 150, 155, 157, 158, 128, - 191, 160, 172, 174, 191, 128, 133, 134, - 155, 157, 191, 157, 128, 191, 143, 128, - 191, 163, 181, 128, 191, 162, 128, 191, - 142, 128, 191, 132, 133, 134, 135, 160, - 128, 191, 128, 255, 128, 129, 130, 132, - 133, 134, 141, 156, 157, 158, 159, 160, - 162, 164, 168, 169, 170, 172, 173, 174, - 175, 176, 179, 183, 160, 255, 128, 129, - 130, 133, 134, 135, 141, 156, 157, 158, - 159, 160, 162, 164, 168, 169, 170, 172, - 173, 174, 175, 176, 179, 183, 160, 255, - 168, 255, 128, 129, 130, 134, 135, 141, - 156, 157, 158, 159, 160, 162, 164, 168, - 169, 170, 172, 173, 174, 175, 176, 179, - 183, 168, 255, 192, 255, 159, 139, 187, - 158, 159, 176, 255, 135, 138, 139, 187, - 188, 255, 168, 255, 153, 154, 155, 160, - 162, 163, 164, 165, 166, 167, 168, 169, - 170, 171, 175, 177, 178, 179, 180, 181, - 182, 184, 185, 186, 187, 188, 189, 191, - 176, 190, 192, 255, 135, 147, 160, 188, - 128, 156, 184, 129, 255, 128, 129, 130, - 133, 134, 141, 156, 157, 158, 159, 160, - 162, 164, 168, 169, 170, 172, 173, 174, - 175, 176, 179, 183, 158, 159, 135, 255, - 148, 176, 140, 168, 132, 160, 188, 152, - 180, 144, 172, 136, 164, 192, 255, 129, - 130, 131, 132, 133, 134, 136, 137, 138, - 139, 140, 141, 143, 144, 145, 146, 147, - 148, 150, 151, 152, 153, 154, 155, 157, - 158, 159, 160, 161, 162, 164, 165, 166, - 167, 168, 169, 171, 172, 173, 174, 175, - 176, 178, 179, 180, 181, 182, 183, 185, - 186, 187, 188, 189, 190, 128, 191, 129, - 130, 131, 132, 133, 134, 136, 137, 138, - 139, 140, 141, 143, 144, 145, 146, 147, - 148, 150, 151, 152, 153, 154, 155, 157, - 158, 159, 160, 161, 162, 164, 165, 166, - 167, 168, 169, 171, 172, 173, 174, 175, - 176, 178, 179, 180, 181, 182, 183, 185, - 186, 187, 188, 189, 190, 128, 191, 129, - 130, 131, 132, 133, 134, 136, 137, 138, - 139, 140, 141, 143, 144, 145, 146, 147, - 148, 150, 151, 152, 153, 154, 155, 157, - 158, 159, 128, 156, 160, 255, 136, 164, - 175, 176, 255, 128, 141, 143, 191, 128, - 129, 152, 155, 156, 130, 191, 140, 141, - 128, 138, 144, 167, 175, 191, 128, 159, - 176, 191, 157, 128, 191, 185, 128, 191, - 128, 137, 138, 141, 142, 191, 128, 191, - 165, 177, 178, 179, 180, 181, 182, 184, - 185, 186, 187, 188, 189, 191, 128, 175, - 176, 190, 192, 255, 128, 159, 160, 188, - 189, 191, 128, 156, 184, 129, 255, 148, - 176, 140, 168, 132, 160, 188, 152, 180, - 144, 172, 136, 164, 192, 255, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 160, 161, 162, 164, 165, 166, 167, - 168, 169, 171, 172, 173, 174, 175, 176, - 178, 179, 180, 181, 182, 183, 185, 186, - 187, 188, 189, 190, 128, 191, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 160, 161, 162, 164, 165, 166, 167, - 168, 169, 171, 172, 173, 174, 175, 176, - 178, 179, 180, 181, 182, 183, 185, 186, - 187, 188, 189, 190, 128, 191, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 128, 156, 160, 255, 136, 164, 175, - 176, 255, 135, 138, 139, 187, 188, 191, - 192, 255, 187, 191, 128, 190, 128, 190, - 188, 128, 175, 190, 191, 145, 155, 157, - 159, 128, 191, 130, 135, 128, 191, 189, - 128, 191, 128, 129, 130, 131, 132, 191, - 178, 128, 191, 128, 159, 164, 191, 133, - 128, 191, 128, 178, 187, 191, 135, 142, - 143, 145, 146, 149, 150, 153, 154, 155, - 164, 128, 191, 128, 165, 166, 191, 144, - 145, 150, 155, 157, 158, 159, 135, 166, - 191, 133, 128, 191, 128, 130, 131, 132, - 133, 137, 138, 139, 140, 191, 174, 188, - 128, 129, 130, 131, 132, 133, 134, 144, - 145, 165, 166, 169, 170, 175, 176, 184, - 185, 191, 128, 132, 170, 129, 135, 136, - 191, 181, 186, 128, 191, 144, 128, 148, - 149, 150, 151, 191, 128, 132, 133, 135, - 136, 138, 139, 143, 144, 191, 163, 128, - 179, 180, 182, 183, 191, 128, 129, 191, - 166, 176, 191, 128, 151, 152, 158, 159, - 178, 179, 185, 186, 187, 188, 190, 128, - 191, 160, 128, 191, 128, 129, 135, 132, - 134, 128, 175, 157, 128, 191, 143, 128, - 191, 163, 181, 128, 191, 162, 128, 191, - 142, 128, 191, 132, 133, 134, 135, 160, - 128, 191, 0, 127, 128, 255, 176, 255, - 131, 137, 191, 145, 189, 135, 129, 130, - 132, 133, 144, 154, 176, 139, 159, 150, - 156, 159, 164, 167, 168, 170, 173, 145, - 176, 255, 139, 255, 166, 176, 171, 179, - 160, 161, 163, 164, 165, 167, 169, 171, - 173, 174, 175, 176, 177, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 166, 170, 172, 178, 150, 153, - 155, 163, 165, 167, 169, 173, 153, 155, - 148, 161, 163, 255, 189, 132, 185, 144, - 152, 161, 164, 255, 188, 129, 131, 190, - 255, 133, 134, 137, 138, 142, 150, 152, - 161, 164, 255, 131, 134, 137, 138, 142, - 144, 146, 175, 178, 180, 182, 255, 134, - 138, 142, 161, 164, 255, 188, 129, 131, - 190, 191, 128, 132, 135, 136, 139, 141, - 150, 151, 162, 163, 130, 190, 191, 151, - 128, 130, 134, 136, 138, 141, 128, 131, - 190, 255, 133, 137, 142, 148, 151, 161, - 164, 255, 128, 132, 134, 136, 138, 141, - 149, 150, 162, 163, 129, 131, 190, 255, - 133, 137, 142, 150, 152, 161, 164, 255, - 130, 131, 138, 150, 143, 148, 152, 159, - 178, 179, 177, 179, 186, 135, 142, 177, - 179, 185, 187, 188, 136, 141, 181, 183, - 185, 152, 153, 190, 191, 177, 191, 128, - 132, 134, 135, 141, 151, 153, 188, 134, - 128, 129, 130, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 173, 183, 185, - 190, 150, 153, 158, 160, 177, 180, 130, - 141, 157, 132, 134, 157, 159, 146, 148, - 178, 180, 146, 147, 178, 179, 180, 255, - 148, 156, 158, 255, 139, 141, 169, 133, - 134, 160, 171, 176, 187, 151, 155, 160, - 162, 191, 149, 158, 165, 188, 176, 190, - 128, 132, 180, 255, 133, 170, 180, 255, - 128, 130, 161, 173, 166, 179, 164, 183, - 173, 144, 146, 148, 168, 178, 180, 184, - 185, 128, 181, 187, 191, 128, 131, 179, - 181, 183, 140, 141, 128, 131, 157, 179, - 181, 183, 144, 176, 164, 175, 177, 191, - 160, 191, 128, 130, 170, 175, 153, 154, - 153, 154, 155, 160, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 175, 175, - 178, 180, 189, 158, 159, 176, 177, 130, - 134, 139, 163, 167, 128, 129, 180, 255, - 134, 159, 178, 255, 166, 173, 135, 147, - 128, 131, 179, 255, 129, 164, 166, 255, - 169, 182, 131, 188, 140, 141, 176, 178, - 180, 183, 184, 190, 191, 129, 171, 175, - 181, 182, 163, 170, 172, 173, 172, 184, - 190, 158, 128, 143, 160, 175, 144, 145, - 150, 155, 157, 158, 159, 135, 139, 141, - 168, 171, 189, 160, 182, 186, 191, 129, - 131, 133, 134, 140, 143, 184, 186, 165, - 166, 128, 129, 130, 132, 133, 134, 135, - 136, 139, 140, 141, 144, 145, 146, 147, - 150, 151, 152, 153, 154, 156, 176, 178, - 128, 130, 184, 255, 135, 190, 131, 175, - 187, 255, 128, 130, 167, 180, 179, 128, - 130, 179, 255, 129, 137, 141, 255, 190, - 172, 183, 159, 170, 188, 128, 131, 190, - 191, 151, 128, 132, 135, 136, 139, 141, - 162, 163, 166, 172, 176, 180, 181, 191, - 128, 134, 176, 255, 132, 255, 175, 181, - 184, 255, 129, 155, 158, 255, 129, 255, - 171, 183, 157, 171, 175, 182, 184, 191, - 146, 167, 169, 182, 171, 172, 189, 190, - 176, 180, 176, 182, 145, 190, 143, 146, - 178, 157, 158, 133, 134, 137, 168, 169, - 170, 165, 169, 173, 178, 187, 255, 131, - 132, 140, 169, 174, 255, 130, 132, 128, - 182, 187, 255, 173, 180, 182, 255, 132, - 155, 159, 161, 175, 128, 163, 165, 128, - 134, 136, 152, 155, 161, 163, 164, 166, - 170, 144, 150, 132, 138, 145, 146, 151, - 166, 169, 128, 255, 176, 255, 131, 137, - 191, 145, 189, 135, 129, 130, 132, 133, - 144, 154, 176, 139, 159, 150, 156, 159, - 164, 167, 168, 170, 173, 145, 176, 255, - 139, 255, 166, 176, 171, 179, 160, 161, - 163, 164, 165, 166, 167, 169, 171, 172, - 173, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 183, 184, 185, 186, 187, 188, - 189, 190, 191, 168, 170, 150, 153, 155, - 163, 165, 167, 169, 173, 153, 155, 148, - 161, 163, 255, 131, 187, 189, 132, 185, - 190, 255, 141, 144, 129, 136, 145, 151, - 152, 161, 162, 163, 164, 255, 129, 188, - 190, 130, 131, 191, 255, 141, 151, 129, - 132, 133, 134, 137, 138, 142, 161, 162, - 163, 164, 255, 131, 188, 129, 130, 190, - 255, 145, 181, 129, 130, 131, 134, 135, - 136, 137, 138, 139, 141, 142, 175, 176, - 177, 178, 255, 134, 138, 141, 129, 136, - 142, 161, 162, 163, 164, 255, 129, 188, - 130, 131, 190, 191, 128, 141, 129, 132, - 135, 136, 139, 140, 150, 151, 162, 163, - 130, 190, 191, 128, 141, 151, 129, 130, - 134, 136, 138, 140, 128, 129, 131, 190, - 255, 133, 137, 129, 132, 142, 148, 151, - 161, 164, 255, 129, 188, 190, 191, 130, - 131, 130, 134, 128, 132, 135, 136, 138, - 139, 140, 141, 149, 150, 162, 163, 129, - 190, 130, 131, 191, 255, 133, 137, 141, - 151, 129, 132, 142, 161, 162, 163, 164, - 255, 138, 143, 150, 159, 144, 145, 146, - 148, 152, 158, 178, 179, 177, 179, 180, - 186, 135, 142, 177, 179, 180, 185, 187, - 188, 136, 141, 181, 183, 185, 152, 153, - 190, 191, 191, 177, 190, 128, 132, 134, - 135, 141, 151, 153, 188, 134, 128, 129, - 130, 141, 156, 157, 158, 159, 160, 162, - 164, 168, 169, 170, 172, 173, 174, 175, - 176, 179, 183, 177, 173, 183, 185, 186, - 187, 188, 189, 190, 150, 151, 152, 153, - 158, 160, 177, 180, 130, 132, 141, 157, - 133, 134, 157, 159, 146, 148, 178, 180, - 146, 147, 178, 179, 182, 180, 189, 190, - 255, 134, 157, 137, 147, 148, 255, 139, - 141, 169, 133, 134, 178, 160, 162, 163, - 166, 167, 168, 169, 171, 176, 184, 185, - 187, 155, 151, 152, 153, 154, 150, 160, - 162, 191, 149, 151, 152, 158, 165, 172, - 173, 178, 179, 188, 176, 190, 132, 181, - 187, 128, 131, 180, 188, 189, 255, 130, - 133, 170, 171, 179, 180, 255, 130, 161, - 170, 128, 129, 162, 165, 166, 167, 168, - 173, 167, 173, 166, 169, 170, 174, 175, - 177, 178, 179, 164, 171, 172, 179, 180, - 181, 182, 183, 161, 173, 180, 144, 146, - 148, 168, 178, 179, 184, 185, 128, 181, - 187, 191, 128, 131, 179, 181, 183, 140, - 141, 144, 176, 175, 177, 191, 160, 191, - 128, 130, 170, 175, 153, 154, 153, 154, - 155, 160, 162, 163, 164, 165, 166, 167, - 168, 169, 170, 171, 175, 175, 178, 180, - 189, 158, 159, 176, 177, 130, 134, 139, - 167, 163, 164, 165, 166, 132, 133, 134, - 159, 160, 177, 178, 255, 166, 173, 135, - 145, 146, 147, 131, 179, 188, 128, 130, - 180, 181, 182, 185, 186, 255, 165, 129, - 255, 169, 174, 175, 176, 177, 178, 179, - 180, 181, 182, 131, 140, 141, 188, 176, - 178, 180, 183, 184, 190, 191, 129, 171, - 181, 182, 172, 173, 174, 175, 165, 168, - 172, 173, 163, 170, 172, 184, 190, 158, - 128, 143, 160, 175, 144, 145, 150, 155, - 157, 158, 159, 135, 139, 141, 168, 171, - 189, 160, 182, 186, 191, 129, 131, 133, - 134, 140, 143, 184, 186, 165, 166, 128, - 129, 130, 132, 133, 134, 135, 136, 139, - 140, 141, 144, 145, 146, 147, 150, 151, - 152, 153, 154, 156, 176, 178, 129, 128, - 130, 184, 255, 135, 190, 130, 131, 175, - 176, 178, 183, 184, 187, 255, 172, 128, - 130, 167, 180, 179, 130, 128, 129, 179, - 181, 182, 190, 191, 255, 129, 137, 138, - 140, 141, 255, 180, 190, 172, 174, 175, - 177, 178, 181, 182, 183, 159, 160, 162, - 163, 170, 188, 190, 191, 128, 129, 130, - 131, 128, 151, 129, 132, 135, 136, 139, - 141, 162, 163, 166, 172, 176, 180, 181, - 183, 184, 191, 133, 128, 129, 130, 134, - 176, 185, 189, 177, 178, 179, 186, 187, - 190, 191, 255, 129, 132, 255, 175, 190, - 176, 177, 178, 181, 184, 187, 188, 255, - 129, 155, 158, 255, 189, 176, 178, 179, - 186, 187, 190, 191, 255, 129, 255, 172, - 182, 171, 173, 174, 175, 176, 183, 166, - 157, 159, 160, 161, 162, 171, 175, 190, - 176, 182, 184, 191, 169, 177, 180, 146, - 167, 170, 182, 171, 172, 189, 190, 176, - 180, 176, 182, 143, 146, 178, 157, 158, - 133, 134, 137, 168, 169, 170, 166, 173, - 165, 169, 174, 178, 187, 255, 131, 132, - 140, 169, 174, 255, 130, 132, 128, 182, - 187, 255, 173, 180, 182, 255, 132, 155, - 159, 161, 175, 128, 163, 165, 128, 134, - 136, 152, 155, 161, 163, 164, 166, 170, - 144, 150, 132, 138, 143, 187, 191, 160, - 128, 129, 132, 135, 133, 134, 160, 255, - 192, 255, 139, 168, 160, 128, 129, 132, - 135, 133, 134, 160, 255, 192, 255, 144, - 145, 150, 155, 157, 158, 128, 129, 130, - 132, 133, 134, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 160, 255, 128, - 129, 130, 133, 134, 135, 141, 156, 157, - 158, 159, 160, 162, 164, 168, 169, 170, - 172, 173, 174, 175, 176, 179, 183, 160, - 255, 168, 255, 128, 129, 130, 134, 135, - 141, 156, 157, 158, 159, 160, 162, 164, - 168, 169, 170, 172, 173, 174, 175, 176, - 179, 183, 168, 255, 192, 255, 159, 139, - 187, 158, 159, 176, 255, 135, 138, 139, - 187, 188, 255, 168, 255, 153, 154, 155, - 160, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 175, 177, 178, 179, 180, - 181, 182, 184, 185, 186, 187, 188, 189, - 191, 176, 190, 192, 255, 135, 147, 160, - 188, 128, 156, 184, 129, 255, 128, 129, - 130, 133, 134, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 158, 159, 135, - 255, 148, 176, 140, 168, 132, 160, 188, - 152, 180, 144, 172, 136, 164, 192, 255, - 129, 130, 131, 132, 133, 134, 136, 137, - 138, 139, 140, 141, 143, 144, 145, 146, - 147, 148, 150, 151, 152, 153, 154, 155, - 157, 158, 159, 160, 161, 162, 164, 165, - 166, 167, 168, 169, 171, 172, 173, 174, - 175, 176, 178, 179, 180, 181, 182, 183, - 185, 186, 187, 188, 189, 190, 128, 191, - 129, 130, 131, 132, 133, 134, 136, 137, - 138, 139, 140, 141, 143, 144, 145, 146, - 147, 148, 150, 151, 152, 153, 154, 155, - 157, 158, 159, 160, 161, 162, 164, 165, - 166, 167, 168, 169, 171, 172, 173, 174, - 175, 176, 178, 179, 180, 181, 182, 183, - 185, 186, 187, 188, 189, 190, 128, 191, - 129, 130, 131, 132, 133, 134, 136, 137, - 138, 139, 140, 141, 143, 144, 145, 146, - 147, 148, 150, 151, 152, 153, 154, 155, - 157, 158, 159, 128, 156, 160, 255, 136, - 164, 175, 176, 255, 142, 128, 191, 128, - 129, 152, 155, 156, 130, 191, 139, 141, - 128, 140, 142, 143, 144, 167, 168, 174, - 175, 191, 128, 255, 176, 255, 131, 137, - 191, 145, 189, 135, 129, 130, 132, 133, - 144, 154, 176, 139, 159, 150, 156, 159, - 164, 167, 168, 170, 173, 145, 176, 255, - 139, 255, 166, 176, 171, 179, 160, 161, - 163, 164, 165, 167, 169, 171, 173, 174, - 175, 176, 177, 179, 180, 181, 182, 183, - 184, 185, 186, 187, 188, 189, 190, 191, - 166, 170, 172, 178, 150, 153, 155, 163, - 165, 167, 169, 173, 153, 155, 148, 161, - 163, 255, 189, 132, 185, 144, 152, 161, - 164, 255, 188, 129, 131, 190, 255, 133, - 134, 137, 138, 142, 150, 152, 161, 164, - 255, 131, 134, 137, 138, 142, 144, 146, - 175, 178, 180, 182, 255, 134, 138, 142, - 161, 164, 255, 188, 129, 131, 190, 191, - 128, 132, 135, 136, 139, 141, 150, 151, - 162, 163, 130, 190, 191, 151, 128, 130, - 134, 136, 138, 141, 128, 131, 190, 255, - 133, 137, 142, 148, 151, 161, 164, 255, - 128, 132, 134, 136, 138, 141, 149, 150, - 162, 163, 129, 131, 190, 255, 133, 137, - 142, 150, 152, 161, 164, 255, 130, 131, - 138, 150, 143, 148, 152, 159, 178, 179, - 177, 179, 186, 135, 142, 177, 179, 185, - 187, 188, 136, 141, 181, 183, 185, 152, - 153, 190, 191, 177, 191, 128, 132, 134, - 135, 141, 151, 153, 188, 134, 128, 129, - 130, 141, 156, 157, 158, 159, 160, 162, - 164, 168, 169, 170, 172, 173, 174, 175, - 176, 179, 183, 173, 183, 185, 190, 150, - 153, 158, 160, 177, 180, 130, 141, 157, - 132, 134, 157, 159, 146, 148, 178, 180, - 146, 147, 178, 179, 180, 255, 148, 156, - 158, 255, 139, 141, 169, 133, 134, 160, - 171, 176, 187, 151, 155, 160, 162, 191, - 149, 158, 165, 188, 176, 190, 128, 132, - 180, 255, 133, 170, 180, 255, 128, 130, - 161, 173, 166, 179, 164, 183, 173, 144, - 146, 148, 168, 178, 180, 184, 185, 128, - 181, 187, 191, 128, 131, 179, 181, 183, - 140, 141, 144, 176, 175, 177, 191, 160, - 191, 128, 130, 170, 175, 153, 154, 153, - 154, 155, 160, 162, 163, 164, 165, 166, - 167, 168, 169, 170, 171, 175, 175, 178, - 180, 189, 158, 159, 176, 177, 130, 134, - 139, 163, 167, 128, 129, 180, 255, 134, - 159, 178, 255, 166, 173, 135, 147, 128, - 131, 179, 255, 129, 164, 166, 255, 169, - 182, 131, 188, 140, 141, 176, 178, 180, - 183, 184, 190, 191, 129, 171, 175, 181, - 182, 163, 170, 172, 173, 172, 184, 190, - 158, 128, 143, 160, 175, 144, 145, 150, - 155, 157, 158, 135, 139, 141, 168, 171, - 189, 160, 182, 186, 191, 129, 131, 133, - 134, 140, 143, 184, 186, 165, 166, 128, - 129, 130, 132, 133, 134, 135, 136, 139, - 140, 141, 144, 145, 146, 147, 150, 151, - 152, 153, 154, 156, 176, 178, 128, 130, - 184, 255, 135, 190, 131, 175, 187, 255, - 128, 130, 167, 180, 179, 128, 130, 179, - 255, 129, 137, 141, 255, 190, 172, 183, - 159, 170, 188, 128, 131, 190, 191, 151, - 128, 132, 135, 136, 139, 141, 162, 163, - 166, 172, 176, 180, 181, 191, 128, 134, - 176, 255, 132, 255, 175, 181, 184, 255, - 129, 155, 158, 255, 129, 255, 171, 183, - 157, 171, 175, 182, 184, 191, 146, 167, - 169, 182, 171, 172, 189, 190, 176, 180, - 176, 182, 145, 190, 143, 146, 178, 157, - 158, 133, 134, 137, 168, 169, 170, 165, - 169, 173, 178, 187, 255, 131, 132, 140, - 169, 174, 255, 130, 132, 128, 182, 187, - 255, 173, 180, 182, 255, 132, 155, 159, - 161, 175, 128, 163, 165, 128, 134, 136, - 152, 155, 161, 163, 164, 166, 170, 144, - 150, 132, 138, 160, 128, 129, 132, 135, - 133, 134, 160, 255, 192, 255, 128, 131, - 157, 179, 181, 183, 164, 144, 145, 150, - 155, 157, 158, 159, 145, 146, 151, 166, - 169, 128, 255, 176, 255, 131, 137, 191, - 145, 189, 135, 129, 130, 132, 133, 144, - 154, 176, 139, 159, 150, 156, 159, 164, - 167, 168, 170, 173, 145, 176, 255, 139, - 255, 166, 176, 171, 179, 160, 161, 163, - 164, 165, 166, 167, 169, 171, 172, 173, - 174, 175, 176, 177, 178, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 168, 170, 150, 153, 155, 163, - 165, 167, 169, 173, 153, 155, 148, 161, - 163, 255, 131, 187, 189, 132, 185, 190, - 255, 141, 144, 129, 136, 145, 151, 152, - 161, 162, 163, 164, 255, 129, 188, 190, - 130, 131, 191, 255, 141, 151, 129, 132, - 133, 134, 137, 138, 142, 161, 162, 163, - 164, 255, 131, 188, 129, 130, 190, 255, - 145, 181, 129, 130, 131, 134, 135, 136, - 137, 138, 139, 141, 142, 175, 176, 177, - 178, 255, 134, 138, 141, 129, 136, 142, - 161, 162, 163, 164, 255, 129, 188, 130, - 131, 190, 191, 128, 141, 129, 132, 135, - 136, 139, 140, 150, 151, 162, 163, 130, - 190, 191, 128, 141, 151, 129, 130, 134, - 136, 138, 140, 128, 129, 131, 190, 255, - 133, 137, 129, 132, 142, 148, 151, 161, - 164, 255, 129, 188, 190, 191, 130, 131, - 130, 134, 128, 132, 135, 136, 138, 139, - 140, 141, 149, 150, 162, 163, 129, 190, - 130, 131, 191, 255, 133, 137, 141, 151, - 129, 132, 142, 161, 162, 163, 164, 255, - 138, 143, 150, 159, 144, 145, 146, 148, - 152, 158, 178, 179, 177, 179, 180, 186, - 135, 142, 177, 179, 180, 185, 187, 188, - 136, 141, 181, 183, 185, 152, 153, 190, - 191, 191, 177, 190, 128, 132, 134, 135, - 141, 151, 153, 188, 134, 128, 129, 130, - 141, 156, 157, 158, 159, 160, 162, 164, - 168, 169, 170, 172, 173, 174, 175, 176, - 179, 183, 177, 173, 183, 185, 186, 187, - 188, 189, 190, 150, 151, 152, 153, 158, - 160, 177, 180, 130, 132, 141, 157, 133, - 134, 157, 159, 146, 148, 178, 180, 146, - 147, 178, 179, 182, 180, 189, 190, 255, - 134, 157, 137, 147, 148, 255, 139, 141, - 169, 133, 134, 178, 160, 162, 163, 166, - 167, 168, 169, 171, 176, 184, 185, 187, - 155, 151, 152, 153, 154, 150, 160, 162, - 191, 149, 151, 152, 158, 165, 172, 173, - 178, 179, 188, 176, 190, 132, 181, 187, - 128, 131, 180, 188, 189, 255, 130, 133, - 170, 171, 179, 180, 255, 130, 161, 170, - 128, 129, 162, 165, 166, 167, 168, 173, - 167, 173, 166, 169, 170, 174, 175, 177, - 178, 179, 164, 171, 172, 179, 180, 181, - 182, 183, 161, 173, 180, 144, 146, 148, - 168, 178, 179, 184, 185, 128, 181, 187, - 191, 128, 131, 179, 181, 183, 140, 141, - 144, 176, 175, 177, 191, 160, 191, 128, - 130, 170, 175, 153, 154, 153, 154, 155, - 160, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 175, 175, 178, 180, 189, - 158, 159, 176, 177, 130, 134, 139, 167, - 163, 164, 165, 166, 132, 133, 134, 159, - 160, 177, 178, 255, 166, 173, 135, 145, - 146, 147, 131, 179, 188, 128, 130, 180, - 181, 182, 185, 186, 255, 165, 129, 255, - 169, 174, 175, 176, 177, 178, 179, 180, - 181, 182, 131, 140, 141, 188, 176, 178, - 180, 183, 184, 190, 191, 129, 171, 181, - 182, 172, 173, 174, 175, 165, 168, 172, - 173, 163, 170, 172, 184, 190, 158, 128, - 143, 160, 175, 144, 145, 150, 155, 157, - 158, 159, 135, 139, 141, 168, 171, 189, - 160, 182, 186, 191, 129, 131, 133, 134, - 140, 143, 184, 186, 165, 166, 128, 129, - 130, 132, 133, 134, 135, 136, 139, 140, - 141, 144, 145, 146, 147, 150, 151, 152, - 153, 154, 156, 176, 178, 129, 128, 130, - 184, 255, 135, 190, 130, 131, 175, 176, - 178, 183, 184, 187, 255, 172, 128, 130, - 167, 180, 179, 130, 128, 129, 179, 181, - 182, 190, 191, 255, 129, 137, 138, 140, - 141, 255, 180, 190, 172, 174, 175, 177, - 178, 181, 182, 183, 159, 160, 162, 163, - 170, 188, 190, 191, 128, 129, 130, 131, - 128, 151, 129, 132, 135, 136, 139, 141, - 162, 163, 166, 172, 176, 180, 181, 183, - 184, 191, 133, 128, 129, 130, 134, 176, - 185, 189, 177, 178, 179, 186, 187, 190, - 191, 255, 129, 132, 255, 175, 190, 176, - 177, 178, 181, 184, 187, 188, 255, 129, - 155, 158, 255, 189, 176, 178, 179, 186, - 187, 190, 191, 255, 129, 255, 172, 182, - 171, 173, 174, 175, 176, 183, 166, 157, - 159, 160, 161, 162, 171, 175, 190, 176, - 182, 184, 191, 169, 177, 180, 146, 167, - 170, 182, 171, 172, 189, 190, 176, 180, - 176, 182, 143, 146, 178, 157, 158, 133, - 134, 137, 168, 169, 170, 166, 173, 165, - 169, 174, 178, 187, 255, 131, 132, 140, - 169, 174, 255, 130, 132, 128, 182, 187, - 255, 173, 180, 182, 255, 132, 155, 159, - 161, 175, 128, 163, 165, 128, 134, 136, - 152, 155, 161, 163, 164, 166, 170, 144, - 150, 132, 138, 143, 187, 191, 160, 128, - 129, 132, 135, 133, 134, 160, 255, 192, - 255, 139, 168, 128, 159, 160, 175, 176, - 191, 157, 128, 191, 128, 255, 176, 255, - 131, 137, 191, 145, 189, 135, 129, 130, - 132, 133, 144, 154, 176, 139, 159, 150, - 156, 159, 164, 167, 168, 170, 173, 145, - 176, 255, 139, 255, 166, 176, 171, 179, - 160, 161, 163, 164, 165, 166, 167, 169, - 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 168, 170, 150, - 153, 155, 163, 165, 167, 169, 173, 153, - 155, 148, 161, 163, 255, 131, 187, 189, - 132, 185, 190, 255, 128, 255, 176, 255, - 131, 137, 191, 145, 189, 135, 129, 130, - 132, 133, 144, 154, 176, 139, 159, 150, - 156, 159, 164, 167, 168, 170, 173, 145, - 176, 255, 139, 255, 166, 176, 171, 179, - 160, 161, 163, 164, 165, 167, 169, 171, - 173, 174, 175, 176, 177, 179, 180, 181, - 182, 183, 184, 185, 186, 187, 188, 189, - 190, 191, 166, 170, 172, 178, 150, 153, - 155, 163, 165, 167, 169, 173, 153, 155, - 148, 161, 163, 255, 189, 132, 185, 144, - 152, 161, 164, 255, 188, 129, 131, 190, - 255, 133, 134, 137, 138, 142, 150, 152, - 161, 164, 255, 131, 134, 137, 138, 142, - 144, 146, 175, 178, 180, 182, 255, 134, - 138, 142, 161, 164, 255, 188, 129, 131, - 190, 191, 128, 132, 135, 136, 139, 141, - 150, 151, 162, 163, 130, 190, 191, 151, - 128, 130, 134, 136, 138, 141, 128, 131, - 190, 255, 133, 137, 142, 148, 151, 161, - 164, 255, 128, 132, 134, 136, 138, 141, - 149, 150, 162, 163, 129, 131, 190, 255, - 133, 137, 142, 150, 152, 161, 164, 255, - 130, 131, 138, 150, 143, 148, 152, 159, - 178, 179, 177, 179, 186, 135, 142, 177, - 179, 185, 187, 188, 136, 141, 181, 183, - 185, 152, 153, 190, 191, 177, 191, 128, - 132, 134, 135, 141, 151, 153, 188, 134, - 128, 129, 130, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 173, 183, 185, - 190, 150, 153, 158, 160, 177, 180, 130, - 141, 157, 132, 134, 157, 159, 146, 148, - 178, 180, 146, 147, 178, 179, 180, 255, - 148, 156, 158, 255, 139, 141, 169, 133, - 134, 160, 171, 176, 187, 151, 155, 160, - 162, 191, 149, 158, 165, 188, 176, 190, - 128, 132, 180, 255, 133, 170, 180, 255, - 128, 130, 161, 173, 166, 179, 164, 183, - 173, 144, 146, 148, 168, 178, 180, 184, - 185, 128, 181, 187, 191, 128, 131, 179, - 181, 183, 140, 141, 128, 131, 157, 179, - 181, 183, 144, 176, 164, 175, 177, 191, - 160, 191, 128, 130, 170, 175, 153, 154, - 153, 154, 155, 160, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 175, 175, - 178, 180, 189, 158, 159, 176, 177, 130, - 134, 139, 163, 167, 128, 129, 180, 255, - 134, 159, 178, 255, 166, 173, 135, 147, - 128, 131, 179, 255, 129, 164, 166, 255, - 169, 182, 131, 188, 140, 141, 176, 178, - 180, 183, 184, 190, 191, 129, 171, 175, - 181, 182, 163, 170, 172, 173, 172, 184, - 190, 158, 128, 143, 160, 175, 144, 145, - 150, 155, 157, 158, 159, 135, 139, 141, - 168, 171, 189, 160, 182, 186, 191, 129, - 131, 133, 134, 140, 143, 184, 186, 165, - 166, 128, 129, 130, 132, 133, 134, 135, - 136, 139, 140, 141, 144, 145, 146, 147, - 150, 151, 152, 153, 154, 156, 176, 178, - 128, 130, 184, 255, 135, 190, 131, 175, - 187, 255, 128, 130, 167, 180, 179, 128, - 130, 179, 255, 129, 137, 141, 255, 190, - 172, 183, 159, 170, 188, 128, 131, 190, - 191, 151, 128, 132, 135, 136, 139, 141, - 162, 163, 166, 172, 176, 180, 181, 191, - 128, 134, 176, 255, 132, 255, 175, 181, - 184, 255, 129, 155, 158, 255, 129, 255, - 171, 183, 157, 171, 175, 182, 184, 191, - 146, 167, 169, 182, 171, 172, 189, 190, - 176, 180, 176, 182, 145, 190, 143, 146, - 178, 157, 158, 133, 134, 137, 168, 169, - 170, 165, 169, 173, 178, 187, 255, 131, - 132, 140, 169, 174, 255, 130, 132, 128, - 182, 187, 255, 173, 180, 182, 255, 132, - 155, 159, 161, 175, 128, 163, 165, 128, - 134, 136, 152, 155, 161, 163, 164, 166, - 170, 144, 150, 132, 138, 145, 146, 151, - 166, 169, 139, 168, 160, 128, 129, 132, - 135, 133, 134, 160, 255, 192, 255, 144, - 145, 150, 155, 157, 158, 141, 144, 129, - 136, 145, 151, 152, 161, 162, 163, 164, - 255, 129, 188, 190, 130, 131, 191, 255, - 141, 151, 129, 132, 133, 134, 137, 138, - 142, 161, 162, 163, 164, 255, 131, 188, - 129, 130, 190, 255, 145, 181, 129, 130, - 131, 134, 135, 136, 137, 138, 139, 141, - 142, 175, 176, 177, 178, 255, 134, 138, - 141, 129, 136, 142, 161, 162, 163, 164, - 255, 129, 188, 130, 131, 190, 191, 128, - 141, 129, 132, 135, 136, 139, 140, 150, - 151, 162, 163, 130, 190, 191, 128, 141, - 151, 129, 130, 134, 136, 138, 140, 128, - 129, 131, 190, 255, 133, 137, 129, 132, - 142, 148, 151, 161, 164, 255, 129, 188, - 190, 191, 130, 131, 130, 134, 128, 132, - 135, 136, 138, 139, 140, 141, 149, 150, - 162, 163, 129, 190, 130, 131, 191, 255, - 133, 137, 141, 151, 129, 132, 142, 161, - 162, 163, 164, 255, 138, 143, 150, 159, - 144, 145, 146, 148, 152, 158, 178, 179, - 177, 179, 180, 186, 135, 142, 177, 179, - 180, 185, 187, 188, 136, 141, 181, 183, - 185, 152, 153, 190, 191, 191, 177, 190, - 128, 132, 134, 135, 141, 151, 153, 188, - 134, 128, 129, 130, 141, 156, 157, 158, - 159, 160, 162, 164, 168, 169, 170, 172, - 173, 174, 175, 176, 179, 183, 177, 173, - 183, 185, 186, 187, 188, 189, 190, 150, - 151, 152, 153, 158, 160, 177, 180, 130, - 132, 141, 157, 133, 134, 157, 159, 146, - 148, 178, 180, 146, 147, 178, 179, 182, - 180, 189, 190, 255, 134, 157, 137, 147, - 148, 255, 139, 141, 169, 133, 134, 178, - 160, 162, 163, 166, 167, 168, 169, 171, - 176, 184, 185, 187, 155, 151, 152, 153, - 154, 150, 160, 162, 191, 149, 151, 152, - 158, 165, 172, 173, 178, 179, 188, 176, - 190, 132, 181, 187, 128, 131, 180, 188, - 189, 255, 130, 133, 170, 171, 179, 180, - 255, 130, 161, 170, 128, 129, 162, 165, - 166, 167, 168, 173, 167, 173, 166, 169, - 170, 174, 175, 177, 178, 179, 164, 171, - 172, 179, 180, 181, 182, 183, 161, 173, - 180, 144, 146, 148, 168, 178, 179, 184, - 185, 128, 181, 187, 191, 128, 131, 179, - 181, 183, 140, 141, 144, 176, 175, 177, - 191, 160, 191, 128, 130, 170, 175, 153, - 154, 153, 154, 155, 160, 162, 163, 164, - 165, 166, 167, 168, 169, 170, 171, 175, - 175, 178, 180, 189, 158, 159, 176, 177, - 130, 134, 139, 167, 163, 164, 165, 166, - 132, 133, 134, 159, 160, 177, 178, 255, - 166, 173, 135, 145, 146, 147, 131, 179, - 188, 128, 130, 180, 181, 182, 185, 186, - 255, 165, 129, 255, 169, 174, 175, 176, - 177, 178, 179, 180, 181, 182, 131, 140, - 141, 188, 176, 178, 180, 183, 184, 190, - 191, 129, 171, 181, 182, 172, 173, 174, - 175, 165, 168, 172, 173, 163, 170, 172, - 184, 190, 158, 128, 143, 160, 175, 144, - 145, 150, 155, 157, 158, 159, 135, 139, - 141, 168, 171, 189, 160, 182, 186, 191, - 129, 131, 133, 134, 140, 143, 184, 186, - 165, 166, 128, 129, 130, 132, 133, 134, - 135, 136, 139, 140, 141, 144, 145, 146, - 147, 150, 151, 152, 153, 154, 156, 176, - 178, 129, 128, 130, 184, 255, 135, 190, - 130, 131, 175, 176, 178, 183, 184, 187, - 255, 172, 128, 130, 167, 180, 179, 130, - 128, 129, 179, 181, 182, 190, 191, 255, - 129, 137, 138, 140, 141, 255, 180, 190, - 172, 174, 175, 177, 178, 181, 182, 183, - 159, 160, 162, 163, 170, 188, 190, 191, - 128, 129, 130, 131, 128, 151, 129, 132, - 135, 136, 139, 141, 162, 163, 166, 172, - 176, 180, 181, 183, 184, 191, 133, 128, - 129, 130, 134, 176, 185, 189, 177, 178, - 179, 186, 187, 190, 191, 255, 129, 132, - 255, 175, 190, 176, 177, 178, 181, 184, - 187, 188, 255, 129, 155, 158, 255, 189, - 176, 178, 179, 186, 187, 190, 191, 255, - 129, 255, 172, 182, 171, 173, 174, 175, - 176, 183, 166, 157, 159, 160, 161, 162, - 171, 175, 190, 176, 182, 184, 191, 169, - 177, 180, 146, 167, 170, 182, 171, 172, - 189, 190, 176, 180, 176, 182, 143, 146, - 178, 157, 158, 133, 134, 137, 168, 169, - 170, 166, 173, 165, 169, 174, 178, 187, - 255, 131, 132, 140, 169, 174, 255, 130, - 132, 128, 182, 187, 255, 173, 180, 182, - 255, 132, 155, 159, 161, 175, 128, 163, - 165, 128, 134, 136, 152, 155, 161, 163, - 164, 166, 170, 144, 150, 132, 138, 143, - 187, 191, 160, 128, 129, 132, 135, 133, - 134, 160, 255, 192, 255, 185, 128, 191, - 128, 137, 138, 141, 142, 191, 128, 191, - 165, 177, 178, 179, 180, 181, 182, 184, - 185, 186, 187, 188, 189, 191, 128, 175, - 176, 190, 192, 255, 128, 159, 160, 188, - 189, 191, 128, 156, 184, 129, 255, 148, - 176, 140, 168, 132, 160, 188, 152, 180, - 144, 172, 136, 164, 192, 255, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 160, 161, 162, 164, 165, 166, 167, - 168, 169, 171, 172, 173, 174, 175, 176, - 178, 179, 180, 181, 182, 183, 185, 186, - 187, 188, 189, 190, 128, 191, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 160, 161, 162, 164, 165, 166, 167, - 168, 169, 171, 172, 173, 174, 175, 176, - 178, 179, 180, 181, 182, 183, 185, 186, - 187, 188, 189, 190, 128, 191, 129, 130, - 131, 132, 133, 134, 136, 137, 138, 139, - 140, 141, 143, 144, 145, 146, 147, 148, - 150, 151, 152, 153, 154, 155, 157, 158, - 159, 160, 191, 128, 156, 161, 190, 192, - 255, 136, 164, 175, 176, 255, 135, 138, - 139, 187, 188, 191, 192, 255, 0, 127, - 192, 255, 187, 191, 128, 190, 191, 128, - 190, 188, 128, 175, 176, 189, 190, 191, - 145, 155, 157, 159, 128, 191, 130, 135, - 128, 191, 189, 128, 191, 128, 129, 130, - 131, 132, 191, 178, 128, 191, 128, 159, - 160, 163, 164, 191, 133, 128, 191, 128, - 178, 179, 186, 187, 191, 135, 142, 143, - 145, 146, 149, 150, 153, 154, 155, 164, - 128, 191, 128, 165, 166, 191, 128, 255, - 176, 255, 131, 137, 191, 145, 189, 135, - 129, 130, 132, 133, 144, 154, 176, 139, - 159, 150, 156, 159, 164, 167, 168, 170, - 173, 145, 176, 255, 139, 255, 166, 176, - 171, 179, 160, 161, 163, 164, 165, 167, - 169, 171, 173, 174, 175, 176, 177, 179, - 180, 181, 182, 183, 184, 185, 186, 187, - 188, 189, 190, 191, 166, 170, 172, 178, - 150, 153, 155, 163, 165, 167, 169, 173, - 153, 155, 148, 161, 163, 255, 189, 132, - 185, 144, 152, 161, 164, 255, 188, 129, - 131, 190, 255, 133, 134, 137, 138, 142, - 150, 152, 161, 164, 255, 131, 134, 137, - 138, 142, 144, 146, 175, 178, 180, 182, - 255, 134, 138, 142, 161, 164, 255, 188, - 129, 131, 190, 191, 128, 132, 135, 136, - 139, 141, 150, 151, 162, 163, 130, 190, - 191, 151, 128, 130, 134, 136, 138, 141, - 128, 131, 190, 255, 133, 137, 142, 148, - 151, 161, 164, 255, 128, 132, 134, 136, - 138, 141, 149, 150, 162, 163, 129, 131, - 190, 255, 133, 137, 142, 150, 152, 161, - 164, 255, 130, 131, 138, 150, 143, 148, - 152, 159, 178, 179, 177, 179, 186, 135, - 142, 177, 179, 185, 187, 188, 136, 141, - 181, 183, 185, 152, 153, 190, 191, 177, - 191, 128, 132, 134, 135, 141, 151, 153, - 188, 134, 128, 129, 130, 141, 156, 157, - 158, 159, 160, 162, 164, 168, 169, 170, - 172, 173, 174, 175, 176, 179, 183, 173, - 183, 185, 190, 150, 153, 158, 160, 177, - 180, 130, 141, 157, 132, 134, 157, 159, - 146, 148, 178, 180, 146, 147, 178, 179, - 180, 255, 148, 156, 158, 255, 139, 141, - 169, 133, 134, 160, 171, 176, 187, 151, - 155, 160, 162, 191, 149, 158, 165, 188, - 176, 190, 128, 132, 180, 255, 133, 170, - 180, 255, 128, 130, 161, 173, 166, 179, - 164, 183, 173, 144, 146, 148, 168, 178, - 180, 184, 185, 128, 181, 187, 191, 128, - 131, 179, 181, 183, 140, 141, 128, 131, - 157, 179, 181, 183, 144, 176, 164, 175, - 177, 191, 160, 191, 128, 130, 170, 175, - 153, 154, 153, 154, 155, 160, 162, 163, - 164, 165, 166, 167, 168, 169, 170, 171, - 175, 175, 178, 180, 189, 158, 159, 176, - 177, 130, 134, 139, 163, 167, 128, 129, - 180, 255, 134, 159, 178, 255, 166, 173, - 135, 147, 128, 131, 179, 255, 129, 164, - 166, 255, 169, 182, 131, 188, 140, 141, - 176, 178, 180, 183, 184, 190, 191, 129, - 171, 175, 181, 182, 163, 170, 172, 173, - 172, 184, 190, 158, 128, 143, 160, 175, - 144, 145, 150, 155, 157, 158, 159, 135, - 139, 141, 168, 171, 189, 160, 182, 186, - 191, 129, 131, 133, 134, 140, 143, 184, - 186, 165, 166, 128, 129, 130, 132, 133, - 134, 135, 136, 139, 140, 141, 144, 145, - 146, 147, 150, 151, 152, 153, 154, 156, - 176, 178, 128, 130, 184, 255, 135, 190, - 131, 175, 187, 255, 128, 130, 167, 180, - 179, 128, 130, 179, 255, 129, 137, 141, - 255, 190, 172, 183, 159, 170, 188, 128, - 131, 190, 191, 151, 128, 132, 135, 136, - 139, 141, 162, 163, 166, 172, 176, 180, - 181, 191, 128, 134, 176, 255, 132, 255, - 175, 181, 184, 255, 129, 155, 158, 255, - 129, 255, 171, 183, 157, 171, 175, 182, - 184, 191, 146, 167, 169, 182, 171, 172, - 189, 190, 176, 180, 176, 182, 145, 190, - 143, 146, 178, 157, 158, 133, 134, 137, - 168, 169, 170, 165, 169, 173, 178, 187, - 255, 131, 132, 140, 169, 174, 255, 130, - 132, 128, 182, 187, 255, 173, 180, 182, - 255, 132, 155, 159, 161, 175, 128, 163, - 165, 128, 134, 136, 152, 155, 161, 163, - 164, 166, 170, 144, 150, 132, 138, 145, - 146, 151, 166, 169, 128, 255, 176, 255, - 131, 137, 191, 145, 189, 135, 129, 130, - 132, 133, 144, 154, 176, 139, 159, 150, - 156, 159, 164, 167, 168, 170, 173, 145, - 176, 255, 139, 255, 166, 176, 171, 179, - 160, 161, 163, 164, 165, 166, 167, 169, - 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, - 187, 188, 189, 190, 191, 168, 170, 150, - 153, 155, 163, 165, 167, 169, 173, 153, - 155, 148, 161, 163, 255, 131, 187, 189, - 132, 185, 190, 255, 141, 144, 129, 136, - 145, 151, 152, 161, 162, 163, 164, 255, - 129, 188, 190, 130, 131, 191, 255, 141, - 151, 129, 132, 133, 134, 137, 138, 142, - 161, 162, 163, 164, 255, 131, 188, 129, - 130, 190, 255, 145, 181, 129, 130, 131, - 134, 135, 136, 137, 138, 139, 141, 142, - 175, 176, 177, 178, 255, 134, 138, 141, - 129, 136, 142, 161, 162, 163, 164, 255, - 129, 188, 130, 131, 190, 191, 128, 141, - 129, 132, 135, 136, 139, 140, 150, 151, - 162, 163, 130, 190, 191, 128, 141, 151, - 129, 130, 134, 136, 138, 140, 128, 129, - 131, 190, 255, 133, 137, 129, 132, 142, - 148, 151, 161, 164, 255, 129, 188, 190, - 191, 130, 131, 130, 134, 128, 132, 135, - 136, 138, 139, 140, 141, 149, 150, 162, - 163, 129, 190, 130, 131, 191, 255, 133, - 137, 141, 151, 129, 132, 142, 161, 162, - 163, 164, 255, 138, 143, 150, 159, 144, - 145, 146, 148, 152, 158, 178, 179, 177, - 179, 180, 186, 135, 142, 177, 179, 180, - 185, 187, 188, 136, 141, 181, 183, 185, - 152, 153, 190, 191, 191, 177, 190, 128, - 132, 134, 135, 141, 151, 153, 188, 134, - 128, 129, 130, 141, 156, 157, 158, 159, - 160, 162, 164, 168, 169, 170, 172, 173, - 174, 175, 176, 179, 183, 177, 173, 183, - 185, 186, 187, 188, 189, 190, 150, 151, - 152, 153, 158, 160, 177, 180, 130, 132, - 141, 157, 133, 134, 157, 159, 146, 148, - 178, 180, 146, 147, 178, 179, 182, 180, - 189, 190, 255, 134, 157, 137, 147, 148, - 255, 139, 141, 169, 133, 134, 178, 160, - 162, 163, 166, 167, 168, 169, 171, 176, - 184, 185, 187, 155, 151, 152, 153, 154, - 150, 160, 162, 191, 149, 151, 152, 158, - 165, 172, 173, 178, 179, 188, 176, 190, - 132, 181, 187, 128, 131, 180, 188, 189, - 255, 130, 133, 170, 171, 179, 180, 255, - 130, 161, 170, 128, 129, 162, 165, 166, - 167, 168, 173, 167, 173, 166, 169, 170, - 174, 175, 177, 178, 179, 164, 171, 172, - 179, 180, 181, 182, 183, 161, 173, 180, - 144, 146, 148, 168, 178, 179, 184, 185, - 128, 181, 187, 191, 128, 131, 179, 181, - 183, 140, 141, 144, 176, 175, 177, 191, - 160, 191, 128, 130, 170, 175, 153, 154, - 153, 154, 155, 160, 162, 163, 164, 165, - 166, 167, 168, 169, 170, 171, 175, 175, - 178, 180, 189, 158, 159, 176, 177, 130, - 134, 139, 167, 163, 164, 165, 166, 132, - 133, 134, 159, 160, 177, 178, 255, 166, - 173, 135, 145, 146, 147, 131, 179, 188, - 128, 130, 180, 181, 182, 185, 186, 255, - 165, 129, 255, 169, 174, 175, 176, 177, - 178, 179, 180, 181, 182, 131, 140, 141, - 188, 176, 178, 180, 183, 184, 190, 191, - 129, 171, 181, 182, 172, 173, 174, 175, - 165, 168, 172, 173, 163, 170, 172, 184, - 190, 158, 128, 143, 160, 175, 144, 145, - 150, 155, 157, 158, 159, 135, 139, 141, - 168, 171, 189, 160, 182, 186, 191, 129, - 131, 133, 134, 140, 143, 184, 186, 165, - 166, 128, 129, 130, 132, 133, 134, 135, - 136, 139, 140, 141, 144, 145, 146, 147, - 150, 151, 152, 153, 154, 156, 176, 178, - 129, 128, 130, 184, 255, 135, 190, 130, - 131, 175, 176, 178, 183, 184, 187, 255, - 172, 128, 130, 167, 180, 179, 130, 128, - 129, 179, 181, 182, 190, 191, 255, 129, - 137, 138, 140, 141, 255, 180, 190, 172, - 174, 175, 177, 178, 181, 182, 183, 159, - 160, 162, 163, 170, 188, 190, 191, 128, - 129, 130, 131, 128, 151, 129, 132, 135, - 136, 139, 141, 162, 163, 166, 172, 176, - 180, 181, 183, 184, 191, 133, 128, 129, - 130, 134, 176, 185, 189, 177, 178, 179, - 186, 187, 190, 191, 255, 129, 132, 255, - 175, 190, 176, 177, 178, 181, 184, 187, - 188, 255, 129, 155, 158, 255, 189, 176, - 178, 179, 186, 187, 190, 191, 255, 129, - 255, 172, 182, 171, 173, 174, 175, 176, - 183, 166, 157, 159, 160, 161, 162, 171, - 175, 190, 176, 182, 184, 191, 169, 177, - 180, 146, 167, 170, 182, 171, 172, 189, - 190, 176, 180, 176, 182, 143, 146, 178, - 157, 158, 133, 134, 137, 168, 169, 170, - 166, 173, 165, 169, 174, 178, 187, 255, - 131, 132, 140, 169, 174, 255, 130, 132, - 128, 182, 187, 255, 173, 180, 182, 255, - 132, 155, 159, 161, 175, 128, 163, 165, - 128, 134, 136, 152, 155, 161, 163, 164, - 166, 170, 144, 150, 132, 138, 143, 187, - 191, 160, 128, 129, 132, 135, 133, 134, - 160, 255, 192, 255, 139, 168, 160, 128, - 129, 132, 135, 133, 134, 160, 255, 192, - 255, 144, 145, 150, 155, 157, 158, 144, - 145, 150, 155, 157, 158, 159, 135, 166, - 191, 133, 128, 191, 128, 130, 131, 132, - 133, 137, 138, 139, 140, 191, 174, 188, - 128, 129, 130, 131, 132, 133, 134, 144, - 145, 165, 166, 169, 170, 175, 176, 184, - 185, 191, 128, 132, 170, 129, 135, 136, - 191, 181, 186, 128, 191, 144, 128, 148, - 149, 150, 151, 191, 128, 132, 133, 135, - 136, 138, 139, 143, 144, 191, 163, 128, - 179, 180, 182, 183, 191, 128, 129, 191, - 166, 176, 191, 128, 151, 152, 158, 159, - 178, 179, 185, 186, 187, 188, 190, 128, - 191, 160, 128, 191, 128, 130, 131, 135, - 191, 129, 134, 136, 190, 128, 159, 160, - 191, 128, 175, 176, 255, 10, 13, 127, - 194, 216, 219, 220, 224, 225, 226, 234, - 235, 236, 237, 239, 240, 243, 0, 31, - 128, 191, 192, 223, 227, 238, 241, 247, - 248, 255, 204, 205, 210, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 234, 239, 240, 243, 204, 205, - 210, 214, 215, 216, 217, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 234, 239, - 240, 243, 204, 205, 210, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 234, 239, 240, 243, 194, 216, - 219, 220, 224, 225, 226, 234, 235, 236, - 237, 239, 240, 243, 32, 126, 192, 223, - 227, 238, 241, 247, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 235, 236, 237, 239, 240, 243, 204, - 205, 210, 214, 215, 216, 217, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 234, - 237, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 237, 239, 240, - 243, 204, 205, 210, 214, 215, 216, 217, - 219, 220, 221, 222, 223, 224, 225, 226, - 227, 234, 237, 239, 240, 243, 204, 205, - 210, 214, 215, 216, 217, 219, 220, 221, - 222, 223, 224, 225, 226, 227, 234, 239, - 240, 243, 204, 205, 210, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 234, 235, 236, 237, 239, 240, - 243, 204, 205, 210, 214, 215, 216, 217, - 219, 220, 221, 222, 223, 224, 225, 226, - 227, 234, 239, 240, 243, 204, 205, 210, - 214, 215, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 234, 239, 240, - 243, 204, 205, 210, 214, 215, 216, 217, - 219, 220, 221, 222, 223, 224, 225, 226, - 227, 234, 239, 240, 243, 204, 205, 210, - 214, 215, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 234, 237, 239, - 240, 243, 204, 205, 210, 214, 215, 216, - 217, 219, 220, 221, 222, 223, 224, 225, - 226, 227, 234, 237, 239, 240, 243, 204, - 205, 210, 214, 215, 216, 217, 219, 220, - 221, 222, 223, 224, 225, 226, 227, 234, - 237, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, 204, 205, 210, 214, - 215, 216, 217, 219, 220, 221, 222, 223, - 224, 225, 226, 227, 234, 239, 240, 243, - 204, 205, 210, 214, 215, 216, 217, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 234, 239, 240, 243, -} - -var _graphclust_single_lengths []byte = []byte{ - 0, 1, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 0, 0, 26, 0, - 0, 0, 1, 1, 1, 0, 0, 2, - 1, 0, 1, 1, 0, 2, 0, 0, - 2, 0, 2, 1, 0, 1, 0, 3, - 0, 0, 1, 21, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 1, - 0, 5, 2, 6, 0, 1, 0, 1, - 0, 2, 0, 0, 15, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 2, 1, 1, 0, 3, 1, 0, 7, - 5, 1, 1, 0, 1, 0, 23, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 1, 3, 0, 0, 0, 3, - 0, 0, 0, 0, 1, 1, 0, 1, - 0, 1, 0, 0, 0, 29, 0, 0, - 0, 3, 2, 3, 2, 2, 2, 3, - 2, 2, 3, 3, 1, 2, 4, 2, - 2, 4, 4, 2, 0, 2, 0, 3, - 1, 0, 1, 21, 1, 0, 4, 0, - 0, 0, 1, 2, 0, 1, 1, 1, - 4, 0, 3, 1, 3, 2, 0, 3, - 0, 5, 2, 0, 0, 1, 0, 2, - 0, 0, 15, 0, 0, 0, 4, 0, - 0, 0, 3, 1, 0, 4, 1, 4, - 4, 3, 1, 0, 7, 5, 1, 1, - 0, 1, 0, 23, 1, 0, 1, 1, - 1, 1, 0, 2, 1, 3, 2, 0, - 1, 3, 1, 2, 0, 1, 0, 2, - 1, 2, 3, 4, 0, 0, 0, 1, - 0, 6, 2, 0, 0, 0, 0, 1, - 3, 0, 0, 0, 1, 0, 1, 4, - 0, 0, 0, 1, 1, 1, 4, 0, - 0, 0, 6, 0, 1, 1, 0, 0, - 0, 1, 1, 0, 1, 0, 1, 0, - 0, 0, 26, 0, 0, 0, 1, 1, - 1, 0, 0, 2, 1, 0, 1, 1, - 0, 2, 0, 0, 2, 0, 2, 1, - 0, 1, 0, 3, 0, 0, 1, 21, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 1, 0, 5, 2, 6, - 0, 1, 0, 1, 0, 2, 0, 0, - 15, 0, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 0, 2, 1, 1, 0, - 3, 1, 0, 7, 5, 1, 1, 0, - 1, 0, 23, 0, 0, 0, 0, 1, - 0, 0, 1, 0, 1, 1, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 4, 0, 0, 0, 0, 1, 0, - 6, 0, 0, 0, 0, 0, 1, 3, - 0, 0, 0, 3, 0, 0, 0, 0, - 1, 1, 0, 1, 0, 1, 0, 0, - 0, 29, 0, 0, 0, 3, 2, 3, - 2, 2, 2, 3, 2, 2, 3, 3, - 1, 2, 4, 2, 2, 4, 4, 2, - 0, 2, 0, 3, 1, 0, 1, 21, - 1, 0, 4, 0, 0, 0, 1, 2, - 0, 1, 1, 1, 4, 0, 3, 1, - 3, 2, 0, 3, 0, 5, 2, 0, - 0, 1, 0, 2, 0, 0, 15, 0, - 0, 0, 4, 0, 0, 0, 3, 1, - 0, 4, 1, 4, 4, 3, 1, 0, - 7, 5, 1, 1, 0, 1, 0, 23, - 1, 0, 1, 1, 1, 1, 0, 2, - 1, 3, 2, 0, 1, 3, 1, 2, - 0, 1, 0, 2, 1, 2, 3, 4, - 0, 0, 0, 1, 0, 6, 2, 0, - 0, 0, 0, 1, 3, 0, 0, 0, - 1, 0, 1, 4, 0, 0, 0, 1, - 1, 1, 4, 0, 0, 0, 6, 0, - 0, 0, 1, 1, 2, 1, 1, 5, - 0, 24, 0, 24, 0, 0, 23, 0, - 0, 1, 0, 2, 0, 0, 0, 28, - 0, 3, 23, 2, 0, 2, 2, 3, - 2, 2, 2, 0, 54, 54, 27, 1, - 0, 5, 2, 0, 1, 1, 0, 0, - 14, 0, 3, 2, 2, 3, 2, 2, - 2, 54, 54, 27, 1, 0, 2, 0, - 1, 4, 2, 1, 0, 1, 0, 1, - 0, 11, 0, 7, 1, 0, 1, 0, - 2, 3, 2, 1, 0, 1, 1, 3, - 0, 1, 3, 0, 1, 1, 2, 1, - 1, 5, 0, 0, 0, 0, 1, 1, - 0, 1, 0, 1, 0, 0, 0, 26, - 0, 0, 0, 1, 1, 1, 0, 0, - 2, 1, 0, 1, 1, 0, 2, 0, - 0, 2, 0, 2, 1, 0, 1, 0, - 3, 0, 0, 1, 21, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 1, 0, 5, 2, 6, 0, 1, 0, - 1, 0, 2, 0, 0, 15, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 2, 1, 1, 0, 3, 1, 0, - 7, 5, 1, 1, 0, 1, 0, 23, - 0, 0, 0, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 1, 0, 6, 0, 0, - 0, 0, 0, 1, 3, 0, 0, 0, - 3, 0, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 0, 0, 29, 0, - 0, 0, 3, 2, 3, 2, 2, 2, - 3, 2, 2, 3, 3, 1, 2, 4, - 2, 2, 4, 4, 2, 0, 2, 0, - 3, 1, 0, 1, 21, 1, 0, 4, - 0, 0, 0, 1, 2, 0, 1, 1, - 1, 4, 0, 3, 1, 3, 2, 0, - 3, 0, 5, 2, 0, 0, 1, 0, - 2, 0, 0, 15, 0, 0, 0, 4, - 0, 0, 0, 3, 1, 0, 4, 1, - 4, 4, 3, 1, 0, 7, 5, 1, - 1, 0, 1, 0, 23, 1, 0, 1, - 1, 1, 1, 0, 2, 1, 3, 2, - 0, 1, 3, 1, 2, 0, 1, 0, - 2, 1, 2, 3, 4, 0, 0, 0, - 1, 0, 6, 2, 0, 0, 0, 0, - 1, 3, 0, 0, 0, 1, 0, 1, - 4, 0, 0, 0, 1, 1, 1, 4, - 0, 0, 0, 6, 24, 0, 24, 0, - 0, 23, 0, 0, 1, 0, 2, 0, - 0, 0, 28, 0, 3, 23, 2, 0, - 2, 2, 3, 2, 2, 2, 0, 54, - 54, 27, 1, 1, 5, 2, 0, 0, - 0, 1, 1, 0, 1, 0, 1, 0, - 0, 0, 26, 0, 0, 0, 1, 1, - 1, 0, 0, 2, 1, 0, 1, 1, - 0, 2, 0, 0, 2, 0, 2, 1, - 0, 1, 0, 3, 0, 0, 1, 21, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 3, 0, 0, 0, - 0, 0, 0, 1, 0, 5, 2, 0, - 0, 1, 0, 2, 0, 0, 15, 0, - 0, 0, 3, 0, 0, 0, 0, 0, - 0, 0, 2, 1, 1, 0, 3, 1, - 0, 6, 5, 1, 1, 0, 1, 0, - 23, 0, 0, 0, 0, 1, 0, 0, - 1, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 4, - 0, 0, 0, 0, 1, 0, 6, 0, - 0, 0, 0, 0, 1, 3, 0, 0, - 0, 1, 4, 0, 0, 0, 6, 1, - 7, 3, 0, 0, 0, 0, 1, 1, - 0, 1, 0, 1, 0, 0, 0, 29, - 0, 0, 0, 3, 2, 3, 2, 2, - 2, 3, 2, 2, 3, 3, 1, 2, - 4, 2, 2, 4, 4, 2, 0, 2, - 0, 3, 1, 0, 1, 21, 1, 0, - 4, 0, 0, 0, 1, 2, 0, 1, - 1, 1, 4, 0, 3, 1, 3, 2, - 0, 3, 0, 5, 2, 0, 0, 1, - 0, 2, 0, 0, 15, 0, 0, 0, - 4, 0, 0, 0, 3, 1, 0, 4, - 1, 4, 4, 3, 1, 0, 7, 5, - 1, 1, 0, 1, 0, 23, 1, 0, - 1, 1, 1, 1, 0, 2, 1, 3, - 2, 0, 1, 3, 1, 2, 0, 1, - 0, 2, 1, 2, 3, 4, 0, 0, - 0, 1, 0, 6, 2, 0, 0, 0, - 0, 1, 3, 0, 0, 0, 1, 0, - 1, 4, 0, 0, 0, 1, 1, 0, - 1, 0, 0, 0, 1, 1, 0, 1, - 0, 1, 0, 0, 0, 29, 0, 0, - 0, 3, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 0, 0, 26, 0, - 0, 0, 1, 1, 1, 0, 0, 2, - 1, 0, 1, 1, 0, 2, 0, 0, - 2, 0, 2, 1, 0, 1, 0, 3, - 0, 0, 1, 21, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 1, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 1, - 0, 5, 2, 6, 0, 1, 0, 1, - 0, 2, 0, 0, 15, 0, 0, 0, - 3, 0, 0, 0, 0, 0, 0, 0, - 2, 1, 1, 0, 3, 1, 0, 7, - 5, 1, 1, 0, 1, 0, 23, 0, - 0, 0, 0, 1, 0, 0, 1, 0, - 1, 1, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 4, 0, 0, - 0, 0, 1, 0, 6, 0, 0, 0, - 0, 0, 1, 3, 0, 0, 0, 3, - 0, 1, 1, 1, 4, 0, 0, 0, - 6, 2, 3, 2, 2, 2, 3, 2, - 2, 3, 3, 1, 2, 4, 2, 2, - 4, 4, 2, 0, 2, 0, 3, 1, - 0, 1, 21, 1, 0, 4, 0, 0, - 0, 1, 2, 0, 1, 1, 1, 4, - 0, 3, 1, 3, 2, 0, 3, 0, - 5, 2, 0, 0, 1, 0, 2, 0, - 0, 15, 0, 0, 0, 4, 0, 0, - 0, 3, 1, 0, 4, 1, 4, 4, - 3, 1, 0, 7, 5, 1, 1, 0, - 1, 0, 23, 1, 0, 1, 1, 1, - 1, 0, 2, 1, 3, 2, 0, 1, - 3, 1, 2, 0, 1, 0, 2, 1, - 2, 3, 4, 0, 0, 0, 1, 0, - 6, 2, 0, 0, 0, 0, 1, 3, - 0, 0, 0, 1, 0, 1, 4, 0, - 0, 0, 1, 0, 0, 14, 0, 3, - 2, 2, 3, 2, 2, 2, 54, 54, - 29, 1, 0, 0, 0, 0, 2, 1, - 1, 4, 2, 1, 0, 1, 0, 1, - 0, 11, 0, 0, 0, 0, 1, 1, - 0, 1, 0, 1, 0, 0, 0, 26, - 0, 0, 0, 1, 1, 1, 0, 0, - 2, 1, 0, 1, 1, 0, 2, 0, - 0, 2, 0, 2, 1, 0, 1, 0, - 3, 0, 0, 1, 21, 0, 0, 3, - 0, 0, 0, 0, 0, 0, 1, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 1, 0, 5, 2, 6, 0, 1, 0, - 1, 0, 2, 0, 0, 15, 0, 0, - 0, 3, 0, 0, 0, 0, 0, 0, - 0, 2, 1, 1, 0, 3, 1, 0, - 7, 5, 1, 1, 0, 1, 0, 23, - 0, 0, 0, 0, 1, 0, 0, 1, - 0, 1, 1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 4, 0, - 0, 0, 0, 1, 0, 6, 0, 0, - 0, 0, 0, 1, 3, 0, 0, 0, - 3, 0, 0, 0, 0, 1, 1, 0, - 1, 0, 1, 0, 0, 0, 29, 0, - 0, 0, 3, 2, 3, 2, 2, 2, - 3, 2, 2, 3, 3, 1, 2, 4, - 2, 2, 4, 4, 2, 0, 2, 0, - 3, 1, 0, 1, 21, 1, 0, 4, - 0, 0, 0, 1, 2, 0, 1, 1, - 1, 4, 0, 3, 1, 3, 2, 0, - 3, 0, 5, 2, 0, 0, 1, 0, - 2, 0, 0, 15, 0, 0, 0, 4, - 0, 0, 0, 3, 1, 0, 4, 1, - 4, 4, 3, 1, 0, 7, 5, 1, - 1, 0, 1, 0, 23, 1, 0, 1, - 1, 1, 1, 0, 2, 1, 3, 2, - 0, 1, 3, 1, 2, 0, 1, 0, - 2, 1, 2, 3, 4, 0, 0, 0, - 1, 0, 6, 2, 0, 0, 0, 0, - 1, 3, 0, 0, 0, 1, 0, 1, - 4, 0, 0, 0, 1, 1, 1, 4, - 0, 0, 0, 6, 7, 1, 0, 1, - 0, 2, 3, 2, 1, 0, 1, 1, - 3, 0, 1, 5, 0, 0, 17, 20, - 20, 20, 14, 20, 20, 20, 23, 21, - 21, 21, 20, 23, 20, 20, 20, 21, - 21, 21, 20, 20, 20, 20, 20, 20, - 20, 20, 20, 20, -} - -var _graphclust_range_lengths []byte = []byte{ - 0, 0, 1, 1, 1, 1, 2, 1, - 1, 4, 1, 1, 1, 1, 2, 4, - 1, 2, 1, 2, 2, 5, 6, 2, - 2, 5, 1, 3, 2, 3, 5, 2, - 3, 1, 3, 1, 1, 2, 1, 2, - 1, 4, 0, 0, 2, 3, 1, 1, - 2, 2, 1, 2, 1, 1, 2, 1, - 2, 1, 2, 2, 2, 1, 1, 4, - 2, 0, 0, 0, 1, 0, 1, 0, - 1, 0, 1, 1, 0, 2, 1, 1, - 1, 2, 2, 1, 1, 2, 2, 1, - 1, 3, 2, 2, 0, 0, 2, 0, - 0, 0, 0, 1, 4, 1, 0, 2, - 1, 2, 2, 0, 2, 2, 1, 1, - 2, 6, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 2, 2, 0, 1, 1, - 1, 1, 0, 1, 0, 3, 3, 1, - 2, 2, 2, 0, 5, 1, 1, 0, - 1, 1, 1, 1, 1, 2, 1, 1, - 4, 1, 1, 1, 1, 1, 4, 1, - 2, 2, 5, 2, 6, 2, 8, 4, - 2, 5, 0, 3, 2, 4, 1, 6, - 2, 4, 4, 1, 1, 2, 1, 2, - 1, 4, 0, 0, 4, 4, 1, 1, - 2, 2, 2, 2, 1, 1, 6, 2, - 5, 1, 3, 3, 4, 4, 4, 4, - 2, 0, 0, 1, 1, 0, 1, 0, - 1, 1, 0, 2, 1, 1, 2, 4, - 1, 2, 4, 1, 5, 0, 3, 2, - 1, 0, 0, 2, 0, 0, 0, 0, - 1, 4, 1, 0, 2, 1, 4, 2, - 0, 4, 3, 4, 2, 2, 6, 2, - 2, 4, 1, 4, 2, 4, 1, 3, - 3, 2, 2, 0, 1, 1, 1, 0, - 1, 0, 3, 3, 1, 2, 2, 2, - 0, 5, 1, 1, 0, 1, 0, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 1, 0, 0, 1, 2, 2, 1, 1, - 1, 1, 2, 1, 1, 4, 1, 1, - 1, 1, 2, 4, 1, 2, 1, 2, - 2, 5, 6, 2, 2, 5, 1, 3, - 2, 3, 5, 2, 3, 1, 3, 1, - 1, 2, 1, 2, 1, 4, 0, 0, - 2, 3, 1, 1, 2, 2, 1, 2, - 1, 1, 2, 1, 2, 1, 2, 2, - 2, 1, 1, 4, 2, 0, 0, 0, - 1, 0, 1, 0, 1, 0, 1, 1, - 0, 2, 1, 1, 1, 2, 2, 1, - 1, 2, 2, 1, 1, 3, 2, 2, - 0, 0, 2, 0, 0, 0, 0, 1, - 4, 1, 0, 2, 1, 2, 2, 0, - 2, 2, 1, 1, 2, 6, 1, 1, - 1, 1, 2, 2, 1, 1, 1, 2, - 2, 0, 1, 1, 1, 1, 0, 1, - 0, 3, 3, 1, 2, 2, 2, 0, - 5, 1, 1, 0, 1, 1, 1, 1, - 1, 2, 1, 1, 4, 1, 1, 1, - 1, 1, 4, 1, 2, 2, 5, 2, - 6, 2, 8, 4, 2, 5, 0, 3, - 2, 4, 1, 6, 2, 4, 4, 1, - 1, 2, 1, 2, 1, 4, 0, 0, - 4, 4, 1, 1, 2, 2, 2, 2, - 1, 1, 6, 2, 5, 1, 3, 3, - 4, 4, 4, 4, 2, 0, 0, 1, - 1, 0, 1, 0, 1, 1, 0, 2, - 1, 1, 2, 4, 1, 2, 4, 1, - 5, 0, 3, 2, 1, 0, 0, 2, - 0, 0, 0, 0, 1, 4, 1, 0, - 2, 1, 4, 2, 0, 4, 3, 4, - 2, 2, 6, 2, 2, 4, 1, 4, - 2, 4, 1, 3, 3, 2, 2, 0, - 1, 1, 1, 0, 1, 0, 3, 3, - 1, 2, 2, 2, 0, 5, 1, 1, - 0, 1, 0, 1, 1, 1, 0, 0, - 0, 0, 1, 1, 1, 0, 0, 1, - 2, 3, 1, 1, 1, 1, 1, 1, - 1, 0, 1, 0, 1, 1, 0, 1, - 1, 0, 1, 0, 1, 3, 1, 2, - 2, 1, 0, 0, 1, 0, 0, 0, - 0, 0, 1, 0, 1, 1, 2, 2, - 2, 1, 3, 2, 1, 1, 3, 1, - 3, 3, 1, 0, 0, 0, 0, 0, - 1, 1, 1, 2, 2, 4, 1, 1, - 2, 1, 1, 1, 3, 1, 2, 1, - 2, 1, 2, 0, 0, 1, 1, 5, - 9, 2, 1, 3, 5, 3, 1, 6, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 4, 1, 1, 1, 1, 2, - 4, 1, 2, 1, 2, 2, 5, 6, - 2, 2, 5, 1, 3, 2, 3, 5, - 2, 3, 1, 3, 1, 1, 2, 1, - 2, 1, 4, 0, 0, 2, 3, 1, - 1, 2, 2, 1, 2, 1, 1, 2, - 1, 2, 1, 2, 2, 2, 1, 1, - 4, 2, 0, 0, 0, 1, 0, 1, - 0, 1, 0, 1, 1, 0, 2, 1, - 1, 1, 2, 2, 1, 1, 2, 2, - 1, 1, 3, 2, 2, 0, 0, 2, - 0, 0, 0, 0, 1, 4, 1, 0, - 2, 1, 2, 2, 0, 2, 2, 1, - 1, 2, 6, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 2, 2, 0, 1, - 1, 1, 1, 0, 1, 0, 3, 3, - 1, 2, 2, 2, 0, 5, 1, 1, - 0, 1, 1, 1, 1, 1, 2, 1, - 1, 4, 1, 1, 1, 1, 1, 4, - 1, 2, 2, 5, 2, 6, 2, 8, - 4, 2, 5, 0, 3, 2, 4, 1, - 6, 2, 4, 4, 1, 1, 2, 1, - 2, 1, 4, 0, 0, 4, 4, 1, - 1, 2, 2, 2, 2, 1, 1, 6, - 2, 5, 1, 3, 3, 4, 4, 4, - 4, 2, 0, 0, 1, 1, 0, 1, - 0, 1, 1, 0, 2, 1, 1, 2, - 4, 1, 2, 4, 1, 5, 0, 3, - 2, 1, 0, 0, 2, 0, 0, 0, - 0, 1, 4, 1, 0, 2, 1, 4, - 2, 0, 4, 3, 4, 2, 2, 6, - 2, 2, 4, 1, 4, 2, 4, 1, - 3, 3, 2, 2, 0, 1, 1, 1, - 0, 1, 0, 3, 3, 1, 2, 2, - 2, 0, 5, 1, 1, 0, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 1, - 1, 1, 0, 0, 0, 1, 0, 1, - 1, 0, 1, 1, 0, 1, 0, 1, - 3, 1, 2, 2, 1, 0, 0, 1, - 0, 0, 0, 0, 0, 1, 0, 1, - 1, 2, 2, 1, 1, 5, 1, 1, - 1, 1, 2, 1, 1, 4, 1, 1, - 1, 1, 2, 4, 1, 2, 1, 2, - 2, 5, 6, 2, 2, 5, 1, 3, - 2, 3, 5, 2, 3, 1, 3, 1, - 1, 2, 1, 2, 1, 4, 0, 0, - 2, 3, 1, 1, 2, 2, 1, 2, - 1, 1, 2, 1, 2, 1, 2, 2, - 2, 1, 1, 4, 2, 0, 0, 1, - 1, 0, 1, 0, 1, 1, 0, 2, - 1, 1, 1, 2, 2, 1, 1, 2, - 2, 1, 1, 3, 2, 2, 0, 0, - 2, 0, 0, 0, 0, 1, 4, 1, - 0, 2, 1, 2, 2, 0, 2, 2, - 1, 1, 2, 6, 1, 1, 1, 1, - 2, 2, 1, 1, 1, 2, 2, 0, - 1, 1, 1, 1, 0, 1, 0, 3, - 3, 1, 2, 2, 2, 0, 5, 1, - 1, 0, 1, 1, 1, 0, 0, 0, - 0, 0, 1, 1, 1, 1, 1, 2, - 1, 1, 4, 1, 1, 1, 1, 1, - 4, 1, 2, 2, 5, 2, 6, 2, - 8, 4, 2, 5, 0, 3, 2, 4, - 1, 6, 2, 4, 4, 1, 1, 2, - 1, 2, 1, 4, 0, 0, 4, 4, - 1, 1, 2, 2, 2, 2, 1, 1, - 6, 2, 5, 1, 3, 3, 4, 4, - 4, 4, 2, 0, 0, 1, 1, 0, - 1, 0, 1, 1, 0, 2, 1, 1, - 2, 4, 1, 2, 4, 1, 5, 0, - 3, 2, 1, 0, 0, 2, 0, 0, - 0, 0, 1, 4, 1, 0, 2, 1, - 4, 2, 0, 4, 3, 4, 2, 2, - 6, 2, 2, 4, 1, 4, 2, 4, - 1, 3, 3, 2, 2, 0, 1, 1, - 1, 0, 1, 0, 3, 3, 1, 2, - 2, 2, 0, 5, 1, 1, 0, 1, - 0, 1, 1, 1, 0, 0, 0, 3, - 1, 1, 1, 1, 1, 2, 1, 1, - 4, 1, 1, 1, 1, 1, 4, 1, - 2, 2, 1, 1, 1, 1, 2, 1, - 1, 4, 1, 1, 1, 1, 2, 4, - 1, 2, 1, 2, 2, 5, 6, 2, - 2, 5, 1, 3, 2, 3, 5, 2, - 3, 1, 3, 1, 1, 2, 1, 2, - 1, 4, 0, 0, 2, 3, 1, 1, - 2, 2, 1, 2, 1, 1, 2, 1, - 2, 1, 2, 2, 2, 1, 1, 4, - 2, 0, 0, 0, 1, 0, 1, 0, - 1, 0, 1, 1, 0, 2, 1, 1, - 1, 2, 2, 1, 1, 2, 2, 1, - 1, 3, 2, 2, 0, 0, 2, 0, - 0, 0, 0, 1, 4, 1, 0, 2, - 1, 2, 2, 0, 2, 2, 1, 1, - 2, 6, 1, 1, 1, 1, 2, 2, - 1, 1, 1, 2, 2, 0, 1, 1, - 1, 1, 0, 1, 0, 3, 3, 1, - 2, 2, 2, 0, 5, 1, 1, 0, - 1, 0, 0, 0, 1, 1, 1, 0, - 0, 5, 2, 6, 2, 8, 4, 2, - 5, 0, 3, 2, 4, 1, 6, 2, - 4, 4, 1, 1, 2, 1, 2, 1, - 4, 0, 0, 4, 4, 1, 1, 2, - 2, 2, 2, 1, 1, 6, 2, 5, - 1, 3, 3, 4, 4, 4, 4, 2, - 0, 0, 1, 1, 0, 1, 0, 1, - 1, 0, 2, 1, 1, 2, 4, 1, - 2, 4, 1, 5, 0, 3, 2, 1, - 0, 0, 2, 0, 0, 0, 0, 1, - 4, 1, 0, 2, 1, 4, 2, 0, - 4, 3, 4, 2, 2, 6, 2, 2, - 4, 1, 4, 2, 4, 1, 3, 3, - 2, 2, 0, 1, 1, 1, 0, 1, - 0, 3, 3, 1, 2, 2, 2, 0, - 5, 1, 1, 0, 1, 0, 1, 1, - 1, 0, 1, 3, 1, 3, 3, 1, - 0, 0, 0, 0, 0, 1, 1, 1, - 3, 2, 4, 1, 0, 1, 1, 1, - 3, 1, 1, 1, 3, 1, 3, 1, - 3, 1, 2, 1, 1, 1, 1, 2, - 1, 1, 4, 1, 1, 1, 1, 2, - 4, 1, 2, 1, 2, 2, 5, 6, - 2, 2, 5, 1, 3, 2, 3, 5, - 2, 3, 1, 3, 1, 1, 2, 1, - 2, 1, 4, 0, 0, 2, 3, 1, - 1, 2, 2, 1, 2, 1, 1, 2, - 1, 2, 1, 2, 2, 2, 1, 1, - 4, 2, 0, 0, 0, 1, 0, 1, - 0, 1, 0, 1, 1, 0, 2, 1, - 1, 1, 2, 2, 1, 1, 2, 2, - 1, 1, 3, 2, 2, 0, 0, 2, - 0, 0, 0, 0, 1, 4, 1, 0, - 2, 1, 2, 2, 0, 2, 2, 1, - 1, 2, 6, 1, 1, 1, 1, 2, - 2, 1, 1, 1, 2, 2, 0, 1, - 1, 1, 1, 0, 1, 0, 3, 3, - 1, 2, 2, 2, 0, 5, 1, 1, - 0, 1, 1, 1, 1, 1, 2, 1, - 1, 4, 1, 1, 1, 1, 1, 4, - 1, 2, 2, 5, 2, 6, 2, 8, - 4, 2, 5, 0, 3, 2, 4, 1, - 6, 2, 4, 4, 1, 1, 2, 1, - 2, 1, 4, 0, 0, 4, 4, 1, - 1, 2, 2, 2, 2, 1, 1, 6, - 2, 5, 1, 3, 3, 4, 4, 4, - 4, 2, 0, 0, 1, 1, 0, 1, - 0, 1, 1, 0, 2, 1, 1, 2, - 4, 1, 2, 4, 1, 5, 0, 3, - 2, 1, 0, 0, 2, 0, 0, 0, - 0, 1, 4, 1, 0, 2, 1, 4, - 2, 0, 4, 3, 4, 2, 2, 6, - 2, 2, 4, 1, 4, 2, 4, 1, - 3, 3, 2, 2, 0, 1, 1, 1, - 0, 1, 0, 3, 3, 1, 2, 2, - 2, 0, 5, 1, 1, 0, 1, 0, - 1, 1, 1, 0, 0, 0, 0, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 5, 9, 2, 1, 3, 5, 3, 1, - 6, 1, 1, 2, 2, 2, 6, 0, - 0, 0, 4, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -} - -var _graphclust_index_offsets []int16 = []int16{ - 0, 0, 2, 4, 6, 8, 11, 15, - 17, 20, 25, 28, 30, 32, 34, 63, - 68, 70, 73, 76, 80, 84, 90, 97, - 102, 106, 112, 115, 120, 123, 129, 135, - 138, 144, 146, 152, 155, 157, 161, 163, - 169, 171, 176, 178, 200, 203, 207, 212, - 214, 217, 220, 222, 225, 227, 230, 233, - 235, 241, 243, 246, 249, 252, 254, 256, - 262, 265, 271, 274, 281, 283, 285, 287, - 289, 291, 294, 296, 298, 314, 317, 319, - 321, 326, 329, 332, 334, 336, 339, 342, - 344, 348, 353, 357, 360, 364, 366, 369, - 377, 383, 385, 387, 389, 395, 397, 421, - 424, 426, 429, 432, 434, 437, 440, 443, - 445, 449, 457, 459, 461, 463, 465, 468, - 471, 473, 475, 477, 480, 483, 488, 490, - 492, 494, 496, 498, 500, 507, 511, 515, - 517, 520, 523, 527, 531, 537, 539, 541, - 545, 547, 549, 551, 553, 556, 560, 562, - 565, 570, 573, 575, 577, 579, 610, 615, - 617, 620, 626, 634, 640, 649, 654, 665, - 673, 678, 686, 690, 697, 701, 708, 714, - 723, 728, 737, 746, 750, 752, 757, 759, - 765, 768, 773, 775, 797, 803, 808, 814, - 816, 819, 822, 826, 831, 833, 836, 844, - 848, 858, 860, 867, 872, 880, 887, 892, - 900, 903, 909, 912, 914, 916, 918, 920, - 923, 925, 927, 943, 946, 948, 950, 957, - 962, 964, 967, 975, 978, 984, 989, 994, - 1001, 1007, 1011, 1013, 1016, 1024, 1030, 1032, - 1034, 1036, 1042, 1044, 1068, 1072, 1074, 1080, - 1084, 1086, 1092, 1096, 1103, 1107, 1113, 1122, - 1125, 1129, 1137, 1140, 1147, 1150, 1156, 1158, - 1164, 1169, 1174, 1180, 1185, 1187, 1189, 1191, - 1193, 1195, 1202, 1208, 1212, 1214, 1217, 1220, - 1224, 1228, 1234, 1236, 1238, 1240, 1242, 1244, - 1250, 1252, 1254, 1255, 1257, 1259, 1261, 1267, - 1269, 1271, 1272, 1279, 1281, 1285, 1289, 1291, - 1293, 1295, 1298, 1302, 1304, 1307, 1312, 1315, - 1317, 1319, 1321, 1350, 1355, 1357, 1360, 1363, - 1367, 1371, 1377, 1384, 1389, 1393, 1399, 1402, - 1407, 1410, 1416, 1422, 1425, 1431, 1433, 1439, - 1442, 1444, 1448, 1450, 1456, 1458, 1463, 1465, - 1487, 1490, 1494, 1499, 1501, 1504, 1507, 1509, - 1512, 1514, 1517, 1520, 1522, 1528, 1530, 1533, - 1536, 1539, 1541, 1543, 1549, 1552, 1558, 1561, - 1568, 1570, 1572, 1574, 1576, 1578, 1581, 1583, - 1585, 1601, 1604, 1606, 1608, 1613, 1616, 1619, - 1621, 1623, 1626, 1629, 1631, 1635, 1640, 1644, - 1647, 1651, 1653, 1656, 1664, 1670, 1672, 1674, - 1676, 1682, 1684, 1708, 1711, 1713, 1716, 1719, - 1721, 1724, 1727, 1730, 1732, 1736, 1744, 1746, - 1748, 1750, 1752, 1755, 1758, 1760, 1762, 1764, - 1767, 1770, 1775, 1777, 1779, 1781, 1783, 1785, - 1787, 1794, 1798, 1802, 1804, 1807, 1810, 1814, - 1818, 1824, 1826, 1828, 1832, 1834, 1836, 1838, - 1840, 1843, 1847, 1849, 1852, 1857, 1860, 1862, - 1864, 1866, 1897, 1902, 1904, 1907, 1913, 1921, - 1927, 1936, 1941, 1952, 1960, 1965, 1973, 1977, - 1984, 1988, 1995, 2001, 2010, 2015, 2024, 2033, - 2037, 2039, 2044, 2046, 2052, 2055, 2060, 2062, - 2084, 2090, 2095, 2101, 2103, 2106, 2109, 2113, - 2118, 2120, 2123, 2131, 2135, 2145, 2147, 2154, - 2159, 2167, 2174, 2179, 2187, 2190, 2196, 2199, - 2201, 2203, 2205, 2207, 2210, 2212, 2214, 2230, - 2233, 2235, 2237, 2244, 2249, 2251, 2254, 2262, - 2265, 2271, 2276, 2281, 2288, 2294, 2298, 2300, - 2303, 2311, 2317, 2319, 2321, 2323, 2329, 2331, - 2355, 2359, 2361, 2367, 2371, 2373, 2379, 2383, - 2390, 2394, 2400, 2409, 2412, 2416, 2424, 2427, - 2434, 2437, 2443, 2445, 2451, 2456, 2461, 2467, - 2472, 2474, 2476, 2478, 2480, 2482, 2489, 2495, - 2499, 2501, 2504, 2507, 2511, 2515, 2521, 2523, - 2525, 2527, 2529, 2531, 2537, 2539, 2541, 2542, - 2544, 2546, 2548, 2554, 2556, 2558, 2559, 2566, - 2568, 2571, 2575, 2578, 2581, 2585, 2588, 2591, - 2598, 2600, 2625, 2627, 2652, 2654, 2656, 2680, - 2682, 2684, 2686, 2688, 2691, 2693, 2697, 2699, - 2730, 2733, 2738, 2762, 2765, 2767, 2770, 2773, - 2777, 2780, 2783, 2787, 2788, 2844, 2900, 2930, - 2934, 2937, 2944, 2950, 2953, 2956, 2959, 2963, - 2965, 2983, 2987, 2992, 2995, 2998, 3002, 3005, - 3008, 3012, 3068, 3124, 3154, 3158, 3163, 3167, - 3169, 3173, 3179, 3183, 3186, 3190, 3193, 3196, - 3199, 3202, 3215, 3218, 3226, 3228, 3230, 3233, - 3239, 3251, 3257, 3261, 3266, 3272, 3277, 3280, - 3290, 3292, 3295, 3300, 3302, 3305, 3308, 3312, - 3315, 3318, 3325, 3327, 3329, 3331, 3333, 3336, - 3340, 3342, 3345, 3350, 3353, 3355, 3357, 3359, - 3388, 3393, 3395, 3398, 3401, 3405, 3409, 3415, - 3422, 3427, 3431, 3437, 3440, 3445, 3448, 3454, - 3460, 3463, 3469, 3471, 3477, 3480, 3482, 3486, - 3488, 3494, 3496, 3501, 3503, 3525, 3528, 3532, - 3537, 3539, 3542, 3545, 3547, 3550, 3552, 3555, - 3558, 3560, 3566, 3568, 3571, 3574, 3577, 3579, - 3581, 3587, 3590, 3596, 3599, 3606, 3608, 3610, - 3612, 3614, 3616, 3619, 3621, 3623, 3639, 3642, - 3644, 3646, 3651, 3654, 3657, 3659, 3661, 3664, - 3667, 3669, 3673, 3678, 3682, 3685, 3689, 3691, - 3694, 3702, 3708, 3710, 3712, 3714, 3720, 3722, - 3746, 3749, 3751, 3754, 3757, 3759, 3762, 3765, - 3768, 3770, 3774, 3782, 3784, 3786, 3788, 3790, - 3793, 3796, 3798, 3800, 3802, 3805, 3808, 3813, - 3815, 3817, 3819, 3821, 3823, 3825, 3832, 3836, - 3840, 3842, 3845, 3848, 3852, 3856, 3862, 3864, - 3866, 3870, 3872, 3874, 3876, 3878, 3881, 3885, - 3887, 3890, 3895, 3898, 3900, 3902, 3904, 3935, - 3940, 3942, 3945, 3951, 3959, 3965, 3974, 3979, - 3990, 3998, 4003, 4011, 4015, 4022, 4026, 4033, - 4039, 4048, 4053, 4062, 4071, 4075, 4077, 4082, - 4084, 4090, 4093, 4098, 4100, 4122, 4128, 4133, - 4139, 4141, 4144, 4147, 4151, 4156, 4158, 4161, - 4169, 4173, 4183, 4185, 4192, 4197, 4205, 4212, - 4217, 4225, 4228, 4234, 4237, 4239, 4241, 4243, - 4245, 4248, 4250, 4252, 4268, 4271, 4273, 4275, - 4282, 4287, 4289, 4292, 4300, 4303, 4309, 4314, - 4319, 4326, 4332, 4336, 4338, 4341, 4349, 4355, - 4357, 4359, 4361, 4367, 4369, 4393, 4397, 4399, - 4405, 4409, 4411, 4417, 4421, 4428, 4432, 4438, - 4447, 4450, 4454, 4462, 4465, 4472, 4475, 4481, - 4483, 4489, 4494, 4499, 4505, 4510, 4512, 4514, - 4516, 4518, 4520, 4527, 4533, 4537, 4539, 4542, - 4545, 4549, 4553, 4559, 4561, 4563, 4565, 4567, - 4569, 4575, 4577, 4579, 4580, 4582, 4584, 4586, - 4592, 4594, 4596, 4597, 4604, 4629, 4631, 4656, - 4658, 4660, 4684, 4686, 4688, 4690, 4692, 4695, - 4697, 4701, 4703, 4734, 4737, 4742, 4766, 4769, - 4771, 4774, 4777, 4781, 4784, 4787, 4791, 4792, - 4848, 4904, 4934, 4938, 4941, 4948, 4956, 4958, - 4960, 4962, 4965, 4969, 4971, 4974, 4979, 4982, - 4984, 4986, 4988, 5017, 5022, 5024, 5027, 5030, - 5034, 5038, 5044, 5051, 5056, 5060, 5066, 5069, - 5074, 5077, 5083, 5089, 5092, 5098, 5100, 5106, - 5109, 5111, 5115, 5117, 5123, 5125, 5130, 5132, - 5154, 5157, 5161, 5166, 5168, 5171, 5174, 5176, - 5179, 5181, 5184, 5187, 5189, 5195, 5197, 5200, - 5203, 5206, 5208, 5210, 5216, 5219, 5225, 5228, - 5230, 5232, 5234, 5236, 5239, 5241, 5243, 5259, - 5262, 5264, 5266, 5271, 5274, 5277, 5279, 5281, - 5284, 5287, 5289, 5293, 5298, 5302, 5305, 5309, - 5311, 5314, 5321, 5327, 5329, 5331, 5333, 5339, - 5341, 5365, 5368, 5370, 5373, 5376, 5378, 5381, - 5384, 5387, 5389, 5393, 5401, 5403, 5405, 5407, - 5409, 5412, 5415, 5417, 5419, 5421, 5424, 5427, - 5432, 5434, 5436, 5438, 5440, 5442, 5444, 5451, - 5455, 5459, 5461, 5464, 5467, 5471, 5475, 5481, - 5483, 5485, 5487, 5493, 5495, 5497, 5498, 5505, - 5507, 5515, 5519, 5521, 5523, 5525, 5527, 5530, - 5534, 5536, 5539, 5544, 5547, 5549, 5551, 5553, - 5584, 5589, 5591, 5594, 5600, 5608, 5614, 5623, - 5628, 5639, 5647, 5652, 5660, 5664, 5671, 5675, - 5682, 5688, 5697, 5702, 5711, 5720, 5724, 5726, - 5731, 5733, 5739, 5742, 5747, 5749, 5771, 5777, - 5782, 5788, 5790, 5793, 5796, 5800, 5805, 5807, - 5810, 5818, 5822, 5832, 5834, 5841, 5846, 5854, - 5861, 5866, 5874, 5877, 5883, 5886, 5888, 5890, - 5892, 5894, 5897, 5899, 5901, 5917, 5920, 5922, - 5924, 5931, 5936, 5938, 5941, 5949, 5952, 5958, - 5963, 5968, 5975, 5981, 5985, 5987, 5990, 5998, - 6004, 6006, 6008, 6010, 6016, 6018, 6042, 6046, - 6048, 6054, 6058, 6060, 6066, 6070, 6077, 6081, - 6087, 6096, 6099, 6103, 6111, 6114, 6121, 6124, - 6130, 6132, 6138, 6143, 6148, 6154, 6159, 6161, - 6163, 6165, 6167, 6169, 6176, 6182, 6186, 6188, - 6191, 6194, 6198, 6202, 6208, 6210, 6212, 6214, - 6216, 6218, 6224, 6226, 6228, 6229, 6231, 6233, - 6237, 6240, 6242, 6244, 6246, 6249, 6253, 6255, - 6258, 6263, 6266, 6268, 6270, 6272, 6303, 6308, - 6310, 6313, 6319, 6321, 6323, 6325, 6328, 6332, - 6334, 6337, 6342, 6345, 6347, 6349, 6351, 6380, - 6385, 6387, 6390, 6393, 6397, 6401, 6407, 6414, - 6419, 6423, 6429, 6432, 6437, 6440, 6446, 6452, - 6455, 6461, 6463, 6469, 6472, 6474, 6478, 6480, - 6486, 6488, 6493, 6495, 6517, 6520, 6524, 6529, - 6531, 6534, 6537, 6539, 6542, 6544, 6547, 6550, - 6552, 6558, 6560, 6563, 6566, 6569, 6571, 6573, - 6579, 6582, 6588, 6591, 6598, 6600, 6602, 6604, - 6606, 6608, 6611, 6613, 6615, 6631, 6634, 6636, - 6638, 6643, 6646, 6649, 6651, 6653, 6656, 6659, - 6661, 6665, 6670, 6674, 6677, 6681, 6683, 6686, - 6694, 6700, 6702, 6704, 6706, 6712, 6714, 6738, - 6741, 6743, 6746, 6749, 6751, 6754, 6757, 6760, - 6762, 6766, 6774, 6776, 6778, 6780, 6782, 6785, - 6788, 6790, 6792, 6794, 6797, 6800, 6805, 6807, - 6809, 6811, 6813, 6815, 6817, 6824, 6828, 6832, - 6834, 6837, 6840, 6844, 6848, 6854, 6856, 6858, - 6862, 6864, 6866, 6868, 6870, 6876, 6878, 6880, - 6881, 6888, 6896, 6902, 6911, 6916, 6927, 6935, - 6940, 6948, 6952, 6959, 6963, 6970, 6976, 6985, - 6990, 6999, 7008, 7012, 7014, 7019, 7021, 7027, - 7030, 7035, 7037, 7059, 7065, 7070, 7076, 7078, - 7081, 7084, 7088, 7093, 7095, 7098, 7106, 7110, - 7120, 7122, 7129, 7134, 7142, 7149, 7154, 7162, - 7165, 7171, 7174, 7176, 7178, 7180, 7182, 7185, - 7187, 7189, 7205, 7208, 7210, 7212, 7219, 7224, - 7226, 7229, 7237, 7240, 7246, 7251, 7256, 7263, - 7269, 7273, 7275, 7278, 7286, 7292, 7294, 7296, - 7298, 7304, 7306, 7330, 7334, 7336, 7342, 7346, - 7348, 7354, 7358, 7365, 7369, 7375, 7384, 7387, - 7391, 7399, 7402, 7409, 7412, 7418, 7420, 7426, - 7431, 7436, 7442, 7447, 7449, 7451, 7453, 7455, - 7457, 7464, 7470, 7474, 7476, 7479, 7482, 7486, - 7490, 7496, 7498, 7500, 7502, 7504, 7506, 7512, - 7514, 7516, 7517, 7520, 7524, 7526, 7544, 7548, - 7553, 7556, 7559, 7563, 7566, 7569, 7573, 7629, - 7685, 7718, 7722, 7727, 7729, 7730, 7732, 7736, - 7739, 7744, 7750, 7754, 7757, 7761, 7764, 7768, - 7771, 7775, 7788, 7791, 7793, 7795, 7797, 7800, - 7804, 7806, 7809, 7814, 7817, 7819, 7821, 7823, - 7852, 7857, 7859, 7862, 7865, 7869, 7873, 7879, - 7886, 7891, 7895, 7901, 7904, 7909, 7912, 7918, - 7924, 7927, 7933, 7935, 7941, 7944, 7946, 7950, - 7952, 7958, 7960, 7965, 7967, 7989, 7992, 7996, - 8001, 8003, 8006, 8009, 8011, 8014, 8016, 8019, - 8022, 8024, 8030, 8032, 8035, 8038, 8041, 8043, - 8045, 8051, 8054, 8060, 8063, 8070, 8072, 8074, - 8076, 8078, 8080, 8083, 8085, 8087, 8103, 8106, - 8108, 8110, 8115, 8118, 8121, 8123, 8125, 8128, - 8131, 8133, 8137, 8142, 8146, 8149, 8153, 8155, - 8158, 8166, 8172, 8174, 8176, 8178, 8184, 8186, - 8210, 8213, 8215, 8218, 8221, 8223, 8226, 8229, - 8232, 8234, 8238, 8246, 8248, 8250, 8252, 8254, - 8257, 8260, 8262, 8264, 8266, 8269, 8272, 8277, - 8279, 8281, 8283, 8285, 8287, 8289, 8296, 8300, - 8304, 8306, 8309, 8312, 8316, 8320, 8326, 8328, - 8330, 8334, 8336, 8338, 8340, 8342, 8345, 8349, - 8351, 8354, 8359, 8362, 8364, 8366, 8368, 8399, - 8404, 8406, 8409, 8415, 8423, 8429, 8438, 8443, - 8454, 8462, 8467, 8475, 8479, 8486, 8490, 8497, - 8503, 8512, 8517, 8526, 8535, 8539, 8541, 8546, - 8548, 8554, 8557, 8562, 8564, 8586, 8592, 8597, - 8603, 8605, 8608, 8611, 8615, 8620, 8622, 8625, - 8633, 8637, 8647, 8649, 8656, 8661, 8669, 8676, - 8681, 8689, 8692, 8698, 8701, 8703, 8705, 8707, - 8709, 8712, 8714, 8716, 8732, 8735, 8737, 8739, - 8746, 8751, 8753, 8756, 8764, 8767, 8773, 8778, - 8783, 8790, 8796, 8800, 8802, 8805, 8813, 8819, - 8821, 8823, 8825, 8831, 8833, 8857, 8861, 8863, - 8869, 8873, 8875, 8881, 8885, 8892, 8896, 8902, - 8911, 8914, 8918, 8926, 8929, 8936, 8939, 8945, - 8947, 8953, 8958, 8963, 8969, 8974, 8976, 8978, - 8980, 8982, 8984, 8991, 8997, 9001, 9003, 9006, - 9009, 9013, 9017, 9023, 9025, 9027, 9029, 9031, - 9033, 9039, 9041, 9043, 9044, 9046, 9048, 9050, - 9056, 9058, 9060, 9061, 9068, 9076, 9078, 9080, - 9083, 9089, 9101, 9107, 9111, 9116, 9122, 9127, - 9130, 9140, 9142, 9145, 9153, 9156, 9159, 9183, - 9204, 9225, 9246, 9265, 9286, 9307, 9328, 9352, - 9374, 9396, 9418, 9439, 9463, 9484, 9505, 9526, - 9548, 9570, 9592, 9613, 9634, 9655, 9676, 9697, - 9718, 9739, 9760, 9781, -} - -var _graphclust_indicies []int16 = []int16{ - 0, 1, 3, 2, 2, 3, 3, 2, - 3, 3, 2, 3, 3, 3, 2, 3, - 2, 3, 3, 2, 3, 3, 3, 3, - 2, 3, 3, 2, 2, 3, 3, 2, - 3, 2, 4, 5, 6, 7, 8, 10, - 11, 12, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 9, 13, 2, 3, - 3, 3, 3, 2, 3, 2, 3, 3, - 2, 2, 2, 3, 2, 2, 2, 3, - 3, 3, 3, 2, 2, 2, 2, 2, - 2, 3, 2, 2, 2, 2, 2, 2, - 3, 2, 2, 2, 2, 3, 3, 3, - 3, 2, 3, 3, 3, 3, 3, 2, - 3, 3, 2, 3, 3, 3, 3, 2, - 3, 3, 2, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 2, 3, - 3, 2, 2, 2, 2, 2, 2, 3, - 3, 2, 3, 3, 3, 3, 3, 2, - 3, 3, 2, 3, 2, 3, 3, 3, - 2, 3, 2, 3, 3, 3, 3, 3, - 2, 3, 2, 3, 3, 3, 3, 2, - 3, 2, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 52, 2, - 3, 3, 2, 3, 3, 3, 2, 3, - 3, 3, 3, 2, 3, 2, 3, 3, - 2, 3, 3, 2, 3, 2, 2, 2, - 3, 3, 2, 3, 3, 2, 3, 3, - 2, 3, 2, 3, 3, 3, 3, 3, - 2, 3, 2, 3, 3, 2, 2, 2, - 3, 3, 3, 2, 3, 2, 3, 2, - 3, 3, 3, 3, 3, 2, 3, 3, - 2, 53, 54, 55, 56, 57, 2, 3, - 58, 2, 53, 54, 59, 55, 56, 57, - 2, 3, 2, 3, 2, 3, 2, 3, - 2, 3, 2, 60, 61, 2, 3, 2, - 3, 2, 62, 63, 64, 65, 66, 67, - 68, 69, 70, 71, 72, 73, 74, 75, - 76, 2, 3, 3, 2, 3, 2, 3, - 2, 3, 3, 3, 3, 2, 3, 3, - 2, 2, 2, 3, 3, 2, 3, 2, - 3, 3, 2, 2, 2, 3, 3, 2, - 3, 3, 3, 2, 3, 3, 3, 3, - 2, 3, 3, 3, 2, 3, 3, 2, - 77, 78, 63, 2, 3, 2, 3, 3, - 2, 79, 80, 81, 82, 83, 84, 85, - 2, 86, 87, 88, 89, 90, 2, 3, - 2, 3, 2, 3, 2, 3, 3, 3, - 3, 3, 2, 3, 2, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, - 102, 103, 104, 105, 106, 107, 104, 108, - 109, 110, 111, 112, 2, 3, 3, 2, - 2, 3, 2, 2, 3, 3, 3, 2, - 3, 2, 3, 3, 2, 2, 2, 3, - 3, 3, 2, 3, 2, 3, 3, 3, - 2, 3, 3, 3, 3, 3, 3, 3, - 2, 3, 2, 3, 2, 3, 2, 2, - 3, 3, 3, 2, 2, 2, 3, 2, - 3, 3, 2, 3, 2, 3, 3, 2, - 3, 3, 2, 113, 114, 115, 116, 2, - 3, 2, 3, 2, 3, 2, 3, 2, - 117, 2, 3, 2, 118, 119, 120, 121, - 122, 123, 2, 3, 3, 3, 2, 2, - 2, 2, 3, 3, 2, 3, 3, 2, - 2, 2, 3, 3, 3, 3, 2, 124, - 125, 126, 2, 3, 3, 3, 3, 3, - 2, 3, 2, 3, 2, 127, 128, 129, - 2, 130, 2, 2, 130, 2, 130, 130, - 2, 130, 130, 2, 130, 130, 130, 2, - 130, 2, 130, 130, 2, 130, 130, 130, - 130, 2, 130, 130, 2, 2, 130, 130, - 2, 130, 2, 131, 132, 133, 134, 135, - 136, 137, 139, 140, 141, 142, 143, 144, - 145, 146, 147, 148, 149, 150, 22, 151, - 152, 153, 154, 155, 156, 157, 158, 159, - 138, 2, 130, 130, 130, 130, 2, 130, - 2, 130, 130, 2, 3, 3, 2, 2, - 3, 130, 130, 2, 130, 130, 2, 130, - 2, 3, 130, 130, 130, 3, 3, 2, - 130, 130, 130, 2, 2, 2, 130, 2, - 3, 3, 130, 130, 3, 2, 130, 130, - 130, 2, 130, 2, 130, 2, 130, 2, - 3, 2, 2, 130, 130, 2, 130, 2, - 3, 130, 130, 3, 130, 2, 3, 130, - 130, 3, 3, 130, 130, 2, 130, 130, - 3, 2, 130, 130, 130, 3, 3, 3, - 2, 130, 3, 130, 2, 2, 2, 3, - 2, 2, 2, 130, 130, 130, 3, 130, - 3, 2, 130, 130, 3, 3, 3, 130, - 130, 130, 2, 130, 130, 3, 3, 2, - 2, 2, 130, 130, 130, 2, 130, 2, - 3, 130, 130, 130, 130, 3, 130, 3, - 3, 2, 130, 3, 130, 2, 130, 2, - 130, 3, 130, 130, 2, 130, 2, 130, - 130, 130, 130, 3, 2, 3, 130, 2, - 130, 130, 130, 130, 2, 130, 2, 160, - 161, 162, 163, 164, 165, 166, 167, 168, - 169, 170, 171, 172, 173, 174, 175, 176, - 177, 178, 179, 180, 2, 3, 130, 130, - 3, 130, 2, 3, 130, 130, 130, 2, - 130, 3, 130, 130, 130, 2, 130, 2, - 130, 130, 2, 130, 130, 2, 3, 130, - 3, 2, 130, 130, 130, 2, 3, 130, - 2, 130, 130, 2, 130, 130, 3, 130, - 3, 3, 130, 2, 130, 130, 3, 2, - 130, 130, 130, 130, 3, 130, 130, 3, - 130, 2, 130, 2, 3, 3, 3, 130, - 130, 3, 2, 130, 2, 130, 2, 3, - 3, 3, 3, 130, 130, 3, 130, 2, - 3, 130, 130, 3, 130, 3, 2, 3, - 130, 3, 130, 2, 3, 130, 130, 130, - 130, 3, 130, 2, 130, 130, 2, 181, - 182, 183, 184, 185, 2, 130, 58, 2, - 130, 2, 130, 2, 130, 2, 130, 2, - 186, 187, 2, 130, 2, 130, 2, 188, - 189, 190, 191, 66, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 2, 130, - 130, 2, 130, 2, 130, 2, 130, 130, - 130, 3, 3, 130, 2, 130, 2, 130, - 2, 3, 130, 2, 130, 3, 2, 3, - 130, 130, 130, 3, 130, 3, 2, 130, - 2, 3, 130, 3, 130, 3, 130, 2, - 130, 130, 3, 130, 2, 130, 130, 130, - 130, 2, 130, 3, 3, 130, 130, 3, - 2, 130, 130, 3, 130, 3, 2, 202, - 203, 189, 2, 130, 2, 130, 130, 2, - 204, 205, 206, 207, 208, 209, 210, 2, - 211, 212, 213, 214, 215, 2, 130, 2, - 130, 2, 130, 2, 130, 130, 130, 130, - 130, 2, 130, 2, 216, 217, 218, 219, - 220, 221, 222, 223, 224, 225, 226, 227, - 228, 229, 230, 231, 232, 233, 234, 235, - 236, 237, 238, 2, 130, 3, 130, 2, - 2, 130, 3, 2, 3, 3, 2, 130, - 3, 130, 130, 2, 130, 2, 3, 130, - 3, 130, 3, 2, 2, 130, 2, 3, - 130, 130, 3, 130, 3, 130, 2, 130, - 3, 130, 2, 130, 130, 3, 130, 3, - 2, 130, 130, 3, 3, 3, 3, 130, - 130, 2, 3, 130, 2, 3, 3, 130, - 2, 130, 3, 130, 3, 130, 3, 130, - 2, 3, 2, 130, 130, 3, 3, 130, - 3, 130, 2, 2, 2, 130, 130, 3, - 130, 3, 130, 2, 2, 130, 3, 3, - 130, 3, 130, 2, 3, 130, 3, 130, - 2, 3, 3, 130, 130, 2, 3, 3, - 3, 130, 130, 2, 239, 240, 115, 241, - 2, 130, 2, 130, 2, 130, 2, 242, - 2, 130, 2, 243, 244, 245, 246, 247, - 248, 2, 3, 3, 130, 130, 130, 2, - 2, 2, 2, 130, 130, 2, 130, 130, - 2, 2, 2, 130, 130, 130, 130, 2, - 249, 250, 251, 2, 130, 130, 130, 130, - 130, 2, 130, 2, 130, 2, 252, 2, - 3, 2, 253, 2, 254, 255, 256, 258, - 257, 2, 130, 2, 2, 130, 130, 3, - 2, 3, 2, 259, 2, 260, 261, 262, - 264, 263, 2, 3, 2, 2, 3, 3, - 79, 80, 81, 82, 83, 84, 2, 3, - 1, 265, 265, 3, 1, 265, 266, 3, - 1, 267, 268, 267, 268, 268, 267, 268, - 268, 267, 268, 268, 268, 267, 268, 267, - 268, 268, 267, 268, 268, 268, 268, 267, - 268, 268, 267, 267, 268, 268, 267, 268, - 267, 269, 270, 271, 272, 273, 275, 276, - 277, 279, 280, 281, 282, 283, 284, 285, - 286, 287, 288, 289, 290, 291, 292, 293, - 294, 295, 296, 274, 278, 267, 268, 268, - 268, 268, 267, 268, 267, 268, 268, 267, - 267, 267, 268, 267, 267, 267, 268, 268, - 268, 268, 267, 267, 267, 267, 267, 267, - 268, 267, 267, 267, 267, 267, 267, 268, - 267, 267, 267, 267, 268, 268, 268, 268, - 267, 268, 268, 268, 268, 268, 267, 268, - 268, 267, 268, 268, 268, 268, 267, 268, - 268, 267, 267, 267, 267, 267, 267, 268, - 268, 268, 268, 268, 268, 267, 268, 268, - 267, 267, 267, 267, 267, 267, 268, 268, - 267, 268, 268, 268, 268, 268, 267, 268, - 268, 267, 268, 267, 268, 268, 268, 267, - 268, 267, 268, 268, 268, 268, 268, 267, - 268, 267, 268, 268, 268, 268, 267, 268, - 267, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, - 312, 313, 314, 315, 316, 317, 267, 268, - 268, 267, 268, 268, 268, 267, 268, 268, - 268, 268, 267, 268, 267, 268, 268, 267, - 268, 268, 267, 268, 267, 267, 267, 268, - 268, 267, 268, 268, 267, 268, 268, 267, - 268, 267, 268, 268, 268, 268, 268, 267, - 268, 267, 268, 268, 267, 267, 267, 268, - 268, 268, 267, 268, 267, 268, 267, 268, - 268, 268, 268, 268, 267, 268, 268, 267, - 318, 319, 320, 321, 322, 267, 268, 323, - 267, 318, 319, 324, 320, 321, 322, 267, - 268, 267, 268, 267, 268, 267, 268, 267, - 268, 267, 325, 326, 267, 268, 267, 268, - 267, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, - 267, 268, 268, 267, 268, 267, 268, 267, - 268, 268, 268, 268, 267, 268, 268, 267, - 267, 267, 268, 268, 267, 268, 267, 268, - 268, 267, 267, 267, 268, 268, 267, 268, - 268, 268, 267, 268, 268, 268, 268, 267, - 268, 268, 268, 267, 268, 268, 267, 342, - 343, 328, 267, 268, 267, 268, 268, 267, - 344, 345, 346, 347, 348, 349, 350, 267, - 351, 352, 353, 354, 355, 267, 268, 267, - 268, 267, 268, 267, 268, 268, 268, 268, - 268, 267, 268, 267, 356, 357, 358, 359, - 360, 361, 362, 363, 364, 365, 366, 367, - 368, 369, 370, 371, 372, 369, 373, 374, - 375, 376, 377, 267, 268, 268, 267, 267, - 268, 267, 267, 268, 268, 268, 267, 268, - 267, 268, 268, 267, 267, 267, 268, 268, - 268, 267, 268, 267, 268, 268, 268, 267, - 268, 268, 268, 268, 268, 268, 268, 267, - 268, 267, 268, 267, 268, 267, 267, 268, - 268, 268, 267, 267, 267, 268, 267, 268, - 268, 267, 268, 267, 268, 268, 267, 268, - 268, 267, 378, 379, 380, 381, 267, 268, - 267, 268, 267, 268, 267, 268, 267, 382, - 267, 268, 267, 383, 384, 385, 386, 387, - 388, 267, 268, 268, 268, 267, 267, 267, - 267, 268, 268, 267, 268, 268, 267, 267, - 267, 268, 268, 268, 268, 267, 389, 390, - 391, 267, 268, 268, 268, 268, 268, 267, - 268, 267, 268, 267, 392, 393, 394, 267, - 395, 267, 395, 267, 267, 395, 395, 267, - 395, 395, 267, 395, 395, 395, 267, 395, - 267, 395, 395, 267, 395, 395, 395, 395, - 267, 395, 395, 267, 267, 395, 395, 267, - 395, 267, 396, 397, 398, 399, 400, 401, - 402, 404, 405, 406, 407, 408, 409, 410, - 411, 412, 413, 414, 415, 287, 416, 417, - 418, 419, 420, 421, 422, 423, 424, 403, - 267, 395, 395, 395, 395, 267, 395, 267, - 395, 395, 267, 268, 268, 267, 267, 268, - 395, 395, 267, 395, 395, 267, 395, 267, - 268, 395, 395, 395, 268, 268, 267, 395, - 395, 395, 267, 267, 267, 395, 267, 268, - 268, 395, 395, 268, 267, 395, 395, 395, - 267, 395, 267, 395, 267, 395, 267, 268, - 267, 267, 395, 395, 267, 395, 267, 268, - 395, 395, 268, 395, 267, 268, 395, 395, - 268, 268, 395, 395, 267, 395, 395, 268, - 267, 395, 395, 395, 268, 268, 268, 267, - 395, 268, 395, 267, 267, 267, 268, 267, - 267, 267, 395, 395, 395, 268, 395, 268, - 267, 395, 395, 268, 268, 268, 395, 395, - 395, 267, 395, 395, 268, 268, 267, 267, - 267, 395, 395, 395, 267, 395, 267, 268, - 395, 395, 395, 395, 268, 395, 268, 268, - 267, 395, 268, 395, 267, 395, 267, 395, - 268, 395, 395, 267, 395, 267, 395, 395, - 395, 395, 268, 267, 268, 395, 267, 395, - 395, 395, 395, 267, 395, 267, 425, 426, - 427, 428, 429, 430, 431, 432, 433, 434, - 435, 436, 437, 438, 439, 440, 441, 442, - 443, 444, 445, 267, 268, 395, 395, 268, - 395, 267, 268, 395, 395, 395, 267, 395, - 268, 395, 395, 395, 267, 395, 267, 395, - 395, 267, 395, 395, 267, 268, 395, 268, - 267, 395, 395, 395, 267, 268, 395, 267, - 395, 395, 267, 395, 395, 268, 395, 268, - 268, 395, 267, 395, 395, 268, 267, 395, - 395, 395, 395, 268, 395, 395, 268, 395, - 267, 395, 267, 268, 268, 268, 395, 395, - 268, 267, 395, 267, 395, 267, 268, 268, - 268, 268, 395, 395, 268, 395, 267, 268, - 395, 395, 268, 395, 268, 267, 268, 395, - 268, 395, 267, 268, 395, 395, 395, 395, - 268, 395, 267, 395, 395, 267, 446, 447, - 448, 449, 450, 267, 395, 323, 267, 395, - 267, 395, 267, 395, 267, 395, 267, 451, - 452, 267, 395, 267, 395, 267, 453, 454, - 455, 456, 331, 457, 458, 459, 460, 461, - 462, 463, 464, 465, 466, 267, 395, 395, - 267, 395, 267, 395, 267, 395, 395, 395, - 268, 268, 395, 267, 395, 267, 395, 267, - 268, 395, 267, 395, 268, 267, 268, 395, - 395, 395, 268, 395, 268, 267, 395, 267, - 268, 395, 268, 395, 268, 395, 267, 395, - 395, 268, 395, 267, 395, 395, 395, 395, - 267, 395, 268, 268, 395, 395, 268, 267, - 395, 395, 268, 395, 268, 267, 467, 468, - 454, 267, 395, 267, 395, 395, 267, 469, - 470, 471, 472, 473, 474, 475, 267, 476, - 477, 478, 479, 480, 267, 395, 267, 395, - 267, 395, 267, 395, 395, 395, 395, 395, - 267, 395, 267, 481, 482, 483, 484, 485, - 486, 487, 488, 489, 490, 491, 492, 493, - 494, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 267, 395, 268, 395, 267, 267, - 395, 268, 267, 268, 268, 267, 395, 268, - 395, 395, 267, 395, 267, 268, 395, 268, - 395, 268, 267, 267, 395, 267, 268, 395, - 395, 268, 395, 268, 395, 267, 395, 268, - 395, 267, 395, 395, 268, 395, 268, 267, - 395, 395, 268, 268, 268, 268, 395, 395, - 267, 268, 395, 267, 268, 268, 395, 267, - 395, 268, 395, 268, 395, 268, 395, 267, - 268, 267, 395, 395, 268, 268, 395, 268, - 395, 267, 267, 267, 395, 395, 268, 395, - 268, 395, 267, 267, 395, 268, 268, 395, - 268, 395, 267, 268, 395, 268, 395, 267, - 268, 268, 395, 395, 267, 268, 268, 268, - 395, 395, 267, 504, 505, 380, 506, 267, - 395, 267, 395, 267, 395, 267, 507, 267, - 395, 267, 508, 509, 510, 511, 512, 513, - 267, 268, 268, 395, 395, 395, 267, 267, - 267, 267, 395, 395, 267, 395, 395, 267, - 267, 267, 395, 395, 395, 395, 267, 514, - 515, 516, 267, 395, 395, 395, 395, 395, - 267, 395, 267, 395, 267, 517, 267, 268, - 267, 518, 267, 519, 520, 521, 523, 522, - 267, 395, 267, 267, 395, 395, 268, 267, - 268, 267, 524, 267, 525, 526, 527, 529, - 528, 267, 268, 267, 267, 268, 268, 344, - 345, 346, 347, 348, 349, 267, 268, 267, - 268, 268, 267, 266, 268, 268, 267, 266, - 268, 267, 266, 268, 267, 531, 532, 530, - 267, 266, 268, 267, 266, 268, 267, 533, - 534, 535, 536, 537, 530, 267, 538, 267, - 297, 298, 299, 533, 534, 539, 300, 301, - 302, 303, 304, 305, 306, 307, 308, 309, - 310, 311, 312, 313, 314, 315, 316, 317, - 267, 540, 538, 297, 298, 299, 541, 535, - 536, 300, 301, 302, 303, 304, 305, 306, - 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 267, 540, 267, 542, 540, - 297, 298, 299, 543, 536, 300, 301, 302, - 303, 304, 305, 306, 307, 308, 309, 310, - 311, 312, 313, 314, 315, 316, 317, 267, - 542, 267, 267, 542, 544, 267, 542, 267, - 545, 546, 267, 540, 267, 267, 542, 267, - 540, 267, 540, 327, 328, 329, 330, 331, - 332, 333, 547, 335, 336, 337, 338, 339, - 340, 341, 549, 550, 551, 552, 553, 554, - 549, 550, 551, 552, 553, 554, 549, 548, - 555, 267, 268, 538, 267, 556, 556, 556, - 542, 267, 297, 298, 299, 541, 539, 300, - 301, 302, 303, 304, 305, 306, 307, 308, - 309, 310, 311, 312, 313, 314, 315, 316, - 317, 267, 545, 557, 267, 267, 540, 556, - 556, 542, 556, 556, 542, 556, 556, 556, - 542, 556, 556, 542, 556, 556, 542, 556, - 556, 267, 542, 542, 551, 552, 553, 554, - 548, 549, 551, 552, 553, 554, 548, 549, - 551, 552, 553, 554, 548, 549, 551, 552, - 553, 554, 548, 549, 551, 552, 553, 554, - 548, 549, 551, 552, 553, 554, 548, 549, - 551, 552, 553, 554, 548, 549, 551, 552, - 553, 554, 548, 549, 551, 552, 553, 554, - 548, 549, 550, 555, 552, 553, 554, 548, - 549, 550, 552, 553, 554, 548, 549, 550, - 552, 553, 554, 548, 549, 550, 552, 553, - 554, 548, 549, 550, 552, 553, 554, 548, - 549, 550, 552, 553, 554, 548, 549, 550, - 552, 553, 554, 548, 549, 550, 552, 553, - 554, 548, 549, 550, 552, 553, 554, 548, - 549, 550, 551, 555, 553, 554, 548, 549, - 550, 551, 553, 554, 548, 549, 550, 551, - 553, 554, 548, 549, 550, 551, 553, 554, - 548, 549, 550, 551, 553, 558, 557, 552, - 267, 555, 556, 267, 540, 542, 268, 268, - 267, 559, 560, 561, 562, 563, 530, 267, - 268, 323, 268, 268, 268, 267, 268, 268, - 267, 395, 268, 267, 395, 268, 267, 268, - 395, 268, 267, 530, 267, 564, 566, 567, - 568, 569, 570, 571, 566, 567, 568, 569, - 570, 571, 566, 530, 565, 555, 267, 268, - 538, 268, 267, 540, 540, 540, 542, 267, - 540, 540, 542, 540, 540, 542, 540, 540, - 540, 542, 540, 540, 542, 540, 540, 542, - 540, 540, 267, 542, 568, 569, 570, 571, - 565, 566, 568, 569, 570, 571, 565, 566, - 568, 569, 570, 571, 565, 566, 568, 569, - 570, 571, 565, 566, 568, 569, 570, 571, - 565, 566, 568, 569, 570, 571, 565, 566, - 568, 569, 570, 571, 565, 566, 568, 569, - 570, 571, 565, 566, 568, 569, 570, 571, - 565, 566, 567, 555, 569, 570, 571, 565, - 566, 567, 569, 570, 571, 565, 566, 567, - 569, 570, 571, 565, 566, 567, 569, 570, - 571, 565, 566, 567, 569, 570, 571, 565, - 566, 567, 569, 570, 571, 565, 566, 567, - 569, 570, 571, 565, 566, 567, 569, 570, - 571, 565, 566, 567, 569, 570, 571, 565, - 566, 567, 568, 555, 570, 571, 565, 566, - 567, 568, 570, 571, 565, 566, 567, 568, - 570, 571, 565, 566, 567, 568, 570, 571, - 565, 566, 567, 568, 570, 572, 573, 569, - 267, 555, 540, 268, 540, 542, 268, 542, - 268, 267, 540, 574, 575, 530, 267, 268, - 267, 268, 268, 268, 267, 577, 578, 579, - 580, 576, 267, 581, 582, 530, 267, 266, - 268, 267, 268, 266, 268, 267, 583, 530, - 267, 268, 268, 267, 584, 530, 267, 268, - 268, 267, 585, 586, 587, 588, 589, 590, - 591, 592, 593, 594, 595, 530, 267, 268, - 596, 267, 344, 345, 346, 347, 348, 349, - 597, 267, 598, 267, 268, 267, 395, 268, - 267, 268, 395, 268, 395, 268, 267, 395, - 395, 268, 395, 268, 395, 268, 395, 268, - 395, 268, 267, 268, 268, 395, 395, 268, - 267, 395, 395, 268, 267, 395, 268, 395, - 268, 267, 268, 395, 268, 395, 268, 267, - 395, 268, 395, 268, 267, 395, 268, 267, - 395, 395, 268, 268, 395, 268, 395, 268, - 395, 267, 576, 267, 599, 576, 267, 322, - 530, 600, 530, 267, 268, 267, 266, 3, - 1, 266, 3, 1, 602, 603, 601, 1, - 266, 3, 1, 266, 3, 1, 604, 605, - 606, 607, 608, 601, 1, 609, 610, 612, - 611, 611, 612, 612, 611, 612, 612, 611, - 612, 612, 612, 611, 612, 611, 612, 612, - 611, 612, 612, 612, 612, 611, 612, 612, - 611, 611, 612, 612, 611, 612, 611, 613, - 614, 615, 616, 617, 619, 620, 621, 623, - 624, 625, 626, 627, 628, 629, 630, 631, - 632, 633, 634, 635, 636, 637, 638, 639, - 640, 618, 622, 611, 612, 612, 612, 612, - 611, 612, 611, 612, 612, 611, 611, 611, - 612, 611, 611, 611, 612, 612, 612, 612, - 611, 611, 611, 611, 611, 611, 612, 611, - 611, 611, 611, 611, 611, 612, 611, 611, - 611, 611, 612, 612, 612, 612, 611, 612, - 612, 612, 612, 612, 611, 612, 612, 611, - 612, 612, 612, 612, 611, 612, 612, 611, - 611, 611, 611, 611, 611, 612, 612, 612, - 612, 612, 612, 611, 612, 612, 611, 611, - 611, 611, 611, 611, 612, 612, 611, 612, - 612, 612, 612, 612, 611, 612, 612, 611, - 612, 611, 612, 612, 612, 611, 612, 611, - 612, 612, 612, 612, 612, 611, 612, 611, - 612, 612, 612, 612, 611, 612, 611, 641, - 642, 643, 644, 645, 646, 647, 648, 649, - 650, 651, 652, 653, 654, 655, 656, 657, - 658, 659, 660, 661, 611, 612, 612, 611, - 612, 612, 612, 611, 612, 612, 612, 612, - 611, 612, 611, 612, 612, 611, 612, 612, - 611, 612, 611, 611, 611, 612, 612, 611, - 612, 612, 611, 612, 612, 611, 612, 611, - 612, 612, 612, 612, 612, 611, 612, 611, - 612, 612, 611, 611, 611, 612, 612, 612, - 611, 612, 611, 612, 611, 612, 612, 612, - 612, 612, 611, 612, 612, 611, 662, 663, - 664, 665, 666, 611, 612, 667, 611, 662, - 663, 668, 664, 665, 666, 611, 612, 611, - 612, 611, 612, 611, 612, 611, 612, 611, - 669, 670, 611, 612, 611, 612, 611, 671, - 672, 673, 674, 675, 676, 677, 678, 679, - 680, 681, 682, 683, 684, 685, 611, 612, - 612, 611, 612, 611, 612, 611, 612, 612, - 612, 612, 611, 612, 612, 611, 611, 611, - 612, 612, 611, 612, 611, 612, 612, 611, - 611, 611, 612, 612, 611, 612, 612, 612, - 611, 612, 612, 612, 612, 611, 612, 612, - 612, 611, 612, 612, 611, 686, 687, 672, - 611, 612, 611, 612, 612, 611, 688, 689, - 690, 691, 692, 693, 694, 611, 695, 696, - 697, 698, 699, 611, 612, 611, 612, 611, - 612, 611, 612, 612, 612, 612, 612, 611, - 612, 611, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 713, - 714, 715, 716, 713, 717, 718, 719, 720, - 721, 611, 612, 612, 611, 611, 612, 611, - 611, 612, 612, 612, 611, 612, 611, 612, - 612, 611, 611, 611, 612, 612, 612, 611, - 612, 611, 612, 612, 612, 611, 612, 612, - 612, 612, 612, 612, 612, 611, 612, 611, - 612, 611, 612, 611, 611, 612, 612, 612, - 611, 611, 611, 612, 611, 612, 612, 611, - 612, 611, 612, 612, 611, 612, 612, 611, - 722, 723, 724, 725, 611, 612, 611, 612, - 611, 612, 611, 612, 611, 726, 611, 612, - 611, 727, 728, 729, 730, 731, 732, 611, - 612, 612, 612, 611, 611, 611, 611, 612, - 612, 611, 612, 612, 611, 611, 611, 612, - 612, 612, 612, 611, 733, 734, 735, 611, - 612, 612, 612, 612, 612, 611, 612, 611, - 612, 611, 736, 737, 738, 611, 739, 611, - 739, 611, 611, 739, 739, 611, 739, 739, - 611, 739, 739, 739, 611, 739, 611, 739, - 739, 611, 739, 739, 739, 739, 611, 739, - 739, 611, 611, 739, 739, 611, 739, 611, - 740, 741, 742, 743, 744, 745, 746, 748, - 749, 750, 751, 752, 753, 754, 755, 756, - 757, 758, 759, 631, 760, 761, 762, 763, - 764, 765, 766, 767, 768, 747, 611, 739, - 739, 739, 739, 611, 739, 611, 739, 739, - 611, 612, 612, 611, 611, 612, 739, 739, - 611, 739, 739, 611, 739, 611, 612, 739, - 739, 739, 612, 612, 611, 739, 739, 739, - 611, 611, 611, 739, 611, 612, 612, 739, - 739, 612, 611, 739, 739, 739, 611, 739, - 611, 739, 611, 739, 611, 612, 611, 611, - 739, 739, 611, 739, 611, 612, 739, 739, - 612, 739, 611, 612, 739, 739, 612, 612, - 739, 739, 611, 739, 739, 612, 611, 739, - 739, 739, 612, 612, 612, 611, 739, 612, - 739, 611, 611, 611, 612, 611, 611, 611, - 739, 739, 739, 612, 739, 612, 611, 739, - 739, 612, 612, 612, 739, 739, 739, 611, - 739, 739, 612, 612, 611, 611, 611, 739, - 739, 739, 611, 739, 611, 612, 739, 739, - 739, 739, 612, 739, 612, 612, 611, 739, - 612, 739, 611, 739, 611, 739, 612, 739, - 739, 611, 739, 611, 739, 739, 739, 739, - 612, 611, 612, 739, 611, 739, 739, 739, - 739, 611, 739, 611, 769, 770, 771, 772, - 773, 774, 775, 776, 777, 778, 779, 780, - 781, 782, 783, 784, 785, 786, 787, 788, - 789, 611, 612, 739, 739, 612, 739, 611, - 612, 739, 739, 739, 611, 739, 612, 739, - 739, 739, 611, 739, 611, 739, 739, 611, - 739, 739, 611, 612, 739, 612, 611, 739, - 739, 739, 611, 612, 739, 611, 739, 739, - 611, 739, 739, 612, 739, 612, 612, 739, - 611, 739, 739, 612, 611, 739, 739, 739, - 739, 612, 739, 739, 612, 739, 611, 739, - 611, 612, 612, 612, 739, 739, 612, 611, - 739, 611, 739, 611, 612, 612, 612, 612, - 739, 739, 612, 739, 611, 612, 739, 739, - 612, 739, 612, 611, 612, 739, 612, 739, - 611, 612, 739, 739, 739, 739, 612, 739, - 611, 739, 739, 611, 790, 791, 792, 793, - 794, 611, 739, 667, 611, 739, 611, 739, - 611, 739, 611, 739, 611, 795, 796, 611, - 739, 611, 739, 611, 797, 798, 799, 800, - 675, 801, 802, 803, 804, 805, 806, 807, - 808, 809, 810, 611, 739, 739, 611, 739, - 611, 739, 611, 739, 739, 739, 612, 612, - 739, 611, 739, 611, 739, 611, 612, 739, - 611, 739, 612, 611, 612, 739, 739, 739, - 612, 739, 612, 611, 739, 611, 612, 739, - 612, 739, 612, 739, 611, 739, 739, 612, - 739, 611, 739, 739, 739, 739, 611, 739, - 612, 612, 739, 739, 612, 611, 739, 739, - 612, 739, 612, 611, 811, 812, 798, 611, - 739, 611, 739, 739, 611, 813, 814, 815, - 816, 817, 818, 819, 611, 820, 821, 822, - 823, 824, 611, 739, 611, 739, 611, 739, - 611, 739, 739, 739, 739, 739, 611, 739, - 611, 825, 826, 827, 828, 829, 830, 831, - 832, 833, 834, 835, 836, 837, 838, 839, - 840, 841, 842, 843, 844, 845, 846, 847, - 611, 739, 612, 739, 611, 611, 739, 612, - 611, 612, 612, 611, 739, 612, 739, 739, - 611, 739, 611, 612, 739, 612, 739, 612, - 611, 611, 739, 611, 612, 739, 739, 612, - 739, 612, 739, 611, 739, 612, 739, 611, - 739, 739, 612, 739, 612, 611, 739, 739, - 612, 612, 612, 612, 739, 739, 611, 612, - 739, 611, 612, 612, 739, 611, 739, 612, - 739, 612, 739, 612, 739, 611, 612, 611, - 739, 739, 612, 612, 739, 612, 739, 611, - 611, 611, 739, 739, 612, 739, 612, 739, - 611, 611, 739, 612, 612, 739, 612, 739, - 611, 612, 739, 612, 739, 611, 612, 612, - 739, 739, 611, 612, 612, 612, 739, 739, - 611, 848, 849, 724, 850, 611, 739, 611, - 739, 611, 739, 611, 851, 611, 739, 611, - 852, 853, 854, 855, 856, 857, 611, 612, - 612, 739, 739, 739, 611, 611, 611, 611, - 739, 739, 611, 739, 739, 611, 611, 611, - 739, 739, 739, 739, 611, 858, 859, 860, - 611, 739, 739, 739, 739, 739, 611, 739, - 611, 739, 611, 861, 611, 612, 611, 862, - 611, 863, 864, 865, 867, 866, 611, 739, - 611, 611, 739, 739, 612, 611, 612, 611, - 868, 611, 869, 870, 871, 873, 872, 611, - 612, 611, 611, 612, 612, 688, 689, 690, - 691, 692, 693, 611, 641, 642, 643, 604, - 605, 874, 644, 645, 646, 647, 648, 649, - 650, 651, 652, 653, 654, 655, 656, 657, - 658, 659, 660, 661, 611, 875, 610, 641, - 642, 643, 876, 606, 607, 644, 645, 646, - 647, 648, 649, 650, 651, 652, 653, 654, - 655, 656, 657, 658, 659, 660, 661, 611, - 875, 611, 877, 875, 641, 642, 643, 878, - 607, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 654, 655, 656, 657, 658, - 659, 660, 661, 611, 877, 611, 609, 877, - 879, 611, 877, 611, 880, 881, 611, 875, - 611, 611, 877, 611, 875, 611, 875, 671, - 672, 673, 674, 675, 676, 677, 882, 679, - 680, 681, 682, 683, 684, 685, 884, 885, - 886, 887, 888, 889, 884, 885, 886, 887, - 888, 889, 884, 883, 890, 611, 612, 610, - 611, 891, 891, 891, 877, 611, 641, 642, - 643, 876, 874, 644, 645, 646, 647, 648, - 649, 650, 651, 652, 653, 654, 655, 656, - 657, 658, 659, 660, 661, 611, 880, 892, - 611, 611, 875, 891, 891, 877, 891, 891, - 877, 891, 891, 891, 877, 891, 891, 877, - 891, 891, 877, 891, 891, 611, 877, 877, - 886, 887, 888, 889, 883, 884, 886, 887, - 888, 889, 883, 884, 886, 887, 888, 889, - 883, 884, 886, 887, 888, 889, 883, 884, - 886, 887, 888, 889, 883, 884, 886, 887, - 888, 889, 883, 884, 886, 887, 888, 889, - 883, 884, 886, 887, 888, 889, 883, 884, - 886, 887, 888, 889, 883, 884, 885, 890, - 887, 888, 889, 883, 884, 885, 887, 888, - 889, 883, 884, 885, 887, 888, 889, 883, - 884, 885, 887, 888, 889, 883, 884, 885, - 887, 888, 889, 883, 884, 885, 887, 888, - 889, 883, 884, 885, 887, 888, 889, 883, - 884, 885, 887, 888, 889, 883, 884, 885, - 887, 888, 889, 883, 884, 885, 886, 890, - 888, 889, 883, 884, 885, 886, 888, 889, - 883, 884, 885, 886, 888, 889, 883, 884, - 885, 886, 888, 889, 883, 884, 885, 886, - 888, 893, 892, 887, 611, 890, 891, 611, - 875, 877, 265, 3, 1, 894, 895, 896, - 897, 898, 601, 1, 265, 899, 3, 265, - 3, 265, 3, 1, 901, 900, 900, 901, - 901, 900, 901, 901, 900, 901, 901, 901, - 900, 901, 900, 901, 901, 900, 901, 901, - 901, 901, 900, 901, 901, 900, 900, 901, - 901, 900, 901, 900, 902, 903, 904, 905, - 906, 908, 909, 910, 912, 913, 914, 915, - 916, 917, 918, 919, 920, 921, 922, 923, - 924, 925, 926, 927, 928, 929, 907, 911, - 900, 901, 901, 901, 901, 900, 901, 900, - 901, 901, 900, 900, 900, 901, 900, 900, - 900, 901, 901, 901, 901, 900, 900, 900, - 900, 900, 900, 901, 900, 900, 900, 900, - 900, 900, 901, 900, 900, 900, 900, 901, - 901, 901, 901, 900, 901, 901, 901, 901, - 901, 900, 901, 901, 900, 901, 901, 901, - 901, 900, 901, 901, 900, 900, 900, 900, - 900, 900, 901, 901, 901, 901, 901, 901, - 900, 901, 901, 900, 900, 900, 900, 900, - 900, 901, 901, 900, 901, 901, 901, 901, - 901, 900, 901, 901, 900, 901, 900, 901, - 901, 901, 900, 901, 900, 901, 901, 901, - 901, 901, 900, 901, 900, 901, 901, 901, - 901, 900, 901, 900, 930, 931, 932, 933, - 934, 935, 936, 937, 938, 939, 940, 941, - 942, 943, 944, 945, 946, 947, 948, 949, - 950, 900, 901, 901, 900, 901, 901, 901, - 900, 901, 901, 901, 901, 900, 901, 900, - 901, 901, 900, 901, 901, 900, 901, 900, - 900, 900, 901, 901, 900, 901, 901, 900, - 901, 901, 900, 901, 900, 901, 901, 901, - 901, 901, 900, 901, 900, 901, 901, 900, - 900, 900, 901, 901, 901, 900, 901, 900, - 901, 900, 901, 901, 901, 901, 901, 900, - 901, 901, 900, 951, 952, 953, 954, 955, - 900, 901, 899, 900, 901, 900, 901, 900, - 901, 900, 901, 900, 956, 957, 900, 901, - 900, 901, 900, 958, 959, 960, 961, 962, - 963, 964, 965, 966, 967, 968, 969, 970, - 971, 972, 900, 901, 901, 900, 901, 900, - 901, 900, 901, 901, 901, 901, 900, 901, - 901, 900, 900, 900, 901, 901, 900, 901, - 900, 901, 901, 900, 900, 900, 901, 901, - 900, 901, 901, 901, 900, 901, 901, 901, - 901, 900, 901, 901, 901, 900, 901, 901, - 900, 973, 974, 959, 900, 901, 900, 901, - 901, 900, 975, 976, 977, 978, 979, 980, - 900, 981, 982, 983, 984, 985, 900, 901, - 900, 901, 900, 901, 900, 901, 901, 901, - 901, 901, 900, 901, 900, 986, 987, 988, - 989, 990, 991, 992, 993, 994, 995, 996, - 997, 998, 999, 1000, 1001, 1002, 999, 1003, - 1004, 1005, 1006, 1007, 900, 901, 901, 900, - 900, 901, 900, 900, 901, 901, 901, 900, - 901, 900, 901, 901, 900, 900, 900, 901, - 901, 901, 900, 901, 900, 901, 901, 901, - 900, 901, 901, 901, 901, 901, 901, 901, - 900, 901, 900, 901, 900, 901, 900, 900, - 901, 901, 901, 900, 900, 900, 901, 900, - 901, 901, 900, 901, 900, 901, 901, 900, - 901, 901, 900, 1008, 1009, 1010, 1011, 900, - 901, 900, 901, 900, 901, 900, 901, 900, - 1012, 900, 901, 900, 1013, 1014, 1015, 1016, - 1017, 1018, 900, 901, 901, 901, 900, 900, - 900, 900, 901, 901, 900, 901, 901, 900, - 900, 900, 901, 901, 901, 901, 900, 1019, - 1020, 1021, 900, 901, 901, 901, 901, 901, - 900, 901, 900, 901, 900, 1022, 900, 1023, - 1024, 1025, 1027, 1026, 900, 901, 900, 900, - 901, 901, 951, 952, 1028, 953, 954, 955, - 900, 901, 900, 975, 976, 977, 978, 979, - 980, 1029, 900, 1030, 1031, 1032, 900, 1033, - 900, 1033, 900, 900, 1033, 1033, 900, 1033, - 1033, 900, 1033, 1033, 1033, 900, 1033, 900, - 1033, 1033, 900, 1033, 1033, 1033, 1033, 900, - 1033, 1033, 900, 900, 1033, 1033, 900, 1033, - 900, 1034, 1035, 1036, 1037, 1038, 1039, 1040, - 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, - 1050, 1051, 1052, 1053, 920, 1054, 1055, 1056, - 1057, 1058, 1059, 1060, 1061, 1062, 1041, 900, - 1033, 1033, 1033, 1033, 900, 1033, 900, 1033, - 1033, 900, 901, 901, 900, 900, 901, 1033, - 1033, 900, 1033, 1033, 900, 1033, 900, 901, - 1033, 1033, 1033, 901, 901, 900, 1033, 1033, - 1033, 900, 900, 900, 1033, 900, 901, 901, - 1033, 1033, 901, 900, 1033, 1033, 1033, 900, - 1033, 900, 1033, 900, 1033, 900, 901, 900, - 900, 1033, 1033, 900, 1033, 900, 901, 1033, - 1033, 901, 1033, 900, 901, 1033, 1033, 901, - 901, 1033, 1033, 900, 1033, 1033, 901, 900, - 1033, 1033, 1033, 901, 901, 901, 900, 1033, - 901, 1033, 900, 900, 900, 901, 900, 900, - 900, 1033, 1033, 1033, 901, 1033, 901, 900, - 1033, 1033, 901, 901, 901, 1033, 1033, 1033, - 900, 1033, 1033, 901, 901, 900, 900, 900, - 1033, 1033, 1033, 900, 1033, 900, 901, 1033, - 1033, 1033, 1033, 901, 1033, 901, 901, 900, - 1033, 901, 1033, 900, 1033, 900, 1033, 901, - 1033, 1033, 900, 1033, 900, 1033, 1033, 1033, - 1033, 901, 900, 901, 1033, 900, 1033, 1033, - 1033, 1033, 900, 1033, 900, 1063, 1064, 1065, - 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, - 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, - 1082, 1083, 900, 901, 1033, 1033, 901, 1033, - 900, 901, 1033, 1033, 1033, 900, 1033, 901, - 1033, 1033, 1033, 900, 1033, 900, 1033, 1033, - 900, 1033, 1033, 900, 901, 1033, 901, 900, - 1033, 1033, 1033, 900, 901, 1033, 900, 1033, - 1033, 900, 1033, 1033, 901, 1033, 901, 901, - 1033, 900, 1033, 1033, 901, 900, 1033, 1033, - 1033, 1033, 901, 1033, 1033, 901, 1033, 900, - 1033, 900, 901, 901, 901, 1033, 1033, 901, - 900, 1033, 900, 1033, 900, 901, 901, 901, - 901, 1033, 1033, 901, 1033, 900, 901, 1033, - 1033, 901, 1033, 901, 900, 901, 1033, 901, - 1033, 900, 901, 1033, 1033, 1033, 1033, 901, - 1033, 900, 1033, 1033, 900, 1084, 1085, 1086, - 1087, 1088, 900, 1033, 899, 900, 1033, 900, - 1033, 900, 1033, 900, 1033, 900, 1089, 1090, - 900, 1033, 900, 1033, 900, 1091, 1092, 1093, - 1094, 962, 1095, 1096, 1097, 1098, 1099, 1100, - 1101, 1102, 1103, 1104, 900, 1033, 1033, 900, - 1033, 900, 1033, 900, 1033, 1033, 1033, 901, - 901, 1033, 900, 1033, 900, 1033, 900, 901, - 1033, 900, 1033, 901, 900, 901, 1033, 1033, - 1033, 901, 1033, 901, 900, 1033, 900, 901, - 1033, 901, 1033, 901, 1033, 900, 1033, 1033, - 901, 1033, 900, 1033, 1033, 1033, 1033, 900, - 1033, 901, 901, 1033, 1033, 901, 900, 1033, - 1033, 901, 1033, 901, 900, 1105, 1106, 1092, - 900, 1033, 900, 1033, 1033, 900, 1107, 1108, - 1109, 1110, 1111, 1112, 1113, 900, 1114, 1115, - 1116, 1117, 1118, 900, 1033, 900, 1033, 900, - 1033, 900, 1033, 1033, 1033, 1033, 1033, 900, - 1033, 900, 1119, 1120, 1121, 1122, 1123, 1124, - 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1132, - 1133, 1134, 1135, 1136, 1137, 1138, 1139, 1140, - 1141, 900, 1033, 901, 1033, 900, 900, 1033, - 901, 900, 901, 901, 900, 1033, 901, 1033, - 1033, 900, 1033, 900, 901, 1033, 901, 1033, - 901, 900, 900, 1033, 900, 901, 1033, 1033, - 901, 1033, 901, 1033, 900, 1033, 901, 1033, - 900, 1033, 1033, 901, 1033, 901, 900, 1033, - 1033, 901, 901, 901, 901, 1033, 1033, 900, - 901, 1033, 900, 901, 901, 1033, 900, 1033, - 901, 1033, 901, 1033, 901, 1033, 900, 901, - 900, 1033, 1033, 901, 901, 1033, 901, 1033, - 900, 900, 900, 1033, 1033, 901, 1033, 901, - 1033, 900, 900, 1033, 901, 901, 1033, 901, - 1033, 900, 901, 1033, 901, 1033, 900, 901, - 901, 1033, 1033, 900, 901, 901, 901, 1033, - 1033, 900, 1142, 1143, 1010, 1144, 900, 1033, - 900, 1033, 900, 1033, 900, 1145, 900, 1033, - 900, 1146, 1147, 1148, 1149, 1150, 1151, 900, - 901, 901, 1033, 1033, 1033, 900, 900, 900, - 900, 1033, 1033, 900, 1033, 1033, 900, 900, - 900, 1033, 1033, 1033, 1033, 900, 1152, 1153, - 1154, 900, 1033, 1033, 1033, 1033, 1033, 900, - 1033, 900, 1033, 900, 1155, 900, 901, 900, - 1156, 900, 1157, 1158, 1159, 1161, 1160, 900, - 1033, 900, 900, 1033, 1033, 901, 900, 901, - 900, 3, 265, 3, 1, 1162, 3, 1, - 1162, 1163, 1163, 1162, 1162, 1163, 1162, 1162, - 1163, 1162, 1162, 1162, 1163, 1162, 1163, 1162, - 1162, 1163, 1162, 1162, 1162, 1162, 1163, 1162, - 1162, 1163, 1163, 1162, 1162, 1163, 1162, 1163, - 1164, 1165, 1166, 1167, 1168, 1169, 1170, 1172, - 1173, 1174, 1175, 1176, 1177, 1178, 1179, 1180, - 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, - 1189, 1190, 1191, 1192, 1193, 1171, 1163, 1162, - 1162, 1162, 1162, 1163, 1162, 1163, 1162, 1162, - 1163, 1194, 1194, 1163, 1163, 1194, 1162, 1194, - 1163, 1163, 1194, 1194, 1163, 1194, 1194, 1163, - 1194, 1194, 1194, 1163, 1194, 1163, 1194, 1194, - 1163, 1194, 1194, 1194, 1194, 1163, 1194, 1194, - 1163, 1163, 1194, 1194, 1163, 1194, 1163, 1195, - 1196, 1197, 1198, 1199, 1201, 1202, 1203, 1205, - 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1184, - 1213, 1214, 1215, 1216, 1217, 1218, 1219, 1220, - 1221, 1200, 1204, 1163, 1194, 1194, 1194, 1194, - 1163, 1194, 1163, 1194, 1194, 1163, 1163, 1163, - 1194, 1163, 1163, 1163, 1194, 1194, 1194, 1194, - 1163, 1163, 1163, 1163, 1163, 1163, 1194, 1163, - 1163, 1163, 1163, 1163, 1163, 1194, 1163, 1163, - 1163, 1163, 1194, 1194, 1194, 1194, 1163, 1194, - 1194, 1194, 1194, 1194, 1163, 1194, 1194, 1163, - 1194, 1194, 1194, 1194, 1163, 1194, 1194, 1163, - 1163, 1163, 1163, 1163, 1163, 1194, 1194, 1194, - 1194, 1194, 1194, 1163, 1194, 1194, 1163, 1163, - 1163, 1163, 1163, 1163, 1194, 1194, 1163, 1194, - 1194, 1194, 1194, 1194, 1163, 1194, 1194, 1163, - 1194, 1163, 1194, 1194, 1194, 1163, 1194, 1163, - 1194, 1194, 1194, 1194, 1194, 1163, 1194, 1163, - 1194, 1194, 1194, 1194, 1163, 1194, 1163, 1222, - 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, - 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, - 1239, 1240, 1241, 1242, 1163, 1194, 1194, 1163, - 1194, 1194, 1194, 1163, 1194, 1194, 1194, 1194, - 1163, 1194, 1163, 1194, 1194, 1163, 1194, 1194, - 1163, 1194, 1163, 1163, 1163, 1194, 1194, 1163, - 1194, 1194, 1163, 1194, 1194, 1163, 1194, 1163, - 1194, 1194, 1194, 1194, 1194, 1163, 1194, 1163, - 1194, 1194, 1163, 1163, 1163, 1194, 1194, 1194, - 1163, 1194, 1163, 1194, 1163, 1194, 1194, 1194, - 1194, 1194, 1163, 1194, 1194, 1163, 1243, 1244, - 1245, 1246, 1247, 1163, 1194, 1248, 1163, 1243, - 1244, 1249, 1245, 1246, 1247, 1163, 1194, 1163, - 1194, 1163, 1194, 1163, 1194, 1163, 1194, 1163, - 1250, 1251, 1163, 1194, 1163, 1194, 1163, 1252, - 1253, 1254, 1255, 1256, 1257, 1258, 1259, 1260, - 1261, 1262, 1263, 1264, 1265, 1266, 1163, 1194, - 1194, 1163, 1194, 1163, 1194, 1163, 1194, 1194, - 1194, 1194, 1163, 1194, 1194, 1163, 1163, 1163, - 1194, 1194, 1163, 1194, 1163, 1194, 1194, 1163, - 1163, 1163, 1194, 1194, 1163, 1194, 1194, 1194, - 1163, 1194, 1194, 1194, 1194, 1163, 1194, 1194, - 1194, 1163, 1194, 1194, 1163, 1267, 1268, 1253, - 1163, 1194, 1163, 1194, 1194, 1163, 1269, 1270, - 1271, 1272, 1273, 1274, 1275, 1163, 1276, 1277, - 1278, 1279, 1280, 1163, 1194, 1163, 1194, 1163, - 1194, 1163, 1194, 1194, 1194, 1194, 1194, 1163, - 1194, 1163, 1281, 1282, 1283, 1284, 1285, 1286, - 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, - 1295, 1296, 1297, 1294, 1298, 1299, 1300, 1301, - 1302, 1163, 1194, 1194, 1163, 1163, 1194, 1163, - 1163, 1194, 1194, 1194, 1163, 1194, 1163, 1194, - 1194, 1163, 1163, 1163, 1194, 1194, 1194, 1163, - 1194, 1163, 1194, 1194, 1194, 1163, 1194, 1194, - 1194, 1194, 1194, 1194, 1194, 1163, 1194, 1163, - 1194, 1163, 1194, 1163, 1163, 1194, 1194, 1194, - 1163, 1163, 1163, 1194, 1163, 1194, 1194, 1163, - 1194, 1163, 1194, 1194, 1163, 1194, 1194, 1163, - 1303, 1304, 1305, 1306, 1163, 1194, 1163, 1194, - 1163, 1194, 1163, 1194, 1163, 1307, 1163, 1194, - 1163, 1308, 1309, 1310, 1311, 1312, 1313, 1163, - 1194, 1194, 1194, 1163, 1163, 1163, 1163, 1194, - 1194, 1163, 1194, 1194, 1163, 1163, 1163, 1194, - 1194, 1194, 1194, 1163, 1314, 1315, 1316, 1163, - 1194, 1194, 1194, 1194, 1194, 1163, 1194, 1163, - 1194, 1163, 1317, 1318, 1319, 1163, 1162, 1163, - 1194, 1163, 1194, 1163, 1320, 1163, 1321, 1322, - 1323, 1325, 1324, 1163, 1194, 1163, 1163, 1194, - 1194, 1269, 1270, 1271, 1272, 1273, 1274, 1163, - 1162, 1163, 1162, 1162, 1163, 1162, 1163, 1194, - 1162, 1162, 1162, 1194, 1194, 1163, 1162, 1162, - 1162, 1163, 1163, 1163, 1162, 1163, 1194, 1194, - 1162, 1162, 1194, 1163, 1162, 1162, 1162, 1163, - 1162, 1163, 1162, 1163, 1162, 1163, 1194, 1163, - 1163, 1162, 1162, 1163, 1162, 1163, 1194, 1162, - 1162, 1194, 1162, 1163, 1194, 1162, 1162, 1194, - 1194, 1162, 1162, 1163, 1162, 1162, 1194, 1163, - 1162, 1162, 1162, 1194, 1194, 1194, 1163, 1162, - 1194, 1162, 1163, 1163, 1163, 1194, 1163, 1163, - 1163, 1162, 1162, 1162, 1194, 1162, 1194, 1163, - 1162, 1162, 1194, 1194, 1194, 1162, 1162, 1162, - 1163, 1162, 1162, 1194, 1194, 1163, 1163, 1163, - 1162, 1162, 1162, 1163, 1162, 1163, 1194, 1162, - 1162, 1162, 1162, 1194, 1162, 1194, 1194, 1163, - 1162, 1194, 1162, 1163, 1162, 1163, 1162, 1194, - 1162, 1162, 1163, 1162, 1163, 1162, 1162, 1162, - 1162, 1194, 1163, 1194, 1162, 1163, 1162, 1162, - 1162, 1162, 1163, 1162, 1163, 1326, 1327, 1328, - 1329, 1330, 1331, 1332, 1333, 1334, 1335, 1336, - 1337, 1338, 1339, 1340, 1341, 1342, 1343, 1344, - 1345, 1346, 1163, 1194, 1162, 1162, 1194, 1162, - 1163, 1194, 1162, 1162, 1162, 1163, 1162, 1194, - 1162, 1162, 1162, 1163, 1162, 1163, 1162, 1162, - 1163, 1162, 1162, 1163, 1194, 1162, 1194, 1163, - 1162, 1162, 1162, 1163, 1194, 1162, 1163, 1162, - 1162, 1163, 1162, 1162, 1194, 1162, 1194, 1194, - 1162, 1163, 1162, 1162, 1194, 1163, 1162, 1162, - 1162, 1162, 1194, 1162, 1162, 1194, 1162, 1163, - 1162, 1163, 1194, 1194, 1194, 1162, 1162, 1194, - 1163, 1162, 1163, 1162, 1163, 1194, 1194, 1194, - 1194, 1162, 1162, 1194, 1162, 1163, 1194, 1162, - 1162, 1194, 1162, 1194, 1163, 1194, 1162, 1194, - 1162, 1163, 1194, 1162, 1162, 1162, 1162, 1194, - 1162, 1163, 1162, 1162, 1163, 1347, 1348, 1349, - 1350, 1351, 1163, 1162, 1248, 1163, 1162, 1163, - 1162, 1163, 1162, 1163, 1162, 1163, 1352, 1353, - 1163, 1162, 1163, 1162, 1163, 1354, 1355, 1356, - 1357, 1256, 1358, 1359, 1360, 1361, 1362, 1363, - 1364, 1365, 1366, 1367, 1163, 1162, 1162, 1163, - 1162, 1163, 1162, 1163, 1162, 1162, 1162, 1194, - 1194, 1162, 1163, 1162, 1163, 1162, 1163, 1194, - 1162, 1163, 1162, 1194, 1163, 1194, 1162, 1162, - 1162, 1194, 1162, 1194, 1163, 1162, 1163, 1194, - 1162, 1194, 1162, 1194, 1162, 1163, 1162, 1162, - 1194, 1162, 1163, 1162, 1162, 1162, 1162, 1163, - 1162, 1194, 1194, 1162, 1162, 1194, 1163, 1162, - 1162, 1194, 1162, 1194, 1163, 1368, 1369, 1355, - 1163, 1162, 1163, 1162, 1162, 1163, 1370, 1371, - 1372, 1373, 1374, 1375, 1376, 1163, 1377, 1378, - 1379, 1380, 1381, 1163, 1162, 1163, 1162, 1163, - 1162, 1163, 1162, 1162, 1162, 1162, 1162, 1163, - 1162, 1163, 1382, 1383, 1384, 1385, 1386, 1387, - 1388, 1389, 1390, 1391, 1392, 1393, 1394, 1395, - 1396, 1397, 1398, 1399, 1400, 1401, 1402, 1403, - 1404, 1163, 1162, 1194, 1162, 1163, 1163, 1162, - 1194, 1163, 1194, 1194, 1163, 1162, 1194, 1162, - 1162, 1163, 1162, 1163, 1194, 1162, 1194, 1162, - 1194, 1163, 1163, 1162, 1163, 1194, 1162, 1162, - 1194, 1162, 1194, 1162, 1163, 1162, 1194, 1162, - 1163, 1162, 1162, 1194, 1162, 1194, 1163, 1162, - 1162, 1194, 1194, 1194, 1194, 1162, 1162, 1163, - 1194, 1162, 1163, 1194, 1194, 1162, 1163, 1162, - 1194, 1162, 1194, 1162, 1194, 1162, 1163, 1194, - 1163, 1162, 1162, 1194, 1194, 1162, 1194, 1162, - 1163, 1163, 1163, 1162, 1162, 1194, 1162, 1194, - 1162, 1163, 1163, 1162, 1194, 1194, 1162, 1194, - 1162, 1163, 1194, 1162, 1194, 1162, 1163, 1194, - 1194, 1162, 1162, 1163, 1194, 1194, 1194, 1162, - 1162, 1163, 1405, 1406, 1305, 1407, 1163, 1162, - 1163, 1162, 1163, 1162, 1163, 1408, 1163, 1162, - 1163, 1409, 1410, 1411, 1412, 1413, 1414, 1163, - 1194, 1194, 1162, 1162, 1162, 1163, 1163, 1163, - 1163, 1162, 1162, 1163, 1162, 1162, 1163, 1163, - 1163, 1162, 1162, 1162, 1162, 1163, 1415, 1416, - 1417, 1163, 1162, 1162, 1162, 1162, 1162, 1163, - 1162, 1163, 1162, 1163, 1418, 1163, 1194, 1163, - 1419, 1163, 1420, 1421, 1422, 1424, 1423, 1163, - 1162, 1163, 1163, 1162, 1162, 1162, 3, 1, - 3, 1162, 3, 1, 601, 1, 1425, 1427, - 1428, 1429, 1430, 1431, 1432, 1427, 1428, 1429, - 1430, 1431, 1432, 1427, 601, 1426, 890, 1, - 3, 610, 3, 1, 875, 875, 875, 877, - 1, 875, 875, 877, 875, 875, 877, 875, - 875, 875, 877, 875, 875, 877, 875, 875, - 877, 875, 875, 1, 877, 1429, 1430, 1431, - 1432, 1426, 1427, 1429, 1430, 1431, 1432, 1426, - 1427, 1429, 1430, 1431, 1432, 1426, 1427, 1429, - 1430, 1431, 1432, 1426, 1427, 1429, 1430, 1431, - 1432, 1426, 1427, 1429, 1430, 1431, 1432, 1426, - 1427, 1429, 1430, 1431, 1432, 1426, 1427, 1429, - 1430, 1431, 1432, 1426, 1427, 1429, 1430, 1431, - 1432, 1426, 1427, 1428, 890, 1430, 1431, 1432, - 1426, 1427, 1428, 1430, 1431, 1432, 1426, 1427, - 1428, 1430, 1431, 1432, 1426, 1427, 1428, 1430, - 1431, 1432, 1426, 1427, 1428, 1430, 1431, 1432, - 1426, 1427, 1428, 1430, 1431, 1432, 1426, 1427, - 1428, 1430, 1431, 1432, 1426, 1427, 1428, 1430, - 1431, 1432, 1426, 1427, 1428, 1430, 1431, 1432, - 1426, 1427, 1428, 1429, 890, 1431, 1432, 1426, - 1427, 1428, 1429, 1431, 1432, 1426, 1427, 1428, - 1429, 1431, 1432, 1426, 1427, 1428, 1429, 1431, - 1432, 1426, 1427, 1428, 1429, 1431, 1433, 1434, - 1435, 1437, 1430, 1436, 1, 890, 875, 3, - 875, 877, 3, 877, 3, 1, 875, 1, - 265, 265, 1, 265, 1438, 1439, 601, 1, - 265, 3, 1, 3, 3, 265, 3, 1, - 1441, 1442, 1443, 1444, 1440, 1, 1445, 1446, - 601, 1, 266, 3, 1, 3, 266, 3, - 1, 1447, 601, 1, 3, 265, 3, 1, - 1448, 601, 1, 3, 265, 3, 1, 1449, - 1450, 1451, 1452, 1453, 1454, 1455, 1456, 1457, - 1458, 1459, 601, 1, 3, 1460, 1, 1462, - 1461, 1461, 1462, 1462, 1461, 1462, 1462, 1461, - 1462, 1462, 1462, 1461, 1462, 1461, 1462, 1462, - 1461, 1462, 1462, 1462, 1462, 1461, 1462, 1462, - 1461, 1461, 1462, 1462, 1461, 1462, 1461, 1463, - 1464, 1465, 1466, 1467, 1469, 1470, 1471, 1473, - 1474, 1475, 1476, 1477, 1478, 1479, 1480, 1481, - 1482, 1483, 1484, 1485, 1486, 1487, 1488, 1489, - 1490, 1468, 1472, 1461, 1462, 1462, 1462, 1462, - 1461, 1462, 1461, 1462, 1462, 1461, 1461, 1461, - 1462, 1461, 1461, 1461, 1462, 1462, 1462, 1462, - 1461, 1461, 1461, 1461, 1461, 1461, 1462, 1461, - 1461, 1461, 1461, 1461, 1461, 1462, 1461, 1461, - 1461, 1461, 1462, 1462, 1462, 1462, 1461, 1462, - 1462, 1462, 1462, 1462, 1461, 1462, 1462, 1461, - 1462, 1462, 1462, 1462, 1461, 1462, 1462, 1461, - 1461, 1461, 1461, 1461, 1461, 1462, 1462, 1462, - 1462, 1462, 1462, 1461, 1462, 1462, 1461, 1461, - 1461, 1461, 1461, 1461, 1462, 1462, 1461, 1462, - 1462, 1462, 1462, 1462, 1461, 1462, 1462, 1461, - 1462, 1461, 1462, 1462, 1462, 1461, 1462, 1461, - 1462, 1462, 1462, 1462, 1462, 1461, 1462, 1461, - 1462, 1462, 1462, 1462, 1461, 1462, 1461, 1491, - 1492, 1493, 1494, 1495, 1496, 1497, 1498, 1499, - 1500, 1501, 1502, 1503, 1504, 1505, 1506, 1507, - 1508, 1509, 1510, 1511, 1461, 1462, 1462, 1461, - 1462, 1462, 1462, 1461, 1462, 1462, 1462, 1462, - 1461, 1462, 1461, 1462, 1462, 1461, 1462, 1462, - 1461, 1462, 1461, 1461, 1461, 1462, 1462, 1461, - 1462, 1462, 1461, 1462, 1462, 1461, 1462, 1461, - 1462, 1462, 1462, 1462, 1462, 1461, 1462, 1461, - 1462, 1462, 1461, 1461, 1461, 1462, 1462, 1462, - 1461, 1462, 1461, 1462, 1461, 1462, 1462, 1462, - 1462, 1462, 1461, 1462, 1462, 1461, 1512, 1513, - 1514, 1515, 1516, 1461, 1462, 1517, 1461, 1512, - 1513, 1518, 1514, 1515, 1516, 1461, 1462, 1461, - 1462, 1461, 1462, 1461, 1462, 1461, 1462, 1461, - 1519, 1520, 1461, 1462, 1461, 1462, 1461, 1521, - 1522, 1523, 1524, 1525, 1526, 1527, 1528, 1529, - 1530, 1531, 1532, 1533, 1534, 1535, 1461, 1462, - 1462, 1461, 1462, 1461, 1462, 1461, 1462, 1462, - 1462, 1462, 1461, 1462, 1462, 1461, 1461, 1461, - 1462, 1462, 1461, 1462, 1461, 1462, 1462, 1461, - 1461, 1461, 1462, 1462, 1461, 1462, 1462, 1462, - 1461, 1462, 1462, 1462, 1462, 1461, 1462, 1462, - 1462, 1461, 1462, 1462, 1461, 1536, 1537, 1522, - 1461, 1462, 1461, 1462, 1462, 1461, 1538, 1539, - 1540, 1541, 1542, 1543, 1544, 1461, 1545, 1546, - 1547, 1548, 1549, 1461, 1462, 1461, 1462, 1461, - 1462, 1461, 1462, 1462, 1462, 1462, 1462, 1461, - 1462, 1461, 1550, 1551, 1552, 1553, 1554, 1555, - 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, - 1564, 1565, 1566, 1563, 1567, 1568, 1569, 1570, - 1571, 1461, 1462, 1462, 1461, 1461, 1462, 1461, - 1461, 1462, 1462, 1462, 1461, 1462, 1461, 1462, - 1462, 1461, 1461, 1461, 1462, 1462, 1462, 1461, - 1462, 1461, 1462, 1462, 1462, 1461, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1461, 1462, 1461, - 1462, 1461, 1462, 1461, 1461, 1462, 1462, 1462, - 1461, 1461, 1461, 1462, 1461, 1462, 1462, 1461, - 1462, 1461, 1462, 1462, 1461, 1462, 1462, 1461, - 1572, 1573, 1574, 1575, 1461, 1462, 1461, 1462, - 1461, 1462, 1461, 1462, 1461, 1576, 1461, 1462, - 1461, 1577, 1578, 1579, 1580, 1581, 1582, 1461, - 1462, 1462, 1462, 1461, 1461, 1461, 1461, 1462, - 1462, 1461, 1462, 1462, 1461, 1461, 1461, 1462, - 1462, 1462, 1462, 1461, 1583, 1584, 1585, 1461, - 1462, 1462, 1462, 1462, 1462, 1461, 1462, 1461, - 1462, 1461, 1586, 1587, 1588, 1461, 1589, 1461, - 1589, 1461, 1461, 1589, 1589, 1461, 1589, 1589, - 1461, 1589, 1589, 1589, 1461, 1589, 1461, 1589, - 1589, 1461, 1589, 1589, 1589, 1589, 1461, 1589, - 1589, 1461, 1461, 1589, 1589, 1461, 1589, 1461, - 1590, 1591, 1592, 1593, 1594, 1595, 1596, 1598, - 1599, 1600, 1601, 1602, 1603, 1604, 1605, 1606, - 1607, 1608, 1609, 1481, 1610, 1611, 1612, 1613, - 1614, 1615, 1616, 1617, 1618, 1597, 1461, 1589, - 1589, 1589, 1589, 1461, 1589, 1461, 1589, 1589, - 1461, 1462, 1462, 1461, 1461, 1462, 1589, 1589, - 1461, 1589, 1589, 1461, 1589, 1461, 1462, 1589, - 1589, 1589, 1462, 1462, 1461, 1589, 1589, 1589, - 1461, 1461, 1461, 1589, 1461, 1462, 1462, 1589, - 1589, 1462, 1461, 1589, 1589, 1589, 1461, 1589, - 1461, 1589, 1461, 1589, 1461, 1462, 1461, 1461, - 1589, 1589, 1461, 1589, 1461, 1462, 1589, 1589, - 1462, 1589, 1461, 1462, 1589, 1589, 1462, 1462, - 1589, 1589, 1461, 1589, 1589, 1462, 1461, 1589, - 1589, 1589, 1462, 1462, 1462, 1461, 1589, 1462, - 1589, 1461, 1461, 1461, 1462, 1461, 1461, 1461, - 1589, 1589, 1589, 1462, 1589, 1462, 1461, 1589, - 1589, 1462, 1462, 1462, 1589, 1589, 1589, 1461, - 1589, 1589, 1462, 1462, 1461, 1461, 1461, 1589, - 1589, 1589, 1461, 1589, 1461, 1462, 1589, 1589, - 1589, 1589, 1462, 1589, 1462, 1462, 1461, 1589, - 1462, 1589, 1461, 1589, 1461, 1589, 1462, 1589, - 1589, 1461, 1589, 1461, 1589, 1589, 1589, 1589, - 1462, 1461, 1462, 1589, 1461, 1589, 1589, 1589, - 1589, 1461, 1589, 1461, 1619, 1620, 1621, 1622, - 1623, 1624, 1625, 1626, 1627, 1628, 1629, 1630, - 1631, 1632, 1633, 1634, 1635, 1636, 1637, 1638, - 1639, 1461, 1462, 1589, 1589, 1462, 1589, 1461, - 1462, 1589, 1589, 1589, 1461, 1589, 1462, 1589, - 1589, 1589, 1461, 1589, 1461, 1589, 1589, 1461, - 1589, 1589, 1461, 1462, 1589, 1462, 1461, 1589, - 1589, 1589, 1461, 1462, 1589, 1461, 1589, 1589, - 1461, 1589, 1589, 1462, 1589, 1462, 1462, 1589, - 1461, 1589, 1589, 1462, 1461, 1589, 1589, 1589, - 1589, 1462, 1589, 1589, 1462, 1589, 1461, 1589, - 1461, 1462, 1462, 1462, 1589, 1589, 1462, 1461, - 1589, 1461, 1589, 1461, 1462, 1462, 1462, 1462, - 1589, 1589, 1462, 1589, 1461, 1462, 1589, 1589, - 1462, 1589, 1462, 1461, 1462, 1589, 1462, 1589, - 1461, 1462, 1589, 1589, 1589, 1589, 1462, 1589, - 1461, 1589, 1589, 1461, 1640, 1641, 1642, 1643, - 1644, 1461, 1589, 1517, 1461, 1589, 1461, 1589, - 1461, 1589, 1461, 1589, 1461, 1645, 1646, 1461, - 1589, 1461, 1589, 1461, 1647, 1648, 1649, 1650, - 1525, 1651, 1652, 1653, 1654, 1655, 1656, 1657, - 1658, 1659, 1660, 1461, 1589, 1589, 1461, 1589, - 1461, 1589, 1461, 1589, 1589, 1589, 1462, 1462, - 1589, 1461, 1589, 1461, 1589, 1461, 1462, 1589, - 1461, 1589, 1462, 1461, 1462, 1589, 1589, 1589, - 1462, 1589, 1462, 1461, 1589, 1461, 1462, 1589, - 1462, 1589, 1462, 1589, 1461, 1589, 1589, 1462, - 1589, 1461, 1589, 1589, 1589, 1589, 1461, 1589, - 1462, 1462, 1589, 1589, 1462, 1461, 1589, 1589, - 1462, 1589, 1462, 1461, 1661, 1662, 1648, 1461, - 1589, 1461, 1589, 1589, 1461, 1663, 1664, 1665, - 1666, 1667, 1668, 1669, 1461, 1670, 1671, 1672, - 1673, 1674, 1461, 1589, 1461, 1589, 1461, 1589, - 1461, 1589, 1589, 1589, 1589, 1589, 1461, 1589, - 1461, 1675, 1676, 1677, 1678, 1679, 1680, 1681, - 1682, 1683, 1684, 1685, 1686, 1687, 1688, 1689, - 1690, 1691, 1692, 1693, 1694, 1695, 1696, 1697, - 1461, 1589, 1462, 1589, 1461, 1461, 1589, 1462, - 1461, 1462, 1462, 1461, 1589, 1462, 1589, 1589, - 1461, 1589, 1461, 1462, 1589, 1462, 1589, 1462, - 1461, 1461, 1589, 1461, 1462, 1589, 1589, 1462, - 1589, 1462, 1589, 1461, 1589, 1462, 1589, 1461, - 1589, 1589, 1462, 1589, 1462, 1461, 1589, 1589, - 1462, 1462, 1462, 1462, 1589, 1589, 1461, 1462, - 1589, 1461, 1462, 1462, 1589, 1461, 1589, 1462, - 1589, 1462, 1589, 1462, 1589, 1461, 1462, 1461, - 1589, 1589, 1462, 1462, 1589, 1462, 1589, 1461, - 1461, 1461, 1589, 1589, 1462, 1589, 1462, 1589, - 1461, 1461, 1589, 1462, 1462, 1589, 1462, 1589, - 1461, 1462, 1589, 1462, 1589, 1461, 1462, 1462, - 1589, 1589, 1461, 1462, 1462, 1462, 1589, 1589, - 1461, 1698, 1699, 1574, 1700, 1461, 1589, 1461, - 1589, 1461, 1589, 1461, 1701, 1461, 1589, 1461, - 1702, 1703, 1704, 1705, 1706, 1707, 1461, 1462, - 1462, 1589, 1589, 1589, 1461, 1461, 1461, 1461, - 1589, 1589, 1461, 1589, 1589, 1461, 1461, 1461, - 1589, 1589, 1589, 1589, 1461, 1708, 1709, 1710, - 1461, 1589, 1589, 1589, 1589, 1589, 1461, 1589, - 1461, 1589, 1461, 1711, 1461, 1462, 1461, 1712, - 1461, 1713, 1714, 1715, 1717, 1716, 1461, 1589, - 1461, 1461, 1589, 1589, 1462, 1461, 1462, 1461, - 1718, 1461, 1719, 1720, 1721, 1723, 1722, 1461, - 1462, 1461, 1461, 1462, 1462, 1538, 1539, 1540, - 1541, 1542, 1543, 1461, 1538, 1539, 1540, 1541, - 1542, 1543, 1724, 1461, 1725, 1461, 1462, 1461, - 1162, 3, 1, 3, 1162, 3, 1162, 3, - 1, 1162, 1162, 3, 1162, 3, 1162, 3, - 1162, 3, 1162, 3, 1, 3, 3, 1162, - 1162, 3, 1, 1162, 1162, 3, 1, 1162, - 3, 1162, 3, 1, 3, 1162, 3, 1162, - 3, 1, 1162, 3, 1162, 3, 1, 1162, - 3, 1, 1162, 1162, 3, 3, 1162, 3, - 1162, 3, 1162, 1, 1440, 1, 1726, 1440, - 1, 1727, 1435, 1437, 1728, 1437, 601, 1436, - 1, 265, 3, 1, 3, 265, 1, 1, - 1730, 1729, 1733, 1734, 1735, 1736, 1737, 1738, - 1739, 1741, 1742, 1743, 1744, 1745, 1746, 1748, - 1729, 1, 1732, 1740, 1747, 1, 1731, 262, - 264, 1750, 1751, 1752, 1753, 1754, 1755, 1756, - 1757, 1758, 1759, 1760, 1761, 1762, 1763, 1764, - 1765, 1766, 1767, 1749, 262, 264, 1750, 1751, - 1752, 1753, 1754, 1755, 1756, 1757, 1758, 1759, - 1760, 1761, 1768, 1763, 1764, 1765, 1769, 1767, - 1749, 256, 258, 1770, 1771, 1772, 1773, 1774, - 1775, 1776, 1777, 1778, 1779, 1780, 1781, 1782, - 1783, 1784, 1785, 1786, 1787, 1749, 1789, 1790, - 1791, 1792, 1793, 1794, 1795, 1796, 1797, 1798, - 1799, 1800, 1801, 1803, 268, 530, 576, 1802, - 1788, 527, 529, 1804, 1805, 1806, 1807, 1808, - 1809, 1810, 1811, 1812, 1813, 1814, 1815, 1816, - 1817, 1818, 1819, 1820, 1821, 1788, 527, 529, - 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, - 1812, 1813, 1814, 1815, 1822, 1817, 1818, 1819, - 1823, 1821, 1788, 521, 523, 1824, 1825, 1826, - 1827, 1828, 1829, 1830, 1831, 1832, 1833, 1834, - 1835, 1836, 1837, 1838, 1839, 1840, 1841, 1788, - 527, 529, 1804, 1805, 1806, 1807, 1808, 1809, - 1810, 1811, 1812, 1813, 1814, 1842, 1816, 1817, - 1843, 1844, 1845, 1846, 1819, 1820, 1821, 1788, - 527, 529, 1804, 1805, 1806, 1807, 1808, 1809, - 1810, 1811, 1812, 1813, 1814, 1847, 1816, 1817, - 1818, 1848, 1819, 1820, 1821, 1788, 527, 529, - 1804, 1805, 1806, 1807, 1808, 1809, 1810, 1811, - 1812, 1813, 1814, 1849, 1816, 1817, 1818, 1850, - 1819, 1820, 1821, 1788, 527, 529, 1804, 1805, - 1806, 1807, 1808, 1809, 1810, 1811, 1812, 1813, - 1814, 1851, 1816, 1817, 1818, 1852, 1819, 1820, - 1821, 1788, 527, 529, 1804, 1805, 1806, 1807, - 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1815, - 1816, 1817, 1818, 1819, 1853, 1821, 1788, 871, - 873, 1855, 1856, 1857, 1858, 1859, 1860, 1861, - 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, - 1870, 1871, 1872, 1873, 1874, 1875, 1854, 871, - 873, 1855, 1856, 1857, 1858, 1859, 1860, 1861, - 1862, 1863, 1864, 1865, 1876, 1867, 1868, 1877, - 1873, 1874, 1875, 1854, 871, 873, 1855, 1856, - 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, - 1865, 1876, 1878, 1868, 1877, 1873, 1879, 1875, - 1854, 865, 867, 1880, 1881, 1882, 1883, 1884, - 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, - 1893, 1894, 1895, 1896, 1897, 1854, 871, 873, - 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, - 1863, 1864, 1865, 1898, 1867, 1868, 1877, 1899, - 1873, 1874, 1875, 1854, 871, 873, 1855, 1856, - 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, - 1865, 1900, 1867, 1868, 1877, 1901, 1873, 1874, - 1875, 1854, 871, 873, 1855, 1856, 1857, 1858, - 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1902, - 1867, 1868, 1877, 1903, 1873, 1874, 1875, 1854, - 1025, 1027, 1905, 1906, 1907, 1908, 1909, 1910, - 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, - 1919, 1920, 1921, 1922, 1904, 1025, 1027, 1905, - 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, - 1914, 1915, 1916, 1923, 1918, 1919, 1920, 1924, - 1922, 1904, 1159, 1161, 1925, 1926, 1927, 1928, - 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, - 1937, 1938, 1939, 1940, 1941, 1942, 1904, 1422, - 1424, 1944, 1945, 1946, 1947, 1948, 1949, 1950, - 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, - 1959, 1960, 1961, 1943, 1323, 1325, 1962, 1963, - 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, - 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, - 1943, 1323, 1325, 1962, 1963, 1964, 1965, 1966, - 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1980, - 1975, 1976, 1977, 1981, 1979, 1943, 1721, 1723, - 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, - 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 1982, 1721, 1723, 1983, 1984, 1985, - 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, - 1994, 1995, 1996, 1997, 1998, 2001, 2000, 1982, - 1721, 1723, 1983, 1984, 1985, 1986, 1987, 1988, - 1989, 1990, 1991, 1992, 1993, 1994, 2002, 1996, - 1997, 1998, 2003, 2000, 1982, 1715, 1717, 2004, - 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, - 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, - 2021, 1982, -} - -var _graphclust_trans_targs []int16 = []int16{ - 1974, 0, 1974, 1975, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, - 44, 45, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 56, 57, 58, 59, - 60, 61, 62, 63, 64, 66, 68, 70, - 71, 72, 1976, 69, 74, 75, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 93, 94, 96, - 102, 125, 130, 132, 139, 143, 97, 98, - 99, 100, 101, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, - 124, 126, 127, 128, 129, 131, 133, 134, - 135, 136, 137, 138, 140, 141, 142, 144, - 291, 292, 1977, 158, 159, 160, 161, 162, - 163, 164, 165, 166, 167, 168, 169, 170, - 171, 172, 173, 174, 175, 176, 177, 178, - 179, 180, 181, 182, 183, 184, 185, 186, - 188, 189, 190, 191, 192, 193, 194, 195, - 196, 197, 198, 199, 200, 201, 202, 203, - 204, 205, 206, 207, 208, 210, 211, 212, - 213, 214, 216, 217, 219, 220, 221, 222, - 223, 224, 225, 226, 227, 228, 229, 230, - 231, 232, 234, 235, 237, 243, 267, 271, - 273, 280, 284, 238, 239, 240, 241, 242, - 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 257, 258, 259, - 260, 261, 262, 263, 264, 265, 266, 268, - 269, 270, 272, 274, 275, 276, 277, 278, - 279, 281, 282, 283, 285, 287, 288, 289, - 145, 290, 146, 294, 295, 296, 2, 297, - 3, 1974, 1978, 1974, 1979, 315, 316, 317, - 318, 319, 320, 321, 322, 323, 324, 325, - 326, 327, 328, 329, 330, 331, 332, 333, - 334, 335, 336, 337, 338, 339, 340, 341, - 342, 344, 345, 346, 347, 348, 349, 350, - 351, 352, 353, 354, 355, 356, 357, 358, - 359, 360, 361, 362, 363, 364, 366, 368, - 370, 371, 372, 1980, 369, 374, 375, 377, - 378, 379, 380, 381, 382, 383, 384, 385, - 386, 387, 388, 389, 390, 391, 393, 394, - 396, 402, 425, 430, 432, 439, 443, 397, - 398, 399, 400, 401, 403, 404, 405, 406, - 407, 408, 409, 410, 411, 412, 413, 414, - 415, 416, 417, 418, 419, 420, 421, 422, - 423, 424, 426, 427, 428, 429, 431, 433, - 434, 435, 436, 437, 438, 440, 441, 442, - 444, 591, 592, 1981, 458, 459, 460, 461, - 462, 463, 464, 465, 466, 467, 468, 469, - 470, 471, 472, 473, 474, 475, 476, 477, - 478, 479, 480, 481, 482, 483, 484, 485, - 486, 488, 489, 490, 491, 492, 493, 494, - 495, 496, 497, 498, 499, 500, 501, 502, - 503, 504, 505, 506, 507, 508, 510, 511, - 512, 513, 514, 516, 517, 519, 520, 521, - 522, 523, 524, 525, 526, 527, 528, 529, - 530, 531, 532, 534, 535, 537, 543, 567, - 571, 573, 580, 584, 538, 539, 540, 541, - 542, 544, 545, 546, 547, 548, 549, 550, - 551, 552, 553, 554, 555, 556, 557, 558, - 559, 560, 561, 562, 563, 564, 565, 566, - 568, 569, 570, 572, 574, 575, 576, 577, - 578, 579, 581, 582, 583, 585, 587, 588, - 589, 445, 590, 446, 594, 595, 596, 302, - 597, 303, 599, 605, 606, 608, 610, 613, - 616, 640, 1982, 622, 1983, 612, 1984, 615, - 618, 620, 621, 624, 625, 629, 630, 631, - 632, 633, 634, 635, 1985, 628, 639, 642, - 643, 644, 645, 646, 649, 650, 651, 652, - 653, 654, 655, 656, 660, 661, 663, 664, - 647, 666, 669, 671, 673, 667, 668, 670, - 672, 674, 678, 679, 680, 681, 682, 683, - 684, 685, 686, 687, 1986, 676, 677, 690, - 691, 299, 695, 696, 698, 997, 1000, 1003, - 1027, 1974, 1987, 1974, 1988, 712, 713, 714, - 715, 716, 717, 718, 719, 720, 721, 722, - 723, 724, 725, 726, 727, 728, 729, 730, - 731, 732, 733, 734, 735, 736, 737, 738, - 739, 741, 742, 743, 744, 745, 746, 747, - 748, 749, 750, 751, 752, 753, 754, 755, - 756, 757, 758, 759, 760, 761, 763, 765, - 767, 768, 769, 1989, 766, 771, 772, 774, - 775, 776, 777, 778, 779, 780, 781, 782, - 783, 784, 785, 786, 787, 788, 790, 791, - 793, 799, 822, 827, 829, 836, 840, 794, - 795, 796, 797, 798, 800, 801, 802, 803, - 804, 805, 806, 807, 808, 809, 810, 811, - 812, 813, 814, 815, 816, 817, 818, 819, - 820, 821, 823, 824, 825, 826, 828, 830, - 831, 832, 833, 834, 835, 837, 838, 839, - 841, 988, 989, 1990, 855, 856, 857, 858, - 859, 860, 861, 862, 863, 864, 865, 866, - 867, 868, 869, 870, 871, 872, 873, 874, - 875, 876, 877, 878, 879, 880, 881, 882, - 883, 885, 886, 887, 888, 889, 890, 891, - 892, 893, 894, 895, 896, 897, 898, 899, - 900, 901, 902, 903, 904, 905, 907, 908, - 909, 910, 911, 913, 914, 916, 917, 918, - 919, 920, 921, 922, 923, 924, 925, 926, - 927, 928, 929, 931, 932, 934, 940, 964, - 968, 970, 977, 981, 935, 936, 937, 938, - 939, 941, 942, 943, 944, 945, 946, 947, - 948, 949, 950, 951, 952, 953, 954, 955, - 956, 957, 958, 959, 960, 961, 962, 963, - 965, 966, 967, 969, 971, 972, 973, 974, - 975, 976, 978, 979, 980, 982, 984, 985, - 986, 842, 987, 843, 991, 992, 993, 699, - 994, 700, 1009, 1991, 999, 1992, 1002, 1005, - 1007, 1008, 1011, 1012, 1016, 1017, 1018, 1019, - 1020, 1021, 1022, 1993, 1015, 1026, 1029, 1327, - 1328, 1626, 1627, 1994, 1974, 1995, 1043, 1044, - 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, - 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, - 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, - 1069, 1070, 1072, 1073, 1074, 1075, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, - 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1094, - 1095, 1096, 1097, 1098, 1100, 1101, 1103, 1104, - 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, - 1113, 1114, 1115, 1116, 1117, 1119, 1120, 1122, - 1128, 1151, 1156, 1158, 1165, 1123, 1124, 1125, - 1126, 1127, 1129, 1130, 1131, 1132, 1133, 1134, - 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, - 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, - 1152, 1153, 1154, 1155, 1157, 1159, 1160, 1161, - 1162, 1163, 1164, 1166, 1167, 1168, 1170, 1171, - 1172, 1030, 1173, 1031, 1175, 1177, 1178, 1325, - 1326, 1996, 1192, 1193, 1194, 1195, 1196, 1197, - 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, - 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, - 1214, 1215, 1216, 1217, 1218, 1219, 1220, 1222, - 1223, 1224, 1225, 1226, 1227, 1228, 1229, 1230, - 1231, 1232, 1233, 1234, 1235, 1236, 1237, 1238, - 1239, 1240, 1241, 1242, 1244, 1245, 1246, 1247, - 1248, 1250, 1251, 1253, 1254, 1255, 1256, 1257, - 1258, 1259, 1260, 1261, 1262, 1263, 1264, 1265, - 1266, 1268, 1269, 1271, 1277, 1301, 1305, 1307, - 1314, 1318, 1272, 1273, 1274, 1275, 1276, 1278, - 1279, 1280, 1281, 1282, 1283, 1284, 1285, 1286, - 1287, 1288, 1289, 1290, 1291, 1292, 1293, 1294, - 1295, 1296, 1297, 1298, 1299, 1300, 1302, 1303, - 1304, 1306, 1308, 1309, 1310, 1311, 1312, 1313, - 1315, 1316, 1317, 1319, 1321, 1322, 1323, 1179, - 1324, 1180, 1997, 1974, 1342, 1343, 1344, 1345, - 1497, 1498, 1499, 1500, 1501, 1502, 1503, 1504, - 1505, 1506, 1507, 1508, 1509, 1510, 1511, 1512, - 1377, 1513, 1514, 1515, 1516, 1517, 1518, 1519, - 1520, 1521, 1998, 1359, 1360, 1361, 1362, 1363, - 1364, 1365, 1366, 1367, 1368, 1369, 1370, 1371, - 1372, 1373, 1374, 1375, 1376, 1378, 1379, 1380, - 1381, 1382, 1383, 1384, 1385, 1386, 1388, 1389, - 1390, 1391, 1392, 1393, 1394, 1395, 1396, 1397, - 1398, 1399, 1400, 1401, 1402, 1403, 1404, 1405, - 1406, 1407, 1408, 1410, 1412, 1414, 1415, 1416, - 1999, 1413, 1418, 1419, 1421, 1422, 1423, 1424, - 1425, 1426, 1427, 1428, 1429, 1430, 1431, 1432, - 1433, 1434, 1435, 1437, 1438, 1440, 1446, 1469, - 1474, 1476, 1483, 1487, 1441, 1442, 1443, 1444, - 1445, 1447, 1448, 1449, 1450, 1451, 1452, 1453, - 1454, 1455, 1456, 1457, 1458, 1459, 1460, 1461, - 1462, 1463, 1464, 1465, 1466, 1467, 1468, 1470, - 1471, 1472, 1473, 1475, 1477, 1478, 1479, 1480, - 1481, 1482, 1484, 1485, 1486, 1488, 1489, 1490, - 1492, 1493, 1494, 1346, 1495, 1347, 1523, 1524, - 1525, 1526, 1527, 1528, 1529, 1530, 1531, 1532, - 1533, 1534, 1535, 1536, 1537, 1538, 1539, 1540, - 1541, 1542, 1543, 1545, 1546, 1547, 1548, 1549, - 1551, 1552, 1554, 1555, 1556, 1557, 1558, 1559, - 1560, 1561, 1562, 1563, 1564, 1565, 1566, 1567, - 1569, 1570, 1572, 1578, 1602, 1606, 1608, 1615, - 1619, 1573, 1574, 1575, 1576, 1577, 1579, 1580, - 1581, 1582, 1583, 1584, 1585, 1586, 1587, 1588, - 1589, 1590, 1591, 1592, 1593, 1594, 1595, 1596, - 1597, 1598, 1599, 1600, 1601, 1603, 1604, 1605, - 1607, 1609, 1610, 1611, 1612, 1613, 1614, 1616, - 1617, 1618, 1620, 1622, 1623, 1624, 1329, 1625, - 1330, 1630, 1631, 1632, 1633, 1634, 1635, 1636, - 1637, 1641, 1642, 1643, 1644, 1645, 1647, 1648, - 1628, 1650, 1653, 1655, 1657, 1651, 1652, 1654, - 1656, 1658, 1959, 1960, 1961, 1962, 1963, 1964, - 1965, 1966, 1967, 1968, 2000, 1974, 2001, 1672, - 1673, 1674, 1675, 1676, 1677, 1678, 1679, 1680, - 1681, 1682, 1683, 1684, 1685, 1686, 1687, 1688, - 1689, 1690, 1691, 1692, 1693, 1694, 1695, 1696, - 1697, 1698, 1699, 1701, 1702, 1703, 1704, 1705, - 1706, 1707, 1708, 1709, 1710, 1711, 1712, 1713, - 1714, 1715, 1716, 1717, 1718, 1719, 1720, 1721, - 1723, 1725, 1727, 1728, 1729, 2002, 1726, 1731, - 1732, 1734, 1735, 1736, 1737, 1738, 1739, 1740, - 1741, 1742, 1743, 1744, 1745, 1746, 1747, 1748, - 1750, 1751, 1753, 1759, 1782, 1787, 1789, 1796, - 1800, 1754, 1755, 1756, 1757, 1758, 1760, 1761, - 1762, 1763, 1764, 1765, 1766, 1767, 1768, 1769, - 1770, 1771, 1772, 1773, 1774, 1775, 1776, 1777, - 1778, 1779, 1780, 1781, 1783, 1784, 1785, 1786, - 1788, 1790, 1791, 1792, 1793, 1794, 1795, 1797, - 1798, 1799, 1801, 1948, 1949, 2003, 1815, 1816, - 1817, 1818, 1819, 1820, 1821, 1822, 1823, 1824, - 1825, 1826, 1827, 1828, 1829, 1830, 1831, 1832, - 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1840, - 1841, 1842, 1843, 1845, 1846, 1847, 1848, 1849, - 1850, 1851, 1852, 1853, 1854, 1855, 1856, 1857, - 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, - 1867, 1868, 1869, 1870, 1871, 1873, 1874, 1876, - 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, - 1885, 1886, 1887, 1888, 1889, 1891, 1892, 1894, - 1900, 1924, 1928, 1930, 1937, 1941, 1895, 1896, - 1897, 1898, 1899, 1901, 1902, 1903, 1904, 1905, - 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, - 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, - 1922, 1923, 1925, 1926, 1927, 1929, 1931, 1932, - 1933, 1934, 1935, 1936, 1938, 1939, 1940, 1942, - 1944, 1945, 1946, 1802, 1947, 1803, 1951, 1952, - 1953, 1659, 1954, 1660, 1957, 1958, 1971, 1972, - 1973, 1974, 1, 1975, 299, 300, 301, 692, - 693, 694, 697, 1028, 1628, 1629, 1638, 1639, - 1640, 1646, 1649, 1969, 1970, 1974, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, - 14, 43, 65, 73, 76, 92, 298, 293, - 67, 95, 147, 148, 149, 150, 151, 152, - 153, 154, 155, 156, 157, 187, 209, 215, - 218, 233, 236, 286, 1974, 600, 601, 602, - 603, 604, 607, 641, 648, 657, 658, 659, - 662, 665, 688, 689, 304, 305, 306, 307, - 308, 309, 310, 311, 312, 313, 314, 343, - 365, 373, 376, 392, 598, 593, 367, 395, - 447, 448, 449, 450, 451, 452, 453, 454, - 455, 456, 457, 487, 509, 515, 518, 533, - 536, 586, 609, 623, 636, 637, 638, 611, - 619, 614, 617, 626, 627, 675, 1974, 701, - 702, 703, 704, 705, 706, 707, 708, 709, - 710, 711, 996, 762, 770, 1010, 1023, 1024, - 1025, 789, 995, 990, 740, 773, 764, 792, - 844, 845, 846, 847, 848, 849, 850, 851, - 852, 853, 854, 884, 906, 912, 915, 930, - 933, 983, 998, 1006, 1001, 1004, 1013, 1014, - 1974, 1032, 1033, 1034, 1035, 1036, 1037, 1038, - 1039, 1040, 1041, 1042, 1071, 1174, 1099, 1102, - 1118, 1176, 1169, 1093, 1121, 1181, 1182, 1183, - 1184, 1185, 1186, 1187, 1188, 1189, 1190, 1191, - 1221, 1243, 1249, 1252, 1267, 1270, 1320, 1974, - 1331, 1332, 1333, 1334, 1335, 1336, 1337, 1338, - 1339, 1340, 1341, 1522, 1544, 1550, 1553, 1568, - 1571, 1621, 1348, 1349, 1350, 1351, 1352, 1353, - 1354, 1355, 1356, 1357, 1358, 1387, 1409, 1417, - 1420, 1436, 1496, 1491, 1411, 1439, 1974, 1661, - 1662, 1663, 1664, 1665, 1666, 1667, 1668, 1669, - 1670, 1671, 1700, 1722, 1730, 1733, 1749, 1956, - 1950, 1955, 1724, 1752, 1804, 1805, 1806, 1807, - 1808, 1809, 1810, 1811, 1812, 1813, 1814, 1844, - 1866, 1872, 1875, 1890, 1893, 1943, -} - -var _graphclust_trans_actions []byte = []byte{ - 31, 0, 27, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 34, 40, 25, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 40, 0, 40, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 51, 17, 40, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 51, 0, 51, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 40, 0, 0, 0, 0, - 0, 0, 0, 40, 21, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 40, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 19, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 40, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 40, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 40, 23, 40, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 40, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 43, 1, 47, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 15, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 13, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 5, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 9, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 7, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, -} - -var _graphclust_to_state_actions []byte = []byte{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 37, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -} - -var _graphclust_from_state_actions []byte = []byte{ - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -} - -var _graphclust_eof_trans []int16 = []int16{ - 0, 0, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 0, 0, 0, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 268, 268, 268, 268, - 268, 268, 268, 268, 0, 0, 0, 0, - 0, 0, 610, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 610, 612, 612, - 610, 612, 612, 610, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 612, 612, - 612, 612, 612, 612, 612, 612, 610, 612, - 612, 612, 612, 0, 0, 0, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 0, - 0, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 1164, 1164, 1164, 1164, 1164, 1164, - 1164, 1164, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 1462, - 1462, 1462, 1462, 1462, 1462, 1462, 1462, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 1750, - 1750, 1750, 1789, 1789, 1789, 1789, 1789, 1789, - 1789, 1789, 1789, 1855, 1855, 1855, 1855, 1855, - 1855, 1855, 1905, 1905, 1905, 1944, 1944, 1944, - 1983, 1983, 1983, 1983, -} - -const graphclust_start int = 1974 -const graphclust_first_final int = 1974 -const graphclust_error int = 0 - -const graphclust_en_main int = 1974 - - -// line 14 "grapheme_clusters.rl" - - -var Error = errors.New("invalid UTF8 text") - -// ScanGraphemeClusters is a split function for bufio.Scanner that splits -// on grapheme cluster boundaries. -func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { - if len(data) == 0 { - return 0, nil, nil - } - - // Ragel state - cs := 0 // Current State - p := 0 // "Pointer" into data - pe := len(data) // End-of-data "pointer" - ts := 0 - te := 0 - act := 0 - eof := pe - - // Make Go compiler happy - _ = ts - _ = te - _ = act - _ = eof - - startPos := 0 - endPos := 0 - - -// line 4976 "grapheme_clusters.go" - { - cs = graphclust_start - ts = 0 - te = 0 - act = 0 - } - -// line 4984 "grapheme_clusters.go" - { - var _klen int - var _trans int - var _acts int - var _nacts uint - var _keys int - if p == pe { - goto _test_eof - } - if cs == 0 { - goto _out - } -_resume: - _acts = int(_graphclust_from_state_actions[cs]) - _nacts = uint(_graphclust_actions[_acts]); _acts++ - for ; _nacts > 0; _nacts-- { - _acts++ - switch _graphclust_actions[_acts - 1] { - case 4: -// line 1 "NONE" - -ts = p - -// line 5008 "grapheme_clusters.go" - } - } - - _keys = int(_graphclust_key_offsets[cs]) - _trans = int(_graphclust_index_offsets[cs]) - - _klen = int(_graphclust_single_lengths[cs]) - if _klen > 0 { - _lower := int(_keys) - var _mid int - _upper := int(_keys + _klen - 1) - for { - if _upper < _lower { - break - } - - _mid = _lower + ((_upper - _lower) >> 1) - switch { - case data[p] < _graphclust_trans_keys[_mid]: - _upper = _mid - 1 - case data[p] > _graphclust_trans_keys[_mid]: - _lower = _mid + 1 - default: - _trans += int(_mid - int(_keys)) - goto _match - } - } - _keys += _klen - _trans += _klen - } - - _klen = int(_graphclust_range_lengths[cs]) - if _klen > 0 { - _lower := int(_keys) - var _mid int - _upper := int(_keys + (_klen << 1) - 2) - for { - if _upper < _lower { - break - } - - _mid = _lower + (((_upper - _lower) >> 1) & ^1) - switch { - case data[p] < _graphclust_trans_keys[_mid]: - _upper = _mid - 2 - case data[p] > _graphclust_trans_keys[_mid + 1]: - _lower = _mid + 2 - default: - _trans += int((_mid - int(_keys)) >> 1) - goto _match - } - } - _trans += _klen - } - -_match: - _trans = int(_graphclust_indicies[_trans]) -_eof_trans: - cs = int(_graphclust_trans_targs[_trans]) - - if _graphclust_trans_actions[_trans] == 0 { - goto _again - } - - _acts = int(_graphclust_trans_actions[_trans]) - _nacts = uint(_graphclust_actions[_acts]); _acts++ - for ; _nacts > 0; _nacts-- { - _acts++ - switch _graphclust_actions[_acts-1] { - case 0: -// line 46 "grapheme_clusters.rl" - - - startPos = p - - case 1: -// line 50 "grapheme_clusters.rl" - - - endPos = p - - case 5: -// line 1 "NONE" - -te = p+1 - - case 6: -// line 54 "grapheme_clusters.rl" - -act = 3; - case 7: -// line 54 "grapheme_clusters.rl" - -te = p+1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 8: -// line 54 "grapheme_clusters.rl" - -te = p+1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 9: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 10: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 11: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 12: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 13: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 14: -// line 54 "grapheme_clusters.rl" - -te = p -p-- -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 15: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 16: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 17: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 18: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 19: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 20: -// line 54 "grapheme_clusters.rl" - -p = (te) - 1 -{ - return endPos+1, data[startPos:endPos+1], nil - } - case 21: -// line 1 "NONE" - - switch act { - case 0: - {cs = 0 -goto _again -} - case 3: - {p = (te) - 1 - - return endPos+1, data[startPos:endPos+1], nil - } - } - -// line 5218 "grapheme_clusters.go" - } - } - -_again: - _acts = int(_graphclust_to_state_actions[cs]) - _nacts = uint(_graphclust_actions[_acts]); _acts++ - for ; _nacts > 0; _nacts-- { - _acts++ - switch _graphclust_actions[_acts-1] { - case 2: -// line 1 "NONE" - -ts = 0 - - case 3: -// line 1 "NONE" - -act = 0 - -// line 5238 "grapheme_clusters.go" - } - } - - if cs == 0 { - goto _out - } - p++ - if p != pe { - goto _resume - } - _test_eof: {} - if p == eof { - if _graphclust_eof_trans[cs] > 0 { - _trans = int(_graphclust_eof_trans[cs] - 1) - goto _eof_trans - } - } - - _out: {} - } - -// line 116 "grapheme_clusters.rl" - - - // If we fall out here then we were unable to complete a sequence. - // If we weren't able to complete a sequence then either we've - // reached the end of a partial buffer (so there's more data to come) - // or we have an isolated symbol that would normally be part of a - // grapheme cluster but has appeared in isolation here. - - if !atEOF { - // Request more - return 0, nil, nil - } - - // Just take the first UTF-8 sequence and return that. - _, seqLen := utf8.DecodeRune(data) - return seqLen, data[:seqLen], nil -} diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/LICENSE b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/LICENSE similarity index 100% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/LICENSE rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/LICENSE diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/all_tokens.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/all_tokens.go similarity index 100% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/all_tokens.go rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/all_tokens.go diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/emoji_table.rl b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/emoji_table.rl new file mode 100644 index 00000000000..1c0749c9cb5 --- /dev/null +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/emoji_table.rl @@ -0,0 +1,290 @@ +# The following Ragel file was autogenerated with unicode2ragel.rb +# from: https://www.unicode.org/Public/emoji/12.0/emoji-data.txt +# +# It defines ["Extended_Pictographic"]. +# +# To use this, make sure that your alphtype is set to byte, +# and that your input is in utf8. + +%%{ + machine Emoji; + + Extended_Pictographic = + 0xC2 0xA9 #1.1 [1] (©️) copyright + | 0xC2 0xAE #1.1 [1] (®️) registered + | 0xE2 0x80 0xBC #1.1 [1] (‼️) double exclamation mark + | 0xE2 0x81 0x89 #3.0 [1] (⁉️) exclamation question mark + | 0xE2 0x84 0xA2 #1.1 [1] (™️) trade mark + | 0xE2 0x84 0xB9 #3.0 [1] (ℹ️) information + | 0xE2 0x86 0x94..0x99 #1.1 [6] (↔️..↙️) left-right arrow..down... + | 0xE2 0x86 0xA9..0xAA #1.1 [2] (↩️..↪️) right arrow curving le... + | 0xE2 0x8C 0x9A..0x9B #1.1 [2] (⌚..⌛) watch..hourglass done + | 0xE2 0x8C 0xA8 #1.1 [1] (⌨️) keyboard + | 0xE2 0x8E 0x88 #3.0 [1] (⎈) HELM SYMBOL + | 0xE2 0x8F 0x8F #4.0 [1] (⏏️) eject button + | 0xE2 0x8F 0xA9..0xB3 #6.0 [11] (⏩..⏳) fast-forward button..hou... + | 0xE2 0x8F 0xB8..0xBA #7.0 [3] (⏸️..⏺️) pause button..record b... + | 0xE2 0x93 0x82 #1.1 [1] (Ⓜ️) circled M + | 0xE2 0x96 0xAA..0xAB #1.1 [2] (▪️..▫️) black small square..wh... + | 0xE2 0x96 0xB6 #1.1 [1] (▶️) play button + | 0xE2 0x97 0x80 #1.1 [1] (◀️) reverse button + | 0xE2 0x97 0xBB..0xBE #3.2 [4] (◻️..◾) white medium square..bl... + | 0xE2 0x98 0x80..0x85 #1.1 [6] (☀️..★) sun..BLACK STAR + | 0xE2 0x98 0x87..0x92 #1.1 [12] (☇..☒) LIGHTNING..BALLOT BOX WI... + | 0xE2 0x98 0x94..0x95 #4.0 [2] (☔..☕) umbrella with rain drops... + | 0xE2 0x98 0x96..0x97 #3.2 [2] (☖..☗) WHITE SHOGI PIECE..BLACK... + | 0xE2 0x98 0x98 #4.1 [1] (☘️) shamrock + | 0xE2 0x98 0x99 #3.0 [1] (☙) REVERSED ROTATED FLORAL ... + | 0xE2 0x98 0x9A..0xFF #1.1 [86] (☚..♯) BLACK LEFT POINTING INDE... + | 0xE2 0x99 0x00..0xAF # + | 0xE2 0x99 0xB0..0xB1 #3.0 [2] (♰..♱) WEST SYRIAC CROSS..EAST ... + | 0xE2 0x99 0xB2..0xBD #3.2 [12] (♲..♽) UNIVERSAL RECYCLING SYMB... + | 0xE2 0x99 0xBE..0xBF #4.1 [2] (♾️..♿) infinity..wheelchair sy... + | 0xE2 0x9A 0x80..0x85 #3.2 [6] (⚀..⚅) DIE FACE-1..DIE FACE-6 + | 0xE2 0x9A 0x90..0x91 #4.0 [2] (⚐..⚑) WHITE FLAG..BLACK FLAG + | 0xE2 0x9A 0x92..0x9C #4.1 [11] (⚒️..⚜️) hammer and pick..fleur... + | 0xE2 0x9A 0x9D #5.1 [1] (⚝) OUTLINED WHITE STAR + | 0xE2 0x9A 0x9E..0x9F #5.2 [2] (⚞..⚟) THREE LINES CONVERGING R... + | 0xE2 0x9A 0xA0..0xA1 #4.0 [2] (⚠️..⚡) warning..high voltage + | 0xE2 0x9A 0xA2..0xB1 #4.1 [16] (⚢..⚱️) DOUBLED FEMALE SIGN..fu... + | 0xE2 0x9A 0xB2 #5.0 [1] (⚲) NEUTER + | 0xE2 0x9A 0xB3..0xBC #5.1 [10] (⚳..⚼) CERES..SESQUIQUADRATE + | 0xE2 0x9A 0xBD..0xBF #5.2 [3] (⚽..⚿) soccer ball..SQUARED KEY + | 0xE2 0x9B 0x80..0x83 #5.1 [4] (⛀..⛃) WHITE DRAUGHTS MAN..BLAC... + | 0xE2 0x9B 0x84..0x8D #5.2 [10] (⛄..⛍) snowman without snow..DI... + | 0xE2 0x9B 0x8E #6.0 [1] (⛎) Ophiuchus + | 0xE2 0x9B 0x8F..0xA1 #5.2 [19] (⛏️..⛡) pick..RESTRICTED LEFT E... + | 0xE2 0x9B 0xA2 #6.0 [1] (⛢) ASTRONOMICAL SYMBOL FOR ... + | 0xE2 0x9B 0xA3 #5.2 [1] (⛣) HEAVY CIRCLE WITH STROKE... + | 0xE2 0x9B 0xA4..0xA7 #6.0 [4] (⛤..⛧) PENTAGRAM..INVERTED PENT... + | 0xE2 0x9B 0xA8..0xBF #5.2 [24] (⛨..⛿) BLACK CROSS ON SHIELD..W... + | 0xE2 0x9C 0x80 #7.0 [1] (✀) BLACK SAFETY SCISSORS + | 0xE2 0x9C 0x81..0x84 #1.1 [4] (✁..✄) UPPER BLADE SCISSORS..WH... + | 0xE2 0x9C 0x85 #6.0 [1] (✅) check mark button + | 0xE2 0x9C 0x88..0x89 #1.1 [2] (✈️..✉️) airplane..envelope + | 0xE2 0x9C 0x8A..0x8B #6.0 [2] (✊..✋) raised fist..raised hand + | 0xE2 0x9C 0x8C..0x92 #1.1 [7] (✌️..✒️) victory hand..black nib + | 0xE2 0x9C 0x94 #1.1 [1] (✔️) check mark + | 0xE2 0x9C 0x96 #1.1 [1] (✖️) multiplication sign + | 0xE2 0x9C 0x9D #1.1 [1] (✝️) latin cross + | 0xE2 0x9C 0xA1 #1.1 [1] (✡️) star of David + | 0xE2 0x9C 0xA8 #6.0 [1] (✨) sparkles + | 0xE2 0x9C 0xB3..0xB4 #1.1 [2] (✳️..✴️) eight-spoked asterisk.... + | 0xE2 0x9D 0x84 #1.1 [1] (❄️) snowflake + | 0xE2 0x9D 0x87 #1.1 [1] (❇️) sparkle + | 0xE2 0x9D 0x8C #6.0 [1] (❌) cross mark + | 0xE2 0x9D 0x8E #6.0 [1] (❎) cross mark button + | 0xE2 0x9D 0x93..0x95 #6.0 [3] (❓..❕) question mark..white exc... + | 0xE2 0x9D 0x97 #5.2 [1] (❗) exclamation mark + | 0xE2 0x9D 0xA3..0xA7 #1.1 [5] (❣️..❧) heart exclamation..ROTA... + | 0xE2 0x9E 0x95..0x97 #6.0 [3] (➕..➗) plus sign..division sign + | 0xE2 0x9E 0xA1 #1.1 [1] (➡️) right arrow + | 0xE2 0x9E 0xB0 #6.0 [1] (➰) curly loop + | 0xE2 0x9E 0xBF #6.0 [1] (➿) double curly loop + | 0xE2 0xA4 0xB4..0xB5 #3.2 [2] (⤴️..⤵️) right arrow curving up... + | 0xE2 0xAC 0x85..0x87 #4.0 [3] (⬅️..⬇️) left arrow..down arrow + | 0xE2 0xAC 0x9B..0x9C #5.1 [2] (⬛..⬜) black large square..whit... + | 0xE2 0xAD 0x90 #5.1 [1] (⭐) star + | 0xE2 0xAD 0x95 #5.2 [1] (⭕) hollow red circle + | 0xE3 0x80 0xB0 #1.1 [1] (〰️) wavy dash + | 0xE3 0x80 0xBD #3.2 [1] (〽️) part alternation mark + | 0xE3 0x8A 0x97 #1.1 [1] (㊗️) Japanese “congratulatio... + | 0xE3 0x8A 0x99 #1.1 [1] (㊙️) Japanese “secret” button + | 0xF0 0x9F 0x80 0x80..0xAB #5.1 [44] (🀀..🀫) MAHJONG TILE EAST WIN... + | 0xF0 0x9F 0x80 0xAC..0xAF #NA [4] (🀬..🀯) ...... + | 0xF0 0x9F 0x83 0x81..0x8F #6.0 [15] (🃁..🃏) PLAYING CARD ACE OF D... + | 0xF0 0x9F 0x83 0x90 #NA [1] (🃐) + | 0xF0 0x9F 0x83 0x91..0x9F #6.0 [15] (🃑..🃟) PLAYING CARD ACE OF C... + | 0xF0 0x9F 0x83 0xA0..0xB5 #7.0 [22] (🃠..🃵) PLAYING CARD FOOL..PL... + | 0xF0 0x9F 0x83 0xB6..0xBF #NA [10] (🃶..🃿) ................... + | 0xF0 0x9F 0x8A..0x8A 0x00..0xFF # + | 0xF0 0x9F 0x8B 0x00..0xBF # + | 0xF0 0x9F 0x8C 0x80..0xA0 #6.0 [33] (🌀..🌠) cyclone..shooting star + | 0xF0 0x9F 0x8C 0xA1..0xAC #7.0 [12] (🌡️..🌬️) thermometer..wind face + | 0xF0 0x9F 0x8C 0xAD..0xAF #8.0 [3] (🌭..🌯) hot dog..burrito + | 0xF0 0x9F 0x8C 0xB0..0xB5 #6.0 [6] (🌰..🌵) chestnut..cactus + | 0xF0 0x9F 0x8C 0xB6 #7.0 [1] (🌶️) hot pepper + | 0xF0 0x9F 0x8C 0xB7..0xFF #6.0 [70] (🌷..🍼) tulip..baby bottle + | 0xF0 0x9F 0x8D 0x00..0xBC # + | 0xF0 0x9F 0x8D 0xBD #7.0 [1] (🍽️) fork and knife with plate + | 0xF0 0x9F 0x8D 0xBE..0xBF #8.0 [2] (🍾..🍿) bottle with popping c... + | 0xF0 0x9F 0x8E 0x80..0x93 #6.0 [20] (🎀..🎓) ribbon..graduation cap + | 0xF0 0x9F 0x8E 0x94..0x9F #7.0 [12] (🎔..🎟️) HEART WITH TIP ON TH... + | 0xF0 0x9F 0x8E 0xA0..0xFF #6.0 [37] (🎠..🏄) carousel horse..perso... + | 0xF0 0x9F 0x8F 0x00..0x84 # + | 0xF0 0x9F 0x8F 0x85 #7.0 [1] (🏅) sports medal + | 0xF0 0x9F 0x8F 0x86..0x8A #6.0 [5] (🏆..🏊) trophy..person swimming + | 0xF0 0x9F 0x8F 0x8B..0x8E #7.0 [4] (🏋️..🏎️) person lifting weig... + | 0xF0 0x9F 0x8F 0x8F..0x93 #8.0 [5] (🏏..🏓) cricket game..ping pong + | 0xF0 0x9F 0x8F 0x94..0x9F #7.0 [12] (🏔️..🏟️) snow-capped mountai... + | 0xF0 0x9F 0x8F 0xA0..0xB0 #6.0 [17] (🏠..🏰) house..castle + | 0xF0 0x9F 0x8F 0xB1..0xB7 #7.0 [7] (🏱..🏷️) WHITE PENNANT..label + | 0xF0 0x9F 0x8F 0xB8..0xBA #8.0 [3] (🏸..🏺) badminton..amphora + | 0xF0 0x9F 0x90 0x80..0xBE #6.0 [63] (🐀..🐾) rat..paw prints + | 0xF0 0x9F 0x90 0xBF #7.0 [1] (🐿️) chipmunk + | 0xF0 0x9F 0x91 0x80 #6.0 [1] (👀) eyes + | 0xF0 0x9F 0x91 0x81 #7.0 [1] (👁️) eye + | 0xF0 0x9F 0x91 0x82..0xFF #6.0[182] (👂..📷) ear..camera + | 0xF0 0x9F 0x92..0x92 0x00..0xFF # + | 0xF0 0x9F 0x93 0x00..0xB7 # + | 0xF0 0x9F 0x93 0xB8 #7.0 [1] (📸) camera with flash + | 0xF0 0x9F 0x93 0xB9..0xBC #6.0 [4] (📹..📼) video camera..videoca... + | 0xF0 0x9F 0x93 0xBD..0xBE #7.0 [2] (📽️..📾) film projector..PORT... + | 0xF0 0x9F 0x93 0xBF #8.0 [1] (📿) prayer beads + | 0xF0 0x9F 0x94 0x80..0xBD #6.0 [62] (🔀..🔽) shuffle tracks button... + | 0xF0 0x9F 0x95 0x86..0x8A #7.0 [5] (🕆..🕊️) WHITE LATIN CROSS..dove + | 0xF0 0x9F 0x95 0x8B..0x8F #8.0 [5] (🕋..🕏) kaaba..BOWL OF HYGIEIA + | 0xF0 0x9F 0x95 0x90..0xA7 #6.0 [24] (🕐..🕧) one o’clock..twelve-t... + | 0xF0 0x9F 0x95 0xA8..0xB9 #7.0 [18] (🕨..🕹️) RIGHT SPEAKER..joystick + | 0xF0 0x9F 0x95 0xBA #9.0 [1] (🕺) man dancing + | 0xF0 0x9F 0x95 0xBB..0xFF #7.0 [41] (🕻..🖣) LEFT HAND TELEPHONE R... + | 0xF0 0x9F 0x96 0x00..0xA3 # + | 0xF0 0x9F 0x96 0xA4 #9.0 [1] (🖤) black heart + | 0xF0 0x9F 0x96 0xA5..0xFF #7.0 [86] (🖥️..🗺️) desktop computer..w... + | 0xF0 0x9F 0x97 0x00..0xBA # + | 0xF0 0x9F 0x97 0xBB..0xBF #6.0 [5] (🗻..🗿) mount fuji..moai + | 0xF0 0x9F 0x98 0x80 #6.1 [1] (😀) grinning face + | 0xF0 0x9F 0x98 0x81..0x90 #6.0 [16] (😁..😐) beaming face with smi... + | 0xF0 0x9F 0x98 0x91 #6.1 [1] (😑) expressionless face + | 0xF0 0x9F 0x98 0x92..0x94 #6.0 [3] (😒..😔) unamused face..pensiv... + | 0xF0 0x9F 0x98 0x95 #6.1 [1] (😕) confused face + | 0xF0 0x9F 0x98 0x96 #6.0 [1] (😖) confounded face + | 0xF0 0x9F 0x98 0x97 #6.1 [1] (😗) kissing face + | 0xF0 0x9F 0x98 0x98 #6.0 [1] (😘) face blowing a kiss + | 0xF0 0x9F 0x98 0x99 #6.1 [1] (😙) kissing face with smilin... + | 0xF0 0x9F 0x98 0x9A #6.0 [1] (😚) kissing face with closed... + | 0xF0 0x9F 0x98 0x9B #6.1 [1] (😛) face with tongue + | 0xF0 0x9F 0x98 0x9C..0x9E #6.0 [3] (😜..😞) winking face with ton... + | 0xF0 0x9F 0x98 0x9F #6.1 [1] (😟) worried face + | 0xF0 0x9F 0x98 0xA0..0xA5 #6.0 [6] (😠..😥) angry face..sad but r... + | 0xF0 0x9F 0x98 0xA6..0xA7 #6.1 [2] (😦..😧) frowning face with op... + | 0xF0 0x9F 0x98 0xA8..0xAB #6.0 [4] (😨..😫) fearful face..tired face + | 0xF0 0x9F 0x98 0xAC #6.1 [1] (😬) grimacing face + | 0xF0 0x9F 0x98 0xAD #6.0 [1] (😭) loudly crying face + | 0xF0 0x9F 0x98 0xAE..0xAF #6.1 [2] (😮..😯) face with open mouth.... + | 0xF0 0x9F 0x98 0xB0..0xB3 #6.0 [4] (😰..😳) anxious face with swe... + | 0xF0 0x9F 0x98 0xB4 #6.1 [1] (😴) sleeping face + | 0xF0 0x9F 0x98 0xB5..0xFF #6.0 [12] (😵..🙀) dizzy face..weary cat + | 0xF0 0x9F 0x99 0x00..0x80 # + | 0xF0 0x9F 0x99 0x81..0x82 #7.0 [2] (🙁..🙂) slightly frowning fac... + | 0xF0 0x9F 0x99 0x83..0x84 #8.0 [2] (🙃..🙄) upside-down face..fac... + | 0xF0 0x9F 0x99 0x85..0x8F #6.0 [11] (🙅..🙏) person gesturing NO..... + | 0xF0 0x9F 0x9A 0x80..0xFF #6.0 [70] (🚀..🛅) rocket..left luggage + | 0xF0 0x9F 0x9B 0x00..0x85 # + | 0xF0 0x9F 0x9B 0x86..0x8F #7.0 [10] (🛆..🛏️) TRIANGLE WITH ROUNDE... + | 0xF0 0x9F 0x9B 0x90 #8.0 [1] (🛐) place of worship + | 0xF0 0x9F 0x9B 0x91..0x92 #9.0 [2] (🛑..🛒) stop sign..shopping cart + | 0xF0 0x9F 0x9B 0x93..0x94 #10.0 [2] (🛓..🛔) STUPA..PAGODA + | 0xF0 0x9F 0x9B 0x95 #12.0 [1] (🛕) hindu temple + | 0xF0 0x9F 0x9B 0x96..0x9F #NA [10] (🛖..🛟) ...................... + | 0xF0 0x9F 0xA4 0x8D..0x8F #12.0 [3] (🤍..🤏) white heart..pinchin... + | 0xF0 0x9F 0xA4 0x90..0x98 #8.0 [9] (🤐..🤘) zipper-mouth face..si... + | 0xF0 0x9F 0xA4 0x99..0x9E #9.0 [6] (🤙..🤞) call me hand..crossed... + | 0xF0 0x9F 0xA4 0x9F #10.0 [1] (🤟) love-you gesture + | 0xF0 0x9F 0xA4 0xA0..0xA7 #9.0 [8] (🤠..🤧) cowboy hat face..snee... + | 0xF0 0x9F 0xA4 0xA8..0xAF #10.0 [8] (🤨..🤯) face with raised eye... + | 0xF0 0x9F 0xA4 0xB0 #9.0 [1] (🤰) pregnant woman + | 0xF0 0x9F 0xA4 0xB1..0xB2 #10.0 [2] (🤱..🤲) breast-feeding..palm... + | 0xF0 0x9F 0xA4 0xB3..0xBA #9.0 [8] (🤳..🤺) selfie..person fencing + | 0xF0 0x9F 0xA4 0xBC..0xBE #9.0 [3] (🤼..🤾) people wrestling..per... + | 0xF0 0x9F 0xA4 0xBF #12.0 [1] (🤿) diving mask + | 0xF0 0x9F 0xA5 0x80..0x85 #9.0 [6] (🥀..🥅) wilted flower..goal net + | 0xF0 0x9F 0xA5 0x87..0x8B #9.0 [5] (🥇..🥋) 1st place medal..mart... + | 0xF0 0x9F 0xA5 0x8C #10.0 [1] (🥌) curling stone + | 0xF0 0x9F 0xA5 0x8D..0x8F #11.0 [3] (🥍..🥏) lacrosse..flying disc + | 0xF0 0x9F 0xA5 0x90..0x9E #9.0 [15] (🥐..🥞) croissant..pancakes + | 0xF0 0x9F 0xA5 0x9F..0xAB #10.0 [13] (🥟..🥫) dumpling..canned food + | 0xF0 0x9F 0xA5 0xAC..0xB0 #11.0 [5] (🥬..🥰) leafy green..smiling... + | 0xF0 0x9F 0xA5 0xB1 #12.0 [1] (🥱) yawning face + | 0xF0 0x9F 0xA5 0xB2 #NA [1] (🥲) + | 0xF0 0x9F 0xA5 0xB3..0xB6 #11.0 [4] (🥳..🥶) partying face..cold ... + | 0xF0 0x9F 0xA5 0xB7..0xB9 #NA [3] (🥷..🥹) ..................... + | 0xF0 0x9F 0xAB..0xBE 0x00..0xFF # + | 0xF0 0x9F 0xBF 0x00..0xBD # + ; + +}%% diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/generate.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/generate.go new file mode 100644 index 00000000000..9df1263484f --- /dev/null +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/generate.go @@ -0,0 +1,8 @@ +package textseg + +//go:generate go run make_tables.go -output tables.go +//go:generate go run make_test_tables.go -output tables_test.go +//go:generate ruby unicode2ragel.rb --url=https://www.unicode.org/Public/12.0.0/ucd/auxiliary/GraphemeBreakProperty.txt -m GraphemeCluster -p "Prepend,CR,LF,Control,Extend,Regional_Indicator,SpacingMark,L,V,T,LV,LVT,ZWJ" -o grapheme_clusters_table.rl +//go:generate ruby unicode2ragel.rb --url=https://www.unicode.org/Public/emoji/12.0/emoji-data.txt -m Emoji -p "Extended_Pictographic" -o emoji_table.rl +//go:generate ragel -Z grapheme_clusters.rl +//go:generate gofmt -w grapheme_clusters.go diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.go new file mode 100644 index 00000000000..c389827feda --- /dev/null +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.go @@ -0,0 +1,4078 @@ +//line grapheme_clusters.rl:1 +package textseg + +import ( + "errors" + "unicode/utf8" +) + +// Generated from grapheme_clusters.rl. DO NOT EDIT + +//line grapheme_clusters.go:13 +var _graphclust_actions []byte = []byte{ + 0, 1, 0, 1, 4, 1, 10, 1, 11, + 1, 12, 1, 13, 1, 14, 1, 15, + 1, 16, 1, 17, 1, 18, 1, 19, + 1, 20, 1, 21, 1, 22, 2, 1, + 8, 2, 1, 9, 2, 2, 3, 2, + 5, 1, 3, 0, 1, 9, 3, 5, + 0, 1, 3, 5, 1, 6, 3, 5, + 1, 7, +} + +var _graphclust_key_offsets []int16 = []int16{ + 0, 0, 1, 3, 5, 7, 10, 15, + 17, 20, 28, 31, 33, 35, 38, 68, + 76, 78, 82, 85, 90, 95, 107, 119, + 127, 132, 142, 145, 152, 156, 164, 174, + 180, 188, 190, 198, 201, 203, 206, 208, + 215, 217, 225, 226, 247, 251, 257, 262, + 264, 268, 272, 274, 278, 280, 283, 287, + 289, 296, 298, 302, 306, 310, 312, 314, + 322, 326, 331, 333, 335, 337, 338, 340, + 342, 344, 346, 361, 365, 367, 369, 374, + 378, 384, 386, 388, 392, 396, 398, 402, + 409, 414, 418, 421, 422, 426, 433, 440, + 441, 442, 444, 453, 455, 457, 459, 491, + 495, 497, 501, 505, 508, 512, 516, 519, + 521, 527, 540, 542, 545, 547, 549, 553, + 557, 559, 561, 563, 565, 570, 576, 579, + 581, 585, 589, 596, 599, 605, 607, 611, + 613, 615, 618, 622, 623, 625, 631, 637, + 643, 645, 649, 653, 658, 663, 673, 675, + 677, 679, 680, 682, 683, 689, 691, 693, + 693, 695, 702, 704, 706, 708, 711, 716, + 718, 721, 729, 732, 734, 736, 739, 769, + 777, 779, 783, 786, 791, 796, 808, 820, + 828, 833, 843, 846, 853, 857, 865, 875, + 881, 889, 891, 899, 902, 904, 907, 909, + 916, 918, 926, 927, 948, 952, 958, 963, + 965, 969, 973, 975, 979, 981, 984, 988, + 990, 997, 999, 1003, 1007, 1011, 1013, 1015, + 1023, 1027, 1032, 1034, 1036, 1060, 1063, 1064, + 1066, 1068, 1072, 1075, 1076, 1081, 1082, 1085, + 1088, 1094, 1096, 1100, 1102, 1113, 1122, 1127, + 1129, 1133, 1135, 1137, 1138, 1140, 1143, 1146, + 1148, 1150, 1165, 1169, 1171, 1173, 1178, 1182, + 1188, 1190, 1192, 1196, 1200, 1202, 1206, 1213, + 1218, 1222, 1225, 1226, 1230, 1237, 1244, 1245, + 1246, 1248, 1257, 1259, 1261, 1263, 1295, 1299, + 1301, 1305, 1309, 1312, 1316, 1320, 1323, 1325, + 1331, 1344, 1346, 1349, 1351, 1353, 1357, 1361, + 1363, 1365, 1367, 1369, 1374, 1380, 1383, 1385, + 1389, 1393, 1400, 1403, 1409, 1411, 1415, 1417, + 1419, 1422, 1426, 1427, 1429, 1435, 1441, 1447, + 1449, 1453, 1457, 1462, 1467, 1477, 1479, 1481, + 1483, 1523, 1523, 1526, 1530, 1535, 1537, 1545, + 1547, 1549, 1551, 1553, 1555, 1557, 1559, 1563, + 1567, 1571, 1575, 1577, 1578, 1584, 1586, 1588, + 1590, 1597, 1598, 1600, 1605, 1607, 1609, 1611, + 1614, 1619, 1621, 1624, 1632, 1635, 1637, 1639, + 1642, 1672, 1680, 1682, 1686, 1689, 1694, 1699, + 1711, 1723, 1731, 1736, 1746, 1749, 1756, 1760, + 1768, 1778, 1784, 1792, 1794, 1802, 1805, 1807, + 1810, 1812, 1819, 1821, 1829, 1830, 1851, 1855, + 1861, 1866, 1868, 1872, 1876, 1878, 1882, 1884, + 1887, 1891, 1893, 1900, 1902, 1906, 1910, 1914, + 1916, 1918, 1926, 1930, 1935, 1937, 1939, 1941, + 1942, 1944, 1946, 1948, 1950, 1965, 1969, 1971, + 1973, 1978, 1982, 1988, 1990, 1992, 1996, 2000, + 2002, 2006, 2013, 2018, 2022, 2025, 2026, 2030, + 2037, 2044, 2045, 2046, 2048, 2057, 2059, 2061, + 2063, 2095, 2099, 2101, 2105, 2109, 2112, 2116, + 2120, 2123, 2125, 2131, 2144, 2146, 2149, 2151, + 2153, 2157, 2161, 2163, 2165, 2167, 2169, 2174, + 2180, 2183, 2185, 2189, 2193, 2200, 2203, 2209, + 2211, 2215, 2217, 2219, 2222, 2226, 2227, 2229, + 2235, 2241, 2247, 2249, 2253, 2257, 2262, 2267, + 2277, 2279, 2281, 2283, 2284, 2286, 2287, 2293, + 2295, 2297, 2297, 2299, 2305, 2307, 2309, 2311, + 2314, 2319, 2321, 2324, 2332, 2335, 2337, 2339, + 2342, 2372, 2380, 2382, 2386, 2389, 2394, 2399, + 2411, 2423, 2431, 2436, 2446, 2449, 2456, 2460, + 2468, 2478, 2484, 2492, 2494, 2502, 2505, 2507, + 2510, 2512, 2519, 2521, 2529, 2530, 2551, 2555, + 2561, 2566, 2568, 2572, 2576, 2578, 2582, 2584, + 2587, 2591, 2593, 2600, 2602, 2606, 2610, 2614, + 2616, 2618, 2626, 2630, 2635, 2637, 2639, 2663, + 2666, 2667, 2669, 2671, 2675, 2678, 2679, 2684, + 2685, 2688, 2691, 2697, 2699, 2703, 2705, 2716, + 2725, 2730, 2732, 2736, 2738, 2740, 2741, 2743, + 2746, 2749, 2751, 2753, 2768, 2772, 2774, 2776, + 2781, 2785, 2791, 2793, 2795, 2799, 2803, 2805, + 2809, 2816, 2821, 2825, 2828, 2829, 2833, 2840, + 2847, 2848, 2849, 2851, 2860, 2862, 2864, 2866, + 2898, 2902, 2904, 2908, 2912, 2915, 2919, 2923, + 2926, 2928, 2934, 2947, 2949, 2952, 2954, 2956, + 2960, 2964, 2966, 2968, 2970, 2972, 2977, 2983, + 2986, 2988, 2992, 2996, 3003, 3006, 3012, 3014, + 3018, 3020, 3022, 3025, 3029, 3030, 3032, 3038, + 3044, 3050, 3052, 3056, 3060, 3065, 3070, 3080, + 3082, 3084, 3086, 3126, 3126, 3129, 3133, 3138, + 3140, 3148, 3150, 3152, 3154, 3156, 3158, 3160, + 3162, 3166, 3170, 3174, 3178, 3180, 3181, 3187, + 3189, 3191, 3193, 3200, 3201, 3203, 3209, 3212, + 3215, 3219, 3222, 3225, 3232, 3234, 3258, 3260, + 3284, 3286, 3288, 3311, 3313, 3315, 3316, 3318, + 3320, 3322, 3328, 3330, 3362, 3366, 3371, 3394, + 3396, 3398, 3400, 3402, 3405, 3407, 3409, 3413, + 3413, 3469, 3525, 3556, 3561, 3565, 3587, 3596, + 3601, 3605, 3615, 3622, 3625, 3636, 3639, 3646, + 3652, 3656, 3662, 3679, 3694, 3703, 3709, 3719, + 3723, 3727, 3731, 3735, 3737, 3757, 3763, 3768, + 3770, 3772, 3775, 3777, 3779, 3783, 3839, 3895, + 3928, 3933, 3941, 3945, 3947, 3952, 3959, 3967, + 3970, 3973, 3979, 3982, 3988, 3991, 3994, 3998, + 4001, 4005, 4008, 4012, 4054, 4061, 4069, 4078, + 4082, 4089, 4091, 4093, 4103, 4107, 4111, 4115, + 4119, 4123, 4127, 4131, 4137, 4147, 4155, 4160, + 4163, 4167, 4169, 4172, 4177, 4179, 4182, 4185, + 4189, 4192, 4195, 4202, 4204, 4206, 4208, 4210, + 4213, 4218, 4220, 4223, 4231, 4234, 4236, 4238, + 4241, 4271, 4279, 4281, 4285, 4288, 4293, 4298, + 4310, 4322, 4330, 4335, 4345, 4348, 4355, 4359, + 4367, 4377, 4383, 4391, 4393, 4401, 4404, 4406, + 4409, 4411, 4418, 4420, 4428, 4429, 4450, 4454, + 4460, 4465, 4467, 4471, 4475, 4477, 4481, 4483, + 4486, 4490, 4492, 4499, 4501, 4505, 4509, 4513, + 4515, 4517, 4525, 4529, 4534, 4536, 4538, 4562, + 4565, 4566, 4568, 4570, 4574, 4577, 4578, 4583, + 4584, 4587, 4590, 4596, 4598, 4602, 4604, 4615, + 4624, 4629, 4631, 4635, 4637, 4639, 4640, 4642, + 4645, 4648, 4650, 4652, 4667, 4671, 4673, 4675, + 4680, 4684, 4690, 4692, 4694, 4698, 4702, 4704, + 4708, 4715, 4720, 4724, 4727, 4728, 4732, 4739, + 4746, 4747, 4748, 4750, 4759, 4761, 4763, 4765, + 4797, 4801, 4803, 4807, 4811, 4814, 4818, 4822, + 4825, 4827, 4833, 4846, 4848, 4851, 4853, 4855, + 4859, 4863, 4865, 4867, 4869, 4871, 4876, 4882, + 4885, 4887, 4891, 4895, 4902, 4905, 4911, 4913, + 4917, 4919, 4921, 4924, 4928, 4929, 4931, 4937, + 4943, 4949, 4951, 4955, 4959, 4964, 4969, 4979, + 4981, 4983, 4985, 5025, 5025, 5028, 5032, 5037, + 5039, 5047, 5049, 5051, 5053, 5055, 5057, 5059, + 5061, 5065, 5069, 5073, 5077, 5079, 5080, 5086, + 5088, 5090, 5092, 5099, 5100, 5102, 5126, 5128, + 5152, 5154, 5156, 5179, 5181, 5183, 5184, 5186, + 5188, 5190, 5196, 5198, 5230, 5234, 5239, 5262, + 5264, 5266, 5268, 5270, 5273, 5275, 5277, 5281, + 5281, 5337, 5393, 5424, 5429, 5432, 5454, 5467, + 5469, 5471, 5473, 5476, 5481, 5483, 5486, 5494, + 5497, 5499, 5501, 5504, 5534, 5542, 5544, 5548, + 5551, 5556, 5561, 5573, 5585, 5593, 5598, 5608, + 5611, 5618, 5622, 5630, 5640, 5646, 5654, 5656, + 5664, 5667, 5669, 5672, 5674, 5681, 5683, 5691, + 5692, 5713, 5717, 5723, 5728, 5730, 5734, 5738, + 5740, 5744, 5746, 5749, 5753, 5755, 5762, 5764, + 5768, 5772, 5776, 5778, 5780, 5788, 5792, 5797, + 5799, 5801, 5803, 5804, 5806, 5808, 5810, 5812, + 5827, 5831, 5833, 5835, 5840, 5844, 5850, 5852, + 5854, 5858, 5862, 5864, 5868, 5875, 5880, 5884, + 5887, 5888, 5892, 5899, 5906, 5907, 5908, 5910, + 5919, 5921, 5923, 5925, 5957, 5961, 5963, 5967, + 5971, 5974, 5978, 5982, 5985, 5987, 5993, 6006, + 6008, 6011, 6013, 6015, 6019, 6023, 6025, 6027, + 6029, 6031, 6036, 6042, 6045, 6047, 6051, 6055, + 6062, 6065, 6071, 6073, 6077, 6079, 6081, 6084, + 6088, 6089, 6091, 6097, 6103, 6109, 6111, 6115, + 6119, 6124, 6129, 6139, 6141, 6143, 6145, 6146, + 6148, 6149, 6155, 6157, 6159, 6159, 6166, 6170, + 6180, 6187, 6190, 6201, 6204, 6211, 6217, 6221, + 6227, 6244, 6259, 6268, 6274, 6284, 6288, 6292, + 6296, 6300, 6302, 6322, 6328, 6333, 6335, 6337, + 6340, 6342, 6344, 6348, 6404, 6460, 6493, 6498, + 6506, 6510, 6513, 6520, 6527, 6535, 6538, 6541, + 6547, 6550, 6556, 6559, 6562, 6568, 6571, 6577, + 6580, 6586, 6628, 6635, 6643, 6652, 6656, 6658, + 6660, 6662, 6665, 6670, 6672, 6675, 6683, 6686, + 6688, 6690, 6693, 6723, 6731, 6733, 6737, 6740, + 6745, 6750, 6762, 6774, 6782, 6787, 6797, 6800, + 6807, 6811, 6819, 6829, 6835, 6843, 6845, 6853, + 6856, 6858, 6861, 6863, 6870, 6872, 6880, 6881, + 6902, 6906, 6912, 6917, 6919, 6923, 6927, 6929, + 6933, 6935, 6938, 6942, 6944, 6951, 6953, 6957, + 6961, 6965, 6967, 6969, 6977, 6981, 6986, 6988, + 6990, 7014, 7017, 7018, 7020, 7022, 7026, 7029, + 7030, 7035, 7036, 7039, 7042, 7048, 7050, 7054, + 7056, 7067, 7076, 7081, 7083, 7087, 7089, 7091, + 7092, 7094, 7097, 7100, 7102, 7104, 7119, 7123, + 7125, 7127, 7132, 7136, 7142, 7144, 7146, 7150, + 7154, 7156, 7160, 7167, 7172, 7176, 7179, 7180, + 7184, 7191, 7198, 7199, 7200, 7202, 7211, 7213, + 7215, 7217, 7249, 7253, 7255, 7259, 7263, 7266, + 7270, 7274, 7277, 7279, 7285, 7298, 7300, 7303, + 7305, 7307, 7311, 7315, 7317, 7319, 7321, 7323, + 7328, 7334, 7337, 7339, 7343, 7347, 7354, 7357, + 7363, 7365, 7369, 7371, 7373, 7376, 7380, 7381, + 7383, 7389, 7395, 7401, 7403, 7407, 7411, 7416, + 7421, 7431, 7433, 7435, 7437, 7477, 7477, 7480, + 7484, 7489, 7491, 7499, 7501, 7503, 7505, 7507, + 7509, 7511, 7513, 7517, 7521, 7525, 7529, 7531, + 7532, 7538, 7540, 7542, 7544, 7551, 7552, 7554, + 7561, 7563, 7565, 7575, 7579, 7583, 7587, 7591, + 7595, 7599, 7603, 7609, 7619, 7627, 7632, 7635, + 7639, 7641, 7644, 7653, 7657, 7659, 7661, 7665, + 7665, 7695, 7715, 7735, 7756, 7779, 7799, 7819, + 7840, 7863, 7884, 7905, 7926, 7946, 7969, 7989, + 8010, 8031, 8052, 8073, 8093, 8113, 8133, +} + +var _graphclust_trans_keys []byte = []byte{ + 10, 0, 127, 176, 255, 131, 137, 191, + 145, 189, 135, 129, 130, 132, 133, 144, + 154, 176, 139, 159, 150, 156, 159, 164, + 167, 168, 170, 173, 145, 176, 255, 139, + 255, 166, 176, 189, 171, 179, 160, 161, + 163, 164, 165, 167, 169, 171, 173, 174, + 175, 176, 177, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 166, 170, 172, 178, 150, 153, 155, 163, + 165, 167, 169, 173, 153, 155, 147, 161, + 163, 255, 189, 132, 185, 144, 152, 161, + 164, 255, 188, 129, 131, 190, 255, 133, + 134, 137, 138, 142, 150, 152, 161, 164, + 189, 191, 255, 131, 134, 137, 138, 142, + 144, 146, 175, 178, 180, 182, 255, 134, + 138, 142, 161, 164, 185, 192, 255, 188, + 129, 131, 190, 191, 128, 132, 135, 136, + 139, 141, 150, 151, 162, 163, 130, 190, + 191, 151, 128, 130, 134, 136, 138, 141, + 128, 132, 190, 255, 133, 137, 142, 148, + 151, 161, 164, 255, 128, 132, 134, 136, + 138, 141, 149, 150, 162, 163, 128, 131, + 187, 188, 190, 255, 133, 137, 142, 150, + 152, 161, 164, 255, 130, 131, 138, 150, + 143, 148, 152, 159, 178, 179, 177, 179, + 186, 135, 142, 177, 179, 188, 136, 141, + 181, 183, 185, 152, 153, 190, 191, 177, + 191, 128, 132, 134, 135, 141, 151, 153, + 188, 134, 128, 129, 130, 141, 156, 157, + 158, 159, 160, 162, 164, 168, 169, 170, + 172, 173, 174, 175, 176, 179, 183, 173, + 183, 185, 190, 150, 153, 158, 160, 177, + 180, 130, 141, 157, 132, 134, 157, 159, + 146, 148, 178, 180, 146, 147, 178, 179, + 180, 255, 148, 156, 158, 255, 139, 141, + 169, 133, 134, 160, 171, 176, 187, 151, + 155, 160, 162, 191, 149, 158, 165, 188, + 176, 190, 128, 132, 180, 255, 133, 170, + 180, 255, 128, 130, 161, 173, 166, 179, + 164, 183, 173, 180, 144, 146, 148, 168, + 183, 185, 128, 185, 187, 191, 128, 131, + 179, 181, 183, 140, 141, 144, 176, 175, + 177, 191, 160, 191, 128, 130, 170, 175, + 153, 154, 153, 154, 155, 160, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, + 175, 175, 178, 180, 189, 158, 159, 176, + 177, 130, 134, 139, 163, 167, 128, 129, + 180, 255, 134, 159, 178, 190, 192, 255, + 166, 173, 135, 147, 128, 131, 179, 255, + 129, 164, 166, 255, 169, 182, 131, 188, + 140, 141, 176, 178, 180, 183, 184, 190, + 191, 129, 171, 175, 181, 182, 163, 170, + 172, 173, 172, 184, 190, 158, 128, 143, + 160, 175, 144, 145, 150, 155, 157, 158, + 159, 135, 139, 141, 168, 171, 180, 189, + 189, 160, 182, 186, 191, 129, 131, 133, + 134, 140, 143, 184, 186, 165, 166, 164, + 167, 134, 144, 128, 129, 130, 132, 133, + 134, 135, 136, 139, 140, 141, 144, 145, + 146, 147, 150, 151, 152, 153, 154, 156, + 160, 167, 168, 169, 170, 176, 178, 180, + 181, 182, 187, 128, 130, 184, 255, 135, + 190, 131, 175, 187, 255, 128, 130, 167, + 180, 179, 133, 134, 128, 130, 179, 255, + 129, 136, 141, 255, 190, 172, 183, 159, + 170, 128, 131, 187, 188, 190, 191, 151, + 128, 132, 135, 136, 139, 141, 162, 163, + 166, 172, 176, 180, 181, 191, 158, 128, + 134, 176, 255, 132, 255, 175, 181, 184, + 255, 129, 155, 158, 255, 129, 255, 171, + 183, 157, 171, 172, 186, 164, 145, 151, + 154, 160, 129, 138, 179, 185, 187, 190, + 135, 145, 155, 138, 153, 175, 182, 184, + 191, 146, 167, 169, 182, 186, 177, 182, + 188, 189, 191, 255, 134, 136, 255, 138, + 142, 144, 145, 147, 151, 179, 182, 171, + 172, 189, 190, 176, 180, 176, 182, 143, + 145, 255, 136, 142, 147, 255, 178, 157, + 158, 133, 134, 137, 168, 169, 170, 165, + 169, 173, 178, 187, 255, 131, 132, 140, + 169, 174, 255, 130, 132, 128, 182, 187, + 255, 173, 180, 182, 255, 132, 155, 159, + 161, 175, 128, 132, 139, 163, 165, 128, + 134, 136, 152, 155, 161, 163, 164, 166, + 170, 172, 175, 144, 150, 132, 138, 143, + 187, 191, 160, 128, 129, 132, 135, 133, + 134, 160, 255, 192, 255, 128, 191, 169, + 173, 174, 128, 159, 160, 191, 128, 255, + 176, 255, 131, 137, 191, 145, 189, 135, + 129, 130, 132, 133, 144, 154, 176, 139, + 159, 150, 156, 159, 164, 167, 168, 170, + 173, 145, 176, 255, 139, 255, 166, 176, + 189, 171, 179, 160, 161, 163, 164, 165, + 167, 169, 171, 173, 174, 175, 176, 177, + 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 166, 170, 172, + 178, 150, 153, 155, 163, 165, 167, 169, + 173, 153, 155, 147, 161, 163, 255, 189, + 132, 185, 144, 152, 161, 164, 255, 188, + 129, 131, 190, 255, 133, 134, 137, 138, + 142, 150, 152, 161, 164, 189, 191, 255, + 131, 134, 137, 138, 142, 144, 146, 175, + 178, 180, 182, 255, 134, 138, 142, 161, + 164, 185, 192, 255, 188, 129, 131, 190, + 191, 128, 132, 135, 136, 139, 141, 150, + 151, 162, 163, 130, 190, 191, 151, 128, + 130, 134, 136, 138, 141, 128, 132, 190, + 255, 133, 137, 142, 148, 151, 161, 164, + 255, 128, 132, 134, 136, 138, 141, 149, + 150, 162, 163, 128, 131, 187, 188, 190, + 255, 133, 137, 142, 150, 152, 161, 164, + 255, 130, 131, 138, 150, 143, 148, 152, + 159, 178, 179, 177, 179, 186, 135, 142, + 177, 179, 188, 136, 141, 181, 183, 185, + 152, 153, 190, 191, 177, 191, 128, 132, + 134, 135, 141, 151, 153, 188, 134, 128, + 129, 130, 141, 156, 157, 158, 159, 160, + 162, 164, 168, 169, 170, 172, 173, 174, + 175, 176, 179, 183, 173, 183, 185, 190, + 150, 153, 158, 160, 177, 180, 130, 141, + 157, 132, 134, 157, 159, 146, 148, 178, + 180, 146, 147, 178, 179, 180, 255, 148, + 156, 158, 255, 139, 141, 169, 133, 134, + 160, 171, 176, 187, 151, 155, 160, 162, + 191, 149, 158, 165, 188, 176, 190, 128, + 132, 180, 255, 133, 170, 180, 255, 128, + 130, 161, 173, 166, 179, 164, 183, 173, + 180, 144, 146, 148, 168, 183, 185, 128, + 185, 187, 191, 128, 131, 179, 181, 183, + 140, 141, 169, 174, 128, 129, 131, 132, + 134, 140, 142, 143, 147, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 164, 172, + 173, 179, 181, 183, 140, 141, 188, 137, + 144, 176, 162, 185, 148, 153, 169, 170, + 168, 154, 155, 136, 143, 169, 179, 184, + 186, 130, 182, 170, 171, 128, 187, 190, + 128, 133, 135, 146, 148, 255, 192, 255, + 128, 133, 144, 191, 128, 191, 148, 150, + 157, 161, 168, 128, 133, 136, 146, 179, + 180, 132, 135, 140, 142, 151, 147, 149, + 163, 167, 161, 176, 191, 149, 151, 180, + 181, 133, 135, 155, 156, 144, 149, 175, + 177, 191, 160, 191, 128, 130, 138, 189, + 170, 176, 153, 154, 151, 153, 153, 154, + 155, 160, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 175, 175, 178, 180, + 189, 158, 159, 176, 177, 130, 134, 139, + 163, 167, 128, 129, 180, 255, 134, 159, + 178, 190, 192, 255, 166, 173, 135, 147, + 128, 131, 179, 255, 129, 164, 166, 255, + 169, 182, 131, 188, 140, 141, 176, 178, + 180, 183, 184, 190, 191, 129, 171, 175, + 181, 182, 163, 170, 172, 173, 172, 184, + 190, 158, 128, 143, 160, 175, 144, 145, + 150, 155, 157, 158, 159, 135, 139, 141, + 168, 171, 180, 189, 189, 160, 182, 186, + 191, 129, 131, 133, 134, 140, 143, 184, + 186, 165, 166, 164, 167, 134, 144, 128, + 129, 130, 132, 133, 134, 135, 136, 139, + 140, 141, 144, 145, 146, 147, 150, 151, + 152, 153, 154, 156, 160, 167, 168, 169, + 170, 176, 178, 180, 181, 182, 187, 128, + 130, 184, 255, 135, 190, 131, 175, 187, + 255, 128, 130, 167, 180, 179, 133, 134, + 128, 130, 179, 255, 129, 136, 141, 255, + 190, 172, 183, 159, 170, 128, 131, 187, + 188, 190, 191, 151, 128, 132, 135, 136, + 139, 141, 162, 163, 166, 172, 176, 180, + 181, 191, 158, 128, 134, 176, 255, 132, + 255, 175, 181, 184, 255, 129, 155, 158, + 255, 129, 255, 171, 183, 157, 171, 172, + 186, 164, 145, 151, 154, 160, 129, 138, + 179, 185, 187, 190, 135, 145, 155, 138, + 153, 175, 182, 184, 191, 146, 167, 169, + 182, 186, 177, 182, 188, 189, 191, 255, + 134, 136, 255, 138, 142, 144, 145, 147, + 151, 179, 182, 171, 172, 189, 190, 176, + 180, 176, 182, 143, 145, 255, 136, 142, + 147, 255, 178, 157, 158, 133, 134, 137, + 168, 169, 170, 165, 169, 173, 178, 187, + 255, 131, 132, 140, 169, 174, 255, 130, + 132, 128, 182, 187, 255, 173, 180, 182, + 255, 132, 155, 159, 161, 175, 128, 132, + 139, 163, 165, 128, 134, 136, 152, 155, + 161, 163, 164, 166, 170, 172, 175, 144, + 150, 132, 138, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 139, 141, 143, + 144, 146, 147, 148, 149, 150, 151, 153, + 155, 157, 159, 160, 161, 162, 163, 164, + 165, 169, 191, 128, 154, 166, 167, 168, + 170, 171, 190, 175, 141, 143, 172, 177, + 190, 191, 142, 145, 154, 173, 255, 166, + 255, 154, 175, 129, 143, 178, 186, 188, + 191, 137, 255, 128, 189, 134, 255, 144, + 255, 180, 191, 149, 191, 140, 143, 136, + 143, 154, 159, 136, 143, 174, 255, 140, + 186, 188, 191, 128, 133, 135, 191, 190, + 255, 160, 128, 129, 132, 135, 133, 134, + 160, 255, 128, 130, 170, 175, 144, 145, + 150, 155, 157, 158, 159, 143, 187, 191, + 156, 128, 133, 134, 191, 128, 255, 176, + 255, 131, 137, 191, 145, 189, 135, 129, + 130, 132, 133, 144, 154, 176, 139, 159, + 150, 156, 159, 164, 167, 168, 170, 173, + 145, 176, 255, 139, 255, 166, 176, 189, + 171, 179, 160, 161, 163, 164, 165, 167, + 169, 171, 173, 174, 175, 176, 177, 179, + 180, 181, 182, 183, 184, 185, 186, 187, + 188, 189, 190, 191, 166, 170, 172, 178, + 150, 153, 155, 163, 165, 167, 169, 173, + 153, 155, 147, 161, 163, 255, 189, 132, + 185, 144, 152, 161, 164, 255, 188, 129, + 131, 190, 255, 133, 134, 137, 138, 142, + 150, 152, 161, 164, 189, 191, 255, 131, + 134, 137, 138, 142, 144, 146, 175, 178, + 180, 182, 255, 134, 138, 142, 161, 164, + 185, 192, 255, 188, 129, 131, 190, 191, + 128, 132, 135, 136, 139, 141, 150, 151, + 162, 163, 130, 190, 191, 151, 128, 130, + 134, 136, 138, 141, 128, 132, 190, 255, + 133, 137, 142, 148, 151, 161, 164, 255, + 128, 132, 134, 136, 138, 141, 149, 150, + 162, 163, 128, 131, 187, 188, 190, 255, + 133, 137, 142, 150, 152, 161, 164, 255, + 130, 131, 138, 150, 143, 148, 152, 159, + 178, 179, 177, 179, 186, 135, 142, 177, + 179, 188, 136, 141, 181, 183, 185, 152, + 153, 190, 191, 177, 191, 128, 132, 134, + 135, 141, 151, 153, 188, 134, 128, 129, + 130, 141, 156, 157, 158, 159, 160, 162, + 164, 168, 169, 170, 172, 173, 174, 175, + 176, 179, 183, 173, 183, 185, 190, 150, + 153, 158, 160, 177, 180, 130, 141, 157, + 132, 134, 157, 159, 146, 148, 178, 180, + 146, 147, 178, 179, 180, 255, 148, 156, + 158, 255, 139, 141, 169, 133, 134, 160, + 171, 176, 187, 151, 155, 160, 162, 191, + 149, 158, 165, 188, 176, 190, 128, 132, + 180, 255, 133, 170, 180, 255, 128, 130, + 161, 173, 166, 179, 164, 183, 173, 180, + 144, 146, 148, 168, 183, 185, 128, 185, + 187, 191, 128, 131, 179, 181, 183, 140, + 141, 144, 176, 175, 177, 191, 160, 191, + 128, 130, 170, 175, 153, 154, 153, 154, + 155, 160, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 175, 175, 178, 180, + 189, 158, 159, 176, 177, 130, 134, 139, + 163, 167, 128, 129, 180, 255, 134, 159, + 178, 190, 192, 255, 166, 173, 135, 147, + 128, 131, 179, 255, 129, 164, 166, 255, + 169, 182, 131, 188, 140, 141, 176, 178, + 180, 183, 184, 190, 191, 129, 171, 175, + 181, 182, 163, 170, 172, 173, 172, 184, + 190, 158, 128, 143, 160, 175, 144, 145, + 150, 155, 157, 158, 159, 135, 139, 141, + 168, 171, 180, 189, 189, 160, 182, 186, + 191, 129, 131, 133, 134, 140, 143, 184, + 186, 165, 166, 164, 167, 134, 144, 128, + 129, 130, 132, 133, 134, 135, 136, 139, + 140, 141, 144, 145, 146, 147, 150, 151, + 152, 153, 154, 156, 160, 167, 168, 169, + 170, 176, 178, 180, 181, 182, 187, 128, + 130, 184, 255, 135, 190, 131, 175, 187, + 255, 128, 130, 167, 180, 179, 133, 134, + 128, 130, 179, 255, 129, 136, 141, 255, + 190, 172, 183, 159, 170, 128, 131, 187, + 188, 190, 191, 151, 128, 132, 135, 136, + 139, 141, 162, 163, 166, 172, 176, 180, + 181, 191, 158, 128, 134, 176, 255, 132, + 255, 175, 181, 184, 255, 129, 155, 158, + 255, 129, 255, 171, 183, 157, 171, 172, + 186, 164, 145, 151, 154, 160, 129, 138, + 179, 185, 187, 190, 135, 145, 155, 138, + 153, 175, 182, 184, 191, 146, 167, 169, + 182, 186, 177, 182, 188, 189, 191, 255, + 134, 136, 255, 138, 142, 144, 145, 147, + 151, 179, 182, 171, 172, 189, 190, 176, + 180, 176, 182, 143, 145, 255, 136, 142, + 147, 255, 178, 157, 158, 133, 134, 137, + 168, 169, 170, 165, 169, 173, 178, 187, + 255, 131, 132, 140, 169, 174, 255, 130, + 132, 128, 182, 187, 255, 173, 180, 182, + 255, 132, 155, 159, 161, 175, 128, 132, + 139, 163, 165, 128, 134, 136, 152, 155, + 161, 163, 164, 166, 170, 172, 175, 144, + 150, 132, 138, 143, 187, 191, 160, 128, + 129, 132, 135, 133, 134, 160, 255, 192, + 255, 128, 191, 169, 174, 160, 172, 175, + 191, 128, 255, 176, 255, 131, 137, 191, + 145, 189, 135, 129, 130, 132, 133, 144, + 154, 176, 139, 159, 150, 156, 159, 164, + 167, 168, 170, 173, 145, 176, 255, 139, + 255, 166, 176, 189, 171, 179, 160, 161, + 163, 164, 165, 167, 169, 171, 173, 174, + 175, 176, 177, 179, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, + 166, 170, 172, 178, 150, 153, 155, 163, + 165, 167, 169, 173, 153, 155, 147, 161, + 163, 255, 189, 132, 185, 144, 152, 161, + 164, 255, 188, 129, 131, 190, 255, 133, + 134, 137, 138, 142, 150, 152, 161, 164, + 189, 191, 255, 131, 134, 137, 138, 142, + 144, 146, 175, 178, 180, 182, 255, 134, + 138, 142, 161, 164, 185, 192, 255, 188, + 129, 131, 190, 191, 128, 132, 135, 136, + 139, 141, 150, 151, 162, 163, 130, 190, + 191, 151, 128, 130, 134, 136, 138, 141, + 128, 132, 190, 255, 133, 137, 142, 148, + 151, 161, 164, 255, 128, 132, 134, 136, + 138, 141, 149, 150, 162, 163, 128, 131, + 187, 188, 190, 255, 133, 137, 142, 150, + 152, 161, 164, 255, 130, 131, 138, 150, + 143, 148, 152, 159, 178, 179, 177, 179, + 186, 135, 142, 177, 179, 188, 136, 141, + 181, 183, 185, 152, 153, 190, 191, 177, + 191, 128, 132, 134, 135, 141, 151, 153, + 188, 134, 128, 129, 130, 141, 156, 157, + 158, 159, 160, 162, 164, 168, 169, 170, + 172, 173, 174, 175, 176, 179, 183, 173, + 183, 185, 190, 150, 153, 158, 160, 177, + 180, 130, 141, 157, 132, 134, 157, 159, + 146, 148, 178, 180, 146, 147, 178, 179, + 180, 255, 148, 156, 158, 255, 139, 141, + 169, 133, 134, 160, 171, 176, 187, 151, + 155, 160, 162, 191, 149, 158, 165, 188, + 176, 190, 128, 132, 180, 255, 133, 170, + 180, 255, 128, 130, 161, 173, 166, 179, + 164, 183, 173, 180, 144, 146, 148, 168, + 183, 185, 128, 185, 187, 191, 128, 131, + 179, 181, 183, 140, 141, 169, 174, 128, + 129, 131, 132, 134, 140, 142, 143, 147, + 150, 151, 152, 153, 154, 155, 156, 157, + 158, 164, 172, 173, 179, 181, 183, 140, + 141, 188, 137, 144, 176, 162, 185, 148, + 153, 169, 170, 168, 154, 155, 136, 143, + 169, 179, 184, 186, 130, 182, 170, 171, + 128, 187, 190, 128, 133, 135, 146, 148, + 255, 192, 255, 128, 133, 144, 191, 128, + 191, 148, 150, 157, 161, 168, 128, 133, + 136, 146, 179, 180, 132, 135, 140, 142, + 151, 147, 149, 163, 167, 161, 176, 191, + 149, 151, 180, 181, 133, 135, 155, 156, + 144, 149, 175, 177, 191, 160, 191, 128, + 130, 138, 189, 170, 176, 153, 154, 151, + 153, 153, 154, 155, 160, 162, 163, 164, + 165, 166, 167, 168, 169, 170, 171, 175, + 175, 178, 180, 189, 158, 159, 176, 177, + 130, 134, 139, 163, 167, 128, 129, 180, + 255, 134, 159, 178, 190, 192, 255, 166, + 173, 135, 147, 128, 131, 179, 255, 129, + 164, 166, 255, 169, 182, 131, 188, 140, + 141, 176, 178, 180, 183, 184, 190, 191, + 129, 171, 175, 181, 182, 163, 170, 172, + 173, 172, 184, 190, 158, 128, 143, 160, + 175, 144, 145, 150, 155, 157, 158, 159, + 135, 139, 141, 168, 171, 180, 189, 189, + 160, 182, 186, 191, 129, 131, 133, 134, + 140, 143, 184, 186, 165, 166, 164, 167, + 134, 144, 128, 129, 130, 132, 133, 134, + 135, 136, 139, 140, 141, 144, 145, 146, + 147, 150, 151, 152, 153, 154, 156, 160, + 167, 168, 169, 170, 176, 178, 180, 181, + 182, 187, 128, 130, 184, 255, 135, 190, + 131, 175, 187, 255, 128, 130, 167, 180, + 179, 133, 134, 128, 130, 179, 255, 129, + 136, 141, 255, 190, 172, 183, 159, 170, + 128, 131, 187, 188, 190, 191, 151, 128, + 132, 135, 136, 139, 141, 162, 163, 166, + 172, 176, 180, 181, 191, 158, 128, 134, + 176, 255, 132, 255, 175, 181, 184, 255, + 129, 155, 158, 255, 129, 255, 171, 183, + 157, 171, 172, 186, 164, 145, 151, 154, + 160, 129, 138, 179, 185, 187, 190, 135, + 145, 155, 138, 153, 175, 182, 184, 191, + 146, 167, 169, 182, 186, 177, 182, 188, + 189, 191, 255, 134, 136, 255, 138, 142, + 144, 145, 147, 151, 179, 182, 171, 172, + 189, 190, 176, 180, 176, 182, 143, 145, + 255, 136, 142, 147, 255, 178, 157, 158, + 133, 134, 137, 168, 169, 170, 165, 169, + 173, 178, 187, 255, 131, 132, 140, 169, + 174, 255, 130, 132, 128, 182, 187, 255, + 173, 180, 182, 255, 132, 155, 159, 161, + 175, 128, 132, 139, 163, 165, 128, 134, + 136, 152, 155, 161, 163, 164, 166, 170, + 172, 175, 144, 150, 132, 138, 129, 130, + 131, 132, 133, 134, 135, 136, 137, 138, + 139, 141, 143, 144, 146, 147, 148, 149, + 150, 151, 153, 155, 157, 159, 160, 161, + 162, 163, 164, 165, 169, 191, 128, 154, + 166, 167, 168, 170, 171, 190, 175, 141, + 143, 172, 177, 190, 191, 142, 145, 154, + 173, 255, 166, 255, 154, 175, 129, 143, + 178, 186, 188, 191, 137, 255, 128, 189, + 134, 255, 144, 255, 180, 191, 149, 191, + 140, 143, 136, 143, 154, 159, 136, 143, + 174, 255, 140, 186, 188, 191, 128, 133, + 135, 191, 190, 255, 160, 128, 129, 132, + 135, 133, 134, 160, 255, 128, 130, 170, + 175, 144, 145, 150, 155, 157, 158, 159, + 143, 187, 191, 128, 133, 134, 155, 157, + 191, 157, 128, 191, 143, 128, 191, 163, + 181, 128, 191, 162, 128, 191, 142, 128, + 191, 132, 133, 134, 135, 160, 128, 191, + 128, 255, 128, 129, 130, 132, 133, 134, + 141, 156, 157, 158, 159, 160, 162, 164, + 168, 169, 170, 172, 173, 174, 175, 176, + 179, 183, 160, 255, 128, 129, 130, 133, + 134, 135, 141, 156, 157, 158, 159, 160, + 162, 164, 168, 169, 170, 172, 173, 174, + 175, 176, 179, 183, 160, 255, 168, 255, + 128, 129, 130, 134, 135, 141, 156, 157, + 158, 159, 160, 162, 164, 168, 169, 170, + 172, 173, 174, 175, 176, 179, 183, 168, + 255, 192, 255, 159, 139, 187, 158, 159, + 176, 255, 135, 138, 139, 187, 188, 255, + 168, 255, 153, 154, 155, 160, 162, 163, + 164, 165, 166, 167, 168, 169, 170, 171, + 175, 177, 178, 179, 180, 181, 182, 184, + 185, 186, 187, 188, 189, 191, 176, 190, + 192, 255, 135, 147, 160, 188, 128, 156, + 184, 129, 255, 128, 129, 130, 133, 134, + 141, 156, 157, 158, 159, 160, 162, 164, + 168, 169, 170, 172, 173, 174, 175, 176, + 179, 183, 158, 159, 135, 255, 148, 176, + 140, 168, 132, 160, 188, 152, 180, 144, + 172, 136, 164, 192, 255, 129, 130, 131, + 132, 133, 134, 136, 137, 138, 139, 140, + 141, 143, 144, 145, 146, 147, 148, 150, + 151, 152, 153, 154, 155, 157, 158, 159, + 160, 161, 162, 164, 165, 166, 167, 168, + 169, 171, 172, 173, 174, 175, 176, 178, + 179, 180, 181, 182, 183, 185, 186, 187, + 188, 189, 190, 128, 191, 129, 130, 131, + 132, 133, 134, 136, 137, 138, 139, 140, + 141, 143, 144, 145, 146, 147, 148, 150, + 151, 152, 153, 154, 155, 157, 158, 159, + 160, 161, 162, 164, 165, 166, 167, 168, + 169, 171, 172, 173, 174, 175, 176, 178, + 179, 180, 181, 182, 183, 185, 186, 187, + 188, 189, 190, 128, 191, 129, 130, 131, + 132, 133, 134, 136, 137, 138, 139, 140, + 141, 143, 144, 145, 146, 147, 148, 150, + 151, 152, 153, 154, 155, 157, 158, 159, + 128, 156, 160, 255, 136, 164, 175, 176, + 255, 128, 141, 143, 191, 128, 129, 132, + 134, 140, 142, 143, 147, 150, 151, 152, + 153, 154, 155, 156, 157, 158, 164, 172, + 173, 130, 191, 188, 128, 138, 140, 141, + 144, 167, 175, 191, 137, 128, 159, 176, + 191, 162, 185, 128, 191, 128, 147, 148, + 153, 154, 168, 169, 170, 171, 191, 168, + 128, 153, 154, 155, 156, 191, 136, 128, + 191, 143, 128, 168, 169, 179, 180, 183, + 184, 186, 187, 191, 130, 128, 191, 182, + 128, 169, 170, 171, 172, 191, 128, 191, + 129, 186, 187, 190, 134, 147, 128, 255, + 128, 133, 134, 143, 144, 191, 147, 149, + 157, 161, 168, 128, 133, 134, 135, 136, + 150, 151, 178, 179, 180, 181, 191, 132, + 135, 140, 142, 150, 128, 146, 147, 151, + 152, 162, 163, 167, 168, 191, 161, 176, + 191, 128, 148, 149, 151, 152, 190, 128, + 179, 180, 181, 182, 191, 128, 132, 133, + 135, 136, 154, 155, 156, 157, 191, 144, + 149, 128, 191, 128, 138, 129, 191, 176, + 189, 128, 191, 151, 153, 128, 191, 128, + 191, 165, 177, 178, 179, 180, 181, 182, + 184, 185, 186, 187, 188, 189, 191, 128, + 175, 176, 190, 192, 255, 128, 159, 160, + 188, 189, 191, 128, 156, 184, 129, 255, + 148, 176, 140, 168, 132, 160, 188, 152, + 180, 144, 172, 136, 164, 192, 255, 129, + 130, 131, 132, 133, 134, 136, 137, 138, + 139, 140, 141, 143, 144, 145, 146, 147, + 148, 150, 151, 152, 153, 154, 155, 157, + 158, 159, 160, 161, 162, 164, 165, 166, + 167, 168, 169, 171, 172, 173, 174, 175, + 176, 178, 179, 180, 181, 182, 183, 185, + 186, 187, 188, 189, 190, 128, 191, 129, + 130, 131, 132, 133, 134, 136, 137, 138, + 139, 140, 141, 143, 144, 145, 146, 147, + 148, 150, 151, 152, 153, 154, 155, 157, + 158, 159, 160, 161, 162, 164, 165, 166, + 167, 168, 169, 171, 172, 173, 174, 175, + 176, 178, 179, 180, 181, 182, 183, 185, + 186, 187, 188, 189, 190, 128, 191, 129, + 130, 131, 132, 133, 134, 136, 137, 138, + 139, 140, 141, 143, 144, 145, 146, 147, + 148, 150, 151, 152, 153, 154, 155, 157, + 158, 159, 128, 156, 160, 191, 192, 255, + 136, 164, 175, 176, 255, 135, 138, 139, + 187, 188, 191, 192, 255, 187, 191, 128, + 190, 128, 190, 188, 128, 175, 190, 191, + 145, 147, 155, 157, 159, 128, 191, 130, + 131, 135, 168, 170, 181, 128, 191, 189, + 128, 191, 141, 128, 191, 128, 129, 130, + 131, 132, 191, 186, 128, 191, 128, 131, + 132, 137, 138, 191, 134, 128, 191, 144, + 128, 191, 128, 175, 185, 191, 178, 128, + 191, 128, 159, 164, 191, 133, 128, 191, + 128, 178, 187, 191, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 138, 139, 141, + 143, 144, 146, 147, 148, 149, 150, 151, + 153, 156, 157, 158, 159, 160, 161, 162, + 164, 165, 169, 191, 128, 154, 155, 163, + 166, 167, 168, 170, 171, 190, 175, 128, + 140, 141, 143, 144, 191, 128, 171, 172, + 177, 178, 189, 190, 191, 142, 128, 144, + 145, 154, 155, 172, 173, 255, 166, 191, + 192, 255, 144, 145, 150, 155, 157, 158, + 159, 135, 143, 166, 191, 128, 154, 175, + 187, 129, 143, 144, 177, 178, 191, 128, + 136, 137, 255, 187, 191, 192, 255, 128, + 189, 190, 191, 128, 133, 134, 255, 144, + 191, 192, 255, 128, 179, 180, 191, 128, + 148, 149, 191, 128, 139, 140, 143, 144, + 191, 128, 135, 136, 143, 144, 153, 154, + 159, 160, 191, 128, 135, 136, 143, 144, + 173, 174, 255, 187, 128, 139, 140, 191, + 134, 128, 191, 190, 191, 192, 255, 128, + 191, 160, 128, 191, 128, 129, 135, 132, + 134, 128, 175, 157, 128, 191, 143, 128, + 191, 163, 181, 128, 191, 162, 128, 191, + 142, 128, 191, 132, 133, 134, 135, 160, + 128, 191, 128, 255, 0, 127, 176, 255, + 131, 137, 191, 145, 189, 135, 129, 130, + 132, 133, 144, 154, 176, 139, 159, 150, + 156, 159, 164, 167, 168, 170, 173, 145, + 176, 255, 139, 255, 166, 176, 189, 171, + 179, 160, 161, 163, 164, 165, 167, 169, + 171, 173, 174, 175, 176, 177, 179, 180, + 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 166, 170, 172, 178, 150, + 153, 155, 163, 165, 167, 169, 173, 153, + 155, 147, 161, 163, 255, 189, 132, 185, + 144, 152, 161, 164, 255, 188, 129, 131, + 190, 255, 133, 134, 137, 138, 142, 150, + 152, 161, 164, 189, 191, 255, 131, 134, + 137, 138, 142, 144, 146, 175, 178, 180, + 182, 255, 134, 138, 142, 161, 164, 185, + 192, 255, 188, 129, 131, 190, 191, 128, + 132, 135, 136, 139, 141, 150, 151, 162, + 163, 130, 190, 191, 151, 128, 130, 134, + 136, 138, 141, 128, 132, 190, 255, 133, + 137, 142, 148, 151, 161, 164, 255, 128, + 132, 134, 136, 138, 141, 149, 150, 162, + 163, 128, 131, 187, 188, 190, 255, 133, + 137, 142, 150, 152, 161, 164, 255, 130, + 131, 138, 150, 143, 148, 152, 159, 178, + 179, 177, 179, 186, 135, 142, 177, 179, + 188, 136, 141, 181, 183, 185, 152, 153, + 190, 191, 177, 191, 128, 132, 134, 135, + 141, 151, 153, 188, 134, 128, 129, 130, + 141, 156, 157, 158, 159, 160, 162, 164, + 168, 169, 170, 172, 173, 174, 175, 176, + 179, 183, 173, 183, 185, 190, 150, 153, + 158, 160, 177, 180, 130, 141, 157, 132, + 134, 157, 159, 146, 148, 178, 180, 146, + 147, 178, 179, 180, 255, 148, 156, 158, + 255, 139, 141, 169, 133, 134, 160, 171, + 176, 187, 151, 155, 160, 162, 191, 149, + 158, 165, 188, 176, 190, 128, 132, 180, + 255, 133, 170, 180, 255, 128, 130, 161, + 173, 166, 179, 164, 183, 173, 180, 144, + 146, 148, 168, 183, 185, 128, 185, 187, + 191, 128, 131, 179, 181, 183, 140, 141, + 169, 174, 128, 129, 131, 132, 134, 140, + 142, 143, 147, 150, 151, 152, 153, 154, + 155, 156, 157, 158, 164, 172, 173, 179, + 181, 183, 140, 141, 188, 137, 144, 176, + 162, 185, 148, 153, 169, 170, 168, 154, + 155, 136, 143, 169, 179, 184, 186, 130, + 182, 170, 171, 128, 187, 190, 128, 133, + 135, 146, 148, 255, 192, 255, 128, 133, + 144, 191, 128, 191, 148, 150, 157, 161, + 168, 128, 133, 136, 146, 179, 180, 132, + 135, 140, 142, 151, 147, 149, 163, 167, + 161, 176, 191, 149, 151, 180, 181, 133, + 135, 155, 156, 144, 149, 175, 177, 191, + 160, 191, 128, 130, 138, 189, 170, 176, + 153, 154, 151, 153, 153, 154, 155, 160, + 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 175, 175, 178, 180, 189, 158, + 159, 176, 177, 130, 134, 139, 163, 167, + 128, 129, 180, 255, 134, 159, 178, 190, + 192, 255, 166, 173, 135, 147, 128, 131, + 179, 255, 129, 164, 166, 255, 169, 182, + 131, 188, 140, 141, 176, 178, 180, 183, + 184, 190, 191, 129, 171, 175, 181, 182, + 163, 170, 172, 173, 172, 184, 190, 158, + 128, 143, 160, 175, 144, 145, 150, 155, + 157, 158, 159, 135, 139, 141, 168, 171, + 180, 189, 189, 160, 182, 186, 191, 129, + 131, 133, 134, 140, 143, 184, 186, 165, + 166, 164, 167, 134, 144, 128, 129, 130, + 132, 133, 134, 135, 136, 139, 140, 141, + 144, 145, 146, 147, 150, 151, 152, 153, + 154, 156, 160, 167, 168, 169, 170, 176, + 178, 180, 181, 182, 187, 128, 130, 184, + 255, 135, 190, 131, 175, 187, 255, 128, + 130, 167, 180, 179, 133, 134, 128, 130, + 179, 255, 129, 136, 141, 255, 190, 172, + 183, 159, 170, 128, 131, 187, 188, 190, + 191, 151, 128, 132, 135, 136, 139, 141, + 162, 163, 166, 172, 176, 180, 181, 191, + 158, 128, 134, 176, 255, 132, 255, 175, + 181, 184, 255, 129, 155, 158, 255, 129, + 255, 171, 183, 157, 171, 172, 186, 164, + 145, 151, 154, 160, 129, 138, 179, 185, + 187, 190, 135, 145, 155, 138, 153, 175, + 182, 184, 191, 146, 167, 169, 182, 186, + 177, 182, 188, 189, 191, 255, 134, 136, + 255, 138, 142, 144, 145, 147, 151, 179, + 182, 171, 172, 189, 190, 176, 180, 176, + 182, 143, 145, 255, 136, 142, 147, 255, + 178, 157, 158, 133, 134, 137, 168, 169, + 170, 165, 169, 173, 178, 187, 255, 131, + 132, 140, 169, 174, 255, 130, 132, 128, + 182, 187, 255, 173, 180, 182, 255, 132, + 155, 159, 161, 175, 128, 132, 139, 163, + 165, 128, 134, 136, 152, 155, 161, 163, + 164, 166, 170, 172, 175, 144, 150, 132, + 138, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 138, 139, 141, 143, 144, 146, + 147, 148, 149, 150, 151, 153, 155, 157, + 159, 160, 161, 162, 163, 164, 165, 169, + 191, 128, 154, 166, 167, 168, 170, 171, + 190, 175, 141, 143, 172, 177, 190, 191, + 142, 145, 154, 173, 255, 166, 255, 154, + 175, 129, 143, 178, 186, 188, 191, 137, + 255, 128, 189, 134, 255, 144, 255, 180, + 191, 149, 191, 140, 143, 136, 143, 154, + 159, 136, 143, 174, 255, 140, 186, 188, + 191, 128, 133, 135, 191, 190, 255, 160, + 128, 129, 132, 135, 133, 134, 160, 255, + 128, 130, 170, 175, 144, 145, 150, 155, + 157, 158, 159, 143, 187, 191, 128, 129, + 130, 132, 133, 134, 141, 156, 157, 158, + 159, 160, 162, 164, 168, 169, 170, 172, + 173, 174, 175, 176, 179, 183, 160, 255, + 128, 129, 130, 133, 134, 135, 141, 156, + 157, 158, 159, 160, 162, 164, 168, 169, + 170, 172, 173, 174, 175, 176, 179, 183, + 160, 255, 168, 255, 128, 129, 130, 134, + 135, 141, 156, 157, 158, 159, 160, 162, + 164, 168, 169, 170, 172, 173, 174, 175, + 176, 179, 183, 168, 255, 192, 255, 159, + 139, 187, 158, 159, 176, 255, 135, 138, + 139, 187, 188, 255, 168, 255, 153, 154, + 155, 160, 162, 163, 164, 165, 166, 167, + 168, 169, 170, 171, 175, 177, 178, 179, + 180, 181, 182, 184, 185, 186, 187, 188, + 189, 191, 176, 190, 192, 255, 135, 147, + 160, 188, 128, 156, 184, 129, 255, 128, + 129, 130, 133, 134, 141, 156, 157, 158, + 159, 160, 162, 164, 168, 169, 170, 172, + 173, 174, 175, 176, 179, 183, 158, 159, + 135, 255, 148, 176, 140, 168, 132, 160, + 188, 152, 180, 144, 172, 136, 164, 192, + 255, 129, 130, 131, 132, 133, 134, 136, + 137, 138, 139, 140, 141, 143, 144, 145, + 146, 147, 148, 150, 151, 152, 153, 154, + 155, 157, 158, 159, 160, 161, 162, 164, + 165, 166, 167, 168, 169, 171, 172, 173, + 174, 175, 176, 178, 179, 180, 181, 182, + 183, 185, 186, 187, 188, 189, 190, 128, + 191, 129, 130, 131, 132, 133, 134, 136, + 137, 138, 139, 140, 141, 143, 144, 145, + 146, 147, 148, 150, 151, 152, 153, 154, + 155, 157, 158, 159, 160, 161, 162, 164, + 165, 166, 167, 168, 169, 171, 172, 173, + 174, 175, 176, 178, 179, 180, 181, 182, + 183, 185, 186, 187, 188, 189, 190, 128, + 191, 129, 130, 131, 132, 133, 134, 136, + 137, 138, 139, 140, 141, 143, 144, 145, + 146, 147, 148, 150, 151, 152, 153, 154, + 155, 157, 158, 159, 128, 156, 160, 255, + 136, 164, 175, 176, 255, 142, 128, 191, + 128, 129, 132, 134, 140, 142, 143, 147, + 150, 151, 152, 153, 154, 155, 156, 157, + 158, 164, 172, 173, 130, 191, 139, 141, + 188, 128, 140, 142, 143, 144, 167, 168, + 174, 175, 191, 128, 255, 176, 255, 131, + 137, 191, 145, 189, 135, 129, 130, 132, + 133, 144, 154, 176, 139, 159, 150, 156, + 159, 164, 167, 168, 170, 173, 145, 176, + 255, 139, 255, 166, 176, 189, 171, 179, + 160, 161, 163, 164, 165, 167, 169, 171, + 173, 174, 175, 176, 177, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 166, 170, 172, 178, 150, 153, + 155, 163, 165, 167, 169, 173, 153, 155, + 147, 161, 163, 255, 189, 132, 185, 144, + 152, 161, 164, 255, 188, 129, 131, 190, + 255, 133, 134, 137, 138, 142, 150, 152, + 161, 164, 189, 191, 255, 131, 134, 137, + 138, 142, 144, 146, 175, 178, 180, 182, + 255, 134, 138, 142, 161, 164, 185, 192, + 255, 188, 129, 131, 190, 191, 128, 132, + 135, 136, 139, 141, 150, 151, 162, 163, + 130, 190, 191, 151, 128, 130, 134, 136, + 138, 141, 128, 132, 190, 255, 133, 137, + 142, 148, 151, 161, 164, 255, 128, 132, + 134, 136, 138, 141, 149, 150, 162, 163, + 128, 131, 187, 188, 190, 255, 133, 137, + 142, 150, 152, 161, 164, 255, 130, 131, + 138, 150, 143, 148, 152, 159, 178, 179, + 177, 179, 186, 135, 142, 177, 179, 188, + 136, 141, 181, 183, 185, 152, 153, 190, + 191, 177, 191, 128, 132, 134, 135, 141, + 151, 153, 188, 134, 128, 129, 130, 141, + 156, 157, 158, 159, 160, 162, 164, 168, + 169, 170, 172, 173, 174, 175, 176, 179, + 183, 173, 183, 185, 190, 150, 153, 158, + 160, 177, 180, 130, 141, 157, 132, 134, + 157, 159, 146, 148, 178, 180, 146, 147, + 178, 179, 180, 255, 148, 156, 158, 255, + 139, 141, 169, 133, 134, 160, 171, 176, + 187, 151, 155, 160, 162, 191, 149, 158, + 165, 188, 176, 190, 128, 132, 180, 255, + 133, 170, 180, 255, 128, 130, 161, 173, + 166, 179, 164, 183, 173, 180, 144, 146, + 148, 168, 183, 185, 128, 185, 187, 191, + 128, 131, 179, 181, 183, 140, 141, 144, + 176, 175, 177, 191, 160, 191, 128, 130, + 170, 175, 153, 154, 153, 154, 155, 160, + 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 175, 175, 178, 180, 189, 158, + 159, 176, 177, 130, 134, 139, 163, 167, + 128, 129, 180, 255, 134, 159, 178, 190, + 192, 255, 166, 173, 135, 147, 128, 131, + 179, 255, 129, 164, 166, 255, 169, 182, + 131, 188, 140, 141, 176, 178, 180, 183, + 184, 190, 191, 129, 171, 175, 181, 182, + 163, 170, 172, 173, 172, 184, 190, 158, + 128, 143, 160, 175, 144, 145, 150, 155, + 157, 158, 159, 135, 139, 141, 168, 171, + 180, 189, 189, 160, 182, 186, 191, 129, + 131, 133, 134, 140, 143, 184, 186, 165, + 166, 164, 167, 134, 144, 128, 129, 130, + 132, 133, 134, 135, 136, 139, 140, 141, + 144, 145, 146, 147, 150, 151, 152, 153, + 154, 156, 160, 167, 168, 169, 170, 176, + 178, 180, 181, 182, 187, 128, 130, 184, + 255, 135, 190, 131, 175, 187, 255, 128, + 130, 167, 180, 179, 133, 134, 128, 130, + 179, 255, 129, 136, 141, 255, 190, 172, + 183, 159, 170, 128, 131, 187, 188, 190, + 191, 151, 128, 132, 135, 136, 139, 141, + 162, 163, 166, 172, 176, 180, 181, 191, + 158, 128, 134, 176, 255, 132, 255, 175, + 181, 184, 255, 129, 155, 158, 255, 129, + 255, 171, 183, 157, 171, 172, 186, 164, + 145, 151, 154, 160, 129, 138, 179, 185, + 187, 190, 135, 145, 155, 138, 153, 175, + 182, 184, 191, 146, 167, 169, 182, 186, + 177, 182, 188, 189, 191, 255, 134, 136, + 255, 138, 142, 144, 145, 147, 151, 179, + 182, 171, 172, 189, 190, 176, 180, 176, + 182, 143, 145, 255, 136, 142, 147, 255, + 178, 157, 158, 133, 134, 137, 168, 169, + 170, 165, 169, 173, 178, 187, 255, 131, + 132, 140, 169, 174, 255, 130, 132, 128, + 182, 187, 255, 173, 180, 182, 255, 132, + 155, 159, 161, 175, 128, 132, 139, 163, + 165, 128, 134, 136, 152, 155, 161, 163, + 164, 166, 170, 172, 175, 144, 150, 132, + 138, 143, 187, 191, 160, 128, 129, 132, + 135, 133, 134, 160, 255, 192, 255, 137, + 128, 159, 160, 175, 176, 191, 162, 185, + 128, 191, 128, 147, 148, 153, 154, 168, + 169, 170, 171, 191, 168, 128, 153, 154, + 155, 156, 191, 136, 128, 191, 143, 128, + 168, 169, 179, 180, 183, 184, 186, 187, + 191, 130, 128, 191, 182, 128, 169, 170, + 171, 172, 191, 128, 191, 129, 186, 187, + 190, 134, 147, 128, 255, 128, 133, 134, + 143, 144, 191, 147, 149, 157, 161, 168, + 128, 133, 134, 135, 136, 150, 151, 178, + 179, 180, 181, 191, 132, 135, 140, 142, + 150, 128, 146, 147, 151, 152, 162, 163, + 167, 168, 191, 161, 176, 191, 128, 148, + 149, 151, 152, 190, 128, 179, 180, 181, + 182, 191, 128, 132, 133, 135, 136, 154, + 155, 156, 157, 191, 144, 149, 128, 191, + 128, 138, 129, 191, 176, 189, 128, 191, + 151, 153, 128, 191, 128, 191, 165, 177, + 178, 179, 180, 181, 182, 184, 185, 186, + 187, 188, 189, 191, 128, 175, 176, 190, + 192, 255, 128, 159, 160, 188, 189, 191, + 128, 156, 184, 129, 255, 148, 176, 140, + 168, 132, 160, 188, 152, 180, 144, 172, + 136, 164, 192, 255, 129, 130, 131, 132, + 133, 134, 136, 137, 138, 139, 140, 141, + 143, 144, 145, 146, 147, 148, 150, 151, + 152, 153, 154, 155, 157, 158, 159, 160, + 161, 162, 164, 165, 166, 167, 168, 169, + 171, 172, 173, 174, 175, 176, 178, 179, + 180, 181, 182, 183, 185, 186, 187, 188, + 189, 190, 128, 191, 129, 130, 131, 132, + 133, 134, 136, 137, 138, 139, 140, 141, + 143, 144, 145, 146, 147, 148, 150, 151, + 152, 153, 154, 155, 157, 158, 159, 160, + 161, 162, 164, 165, 166, 167, 168, 169, + 171, 172, 173, 174, 175, 176, 178, 179, + 180, 181, 182, 183, 185, 186, 187, 188, + 189, 190, 128, 191, 129, 130, 131, 132, + 133, 134, 136, 137, 138, 139, 140, 141, + 143, 144, 145, 146, 147, 148, 150, 151, + 152, 153, 154, 155, 157, 158, 159, 128, + 156, 160, 191, 192, 255, 136, 164, 175, + 176, 255, 135, 138, 139, 187, 188, 191, + 192, 255, 187, 191, 128, 190, 191, 128, + 190, 188, 128, 175, 176, 189, 190, 191, + 145, 147, 155, 157, 159, 128, 191, 130, + 131, 135, 168, 170, 181, 128, 191, 189, + 128, 191, 141, 128, 191, 128, 129, 130, + 131, 132, 191, 186, 128, 191, 128, 131, + 132, 137, 138, 191, 134, 128, 191, 144, + 128, 191, 128, 175, 176, 184, 185, 191, + 178, 128, 191, 128, 159, 160, 163, 164, + 191, 133, 128, 191, 128, 178, 179, 186, + 187, 191, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 141, 143, 144, + 146, 147, 148, 149, 150, 151, 153, 156, + 157, 158, 159, 160, 161, 162, 164, 165, + 169, 191, 128, 154, 155, 163, 166, 167, + 168, 170, 171, 190, 175, 128, 140, 141, + 143, 144, 191, 128, 171, 172, 177, 178, + 189, 190, 191, 142, 128, 144, 145, 154, + 155, 172, 173, 255, 166, 191, 192, 255, + 0, 127, 176, 255, 131, 137, 191, 145, + 189, 135, 129, 130, 132, 133, 144, 154, + 176, 139, 159, 150, 156, 159, 164, 167, + 168, 170, 173, 145, 176, 255, 139, 255, + 166, 176, 189, 171, 179, 160, 161, 163, + 164, 165, 167, 169, 171, 173, 174, 175, + 176, 177, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 166, + 170, 172, 178, 150, 153, 155, 163, 165, + 167, 169, 173, 153, 155, 147, 161, 163, + 255, 189, 132, 185, 144, 152, 161, 164, + 255, 188, 129, 131, 190, 255, 133, 134, + 137, 138, 142, 150, 152, 161, 164, 189, + 191, 255, 131, 134, 137, 138, 142, 144, + 146, 175, 178, 180, 182, 255, 134, 138, + 142, 161, 164, 185, 192, 255, 188, 129, + 131, 190, 191, 128, 132, 135, 136, 139, + 141, 150, 151, 162, 163, 130, 190, 191, + 151, 128, 130, 134, 136, 138, 141, 128, + 132, 190, 255, 133, 137, 142, 148, 151, + 161, 164, 255, 128, 132, 134, 136, 138, + 141, 149, 150, 162, 163, 128, 131, 187, + 188, 190, 255, 133, 137, 142, 150, 152, + 161, 164, 255, 130, 131, 138, 150, 143, + 148, 152, 159, 178, 179, 177, 179, 186, + 135, 142, 177, 179, 188, 136, 141, 181, + 183, 185, 152, 153, 190, 191, 177, 191, + 128, 132, 134, 135, 141, 151, 153, 188, + 134, 128, 129, 130, 141, 156, 157, 158, + 159, 160, 162, 164, 168, 169, 170, 172, + 173, 174, 175, 176, 179, 183, 173, 183, + 185, 190, 150, 153, 158, 160, 177, 180, + 130, 141, 157, 132, 134, 157, 159, 146, + 148, 178, 180, 146, 147, 178, 179, 180, + 255, 148, 156, 158, 255, 139, 141, 169, + 133, 134, 160, 171, 176, 187, 151, 155, + 160, 162, 191, 149, 158, 165, 188, 176, + 190, 128, 132, 180, 255, 133, 170, 180, + 255, 128, 130, 161, 173, 166, 179, 164, + 183, 173, 180, 144, 146, 148, 168, 183, + 185, 128, 185, 187, 191, 128, 131, 179, + 181, 183, 140, 141, 169, 174, 128, 129, + 131, 132, 134, 140, 142, 143, 147, 150, + 151, 152, 153, 154, 155, 156, 157, 158, + 164, 172, 173, 179, 181, 183, 140, 141, + 188, 137, 144, 176, 162, 185, 148, 153, + 169, 170, 168, 154, 155, 136, 143, 169, + 179, 184, 186, 130, 182, 170, 171, 128, + 187, 190, 128, 133, 135, 146, 148, 255, + 192, 255, 128, 133, 144, 191, 128, 191, + 148, 150, 157, 161, 168, 128, 133, 136, + 146, 179, 180, 132, 135, 140, 142, 151, + 147, 149, 163, 167, 161, 176, 191, 149, + 151, 180, 181, 133, 135, 155, 156, 144, + 149, 175, 177, 191, 160, 191, 128, 130, + 138, 189, 170, 176, 153, 154, 151, 153, + 153, 154, 155, 160, 162, 163, 164, 165, + 166, 167, 168, 169, 170, 171, 175, 175, + 178, 180, 189, 158, 159, 176, 177, 130, + 134, 139, 163, 167, 128, 129, 180, 255, + 134, 159, 178, 190, 192, 255, 166, 173, + 135, 147, 128, 131, 179, 255, 129, 164, + 166, 255, 169, 182, 131, 188, 140, 141, + 176, 178, 180, 183, 184, 190, 191, 129, + 171, 175, 181, 182, 163, 170, 172, 173, + 172, 184, 190, 158, 128, 143, 160, 175, + 144, 145, 150, 155, 157, 158, 159, 135, + 139, 141, 168, 171, 180, 189, 189, 160, + 182, 186, 191, 129, 131, 133, 134, 140, + 143, 184, 186, 165, 166, 164, 167, 134, + 144, 128, 129, 130, 132, 133, 134, 135, + 136, 139, 140, 141, 144, 145, 146, 147, + 150, 151, 152, 153, 154, 156, 160, 167, + 168, 169, 170, 176, 178, 180, 181, 182, + 187, 128, 130, 184, 255, 135, 190, 131, + 175, 187, 255, 128, 130, 167, 180, 179, + 133, 134, 128, 130, 179, 255, 129, 136, + 141, 255, 190, 172, 183, 159, 170, 128, + 131, 187, 188, 190, 191, 151, 128, 132, + 135, 136, 139, 141, 162, 163, 166, 172, + 176, 180, 181, 191, 158, 128, 134, 176, + 255, 132, 255, 175, 181, 184, 255, 129, + 155, 158, 255, 129, 255, 171, 183, 157, + 171, 172, 186, 164, 145, 151, 154, 160, + 129, 138, 179, 185, 187, 190, 135, 145, + 155, 138, 153, 175, 182, 184, 191, 146, + 167, 169, 182, 186, 177, 182, 188, 189, + 191, 255, 134, 136, 255, 138, 142, 144, + 145, 147, 151, 179, 182, 171, 172, 189, + 190, 176, 180, 176, 182, 143, 145, 255, + 136, 142, 147, 255, 178, 157, 158, 133, + 134, 137, 168, 169, 170, 165, 169, 173, + 178, 187, 255, 131, 132, 140, 169, 174, + 255, 130, 132, 128, 182, 187, 255, 173, + 180, 182, 255, 132, 155, 159, 161, 175, + 128, 132, 139, 163, 165, 128, 134, 136, + 152, 155, 161, 163, 164, 166, 170, 172, + 175, 144, 150, 132, 138, 129, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, + 141, 143, 144, 146, 147, 148, 149, 150, + 151, 153, 155, 157, 159, 160, 161, 162, + 163, 164, 165, 169, 191, 128, 154, 166, + 167, 168, 170, 171, 190, 175, 141, 143, + 172, 177, 190, 191, 142, 145, 154, 173, + 255, 166, 255, 154, 175, 129, 143, 178, + 186, 188, 191, 137, 255, 128, 189, 134, + 255, 144, 255, 180, 191, 149, 191, 140, + 143, 136, 143, 154, 159, 136, 143, 174, + 255, 140, 186, 188, 191, 128, 133, 135, + 191, 190, 255, 160, 128, 129, 132, 135, + 133, 134, 160, 255, 128, 130, 170, 175, + 144, 145, 150, 155, 157, 158, 159, 143, + 187, 191, 144, 145, 150, 155, 157, 158, + 159, 135, 143, 166, 191, 128, 154, 175, + 187, 129, 143, 144, 177, 178, 191, 128, + 136, 137, 255, 187, 191, 192, 255, 128, + 189, 190, 191, 128, 133, 134, 255, 144, + 191, 192, 255, 128, 179, 180, 191, 128, + 148, 149, 191, 128, 139, 140, 143, 144, + 191, 128, 135, 136, 143, 144, 153, 154, + 159, 160, 191, 128, 135, 136, 143, 144, + 173, 174, 255, 187, 128, 139, 140, 191, + 134, 128, 191, 190, 191, 192, 255, 128, + 191, 160, 128, 191, 128, 130, 131, 135, + 191, 129, 134, 136, 190, 128, 159, 160, + 191, 0, 127, 192, 255, 128, 175, 176, + 255, 10, 13, 127, 194, 216, 219, 220, + 224, 225, 226, 227, 234, 235, 236, 237, + 239, 240, 243, 0, 31, 128, 191, 192, + 223, 228, 238, 241, 247, 248, 255, 204, + 205, 210, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 234, + 239, 240, 243, 204, 205, 210, 214, 215, + 216, 217, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 234, 239, 240, 243, 194, + 204, 205, 210, 214, 215, 216, 217, 219, + 220, 221, 222, 223, 224, 225, 226, 227, + 234, 239, 240, 243, 194, 216, 219, 220, + 224, 225, 226, 227, 234, 235, 236, 237, + 239, 240, 243, 32, 126, 192, 223, 228, + 238, 241, 247, 204, 205, 210, 214, 215, + 216, 217, 219, 220, 221, 222, 223, 224, + 225, 226, 227, 234, 239, 240, 243, 204, + 205, 210, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 234, + 239, 240, 243, 194, 204, 205, 210, 214, + 215, 216, 217, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 234, 239, 240, 243, + 204, 205, 210, 214, 215, 216, 217, 219, + 220, 221, 222, 223, 224, 225, 226, 227, + 234, 235, 236, 237, 239, 240, 243, 204, + 205, 210, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 234, + 237, 239, 240, 243, 204, 205, 210, 214, + 215, 216, 217, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 234, 237, 239, 240, + 243, 204, 205, 210, 214, 215, 216, 217, + 219, 220, 221, 222, 223, 224, 225, 226, + 227, 234, 237, 239, 240, 243, 204, 205, + 210, 214, 215, 216, 217, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 234, 239, + 240, 243, 204, 205, 210, 214, 215, 216, + 217, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 234, 235, 236, 237, 239, 240, + 243, 204, 205, 210, 214, 215, 216, 217, + 219, 220, 221, 222, 223, 224, 225, 226, + 227, 234, 239, 240, 243, 194, 204, 205, + 210, 214, 215, 216, 217, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 234, 239, + 240, 243, 204, 205, 210, 214, 215, 216, + 217, 219, 220, 221, 222, 223, 224, 225, + 226, 227, 234, 237, 239, 240, 243, 204, + 205, 210, 214, 215, 216, 217, 219, 220, + 221, 222, 223, 224, 225, 226, 227, 234, + 237, 239, 240, 243, 204, 205, 210, 214, + 215, 216, 217, 219, 220, 221, 222, 223, + 224, 225, 226, 227, 234, 237, 239, 240, + 243, 204, 205, 210, 214, 215, 216, 217, + 219, 220, 221, 222, 223, 224, 225, 226, + 227, 234, 239, 240, 243, 204, 205, 210, + 214, 215, 216, 217, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 234, 239, 240, + 243, 204, 205, 210, 214, 215, 216, 217, + 219, 220, 221, 222, 223, 224, 225, 226, + 227, 234, 239, 240, 243, 194, 204, 205, + 210, 214, 215, 216, 217, 219, 220, 221, + 222, 223, 224, 225, 226, 227, 234, 239, + 240, 243, +} + +var _graphclust_single_lengths []byte = []byte{ + 0, 1, 0, 0, 0, 1, 1, 0, + 1, 0, 1, 0, 0, 1, 26, 0, + 0, 0, 1, 1, 1, 0, 0, 2, + 1, 0, 1, 1, 0, 2, 0, 0, + 2, 0, 2, 1, 0, 1, 0, 3, + 0, 0, 1, 21, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 2, + 0, 5, 0, 0, 0, 1, 0, 2, + 0, 0, 15, 0, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 0, 2, 1, + 1, 0, 3, 1, 0, 7, 7, 1, + 1, 0, 1, 0, 0, 0, 32, 0, + 0, 0, 0, 1, 0, 0, 1, 0, + 0, 1, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, + 0, 0, 1, 1, 0, 0, 4, 0, + 0, 1, 0, 1, 0, 6, 0, 0, + 0, 0, 0, 1, 5, 0, 0, 0, + 0, 1, 0, 1, 4, 0, 0, 0, + 0, 3, 0, 0, 0, 1, 1, 0, + 1, 0, 1, 0, 0, 1, 26, 0, + 0, 0, 1, 1, 1, 0, 0, 2, + 1, 0, 1, 1, 0, 2, 0, 0, + 2, 0, 2, 1, 0, 1, 0, 3, + 0, 0, 1, 21, 0, 0, 3, 0, + 0, 0, 0, 0, 0, 1, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 2, + 0, 5, 2, 2, 24, 3, 1, 0, + 2, 0, 1, 1, 1, 1, 1, 1, + 0, 0, 0, 0, 5, 5, 3, 0, + 0, 2, 0, 1, 0, 3, 1, 0, + 2, 15, 0, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 0, 2, 1, 1, + 0, 3, 1, 0, 7, 7, 1, 1, + 0, 1, 0, 0, 0, 32, 0, 0, + 0, 0, 1, 0, 0, 1, 0, 0, + 1, 0, 1, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0, 1, 0, 0, + 0, 1, 1, 0, 0, 4, 0, 0, + 1, 0, 1, 0, 6, 0, 0, 0, + 0, 0, 1, 5, 0, 0, 0, 0, + 32, 0, 1, 0, 1, 0, 2, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 4, 0, 2, 0, + 7, 1, 0, 1, 0, 0, 0, 1, + 1, 0, 1, 0, 1, 0, 0, 1, + 26, 0, 0, 0, 1, 1, 1, 0, + 0, 2, 1, 0, 1, 1, 0, 2, + 0, 0, 2, 0, 2, 1, 0, 1, + 0, 3, 0, 0, 1, 21, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 3, 0, 0, 0, 0, 0, + 0, 2, 0, 5, 0, 0, 0, 1, + 0, 2, 0, 0, 15, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 2, 1, 1, 0, 3, 1, 0, 7, + 7, 1, 1, 0, 1, 0, 0, 0, + 32, 0, 0, 0, 0, 1, 0, 0, + 1, 0, 0, 1, 0, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 0, + 1, 0, 0, 0, 1, 1, 0, 0, + 4, 0, 0, 1, 0, 1, 0, 6, + 0, 0, 0, 0, 0, 1, 5, 0, + 0, 0, 0, 1, 0, 1, 4, 0, + 0, 0, 0, 2, 0, 0, 0, 1, + 1, 0, 1, 0, 1, 0, 0, 1, + 26, 0, 0, 0, 1, 1, 1, 0, + 0, 2, 1, 0, 1, 1, 0, 2, + 0, 0, 2, 0, 2, 1, 0, 1, + 0, 3, 0, 0, 1, 21, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 3, 0, 0, 0, 0, 0, + 0, 2, 0, 5, 2, 2, 24, 3, + 1, 0, 2, 0, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 5, 5, + 3, 0, 0, 2, 0, 1, 0, 3, + 1, 0, 2, 15, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 2, + 1, 1, 0, 3, 1, 0, 7, 7, + 1, 1, 0, 1, 0, 0, 0, 32, + 0, 0, 0, 0, 1, 0, 0, 1, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 4, + 0, 0, 1, 0, 1, 0, 6, 0, + 0, 0, 0, 0, 1, 5, 0, 0, + 0, 0, 32, 0, 1, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 4, 0, + 2, 0, 7, 1, 0, 0, 1, 1, + 2, 1, 1, 5, 0, 24, 0, 24, + 0, 0, 23, 0, 0, 1, 0, 2, + 0, 0, 0, 28, 0, 3, 23, 2, + 0, 2, 2, 3, 2, 2, 2, 0, + 54, 54, 27, 1, 0, 20, 1, 1, + 2, 0, 1, 1, 1, 1, 1, 2, + 2, 0, 5, 5, 3, 0, 0, 2, + 2, 2, 2, 0, 14, 0, 3, 2, + 2, 3, 2, 2, 2, 54, 54, 27, + 1, 0, 2, 0, 1, 5, 6, 1, + 1, 0, 1, 0, 1, 1, 0, 1, + 0, 1, 0, 32, 1, 0, 1, 0, + 7, 2, 0, 4, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, + 0, 0, 1, 3, 0, 1, 1, 2, + 1, 1, 5, 0, 0, 0, 0, 1, + 1, 0, 1, 0, 1, 0, 0, 1, + 26, 0, 0, 0, 1, 1, 1, 0, + 0, 2, 1, 0, 1, 1, 0, 2, + 0, 0, 2, 0, 2, 1, 0, 1, + 0, 3, 0, 0, 1, 21, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 1, + 0, 0, 3, 0, 0, 0, 0, 0, + 0, 2, 0, 5, 2, 2, 24, 3, + 1, 0, 2, 0, 1, 1, 1, 1, + 1, 1, 0, 0, 0, 0, 5, 5, + 3, 0, 0, 2, 0, 1, 0, 3, + 1, 0, 2, 15, 0, 0, 0, 3, + 0, 0, 0, 0, 0, 0, 0, 2, + 1, 1, 0, 3, 1, 0, 7, 7, + 1, 1, 0, 1, 0, 0, 0, 32, + 0, 0, 0, 0, 1, 0, 0, 1, + 0, 0, 1, 0, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 0, 1, + 0, 0, 0, 1, 1, 0, 0, 4, + 0, 0, 1, 0, 1, 0, 6, 0, + 0, 0, 0, 0, 1, 5, 0, 0, + 0, 0, 32, 0, 1, 0, 1, 0, + 2, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 4, 0, + 2, 0, 7, 1, 0, 24, 0, 24, + 0, 0, 23, 0, 0, 1, 0, 2, + 0, 0, 0, 28, 0, 3, 23, 2, + 0, 2, 2, 3, 2, 2, 2, 0, + 54, 54, 27, 1, 1, 20, 3, 0, + 0, 0, 1, 1, 0, 1, 0, 1, + 0, 0, 1, 26, 0, 0, 0, 1, + 1, 1, 0, 0, 2, 1, 0, 1, + 1, 0, 2, 0, 0, 2, 0, 2, + 1, 0, 1, 0, 3, 0, 0, 1, + 21, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 3, 0, 0, + 0, 0, 0, 0, 2, 0, 5, 0, + 0, 0, 1, 0, 2, 0, 0, 15, + 0, 0, 0, 3, 0, 0, 0, 0, + 0, 0, 0, 2, 1, 1, 0, 3, + 1, 0, 7, 7, 1, 1, 0, 1, + 0, 0, 0, 32, 0, 0, 0, 0, + 1, 0, 0, 1, 0, 0, 1, 0, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 1, 0, 0, 0, 1, + 1, 0, 0, 4, 0, 0, 1, 0, + 1, 0, 6, 0, 0, 0, 0, 0, + 1, 5, 0, 0, 0, 0, 1, 0, + 1, 4, 0, 0, 0, 1, 2, 0, + 1, 1, 1, 1, 1, 2, 2, 0, + 5, 5, 3, 0, 0, 2, 2, 2, + 2, 0, 14, 0, 3, 2, 2, 3, + 2, 2, 2, 54, 54, 27, 1, 0, + 2, 1, 1, 5, 6, 1, 1, 0, + 1, 0, 1, 1, 0, 1, 0, 1, + 0, 32, 1, 0, 1, 0, 0, 0, + 0, 1, 1, 0, 1, 0, 1, 0, + 0, 1, 26, 0, 0, 0, 1, 1, + 1, 0, 0, 2, 1, 0, 1, 1, + 0, 2, 0, 0, 2, 0, 2, 1, + 0, 1, 0, 3, 0, 0, 1, 21, + 0, 0, 3, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 3, 0, 0, 0, + 0, 0, 0, 2, 0, 5, 2, 2, + 24, 3, 1, 0, 2, 0, 1, 1, + 1, 1, 1, 1, 0, 0, 0, 0, + 5, 5, 3, 0, 0, 2, 0, 1, + 0, 3, 1, 0, 2, 15, 0, 0, + 0, 3, 0, 0, 0, 0, 0, 0, + 0, 2, 1, 1, 0, 3, 1, 0, + 7, 7, 1, 1, 0, 1, 0, 0, + 0, 32, 0, 0, 0, 0, 1, 0, + 0, 1, 0, 0, 1, 0, 1, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 0, 1, 0, 0, 0, 1, 1, 0, + 0, 4, 0, 0, 1, 0, 1, 0, + 6, 0, 0, 0, 0, 0, 1, 5, + 0, 0, 0, 0, 32, 0, 1, 0, + 1, 0, 2, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 1, + 4, 0, 2, 0, 7, 1, 0, 7, + 2, 0, 4, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 1, 1, 0, + 0, 1, 5, 0, 0, 0, 0, 0, + 18, 20, 20, 21, 15, 20, 20, 21, + 23, 21, 21, 21, 20, 23, 20, 21, + 21, 21, 21, 20, 20, 20, 21, +} + +var _graphclust_range_lengths []byte = []byte{ + 0, 0, 1, 1, 1, 1, 2, 1, + 1, 4, 1, 1, 1, 1, 2, 4, + 1, 2, 1, 2, 2, 6, 6, 3, + 2, 5, 1, 3, 2, 3, 5, 3, + 3, 1, 3, 1, 1, 1, 1, 2, + 1, 4, 0, 0, 2, 3, 1, 1, + 2, 2, 1, 2, 1, 1, 2, 1, + 2, 1, 2, 2, 2, 1, 1, 3, + 2, 0, 1, 1, 1, 0, 1, 0, + 1, 1, 0, 2, 1, 1, 1, 2, + 3, 1, 1, 2, 2, 1, 1, 3, + 2, 2, 0, 0, 2, 0, 0, 0, + 0, 1, 4, 1, 1, 1, 0, 2, + 1, 2, 2, 1, 2, 2, 1, 1, + 3, 6, 1, 1, 1, 1, 2, 2, + 1, 1, 1, 1, 2, 3, 1, 1, + 2, 2, 3, 1, 3, 1, 0, 1, + 1, 1, 2, 0, 1, 0, 3, 3, + 1, 2, 2, 2, 0, 5, 1, 1, + 1, 0, 1, 0, 1, 1, 1, 0, + 1, 2, 1, 1, 1, 1, 2, 1, + 1, 4, 1, 1, 1, 1, 2, 4, + 1, 2, 1, 2, 2, 6, 6, 3, + 2, 5, 1, 3, 2, 3, 5, 3, + 3, 1, 3, 1, 1, 1, 1, 2, + 1, 4, 0, 0, 2, 3, 1, 1, + 2, 2, 1, 2, 1, 1, 2, 1, + 2, 1, 2, 2, 2, 1, 1, 3, + 2, 0, 0, 0, 0, 0, 0, 1, + 0, 2, 1, 0, 2, 0, 1, 1, + 3, 1, 2, 1, 3, 2, 1, 1, + 2, 0, 1, 0, 1, 0, 1, 1, + 0, 0, 2, 1, 1, 1, 2, 3, + 1, 1, 2, 2, 1, 1, 3, 2, + 2, 0, 0, 2, 0, 0, 0, 0, + 1, 4, 1, 1, 1, 0, 2, 1, + 2, 2, 1, 2, 2, 1, 1, 3, + 6, 1, 1, 1, 1, 2, 2, 1, + 1, 1, 1, 2, 3, 1, 1, 2, + 2, 3, 1, 3, 1, 0, 1, 1, + 1, 2, 0, 1, 0, 3, 3, 1, + 2, 2, 2, 0, 5, 1, 1, 1, + 4, 0, 1, 2, 2, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 2, 2, + 2, 2, 1, 0, 1, 1, 0, 1, + 0, 0, 1, 2, 1, 1, 1, 1, + 2, 1, 1, 4, 1, 1, 1, 1, + 2, 4, 1, 2, 1, 2, 2, 6, + 6, 3, 2, 5, 1, 3, 2, 3, + 5, 3, 3, 1, 3, 1, 1, 1, + 1, 2, 1, 4, 0, 0, 2, 3, + 1, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 2, 1, 2, 2, 2, 1, + 1, 3, 2, 0, 1, 1, 1, 0, + 1, 0, 1, 1, 0, 2, 1, 1, + 1, 2, 3, 1, 1, 2, 2, 1, + 1, 3, 2, 2, 0, 0, 2, 0, + 0, 0, 0, 1, 4, 1, 1, 1, + 0, 2, 1, 2, 2, 1, 2, 2, + 1, 1, 3, 6, 1, 1, 1, 1, + 2, 2, 1, 1, 1, 1, 2, 3, + 1, 1, 2, 2, 3, 1, 3, 1, + 0, 1, 1, 1, 2, 0, 1, 0, + 3, 3, 1, 2, 2, 2, 0, 5, + 1, 1, 1, 0, 1, 0, 1, 1, + 1, 0, 1, 2, 1, 1, 1, 1, + 2, 1, 1, 4, 1, 1, 1, 1, + 2, 4, 1, 2, 1, 2, 2, 6, + 6, 3, 2, 5, 1, 3, 2, 3, + 5, 3, 3, 1, 3, 1, 1, 1, + 1, 2, 1, 4, 0, 0, 2, 3, + 1, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 2, 1, 2, 2, 2, 1, + 1, 3, 2, 0, 0, 0, 0, 0, + 0, 1, 0, 2, 1, 0, 2, 0, + 1, 1, 3, 1, 2, 1, 3, 2, + 1, 1, 2, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 2, 1, 1, 1, + 2, 3, 1, 1, 2, 2, 1, 1, + 3, 2, 2, 0, 0, 2, 0, 0, + 0, 0, 1, 4, 1, 1, 1, 0, + 2, 1, 2, 2, 1, 2, 2, 1, + 1, 3, 6, 1, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 2, 3, 1, + 1, 2, 2, 3, 1, 3, 1, 0, + 1, 1, 1, 2, 0, 1, 0, 3, + 3, 1, 2, 2, 2, 0, 5, 1, + 1, 1, 4, 0, 1, 2, 2, 1, + 3, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 1, 0, 1, 1, + 0, 1, 0, 0, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 0, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 0, + 1, 3, 1, 2, 2, 1, 0, 0, + 1, 0, 0, 0, 0, 0, 1, 0, + 1, 1, 2, 2, 2, 1, 4, 2, + 1, 5, 3, 1, 5, 1, 3, 2, + 1, 3, 6, 5, 3, 3, 5, 1, + 1, 1, 1, 1, 3, 3, 1, 0, + 0, 0, 0, 0, 1, 1, 1, 3, + 2, 4, 1, 1, 2, 1, 1, 1, + 1, 3, 1, 3, 1, 1, 2, 1, + 2, 1, 2, 5, 3, 4, 4, 2, + 0, 0, 1, 3, 2, 2, 2, 2, + 2, 2, 2, 3, 5, 4, 2, 1, + 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 4, 1, 1, 1, 1, + 2, 4, 1, 2, 1, 2, 2, 6, + 6, 3, 2, 5, 1, 3, 2, 3, + 5, 3, 3, 1, 3, 1, 1, 1, + 1, 2, 1, 4, 0, 0, 2, 3, + 1, 1, 2, 2, 1, 2, 1, 1, + 2, 1, 2, 1, 2, 2, 2, 1, + 1, 3, 2, 0, 0, 0, 0, 0, + 0, 1, 0, 2, 1, 0, 2, 0, + 1, 1, 3, 1, 2, 1, 3, 2, + 1, 1, 2, 0, 1, 0, 1, 0, + 1, 1, 0, 0, 2, 1, 1, 1, + 2, 3, 1, 1, 2, 2, 1, 1, + 3, 2, 2, 0, 0, 2, 0, 0, + 0, 0, 1, 4, 1, 1, 1, 0, + 2, 1, 2, 2, 1, 2, 2, 1, + 1, 3, 6, 1, 1, 1, 1, 2, + 2, 1, 1, 1, 1, 2, 3, 1, + 1, 2, 2, 3, 1, 3, 1, 0, + 1, 1, 1, 2, 0, 1, 0, 3, + 3, 1, 2, 2, 2, 0, 5, 1, + 1, 1, 4, 0, 1, 2, 2, 1, + 3, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 1, 0, 1, 1, + 0, 1, 0, 0, 1, 0, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 0, + 1, 3, 1, 2, 2, 1, 0, 0, + 1, 0, 0, 0, 0, 0, 1, 0, + 1, 1, 2, 2, 1, 1, 5, 1, + 1, 1, 1, 2, 1, 1, 4, 1, + 1, 1, 1, 2, 4, 1, 2, 1, + 2, 2, 6, 6, 3, 2, 5, 1, + 3, 2, 3, 5, 3, 3, 1, 3, + 1, 1, 1, 1, 2, 1, 4, 0, + 0, 2, 3, 1, 1, 2, 2, 1, + 2, 1, 1, 2, 1, 2, 1, 2, + 2, 2, 1, 1, 3, 2, 0, 1, + 1, 1, 0, 1, 0, 1, 1, 0, + 2, 1, 1, 1, 2, 3, 1, 1, + 2, 2, 1, 1, 3, 2, 2, 0, + 0, 2, 0, 0, 0, 0, 1, 4, + 1, 1, 1, 0, 2, 1, 2, 2, + 1, 2, 2, 1, 1, 3, 6, 1, + 1, 1, 1, 2, 2, 1, 1, 1, + 1, 2, 3, 1, 1, 2, 2, 3, + 1, 3, 1, 0, 1, 1, 1, 2, + 0, 1, 0, 3, 3, 1, 2, 2, + 2, 0, 5, 1, 1, 1, 0, 1, + 0, 1, 1, 1, 0, 3, 1, 5, + 3, 1, 5, 1, 3, 2, 1, 3, + 6, 5, 3, 3, 5, 1, 1, 1, + 1, 1, 3, 3, 1, 0, 0, 0, + 0, 0, 1, 1, 1, 3, 2, 4, + 1, 1, 3, 1, 1, 1, 1, 3, + 1, 3, 1, 1, 3, 1, 3, 1, + 3, 5, 3, 4, 4, 2, 1, 1, + 1, 1, 2, 1, 1, 4, 1, 1, + 1, 1, 2, 4, 1, 2, 1, 2, + 2, 6, 6, 3, 2, 5, 1, 3, + 2, 3, 5, 3, 3, 1, 3, 1, + 1, 1, 1, 2, 1, 4, 0, 0, + 2, 3, 1, 1, 2, 2, 1, 2, + 1, 1, 2, 1, 2, 1, 2, 2, + 2, 1, 1, 3, 2, 0, 0, 0, + 0, 0, 0, 1, 0, 2, 1, 0, + 2, 0, 1, 1, 3, 1, 2, 1, + 3, 2, 1, 1, 2, 0, 1, 0, + 1, 0, 1, 1, 0, 0, 2, 1, + 1, 1, 2, 3, 1, 1, 2, 2, + 1, 1, 3, 2, 2, 0, 0, 2, + 0, 0, 0, 0, 1, 4, 1, 1, + 1, 0, 2, 1, 2, 2, 1, 2, + 2, 1, 1, 3, 6, 1, 1, 1, + 1, 2, 2, 1, 1, 1, 1, 2, + 3, 1, 1, 2, 2, 3, 1, 3, + 1, 0, 1, 1, 1, 2, 0, 1, + 0, 3, 3, 1, 2, 2, 2, 0, + 5, 1, 1, 1, 4, 0, 1, 2, + 2, 1, 3, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 2, 2, 1, 0, + 1, 1, 0, 1, 0, 0, 1, 0, + 0, 1, 3, 2, 2, 2, 2, 2, + 2, 2, 3, 5, 4, 2, 1, 2, + 1, 1, 2, 2, 1, 1, 2, 0, + 6, 0, 0, 0, 4, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +} + +var _graphclust_index_offsets []int16 = []int16{ + 0, 0, 2, 4, 6, 8, 11, 15, + 17, 20, 25, 28, 30, 32, 35, 64, + 69, 71, 74, 77, 81, 85, 92, 99, + 105, 109, 115, 118, 123, 126, 132, 138, + 142, 148, 150, 156, 159, 161, 164, 166, + 172, 174, 179, 181, 203, 206, 210, 215, + 217, 220, 223, 225, 228, 230, 233, 236, + 238, 244, 246, 249, 252, 255, 257, 259, + 265, 268, 274, 276, 278, 280, 282, 284, + 287, 289, 291, 307, 310, 312, 314, 319, + 322, 326, 328, 330, 333, 336, 338, 342, + 347, 351, 354, 358, 360, 363, 371, 379, + 381, 383, 385, 391, 393, 395, 397, 430, + 433, 435, 438, 441, 444, 447, 450, 453, + 455, 459, 467, 469, 472, 474, 476, 479, + 482, 484, 486, 488, 490, 494, 498, 501, + 503, 506, 509, 514, 517, 521, 523, 528, + 530, 532, 535, 538, 540, 542, 549, 553, + 557, 559, 562, 565, 569, 575, 581, 583, + 585, 587, 589, 591, 593, 599, 601, 603, + 604, 606, 612, 614, 616, 618, 621, 625, + 627, 630, 635, 638, 640, 642, 645, 674, + 679, 681, 684, 687, 691, 695, 702, 709, + 715, 719, 725, 728, 733, 736, 742, 748, + 752, 758, 760, 766, 769, 771, 774, 776, + 782, 784, 789, 791, 813, 816, 820, 825, + 827, 830, 833, 835, 838, 840, 843, 846, + 848, 854, 856, 859, 862, 865, 867, 869, + 875, 878, 884, 887, 890, 915, 919, 921, + 923, 926, 929, 932, 934, 938, 940, 943, + 946, 950, 952, 955, 957, 966, 974, 979, + 981, 984, 987, 989, 991, 993, 997, 1000, + 1002, 1005, 1021, 1024, 1026, 1028, 1033, 1036, + 1040, 1042, 1044, 1047, 1050, 1052, 1056, 1061, + 1065, 1068, 1072, 1074, 1077, 1085, 1093, 1095, + 1097, 1099, 1105, 1107, 1109, 1111, 1144, 1147, + 1149, 1152, 1155, 1158, 1161, 1164, 1167, 1169, + 1173, 1181, 1183, 1186, 1188, 1190, 1193, 1196, + 1198, 1200, 1202, 1204, 1208, 1212, 1215, 1217, + 1220, 1223, 1228, 1231, 1235, 1237, 1242, 1244, + 1246, 1249, 1252, 1254, 1256, 1263, 1267, 1271, + 1273, 1276, 1279, 1283, 1289, 1295, 1297, 1299, + 1301, 1338, 1339, 1342, 1345, 1349, 1351, 1357, + 1359, 1361, 1363, 1365, 1367, 1369, 1371, 1374, + 1377, 1380, 1383, 1385, 1387, 1393, 1395, 1398, + 1400, 1408, 1410, 1412, 1416, 1418, 1420, 1422, + 1425, 1429, 1431, 1434, 1439, 1442, 1444, 1446, + 1449, 1478, 1483, 1485, 1488, 1491, 1495, 1499, + 1506, 1513, 1519, 1523, 1529, 1532, 1537, 1540, + 1546, 1552, 1556, 1562, 1564, 1570, 1573, 1575, + 1578, 1580, 1586, 1588, 1593, 1595, 1617, 1620, + 1624, 1629, 1631, 1634, 1637, 1639, 1642, 1644, + 1647, 1650, 1652, 1658, 1660, 1663, 1666, 1669, + 1671, 1673, 1679, 1682, 1688, 1690, 1692, 1694, + 1696, 1698, 1701, 1703, 1705, 1721, 1724, 1726, + 1728, 1733, 1736, 1740, 1742, 1744, 1747, 1750, + 1752, 1756, 1761, 1765, 1768, 1772, 1774, 1777, + 1785, 1793, 1795, 1797, 1799, 1805, 1807, 1809, + 1811, 1844, 1847, 1849, 1852, 1855, 1858, 1861, + 1864, 1867, 1869, 1873, 1881, 1883, 1886, 1888, + 1890, 1893, 1896, 1898, 1900, 1902, 1904, 1908, + 1912, 1915, 1917, 1920, 1923, 1928, 1931, 1935, + 1937, 1942, 1944, 1946, 1949, 1952, 1954, 1956, + 1963, 1967, 1971, 1973, 1976, 1979, 1983, 1989, + 1995, 1997, 1999, 2001, 2003, 2005, 2007, 2013, + 2015, 2017, 2018, 2020, 2025, 2027, 2029, 2031, + 2034, 2038, 2040, 2043, 2048, 2051, 2053, 2055, + 2058, 2087, 2092, 2094, 2097, 2100, 2104, 2108, + 2115, 2122, 2128, 2132, 2138, 2141, 2146, 2149, + 2155, 2161, 2165, 2171, 2173, 2179, 2182, 2184, + 2187, 2189, 2195, 2197, 2202, 2204, 2226, 2229, + 2233, 2238, 2240, 2243, 2246, 2248, 2251, 2253, + 2256, 2259, 2261, 2267, 2269, 2272, 2275, 2278, + 2280, 2282, 2288, 2291, 2297, 2300, 2303, 2328, + 2332, 2334, 2336, 2339, 2342, 2345, 2347, 2351, + 2353, 2356, 2359, 2363, 2365, 2368, 2370, 2379, + 2387, 2392, 2394, 2397, 2400, 2402, 2404, 2406, + 2410, 2413, 2415, 2418, 2434, 2437, 2439, 2441, + 2446, 2449, 2453, 2455, 2457, 2460, 2463, 2465, + 2469, 2474, 2478, 2481, 2485, 2487, 2490, 2498, + 2506, 2508, 2510, 2512, 2518, 2520, 2522, 2524, + 2557, 2560, 2562, 2565, 2568, 2571, 2574, 2577, + 2580, 2582, 2586, 2594, 2596, 2599, 2601, 2603, + 2606, 2609, 2611, 2613, 2615, 2617, 2621, 2625, + 2628, 2630, 2633, 2636, 2641, 2644, 2648, 2650, + 2655, 2657, 2659, 2662, 2665, 2667, 2669, 2676, + 2680, 2684, 2686, 2689, 2692, 2696, 2702, 2708, + 2710, 2712, 2714, 2751, 2752, 2755, 2758, 2762, + 2764, 2770, 2772, 2774, 2776, 2778, 2780, 2782, + 2784, 2787, 2790, 2793, 2796, 2798, 2800, 2806, + 2808, 2811, 2813, 2821, 2823, 2825, 2829, 2832, + 2835, 2839, 2842, 2845, 2852, 2854, 2879, 2881, + 2906, 2908, 2910, 2934, 2936, 2938, 2940, 2942, + 2945, 2947, 2951, 2953, 2984, 2987, 2992, 3016, + 3019, 3021, 3024, 3027, 3031, 3034, 3037, 3041, + 3042, 3098, 3154, 3184, 3188, 3191, 3213, 3219, + 3223, 3227, 3233, 3238, 3241, 3248, 3251, 3256, + 3261, 3265, 3269, 3281, 3292, 3299, 3303, 3309, + 3313, 3317, 3321, 3325, 3327, 3345, 3349, 3354, + 3357, 3360, 3364, 3367, 3370, 3374, 3430, 3486, + 3517, 3521, 3526, 3530, 3532, 3536, 3543, 3551, + 3554, 3557, 3561, 3564, 3568, 3571, 3574, 3577, + 3580, 3583, 3586, 3589, 3627, 3632, 3637, 3643, + 3646, 3654, 3657, 3659, 3667, 3670, 3673, 3676, + 3679, 3682, 3685, 3688, 3692, 3698, 3703, 3707, + 3710, 3713, 3715, 3718, 3723, 3725, 3728, 3731, + 3735, 3738, 3741, 3748, 3750, 3752, 3754, 3756, + 3759, 3763, 3765, 3768, 3773, 3776, 3778, 3780, + 3783, 3812, 3817, 3819, 3822, 3825, 3829, 3833, + 3840, 3847, 3853, 3857, 3863, 3866, 3871, 3874, + 3880, 3886, 3890, 3896, 3898, 3904, 3907, 3909, + 3912, 3914, 3920, 3922, 3927, 3929, 3951, 3954, + 3958, 3963, 3965, 3968, 3971, 3973, 3976, 3978, + 3981, 3984, 3986, 3992, 3994, 3997, 4000, 4003, + 4005, 4007, 4013, 4016, 4022, 4025, 4028, 4053, + 4057, 4059, 4061, 4064, 4067, 4070, 4072, 4076, + 4078, 4081, 4084, 4088, 4090, 4093, 4095, 4104, + 4112, 4117, 4119, 4122, 4125, 4127, 4129, 4131, + 4135, 4138, 4140, 4143, 4159, 4162, 4164, 4166, + 4171, 4174, 4178, 4180, 4182, 4185, 4188, 4190, + 4194, 4199, 4203, 4206, 4210, 4212, 4215, 4223, + 4231, 4233, 4235, 4237, 4243, 4245, 4247, 4249, + 4282, 4285, 4287, 4290, 4293, 4296, 4299, 4302, + 4305, 4307, 4311, 4319, 4321, 4324, 4326, 4328, + 4331, 4334, 4336, 4338, 4340, 4342, 4346, 4350, + 4353, 4355, 4358, 4361, 4366, 4369, 4373, 4375, + 4380, 4382, 4384, 4387, 4390, 4392, 4394, 4401, + 4405, 4409, 4411, 4414, 4417, 4421, 4427, 4433, + 4435, 4437, 4439, 4476, 4477, 4480, 4483, 4487, + 4489, 4495, 4497, 4499, 4501, 4503, 4505, 4507, + 4509, 4512, 4515, 4518, 4521, 4523, 4525, 4531, + 4533, 4536, 4538, 4546, 4548, 4550, 4575, 4577, + 4602, 4604, 4606, 4630, 4632, 4634, 4636, 4638, + 4641, 4643, 4647, 4649, 4680, 4683, 4688, 4712, + 4715, 4717, 4720, 4723, 4727, 4730, 4733, 4737, + 4738, 4794, 4850, 4880, 4884, 4887, 4909, 4918, + 4920, 4922, 4924, 4927, 4931, 4933, 4936, 4941, + 4944, 4946, 4948, 4951, 4980, 4985, 4987, 4990, + 4993, 4997, 5001, 5008, 5015, 5021, 5025, 5031, + 5034, 5039, 5042, 5048, 5054, 5058, 5064, 5066, + 5072, 5075, 5077, 5080, 5082, 5088, 5090, 5095, + 5097, 5119, 5122, 5126, 5131, 5133, 5136, 5139, + 5141, 5144, 5146, 5149, 5152, 5154, 5160, 5162, + 5165, 5168, 5171, 5173, 5175, 5181, 5184, 5190, + 5192, 5194, 5196, 5198, 5200, 5203, 5205, 5207, + 5223, 5226, 5228, 5230, 5235, 5238, 5242, 5244, + 5246, 5249, 5252, 5254, 5258, 5263, 5267, 5270, + 5274, 5276, 5279, 5287, 5295, 5297, 5299, 5301, + 5307, 5309, 5311, 5313, 5346, 5349, 5351, 5354, + 5357, 5360, 5363, 5366, 5369, 5371, 5375, 5383, + 5385, 5388, 5390, 5392, 5395, 5398, 5400, 5402, + 5404, 5406, 5410, 5414, 5417, 5419, 5422, 5425, + 5430, 5433, 5437, 5439, 5444, 5446, 5448, 5451, + 5454, 5456, 5458, 5465, 5469, 5473, 5475, 5478, + 5481, 5485, 5491, 5497, 5499, 5501, 5503, 5505, + 5507, 5509, 5515, 5517, 5519, 5520, 5525, 5529, + 5535, 5540, 5543, 5550, 5553, 5558, 5563, 5567, + 5571, 5583, 5594, 5601, 5605, 5611, 5615, 5619, + 5623, 5627, 5629, 5647, 5651, 5656, 5659, 5662, + 5666, 5669, 5672, 5676, 5732, 5788, 5819, 5823, + 5828, 5832, 5835, 5840, 5847, 5855, 5858, 5861, + 5865, 5868, 5872, 5875, 5878, 5882, 5885, 5889, + 5892, 5896, 5934, 5939, 5944, 5950, 5953, 5955, + 5957, 5959, 5962, 5966, 5968, 5971, 5976, 5979, + 5981, 5983, 5986, 6015, 6020, 6022, 6025, 6028, + 6032, 6036, 6043, 6050, 6056, 6060, 6066, 6069, + 6074, 6077, 6083, 6089, 6093, 6099, 6101, 6107, + 6110, 6112, 6115, 6117, 6123, 6125, 6130, 6132, + 6154, 6157, 6161, 6166, 6168, 6171, 6174, 6176, + 6179, 6181, 6184, 6187, 6189, 6195, 6197, 6200, + 6203, 6206, 6208, 6210, 6216, 6219, 6225, 6228, + 6231, 6256, 6260, 6262, 6264, 6267, 6270, 6273, + 6275, 6279, 6281, 6284, 6287, 6291, 6293, 6296, + 6298, 6307, 6315, 6320, 6322, 6325, 6328, 6330, + 6332, 6334, 6338, 6341, 6343, 6346, 6362, 6365, + 6367, 6369, 6374, 6377, 6381, 6383, 6385, 6388, + 6391, 6393, 6397, 6402, 6406, 6409, 6413, 6415, + 6418, 6426, 6434, 6436, 6438, 6440, 6446, 6448, + 6450, 6452, 6485, 6488, 6490, 6493, 6496, 6499, + 6502, 6505, 6508, 6510, 6514, 6522, 6524, 6527, + 6529, 6531, 6534, 6537, 6539, 6541, 6543, 6545, + 6549, 6553, 6556, 6558, 6561, 6564, 6569, 6572, + 6576, 6578, 6583, 6585, 6587, 6590, 6593, 6595, + 6597, 6604, 6608, 6612, 6614, 6617, 6620, 6624, + 6630, 6636, 6638, 6640, 6642, 6679, 6680, 6683, + 6686, 6690, 6692, 6698, 6700, 6702, 6704, 6706, + 6708, 6710, 6712, 6715, 6718, 6721, 6724, 6726, + 6728, 6734, 6736, 6739, 6741, 6749, 6751, 6753, + 6761, 6764, 6766, 6774, 6777, 6780, 6783, 6786, + 6789, 6792, 6795, 6799, 6805, 6810, 6814, 6817, + 6820, 6822, 6825, 6833, 6836, 6838, 6840, 6843, + 6844, 6869, 6890, 6911, 6933, 6953, 6974, 6995, + 7017, 7041, 7063, 7085, 7107, 7128, 7152, 7173, + 7195, 7217, 7239, 7261, 7282, 7303, 7324, +} + +var _graphclust_indicies []int16 = []int16{ + 0, 1, 2, 3, 2, 3, 3, 2, + 3, 3, 2, 3, 3, 3, 2, 3, + 2, 3, 3, 2, 3, 3, 3, 3, + 2, 3, 3, 2, 2, 3, 3, 2, + 3, 3, 2, 4, 5, 6, 7, 8, + 10, 11, 12, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 9, 13, 2, + 3, 3, 3, 3, 2, 3, 2, 3, + 3, 2, 2, 2, 3, 2, 2, 2, + 3, 3, 3, 3, 2, 2, 2, 2, + 2, 2, 2, 3, 2, 2, 2, 2, + 2, 2, 3, 2, 2, 2, 2, 2, + 3, 3, 3, 3, 2, 3, 3, 3, + 3, 3, 2, 3, 3, 2, 3, 3, + 3, 3, 2, 3, 3, 2, 2, 2, + 2, 2, 2, 3, 3, 3, 3, 3, + 3, 2, 3, 3, 3, 2, 2, 2, + 2, 2, 2, 3, 3, 2, 3, 3, + 3, 3, 3, 2, 3, 3, 2, 3, + 2, 3, 3, 2, 3, 2, 3, 3, + 3, 3, 3, 2, 3, 2, 3, 3, + 3, 3, 2, 3, 2, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 2, 3, 3, 2, 3, 3, + 3, 2, 3, 3, 3, 3, 2, 3, + 2, 3, 3, 2, 3, 3, 2, 3, + 2, 2, 2, 3, 3, 2, 3, 3, + 2, 3, 3, 2, 3, 2, 3, 3, + 3, 3, 3, 2, 3, 2, 3, 3, + 2, 2, 2, 3, 3, 3, 2, 3, + 2, 3, 2, 3, 3, 3, 3, 3, + 2, 3, 3, 2, 53, 54, 55, 56, + 57, 2, 3, 2, 3, 2, 3, 2, + 3, 2, 3, 2, 58, 59, 2, 3, + 2, 3, 2, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, + 73, 74, 2, 3, 3, 2, 3, 2, + 3, 2, 3, 3, 3, 3, 2, 3, + 3, 2, 2, 2, 2, 3, 3, 2, + 3, 2, 3, 3, 2, 2, 2, 3, + 3, 2, 3, 3, 3, 2, 3, 3, + 3, 3, 2, 3, 3, 3, 2, 3, + 3, 2, 75, 76, 61, 2, 3, 2, + 3, 3, 2, 77, 78, 79, 80, 81, + 82, 83, 2, 84, 85, 86, 87, 88, + 89, 90, 2, 3, 2, 3, 2, 3, + 2, 3, 3, 3, 3, 3, 2, 3, + 2, 3, 2, 3, 2, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 104, 108, + 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 120, 121, 2, 3, 3, + 2, 2, 3, 2, 2, 3, 3, 3, + 2, 3, 3, 2, 3, 3, 2, 2, + 2, 3, 3, 3, 2, 3, 2, 3, + 3, 3, 2, 3, 3, 3, 3, 3, + 3, 3, 2, 3, 2, 3, 3, 2, + 3, 2, 2, 3, 3, 3, 2, 2, + 2, 3, 2, 3, 3, 2, 3, 2, + 3, 2, 3, 3, 3, 2, 3, 3, + 3, 2, 3, 3, 2, 3, 2, 3, + 3, 2, 3, 3, 2, 3, 3, 3, + 3, 2, 2, 2, 3, 3, 3, 3, + 2, 3, 2, 122, 123, 124, 125, 2, + 3, 2, 3, 2, 3, 3, 2, 2, + 2, 3, 126, 2, 3, 2, 127, 128, + 129, 130, 131, 132, 2, 3, 3, 3, + 2, 2, 2, 2, 3, 3, 2, 3, + 3, 2, 2, 2, 3, 3, 3, 3, + 2, 133, 123, 134, 135, 136, 2, 3, + 3, 3, 3, 3, 2, 3, 2, 3, + 2, 3, 2, 137, 2, 3, 2, 138, + 2, 139, 140, 141, 143, 142, 2, 3, + 2, 2, 3, 3, 3, 1, 145, 144, + 145, 144, 3, 1, 145, 146, 147, 145, + 145, 147, 145, 145, 147, 145, 145, 145, + 147, 145, 147, 145, 145, 147, 145, 145, + 145, 145, 147, 145, 145, 147, 147, 145, + 145, 147, 145, 145, 147, 148, 149, 150, + 151, 152, 154, 155, 156, 158, 159, 160, + 161, 162, 163, 164, 165, 166, 167, 168, + 169, 170, 171, 172, 173, 174, 175, 153, + 157, 147, 145, 145, 145, 145, 147, 145, + 147, 145, 145, 147, 147, 147, 145, 147, + 147, 147, 145, 145, 145, 145, 147, 147, + 147, 147, 147, 147, 147, 145, 147, 147, + 147, 147, 147, 147, 145, 147, 147, 147, + 147, 147, 145, 145, 145, 145, 147, 145, + 145, 145, 145, 145, 147, 145, 145, 147, + 145, 145, 145, 145, 147, 145, 145, 147, + 147, 147, 147, 147, 147, 145, 145, 145, + 145, 145, 145, 147, 145, 145, 145, 147, + 147, 147, 147, 147, 147, 145, 145, 147, + 145, 145, 145, 145, 145, 147, 145, 145, + 147, 145, 147, 145, 145, 147, 145, 147, + 145, 145, 145, 145, 145, 147, 145, 147, + 145, 145, 145, 145, 147, 145, 147, 176, + 177, 178, 179, 180, 181, 182, 183, 184, + 185, 186, 187, 188, 189, 190, 191, 192, + 193, 194, 195, 196, 147, 145, 145, 147, + 145, 145, 145, 147, 145, 145, 145, 145, + 147, 145, 147, 145, 145, 147, 145, 145, + 147, 145, 147, 147, 147, 145, 145, 147, + 145, 145, 147, 145, 145, 147, 145, 147, + 145, 145, 145, 145, 145, 147, 145, 147, + 145, 145, 147, 147, 147, 145, 145, 145, + 147, 145, 147, 145, 147, 145, 145, 145, + 145, 145, 147, 145, 145, 147, 197, 198, + 199, 200, 201, 147, 145, 202, 147, 145, + 145, 147, 203, 204, 198, 205, 206, 207, + 208, 209, 210, 211, 212, 213, 214, 215, + 216, 217, 218, 219, 220, 221, 222, 199, + 200, 201, 147, 145, 202, 145, 147, 145, + 147, 145, 147, 145, 145, 147, 145, 145, + 147, 145, 145, 147, 145, 147, 145, 145, + 145, 147, 145, 147, 145, 145, 147, 145, + 145, 147, 145, 145, 145, 147, 146, 145, + 145, 145, 147, 145, 146, 145, 145, 145, + 145, 145, 145, 145, 145, 147, 145, 145, + 145, 145, 145, 145, 145, 147, 145, 145, + 145, 145, 147, 145, 147, 145, 145, 147, + 145, 145, 147, 145, 147, 145, 147, 145, + 147, 223, 224, 225, 147, 145, 145, 147, + 145, 147, 145, 145, 147, 226, 227, 228, + 229, 230, 231, 232, 233, 234, 235, 236, + 237, 238, 239, 240, 147, 145, 145, 147, + 145, 147, 145, 147, 145, 145, 145, 145, + 147, 145, 145, 147, 147, 147, 147, 145, + 145, 147, 145, 147, 145, 145, 147, 147, + 147, 145, 145, 147, 145, 145, 145, 147, + 145, 145, 145, 145, 147, 145, 145, 145, + 147, 145, 145, 147, 241, 242, 227, 147, + 145, 147, 145, 145, 147, 243, 244, 245, + 246, 247, 248, 249, 147, 250, 251, 252, + 253, 254, 255, 256, 147, 145, 147, 145, + 147, 145, 147, 145, 145, 145, 145, 145, + 147, 145, 147, 145, 147, 145, 147, 257, + 258, 259, 260, 261, 262, 263, 264, 265, + 266, 267, 268, 269, 270, 271, 272, 273, + 270, 274, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 284, 285, 286, 287, 147, + 145, 145, 147, 147, 145, 147, 147, 145, + 145, 145, 147, 145, 145, 147, 145, 145, + 147, 147, 147, 145, 145, 145, 147, 145, + 147, 145, 145, 145, 147, 145, 145, 145, + 145, 145, 145, 145, 147, 145, 147, 145, + 145, 147, 145, 147, 147, 145, 145, 145, + 147, 147, 147, 145, 147, 145, 145, 147, + 145, 147, 145, 147, 145, 145, 145, 147, + 145, 145, 145, 147, 145, 145, 147, 145, + 147, 145, 145, 147, 145, 145, 147, 145, + 145, 145, 145, 147, 147, 147, 145, 145, + 145, 145, 147, 145, 147, 288, 289, 290, + 291, 147, 145, 147, 145, 147, 145, 145, + 147, 147, 147, 145, 292, 147, 145, 147, + 293, 294, 295, 296, 297, 298, 147, 145, + 145, 145, 147, 147, 147, 147, 145, 145, + 147, 145, 145, 147, 147, 147, 145, 145, + 145, 145, 147, 299, 289, 300, 301, 302, + 147, 145, 145, 145, 145, 145, 147, 145, + 147, 145, 147, 145, 147, 304, 214, 216, + 305, 306, 307, 308, 309, 310, 304, 214, + 214, 214, 216, 304, 214, 311, 312, 304, + 214, 313, 214, 314, 315, 316, 317, 318, + 214, 319, 320, 214, 321, 303, 216, 303, + 304, 147, 145, 145, 145, 147, 145, 145, + 147, 145, 145, 145, 147, 147, 145, 145, + 145, 145, 145, 145, 147, 145, 147, 145, + 147, 145, 147, 147, 145, 145, 147, 145, + 147, 145, 147, 145, 145, 147, 145, 145, + 147, 145, 145, 147, 145, 145, 147, 147, + 145, 322, 147, 323, 214, 303, 324, 304, + 147, 145, 147, 325, 224, 147, 145, 147, + 243, 244, 245, 246, 247, 248, 326, 147, + 327, 147, 145, 147, 144, 328, 3, 1, + 330, 329, 329, 330, 330, 329, 330, 330, + 329, 330, 330, 330, 329, 330, 329, 330, + 330, 329, 330, 330, 330, 330, 329, 330, + 330, 329, 329, 330, 330, 329, 330, 330, + 329, 331, 332, 333, 334, 335, 337, 338, + 339, 341, 342, 343, 344, 345, 346, 347, + 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 336, 340, 329, 330, 330, + 330, 330, 329, 330, 329, 330, 330, 329, + 329, 329, 330, 329, 329, 329, 330, 330, + 330, 330, 329, 329, 329, 329, 329, 329, + 329, 330, 329, 329, 329, 329, 329, 329, + 330, 329, 329, 329, 329, 329, 330, 330, + 330, 330, 329, 330, 330, 330, 330, 330, + 329, 330, 330, 329, 330, 330, 330, 330, + 329, 330, 330, 329, 329, 329, 329, 329, + 329, 330, 330, 330, 330, 330, 330, 329, + 330, 330, 330, 329, 329, 329, 329, 329, + 329, 330, 330, 329, 330, 330, 330, 330, + 330, 329, 330, 330, 329, 330, 329, 330, + 330, 329, 330, 329, 330, 330, 330, 330, + 330, 329, 330, 329, 330, 330, 330, 330, + 329, 330, 329, 359, 360, 361, 362, 363, + 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, + 329, 330, 330, 329, 330, 330, 330, 329, + 330, 330, 330, 330, 329, 330, 329, 330, + 330, 329, 330, 330, 329, 330, 329, 329, + 329, 330, 330, 329, 330, 330, 329, 330, + 330, 329, 330, 329, 330, 330, 330, 330, + 330, 329, 330, 329, 330, 330, 329, 329, + 329, 330, 330, 330, 329, 330, 329, 330, + 329, 330, 330, 330, 330, 330, 329, 330, + 330, 329, 380, 381, 382, 383, 384, 329, + 330, 329, 330, 329, 330, 329, 330, 329, + 330, 329, 385, 386, 329, 330, 329, 330, + 329, 387, 388, 389, 390, 391, 392, 393, + 394, 395, 396, 397, 398, 399, 400, 401, + 329, 330, 330, 329, 330, 329, 330, 329, + 330, 330, 330, 330, 329, 330, 330, 329, + 329, 329, 329, 330, 330, 329, 330, 329, + 330, 330, 329, 329, 329, 330, 330, 329, + 330, 330, 330, 329, 330, 330, 330, 330, + 329, 330, 330, 330, 329, 330, 330, 329, + 402, 403, 388, 329, 330, 329, 330, 330, + 329, 404, 405, 406, 407, 408, 409, 410, + 329, 411, 412, 413, 414, 415, 416, 417, + 329, 330, 329, 330, 329, 330, 329, 330, + 330, 330, 330, 330, 329, 330, 329, 330, + 329, 330, 329, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 427, 428, 429, 430, + 431, 432, 433, 434, 431, 435, 436, 437, + 438, 439, 440, 441, 442, 443, 444, 445, + 446, 447, 448, 329, 330, 330, 329, 329, + 330, 329, 329, 330, 330, 330, 329, 330, + 330, 329, 330, 330, 329, 329, 329, 330, + 330, 330, 329, 330, 329, 330, 330, 330, + 329, 330, 330, 330, 330, 330, 330, 330, + 329, 330, 329, 330, 330, 329, 330, 329, + 329, 330, 330, 330, 329, 329, 329, 330, + 329, 330, 330, 329, 330, 329, 330, 329, + 330, 330, 330, 329, 330, 330, 330, 329, + 330, 330, 329, 330, 329, 330, 330, 329, + 330, 330, 329, 330, 330, 330, 330, 329, + 329, 329, 330, 330, 330, 330, 329, 330, + 329, 449, 450, 451, 452, 329, 330, 329, + 330, 329, 330, 330, 329, 329, 329, 330, + 453, 329, 330, 329, 454, 455, 456, 457, + 458, 459, 329, 330, 330, 330, 329, 329, + 329, 329, 330, 330, 329, 330, 330, 329, + 329, 329, 330, 330, 330, 330, 329, 460, + 450, 461, 462, 463, 329, 330, 330, 330, + 330, 330, 329, 330, 329, 330, 329, 330, + 329, 464, 329, 330, 329, 465, 329, 466, + 467, 468, 470, 469, 329, 330, 329, 329, + 330, 330, 330, 329, 471, 471, 330, 330, + 329, 471, 329, 329, 471, 471, 329, 471, + 471, 329, 471, 471, 471, 329, 471, 329, + 471, 471, 329, 471, 471, 471, 471, 329, + 471, 471, 329, 329, 471, 471, 329, 471, + 471, 329, 472, 473, 474, 475, 476, 478, + 479, 480, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 494, 495, + 496, 497, 498, 499, 477, 481, 329, 471, + 471, 471, 471, 329, 471, 329, 471, 471, + 329, 329, 329, 471, 329, 329, 329, 471, + 471, 471, 471, 329, 329, 329, 329, 329, + 329, 329, 471, 329, 329, 329, 329, 329, + 329, 471, 329, 329, 329, 329, 329, 471, + 471, 471, 471, 329, 471, 471, 471, 471, + 471, 329, 471, 471, 329, 471, 471, 471, + 471, 329, 471, 471, 329, 329, 329, 329, + 329, 329, 471, 471, 471, 471, 471, 471, + 329, 471, 471, 471, 329, 329, 329, 329, + 329, 329, 471, 471, 329, 471, 471, 471, + 471, 471, 329, 471, 471, 329, 471, 329, + 471, 471, 329, 471, 329, 471, 471, 471, + 471, 471, 329, 471, 329, 471, 471, 471, + 471, 329, 471, 329, 500, 501, 502, 503, + 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, + 520, 329, 471, 471, 329, 471, 471, 471, + 329, 471, 471, 471, 471, 329, 471, 329, + 471, 471, 329, 471, 471, 329, 471, 329, + 329, 329, 471, 471, 329, 471, 471, 329, + 471, 471, 329, 471, 329, 471, 471, 471, + 471, 471, 329, 471, 329, 471, 471, 329, + 329, 329, 471, 471, 471, 329, 471, 329, + 471, 329, 471, 471, 471, 471, 471, 329, + 471, 471, 329, 521, 522, 523, 524, 525, + 329, 471, 526, 329, 471, 471, 329, 527, + 528, 522, 529, 530, 531, 532, 533, 534, + 535, 536, 537, 538, 539, 540, 541, 542, + 543, 544, 545, 546, 523, 524, 525, 329, + 471, 526, 471, 329, 471, 329, 471, 329, + 471, 471, 329, 471, 471, 329, 471, 471, + 329, 471, 329, 471, 471, 471, 329, 471, + 329, 471, 471, 329, 471, 471, 329, 471, + 471, 471, 329, 329, 471, 471, 471, 329, + 471, 329, 471, 471, 471, 471, 471, 471, + 471, 471, 329, 471, 471, 471, 471, 471, + 471, 471, 329, 471, 471, 471, 471, 329, + 471, 329, 471, 471, 329, 471, 471, 329, + 471, 329, 471, 329, 471, 329, 547, 548, + 549, 329, 471, 471, 329, 471, 329, 471, + 471, 329, 550, 551, 552, 553, 554, 555, + 556, 557, 558, 559, 560, 561, 562, 563, + 564, 329, 471, 471, 329, 471, 329, 471, + 329, 471, 471, 471, 471, 329, 471, 471, + 329, 329, 329, 329, 471, 471, 329, 471, + 329, 471, 471, 329, 329, 329, 471, 471, + 329, 471, 471, 471, 329, 471, 471, 471, + 471, 329, 471, 471, 471, 329, 471, 471, + 329, 565, 566, 551, 329, 471, 329, 471, + 471, 329, 567, 568, 569, 570, 571, 572, + 573, 329, 574, 575, 576, 577, 578, 579, + 580, 329, 471, 329, 471, 329, 471, 329, + 471, 471, 471, 471, 471, 329, 471, 329, + 471, 329, 471, 329, 581, 582, 583, 584, + 585, 586, 587, 588, 589, 590, 591, 592, + 593, 594, 595, 596, 597, 594, 598, 599, + 600, 601, 602, 603, 604, 605, 606, 607, + 608, 609, 610, 611, 329, 471, 471, 329, + 329, 471, 329, 329, 471, 471, 471, 329, + 471, 471, 329, 471, 471, 329, 329, 329, + 471, 471, 471, 329, 471, 329, 471, 471, + 471, 329, 471, 471, 471, 471, 471, 471, + 471, 329, 471, 329, 471, 471, 329, 471, + 329, 329, 471, 471, 471, 329, 329, 329, + 471, 329, 471, 471, 329, 471, 329, 471, + 329, 471, 471, 471, 329, 471, 471, 471, + 329, 471, 471, 329, 471, 329, 471, 471, + 329, 471, 471, 329, 471, 471, 471, 471, + 329, 329, 329, 471, 471, 471, 471, 329, + 471, 329, 612, 613, 614, 615, 329, 471, + 329, 471, 329, 471, 471, 329, 329, 329, + 471, 616, 329, 471, 329, 617, 618, 619, + 620, 621, 622, 329, 471, 471, 471, 329, + 329, 329, 329, 471, 471, 329, 471, 471, + 329, 329, 329, 471, 471, 471, 471, 329, + 623, 613, 624, 625, 626, 329, 471, 471, + 471, 471, 471, 329, 471, 329, 471, 329, + 471, 329, 628, 538, 540, 629, 630, 631, + 632, 633, 634, 628, 538, 538, 538, 540, + 628, 538, 635, 636, 628, 538, 637, 538, + 638, 639, 640, 641, 642, 538, 643, 644, + 538, 645, 627, 540, 627, 628, 329, 471, + 471, 471, 329, 471, 471, 329, 471, 471, + 471, 329, 329, 471, 471, 471, 471, 471, + 471, 329, 471, 329, 471, 329, 471, 329, + 329, 471, 471, 329, 471, 329, 471, 329, + 471, 471, 329, 471, 471, 329, 471, 471, + 329, 471, 471, 329, 329, 471, 646, 329, + 647, 538, 627, 648, 628, 329, 471, 329, + 649, 548, 329, 471, 329, 567, 568, 569, + 570, 571, 572, 650, 329, 651, 329, 471, + 329, 328, 330, 330, 329, 328, 330, 329, + 328, 330, 329, 653, 654, 652, 329, 328, + 330, 329, 328, 330, 329, 655, 656, 657, + 658, 659, 652, 329, 660, 329, 500, 501, + 502, 655, 656, 661, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 513, 514, + 515, 516, 517, 518, 519, 520, 329, 662, + 660, 500, 501, 502, 663, 657, 658, 503, + 504, 505, 506, 507, 508, 509, 510, 511, + 512, 513, 514, 515, 516, 517, 518, 519, + 520, 329, 662, 329, 664, 662, 500, 501, + 502, 665, 658, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 514, 515, + 516, 517, 518, 519, 520, 329, 664, 329, + 329, 664, 666, 329, 664, 329, 667, 668, + 329, 662, 329, 329, 664, 329, 662, 329, + 662, 550, 551, 552, 553, 554, 555, 556, + 669, 558, 559, 560, 561, 562, 563, 564, + 671, 672, 673, 674, 675, 676, 671, 672, + 673, 674, 675, 676, 671, 670, 677, 329, + 471, 660, 329, 678, 678, 678, 664, 329, + 500, 501, 502, 663, 661, 503, 504, 505, + 506, 507, 508, 509, 510, 511, 512, 513, + 514, 515, 516, 517, 518, 519, 520, 329, + 667, 679, 329, 329, 662, 678, 678, 664, + 678, 678, 664, 678, 678, 678, 664, 678, + 678, 664, 678, 678, 664, 678, 678, 329, + 664, 664, 673, 674, 675, 676, 670, 671, + 673, 674, 675, 676, 670, 671, 673, 674, + 675, 676, 670, 671, 673, 674, 675, 676, + 670, 671, 673, 674, 675, 676, 670, 671, + 673, 674, 675, 676, 670, 671, 673, 674, + 675, 676, 670, 671, 673, 674, 675, 676, + 670, 671, 673, 674, 675, 676, 670, 671, + 672, 677, 674, 675, 676, 670, 671, 672, + 674, 675, 676, 670, 671, 672, 674, 675, + 676, 670, 671, 672, 674, 675, 676, 670, + 671, 672, 674, 675, 676, 670, 671, 672, + 674, 675, 676, 670, 671, 672, 674, 675, + 676, 670, 671, 672, 674, 675, 676, 670, + 671, 672, 674, 675, 676, 670, 671, 672, + 673, 677, 675, 676, 670, 671, 672, 673, + 675, 676, 670, 671, 672, 673, 675, 676, + 670, 671, 672, 673, 675, 676, 670, 671, + 672, 673, 675, 680, 679, 674, 329, 677, + 678, 329, 662, 664, 330, 330, 329, 681, + 682, 683, 684, 685, 686, 687, 688, 689, + 690, 691, 538, 692, 540, 693, 694, 695, + 696, 697, 698, 652, 329, 471, 330, 330, + 330, 330, 329, 471, 330, 330, 329, 471, + 471, 330, 329, 330, 471, 330, 471, 330, + 329, 471, 330, 471, 330, 329, 471, 330, + 329, 471, 330, 471, 330, 471, 330, 329, + 471, 330, 329, 471, 330, 471, 330, 329, + 471, 330, 330, 471, 329, 330, 330, 471, + 329, 471, 330, 471, 329, 330, 330, 471, + 471, 471, 471, 330, 471, 330, 471, 330, + 329, 471, 471, 471, 471, 330, 330, 471, + 330, 471, 330, 329, 471, 471, 471, 330, + 471, 330, 329, 330, 471, 330, 329, 330, + 471, 330, 471, 330, 329, 471, 471, 330, + 329, 699, 700, 652, 329, 471, 471, 330, + 329, 471, 471, 330, 329, 652, 329, 701, + 703, 704, 705, 706, 707, 708, 703, 704, + 705, 706, 707, 708, 703, 652, 702, 677, + 329, 330, 660, 330, 329, 662, 662, 662, + 664, 329, 662, 662, 664, 662, 662, 664, + 662, 662, 662, 664, 662, 662, 664, 662, + 662, 664, 662, 662, 329, 664, 705, 706, + 707, 708, 702, 703, 705, 706, 707, 708, + 702, 703, 705, 706, 707, 708, 702, 703, + 705, 706, 707, 708, 702, 703, 705, 706, + 707, 708, 702, 703, 705, 706, 707, 708, + 702, 703, 705, 706, 707, 708, 702, 703, + 705, 706, 707, 708, 702, 703, 705, 706, + 707, 708, 702, 703, 704, 677, 706, 707, + 708, 702, 703, 704, 706, 707, 708, 702, + 703, 704, 706, 707, 708, 702, 703, 704, + 706, 707, 708, 702, 703, 704, 706, 707, + 708, 702, 703, 704, 706, 707, 708, 702, + 703, 704, 706, 707, 708, 702, 703, 704, + 706, 707, 708, 702, 703, 704, 706, 707, + 708, 702, 703, 704, 705, 677, 707, 708, + 702, 703, 704, 705, 707, 708, 702, 703, + 704, 705, 707, 708, 702, 703, 704, 705, + 707, 708, 702, 703, 704, 705, 707, 709, + 710, 706, 652, 329, 677, 662, 330, 662, + 664, 330, 664, 330, 329, 662, 711, 712, + 652, 329, 330, 329, 330, 330, 330, 329, + 714, 715, 716, 717, 718, 713, 329, 719, + 720, 721, 722, 723, 724, 652, 329, 328, + 330, 329, 328, 330, 329, 330, 328, 330, + 329, 328, 330, 329, 330, 328, 330, 329, + 328, 330, 329, 725, 652, 329, 330, 330, + 329, 726, 652, 329, 330, 330, 329, 727, + 652, 329, 330, 330, 329, 628, 538, 540, + 728, 729, 730, 731, 732, 733, 628, 538, + 538, 734, 540, 628, 538, 735, 736, 628, + 538, 737, 652, 738, 652, 739, 740, 741, + 742, 743, 744, 538, 745, 627, 538, 540, + 627, 628, 329, 471, 330, 471, 330, 329, + 330, 471, 330, 471, 329, 471, 330, 471, + 330, 471, 329, 746, 329, 471, 567, 568, + 569, 570, 571, 572, 747, 329, 748, 651, + 329, 471, 329, 330, 471, 471, 330, 471, + 330, 471, 329, 330, 471, 329, 330, 329, + 471, 471, 330, 329, 330, 471, 329, 330, + 329, 471, 330, 471, 329, 330, 471, 329, + 330, 471, 330, 329, 330, 471, 330, 471, + 330, 329, 330, 471, 330, 471, 329, 330, + 330, 471, 329, 330, 471, 329, 330, 329, + 471, 713, 329, 749, 713, 329, 384, 652, + 750, 652, 329, 330, 329, 328, 3, 1, + 328, 3, 1, 752, 753, 751, 1, 328, + 3, 1, 328, 3, 1, 754, 755, 756, + 757, 758, 751, 1, 759, 146, 760, 761, + 760, 761, 761, 760, 761, 761, 760, 761, + 761, 761, 760, 761, 760, 761, 761, 760, + 761, 761, 761, 761, 760, 761, 761, 760, + 760, 761, 761, 760, 761, 761, 760, 762, + 763, 764, 765, 766, 768, 769, 770, 772, + 773, 774, 775, 776, 777, 778, 779, 780, + 781, 782, 783, 784, 785, 786, 787, 788, + 789, 767, 771, 760, 761, 761, 761, 761, + 760, 761, 760, 761, 761, 760, 760, 760, + 761, 760, 760, 760, 761, 761, 761, 761, + 760, 760, 760, 760, 760, 760, 760, 761, + 760, 760, 760, 760, 760, 760, 761, 760, + 760, 760, 760, 760, 761, 761, 761, 761, + 760, 761, 761, 761, 761, 761, 760, 761, + 761, 760, 761, 761, 761, 761, 760, 761, + 761, 760, 760, 760, 760, 760, 760, 761, + 761, 761, 761, 761, 761, 760, 761, 761, + 761, 760, 760, 760, 760, 760, 760, 761, + 761, 760, 761, 761, 761, 761, 761, 760, + 761, 761, 760, 761, 760, 761, 761, 760, + 761, 760, 761, 761, 761, 761, 761, 760, + 761, 760, 761, 761, 761, 761, 760, 761, + 760, 790, 791, 792, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, + 805, 806, 807, 808, 809, 810, 760, 761, + 761, 760, 761, 761, 761, 760, 761, 761, + 761, 761, 760, 761, 760, 761, 761, 760, + 761, 761, 760, 761, 760, 760, 760, 761, + 761, 760, 761, 761, 760, 761, 761, 760, + 761, 760, 761, 761, 761, 761, 761, 760, + 761, 760, 761, 761, 760, 760, 760, 761, + 761, 761, 760, 761, 760, 761, 760, 761, + 761, 761, 761, 761, 760, 761, 761, 760, + 811, 812, 813, 814, 815, 760, 761, 816, + 760, 761, 761, 760, 817, 818, 812, 819, + 820, 821, 822, 823, 824, 825, 826, 827, + 828, 829, 830, 831, 832, 833, 834, 835, + 836, 813, 814, 815, 760, 761, 816, 761, + 760, 761, 760, 761, 760, 761, 761, 760, + 761, 761, 760, 761, 761, 760, 761, 760, + 761, 761, 761, 760, 761, 760, 761, 761, + 760, 761, 761, 760, 761, 761, 761, 760, + 760, 761, 761, 761, 760, 761, 760, 761, + 761, 761, 761, 761, 761, 761, 761, 760, + 761, 761, 761, 761, 761, 761, 761, 760, + 761, 761, 761, 761, 760, 761, 760, 761, + 761, 760, 761, 761, 760, 761, 760, 761, + 760, 761, 760, 837, 838, 839, 760, 761, + 761, 760, 761, 760, 761, 761, 760, 840, + 841, 842, 843, 844, 845, 846, 847, 848, + 849, 850, 851, 852, 853, 854, 760, 761, + 761, 760, 761, 760, 761, 760, 761, 761, + 761, 761, 760, 761, 761, 760, 760, 760, + 760, 761, 761, 760, 761, 760, 761, 761, + 760, 760, 760, 761, 761, 760, 761, 761, + 761, 760, 761, 761, 761, 761, 760, 761, + 761, 761, 760, 761, 761, 760, 855, 856, + 841, 760, 761, 760, 761, 761, 760, 857, + 858, 859, 860, 861, 862, 863, 760, 864, + 865, 866, 867, 868, 869, 870, 760, 761, + 760, 761, 760, 761, 760, 761, 761, 761, + 761, 761, 760, 761, 760, 761, 760, 761, + 760, 871, 872, 873, 874, 875, 876, 877, + 878, 879, 880, 881, 882, 883, 884, 885, + 886, 887, 884, 888, 889, 890, 891, 892, + 893, 894, 895, 896, 897, 898, 899, 900, + 901, 760, 761, 761, 760, 760, 761, 760, + 760, 761, 761, 761, 760, 761, 761, 760, + 761, 761, 760, 760, 760, 761, 761, 761, + 760, 761, 760, 761, 761, 761, 760, 761, + 761, 761, 761, 761, 761, 761, 760, 761, + 760, 761, 761, 760, 761, 760, 760, 761, + 761, 761, 760, 760, 760, 761, 760, 761, + 761, 760, 761, 760, 761, 760, 761, 761, + 761, 760, 761, 761, 761, 760, 761, 761, + 760, 761, 760, 761, 761, 760, 761, 761, + 760, 761, 761, 761, 761, 760, 760, 760, + 761, 761, 761, 761, 760, 761, 760, 902, + 903, 904, 905, 760, 761, 760, 761, 760, + 761, 761, 760, 760, 760, 761, 906, 760, + 761, 760, 907, 908, 909, 910, 911, 912, + 760, 761, 761, 761, 760, 760, 760, 760, + 761, 761, 760, 761, 761, 760, 760, 760, + 761, 761, 761, 761, 760, 913, 903, 914, + 915, 916, 760, 761, 761, 761, 761, 761, + 760, 761, 760, 761, 760, 761, 760, 918, + 828, 830, 919, 920, 921, 922, 923, 924, + 918, 828, 828, 828, 830, 918, 828, 925, + 926, 918, 828, 927, 828, 928, 929, 930, + 931, 932, 828, 933, 934, 828, 935, 917, + 830, 917, 918, 760, 761, 761, 761, 760, + 761, 761, 760, 761, 761, 761, 760, 760, + 761, 761, 761, 761, 761, 761, 760, 761, + 760, 761, 760, 761, 760, 760, 761, 761, + 760, 761, 760, 761, 760, 761, 761, 760, + 761, 761, 760, 761, 761, 760, 761, 761, + 760, 760, 761, 936, 760, 937, 828, 917, + 938, 918, 760, 761, 760, 939, 838, 760, + 761, 760, 857, 858, 859, 860, 861, 862, + 940, 760, 941, 760, 761, 760, 790, 791, + 792, 754, 755, 942, 793, 794, 795, 796, + 797, 798, 799, 800, 801, 802, 803, 804, + 805, 806, 807, 808, 809, 810, 760, 943, + 759, 790, 791, 792, 944, 756, 757, 793, + 794, 795, 796, 797, 798, 799, 800, 801, + 802, 803, 804, 805, 806, 807, 808, 809, + 810, 760, 943, 760, 945, 943, 790, 791, + 792, 946, 757, 793, 794, 795, 796, 797, + 798, 799, 800, 801, 802, 803, 804, 805, + 806, 807, 808, 809, 810, 760, 945, 760, + 146, 945, 947, 760, 945, 760, 948, 949, + 760, 943, 760, 760, 945, 760, 943, 760, + 943, 840, 841, 842, 843, 844, 845, 846, + 950, 848, 849, 850, 851, 852, 853, 854, + 952, 953, 954, 955, 956, 957, 952, 953, + 954, 955, 956, 957, 952, 951, 958, 760, + 761, 759, 760, 959, 959, 959, 945, 760, + 790, 791, 792, 944, 942, 793, 794, 795, + 796, 797, 798, 799, 800, 801, 802, 803, + 804, 805, 806, 807, 808, 809, 810, 760, + 948, 960, 760, 760, 943, 959, 959, 945, + 959, 959, 945, 959, 959, 959, 945, 959, + 959, 945, 959, 959, 945, 959, 959, 760, + 945, 945, 954, 955, 956, 957, 951, 952, + 954, 955, 956, 957, 951, 952, 954, 955, + 956, 957, 951, 952, 954, 955, 956, 957, + 951, 952, 954, 955, 956, 957, 951, 952, + 954, 955, 956, 957, 951, 952, 954, 955, + 956, 957, 951, 952, 954, 955, 956, 957, + 951, 952, 954, 955, 956, 957, 951, 952, + 953, 958, 955, 956, 957, 951, 952, 953, + 955, 956, 957, 951, 952, 953, 955, 956, + 957, 951, 952, 953, 955, 956, 957, 951, + 952, 953, 955, 956, 957, 951, 952, 953, + 955, 956, 957, 951, 952, 953, 955, 956, + 957, 951, 952, 953, 955, 956, 957, 951, + 952, 953, 955, 956, 957, 951, 952, 953, + 954, 958, 956, 957, 951, 952, 953, 954, + 956, 957, 951, 952, 953, 954, 956, 957, + 951, 952, 953, 954, 956, 957, 951, 952, + 953, 954, 956, 961, 960, 955, 760, 958, + 959, 760, 943, 945, 144, 3, 1, 962, + 963, 964, 965, 966, 967, 968, 969, 970, + 971, 972, 214, 973, 216, 974, 975, 976, + 977, 978, 979, 751, 1, 144, 980, 145, + 3, 144, 3, 144, 3, 1, 980, 981, + 981, 980, 980, 981, 980, 980, 981, 980, + 980, 980, 981, 980, 981, 980, 980, 981, + 980, 980, 980, 980, 981, 980, 980, 981, + 981, 980, 980, 981, 980, 980, 981, 982, + 983, 984, 985, 986, 988, 989, 990, 992, + 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, + 1009, 987, 991, 981, 980, 980, 980, 980, + 981, 980, 981, 980, 980, 981, 981, 981, + 980, 981, 981, 981, 980, 980, 980, 980, + 981, 981, 981, 981, 981, 981, 981, 980, + 981, 981, 981, 981, 981, 981, 980, 981, + 981, 981, 981, 981, 980, 980, 980, 980, + 981, 980, 980, 980, 980, 980, 981, 980, + 980, 981, 980, 980, 980, 980, 981, 980, + 980, 981, 981, 981, 981, 981, 981, 980, + 980, 980, 980, 980, 980, 981, 980, 980, + 980, 981, 981, 981, 981, 981, 981, 980, + 980, 981, 980, 980, 980, 980, 980, 981, + 980, 980, 981, 980, 981, 980, 980, 981, + 980, 981, 980, 980, 980, 980, 980, 981, + 980, 981, 980, 980, 980, 980, 981, 980, + 981, 1010, 1011, 1012, 1013, 1014, 1015, 1016, + 1017, 1018, 1019, 1020, 1021, 1022, 1023, 1024, + 1025, 1026, 1027, 1028, 1029, 1030, 981, 980, + 980, 981, 980, 980, 980, 981, 980, 980, + 980, 980, 981, 980, 981, 980, 980, 981, + 980, 980, 981, 980, 981, 981, 981, 980, + 980, 981, 980, 980, 981, 980, 980, 981, + 980, 981, 980, 980, 980, 980, 980, 981, + 980, 981, 980, 980, 981, 981, 981, 980, + 980, 980, 981, 980, 981, 980, 981, 980, + 980, 980, 980, 980, 981, 980, 980, 981, + 1031, 1032, 1033, 1034, 1035, 981, 980, 981, + 980, 981, 980, 981, 980, 981, 980, 981, + 1036, 1037, 981, 980, 981, 980, 981, 1038, + 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, + 1047, 1048, 1049, 1050, 1051, 1052, 981, 980, + 980, 981, 980, 981, 980, 981, 980, 980, + 980, 980, 981, 980, 980, 981, 981, 981, + 981, 980, 980, 981, 980, 981, 980, 980, + 981, 981, 981, 980, 980, 981, 980, 980, + 980, 981, 980, 980, 980, 980, 981, 980, + 980, 980, 981, 980, 980, 981, 1053, 1054, + 1039, 981, 980, 981, 980, 980, 981, 1055, + 1056, 1057, 1058, 1059, 1060, 1061, 981, 1062, + 1063, 1064, 1065, 1066, 1067, 1068, 981, 980, + 981, 980, 981, 980, 981, 980, 980, 980, + 980, 980, 981, 980, 981, 980, 981, 980, + 981, 1069, 1070, 1071, 1072, 1073, 1074, 1075, + 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, + 1084, 1085, 1082, 1086, 1087, 1088, 1089, 1090, + 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, + 1099, 981, 980, 980, 981, 981, 980, 981, + 981, 980, 980, 980, 981, 980, 980, 981, + 980, 980, 981, 981, 981, 980, 980, 980, + 981, 980, 981, 980, 980, 980, 981, 980, + 980, 980, 980, 980, 980, 980, 981, 980, + 981, 980, 980, 981, 980, 981, 981, 980, + 980, 980, 981, 981, 981, 980, 981, 980, + 980, 981, 980, 981, 980, 981, 980, 980, + 980, 981, 980, 980, 980, 981, 980, 980, + 981, 980, 981, 980, 980, 981, 980, 980, + 981, 980, 980, 980, 980, 981, 981, 981, + 980, 980, 980, 980, 981, 980, 981, 1100, + 1101, 1102, 1103, 981, 980, 981, 980, 981, + 980, 980, 981, 981, 981, 980, 1104, 981, + 980, 981, 1105, 1106, 1107, 1108, 1109, 1110, + 981, 980, 980, 980, 981, 981, 981, 981, + 980, 980, 981, 980, 980, 981, 981, 981, + 980, 980, 980, 980, 981, 1111, 1101, 1112, + 1113, 1114, 981, 980, 980, 980, 980, 980, + 981, 980, 981, 980, 981, 980, 981, 1115, + 981, 980, 981, 1116, 981, 1117, 1118, 1119, + 1121, 1120, 981, 980, 981, 981, 980, 980, + 145, 3, 144, 3, 1, 145, 145, 3, + 1, 3, 145, 3, 145, 3, 1, 145, + 3, 145, 3, 1, 145, 3, 1, 145, + 3, 145, 3, 145, 3, 1, 145, 3, + 1, 145, 3, 145, 3, 1, 145, 3, + 3, 145, 1, 3, 3, 145, 1, 145, + 3, 145, 1, 3, 3, 145, 145, 145, + 145, 3, 145, 3, 145, 3, 1, 145, + 145, 145, 145, 3, 3, 145, 3, 145, + 3, 1, 145, 145, 145, 3, 145, 3, + 1, 3, 145, 3, 1, 3, 145, 3, + 145, 3, 1, 145, 145, 3, 1, 1122, + 1123, 751, 1, 145, 145, 3, 1, 145, + 145, 3, 1, 751, 1, 1124, 1126, 1127, + 1128, 1129, 1130, 1131, 1126, 1127, 1128, 1129, + 1130, 1131, 1126, 751, 1125, 958, 1, 3, + 759, 3, 1, 943, 943, 943, 945, 1, + 943, 943, 945, 943, 943, 945, 943, 943, + 943, 945, 943, 943, 945, 943, 943, 945, + 943, 943, 1, 945, 1128, 1129, 1130, 1131, + 1125, 1126, 1128, 1129, 1130, 1131, 1125, 1126, + 1128, 1129, 1130, 1131, 1125, 1126, 1128, 1129, + 1130, 1131, 1125, 1126, 1128, 1129, 1130, 1131, + 1125, 1126, 1128, 1129, 1130, 1131, 1125, 1126, + 1128, 1129, 1130, 1131, 1125, 1126, 1128, 1129, + 1130, 1131, 1125, 1126, 1128, 1129, 1130, 1131, + 1125, 1126, 1127, 958, 1129, 1130, 1131, 1125, + 1126, 1127, 1129, 1130, 1131, 1125, 1126, 1127, + 1129, 1130, 1131, 1125, 1126, 1127, 1129, 1130, + 1131, 1125, 1126, 1127, 1129, 1130, 1131, 1125, + 1126, 1127, 1129, 1130, 1131, 1125, 1126, 1127, + 1129, 1130, 1131, 1125, 1126, 1127, 1129, 1130, + 1131, 1125, 1126, 1127, 1129, 1130, 1131, 1125, + 1126, 1127, 1128, 958, 1130, 1131, 1125, 1126, + 1127, 1128, 1130, 1131, 1125, 1126, 1127, 1128, + 1130, 1131, 1125, 1126, 1127, 1128, 1130, 1131, + 1125, 1126, 1127, 1128, 1130, 1132, 1133, 1129, + 751, 1, 958, 943, 3, 943, 945, 3, + 945, 3, 1, 943, 1134, 1135, 751, 1, + 144, 3, 1, 3, 3, 144, 3, 1, + 1137, 1138, 1139, 1140, 1141, 1136, 1, 1142, + 1143, 1144, 1145, 1146, 1147, 751, 1, 328, + 3, 1, 328, 3, 1, 3, 328, 3, + 1, 328, 3, 1, 3, 328, 3, 1, + 328, 3, 1, 1148, 751, 1, 3, 144, + 3, 1, 1149, 751, 1, 3, 144, 3, + 1, 1150, 751, 1, 3, 144, 3, 1, + 304, 214, 216, 1151, 1152, 1153, 1154, 1155, + 1156, 304, 214, 214, 1157, 216, 304, 214, + 1158, 1159, 304, 214, 1160, 751, 1161, 751, + 1162, 1163, 1164, 1165, 1166, 1167, 214, 1168, + 303, 214, 216, 303, 304, 1, 145, 3, + 145, 3, 1, 3, 145, 3, 145, 1, + 145, 3, 145, 3, 145, 1, 1169, 1, + 145, 1170, 1171, 1170, 1171, 1171, 1170, 1171, + 1171, 1170, 1171, 1171, 1171, 1170, 1171, 1170, + 1171, 1171, 1170, 1171, 1171, 1171, 1171, 1170, + 1171, 1171, 1170, 1170, 1171, 1171, 1170, 1171, + 1171, 1170, 1172, 1173, 1174, 1175, 1176, 1178, + 1179, 1180, 1182, 1183, 1184, 1185, 1186, 1187, + 1188, 1189, 1190, 1191, 1192, 1193, 1194, 1195, + 1196, 1197, 1198, 1199, 1177, 1181, 1170, 1171, + 1171, 1171, 1171, 1170, 1171, 1170, 1171, 1171, + 1170, 1170, 1170, 1171, 1170, 1170, 1170, 1171, + 1171, 1171, 1171, 1170, 1170, 1170, 1170, 1170, + 1170, 1170, 1171, 1170, 1170, 1170, 1170, 1170, + 1170, 1171, 1170, 1170, 1170, 1170, 1170, 1171, + 1171, 1171, 1171, 1170, 1171, 1171, 1171, 1171, + 1171, 1170, 1171, 1171, 1170, 1171, 1171, 1171, + 1171, 1170, 1171, 1171, 1170, 1170, 1170, 1170, + 1170, 1170, 1171, 1171, 1171, 1171, 1171, 1171, + 1170, 1171, 1171, 1171, 1170, 1170, 1170, 1170, + 1170, 1170, 1171, 1171, 1170, 1171, 1171, 1171, + 1171, 1171, 1170, 1171, 1171, 1170, 1171, 1170, + 1171, 1171, 1170, 1171, 1170, 1171, 1171, 1171, + 1171, 1171, 1170, 1171, 1170, 1171, 1171, 1171, + 1171, 1170, 1171, 1170, 1200, 1201, 1202, 1203, + 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, + 1212, 1213, 1214, 1215, 1216, 1217, 1218, 1219, + 1220, 1170, 1171, 1171, 1170, 1171, 1171, 1171, + 1170, 1171, 1171, 1171, 1171, 1170, 1171, 1170, + 1171, 1171, 1170, 1171, 1171, 1170, 1171, 1170, + 1170, 1170, 1171, 1171, 1170, 1171, 1171, 1170, + 1171, 1171, 1170, 1171, 1170, 1171, 1171, 1171, + 1171, 1171, 1170, 1171, 1170, 1171, 1171, 1170, + 1170, 1170, 1171, 1171, 1171, 1170, 1171, 1170, + 1171, 1170, 1171, 1171, 1171, 1171, 1171, 1170, + 1171, 1171, 1170, 1221, 1222, 1223, 1224, 1225, + 1170, 1171, 1226, 1170, 1171, 1171, 1170, 1227, + 1228, 1222, 1229, 1230, 1231, 1232, 1233, 1234, + 1235, 1236, 1237, 1238, 1239, 1240, 1241, 1242, + 1243, 1244, 1245, 1246, 1223, 1224, 1225, 1170, + 1171, 1226, 1171, 1170, 1171, 1170, 1171, 1170, + 1171, 1171, 1170, 1171, 1171, 1170, 1171, 1171, + 1170, 1171, 1170, 1171, 1171, 1171, 1170, 1171, + 1170, 1171, 1171, 1170, 1171, 1171, 1170, 1171, + 1171, 1171, 1170, 1170, 1171, 1171, 1171, 1170, + 1171, 1170, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1170, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1170, 1171, 1171, 1171, 1171, 1170, + 1171, 1170, 1171, 1171, 1170, 1171, 1171, 1170, + 1171, 1170, 1171, 1170, 1171, 1170, 1247, 1248, + 1249, 1170, 1171, 1171, 1170, 1171, 1170, 1171, + 1171, 1170, 1250, 1251, 1252, 1253, 1254, 1255, + 1256, 1257, 1258, 1259, 1260, 1261, 1262, 1263, + 1264, 1170, 1171, 1171, 1170, 1171, 1170, 1171, + 1170, 1171, 1171, 1171, 1171, 1170, 1171, 1171, + 1170, 1170, 1170, 1170, 1171, 1171, 1170, 1171, + 1170, 1171, 1171, 1170, 1170, 1170, 1171, 1171, + 1170, 1171, 1171, 1171, 1170, 1171, 1171, 1171, + 1171, 1170, 1171, 1171, 1171, 1170, 1171, 1171, + 1170, 1265, 1266, 1251, 1170, 1171, 1170, 1171, + 1171, 1170, 1267, 1268, 1269, 1270, 1271, 1272, + 1273, 1170, 1274, 1275, 1276, 1277, 1278, 1279, + 1280, 1170, 1171, 1170, 1171, 1170, 1171, 1170, + 1171, 1171, 1171, 1171, 1171, 1170, 1171, 1170, + 1171, 1170, 1171, 1170, 1281, 1282, 1283, 1284, + 1285, 1286, 1287, 1288, 1289, 1290, 1291, 1292, + 1293, 1294, 1295, 1296, 1297, 1294, 1298, 1299, + 1300, 1301, 1302, 1303, 1304, 1305, 1306, 1307, + 1308, 1309, 1310, 1311, 1170, 1171, 1171, 1170, + 1170, 1171, 1170, 1170, 1171, 1171, 1171, 1170, + 1171, 1171, 1170, 1171, 1171, 1170, 1170, 1170, + 1171, 1171, 1171, 1170, 1171, 1170, 1171, 1171, + 1171, 1170, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1170, 1171, 1170, 1171, 1171, 1170, 1171, + 1170, 1170, 1171, 1171, 1171, 1170, 1170, 1170, + 1171, 1170, 1171, 1171, 1170, 1171, 1170, 1171, + 1170, 1171, 1171, 1171, 1170, 1171, 1171, 1171, + 1170, 1171, 1171, 1170, 1171, 1170, 1171, 1171, + 1170, 1171, 1171, 1170, 1171, 1171, 1171, 1171, + 1170, 1170, 1170, 1171, 1171, 1171, 1171, 1170, + 1171, 1170, 1312, 1313, 1314, 1315, 1170, 1171, + 1170, 1171, 1170, 1171, 1171, 1170, 1170, 1170, + 1171, 1316, 1170, 1171, 1170, 1317, 1318, 1319, + 1320, 1321, 1322, 1170, 1171, 1171, 1171, 1170, + 1170, 1170, 1170, 1171, 1171, 1170, 1171, 1171, + 1170, 1170, 1170, 1171, 1171, 1171, 1171, 1170, + 1323, 1313, 1324, 1325, 1326, 1170, 1171, 1171, + 1171, 1171, 1171, 1170, 1171, 1170, 1171, 1170, + 1171, 1170, 1328, 1238, 1240, 1329, 1330, 1331, + 1332, 1333, 1334, 1328, 1238, 1238, 1238, 1240, + 1328, 1238, 1335, 1336, 1328, 1238, 1337, 1238, + 1338, 1339, 1340, 1341, 1342, 1238, 1343, 1344, + 1238, 1345, 1327, 1240, 1327, 1328, 1170, 1171, + 1171, 1171, 1170, 1171, 1171, 1170, 1171, 1171, + 1171, 1170, 1170, 1171, 1171, 1171, 1171, 1171, + 1171, 1170, 1171, 1170, 1171, 1170, 1171, 1170, + 1170, 1171, 1171, 1170, 1171, 1170, 1171, 1170, + 1171, 1171, 1170, 1171, 1171, 1170, 1171, 1171, + 1170, 1171, 1171, 1170, 1170, 1171, 1346, 1170, + 1347, 1238, 1327, 1348, 1328, 1170, 1171, 1170, + 1349, 1248, 1170, 1171, 1170, 1267, 1268, 1269, + 1270, 1271, 1272, 1350, 1170, 1351, 1170, 1171, + 1170, 1267, 1268, 1269, 1270, 1271, 1272, 1352, + 1170, 1353, 1351, 1170, 1171, 1170, 3, 145, + 145, 3, 145, 3, 145, 1, 3, 145, + 1, 3, 1, 145, 145, 3, 1, 3, + 145, 1, 3, 1, 145, 3, 145, 1, + 3, 145, 1, 3, 145, 3, 1, 3, + 145, 3, 145, 3, 1, 3, 145, 3, + 145, 1, 3, 3, 145, 1, 3, 145, + 1, 3, 1, 145, 1136, 1, 1354, 1136, + 1, 1355, 1356, 1357, 1358, 1357, 751, 1359, + 1, 144, 3, 1, 1, 144, 1, 144, + 3, 144, 1, 144, 1, 1361, 1360, 1364, + 1365, 1366, 1367, 1368, 1369, 1370, 1371, 1373, + 1374, 1375, 1376, 1377, 1378, 1380, 1360, 1, + 1363, 1372, 1379, 1, 1362, 141, 143, 1382, + 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1390, + 1391, 1392, 1393, 1394, 1395, 1396, 1397, 1398, + 1399, 1381, 303, 324, 1401, 1402, 1403, 1404, + 1405, 1406, 1407, 1408, 1409, 1410, 1411, 1412, + 1413, 1414, 1415, 1416, 1417, 1418, 1400, 1419, + 303, 324, 1401, 1402, 1403, 1404, 1405, 1406, + 1407, 1408, 1409, 1410, 1411, 1412, 1420, 1421, + 1415, 1416, 1422, 1418, 1400, 1424, 1425, 1426, + 1427, 1428, 1429, 1430, 1431, 1432, 1433, 1434, + 1435, 1436, 1437, 1439, 330, 652, 713, 1438, + 1423, 468, 470, 1440, 1441, 1442, 1443, 1444, + 1445, 1446, 1447, 1448, 1449, 1450, 1451, 1452, + 1453, 1454, 1455, 1456, 1457, 1423, 627, 648, + 1458, 1459, 1460, 1461, 1462, 1463, 1464, 1465, + 1466, 1467, 1468, 1469, 1470, 1471, 1472, 1473, + 1474, 1475, 1423, 1476, 627, 648, 1458, 1459, + 1460, 1461, 1462, 1463, 1464, 1465, 1466, 1467, + 1468, 1469, 1477, 1478, 1472, 1473, 1479, 1475, + 1423, 627, 648, 1458, 1459, 1460, 1461, 1462, + 1463, 1464, 1465, 1466, 1467, 1468, 1480, 1470, + 1471, 1481, 1482, 1483, 1484, 1473, 1474, 1475, + 1423, 627, 648, 1458, 1459, 1460, 1461, 1462, + 1463, 1464, 1465, 1466, 1467, 1468, 1485, 1470, + 1471, 1472, 1486, 1473, 1474, 1475, 1423, 627, + 648, 1458, 1459, 1460, 1461, 1462, 1463, 1464, + 1465, 1466, 1467, 1468, 1487, 1470, 1471, 1472, + 1488, 1473, 1474, 1475, 1423, 627, 648, 1458, + 1459, 1460, 1461, 1462, 1463, 1464, 1465, 1466, + 1467, 1468, 1489, 1470, 1471, 1472, 1490, 1473, + 1474, 1475, 1423, 627, 648, 1458, 1459, 1460, + 1461, 1462, 1463, 1464, 1465, 1466, 1467, 1468, + 1469, 1470, 1471, 1472, 1473, 1491, 1475, 1423, + 917, 938, 1493, 1494, 1495, 1496, 1497, 1498, + 1499, 1500, 1501, 1502, 1503, 1504, 1505, 1506, + 1507, 1508, 1509, 1510, 1511, 1512, 1513, 1492, + 917, 938, 1493, 1494, 1495, 1496, 1497, 1498, + 1499, 1500, 1501, 1502, 1503, 1514, 1505, 1506, + 1515, 1511, 1512, 1513, 1492, 1516, 917, 938, + 1493, 1494, 1495, 1496, 1497, 1498, 1499, 1500, + 1501, 1502, 1503, 1514, 1517, 1518, 1515, 1511, + 1519, 1513, 1492, 917, 938, 1493, 1494, 1495, + 1496, 1497, 1498, 1499, 1500, 1501, 1502, 1503, + 1520, 1505, 1506, 1515, 1521, 1511, 1512, 1513, + 1492, 917, 938, 1493, 1494, 1495, 1496, 1497, + 1498, 1499, 1500, 1501, 1502, 1503, 1522, 1505, + 1506, 1515, 1523, 1511, 1512, 1513, 1492, 917, + 938, 1493, 1494, 1495, 1496, 1497, 1498, 1499, + 1500, 1501, 1502, 1503, 1524, 1505, 1506, 1515, + 1525, 1511, 1512, 1513, 1492, 1119, 1121, 1527, + 1528, 1529, 1530, 1531, 1532, 1533, 1534, 1535, + 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, + 1544, 1526, 1327, 1348, 1546, 1547, 1548, 1549, + 1550, 1551, 1552, 1553, 1554, 1555, 1556, 1557, + 1558, 1559, 1560, 1561, 1562, 1563, 1545, 1327, + 1348, 1546, 1547, 1548, 1549, 1550, 1551, 1552, + 1553, 1554, 1555, 1556, 1557, 1558, 1559, 1560, + 1561, 1564, 1563, 1545, 1565, 1327, 1348, 1546, + 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, + 1555, 1556, 1557, 1566, 1567, 1560, 1561, 1568, + 1563, 1545, +} + +var _graphclust_trans_targs []int16 = []int16{ + 1528, 0, 1528, 1529, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, + 44, 45, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 66, 67, 68, + 69, 70, 72, 73, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 91, 92, 94, 102, 134, + 139, 141, 148, 153, 95, 96, 97, 98, + 99, 100, 101, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 135, 136, 137, 138, 140, 142, + 143, 144, 145, 146, 147, 149, 150, 151, + 152, 154, 156, 157, 158, 2, 159, 3, + 1528, 1530, 1528, 1528, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, + 187, 188, 189, 190, 191, 192, 193, 194, + 195, 196, 197, 198, 199, 200, 201, 202, + 204, 205, 206, 207, 208, 209, 210, 211, + 212, 213, 214, 215, 216, 217, 218, 219, + 220, 221, 222, 223, 224, 226, 231, 250, + 251, 252, 1531, 229, 230, 232, 233, 234, + 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 249, 254, + 255, 256, 258, 259, 260, 261, 262, 263, + 264, 265, 266, 267, 268, 269, 270, 271, + 272, 274, 275, 277, 285, 317, 322, 324, + 331, 336, 278, 279, 280, 281, 282, 283, + 284, 286, 287, 288, 289, 290, 291, 292, + 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, + 309, 310, 311, 312, 313, 314, 315, 316, + 318, 319, 320, 321, 323, 325, 326, 327, + 328, 329, 330, 332, 333, 334, 335, 162, + 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, + 353, 354, 356, 357, 163, 359, 361, 362, + 1532, 1528, 1533, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 393, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 406, + 407, 408, 409, 410, 411, 412, 413, 414, + 415, 416, 417, 418, 419, 420, 421, 422, + 423, 424, 425, 426, 428, 429, 430, 431, + 432, 434, 435, 437, 438, 439, 440, 441, + 442, 443, 444, 445, 446, 447, 448, 449, + 450, 451, 453, 454, 456, 464, 496, 501, + 503, 510, 515, 457, 458, 459, 460, 461, + 462, 463, 465, 466, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 476, 477, 478, + 479, 480, 481, 482, 483, 484, 485, 486, + 487, 488, 489, 490, 491, 492, 493, 494, + 495, 497, 498, 499, 500, 502, 504, 505, + 506, 507, 508, 509, 511, 512, 513, 514, + 516, 518, 519, 520, 364, 521, 365, 1534, + 537, 538, 539, 540, 541, 542, 543, 544, + 545, 546, 547, 548, 549, 550, 551, 552, + 553, 554, 555, 556, 557, 558, 559, 560, + 561, 562, 563, 564, 566, 567, 568, 569, + 570, 571, 572, 573, 574, 575, 576, 577, + 578, 579, 580, 581, 582, 583, 584, 585, + 586, 588, 593, 612, 613, 614, 1535, 591, + 592, 594, 595, 596, 597, 598, 599, 600, + 601, 602, 603, 604, 605, 606, 607, 608, + 609, 610, 611, 616, 617, 618, 620, 621, + 622, 623, 624, 625, 626, 627, 628, 629, + 630, 631, 632, 633, 634, 636, 637, 639, + 647, 679, 684, 686, 693, 698, 640, 641, + 642, 643, 644, 645, 646, 648, 649, 650, + 651, 652, 653, 654, 655, 656, 657, 658, + 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 671, 672, 673, 674, + 675, 676, 677, 678, 680, 681, 682, 683, + 685, 687, 688, 689, 690, 691, 692, 694, + 695, 696, 697, 524, 699, 700, 701, 702, + 703, 704, 705, 706, 707, 708, 709, 710, + 711, 712, 713, 714, 715, 716, 718, 719, + 525, 721, 723, 724, 522, 729, 730, 732, + 734, 737, 740, 764, 1536, 746, 1537, 736, + 1538, 739, 742, 744, 745, 748, 749, 753, + 754, 755, 756, 757, 758, 759, 1539, 752, + 763, 766, 767, 768, 769, 770, 771, 772, + 773, 774, 775, 776, 777, 778, 779, 780, + 781, 782, 783, 785, 786, 789, 790, 791, + 792, 793, 794, 795, 796, 800, 801, 803, + 804, 787, 806, 813, 815, 817, 819, 807, + 808, 809, 810, 811, 812, 814, 816, 818, + 820, 821, 822, 823, 827, 828, 829, 830, + 831, 832, 833, 834, 835, 836, 837, 838, + 839, 840, 1540, 825, 826, 843, 844, 160, + 848, 849, 851, 1054, 1057, 1060, 1084, 1541, + 1528, 1542, 865, 866, 867, 868, 869, 870, + 871, 872, 873, 874, 875, 876, 877, 878, + 879, 880, 881, 882, 883, 884, 885, 886, + 887, 888, 889, 890, 891, 892, 894, 895, + 896, 897, 898, 899, 900, 901, 902, 903, + 904, 905, 906, 907, 908, 909, 910, 911, + 912, 913, 914, 916, 921, 940, 941, 942, + 1543, 919, 920, 922, 923, 924, 925, 926, + 927, 928, 929, 930, 931, 932, 933, 934, + 935, 936, 937, 938, 939, 944, 945, 946, + 948, 949, 950, 951, 952, 953, 954, 955, + 956, 957, 958, 959, 960, 961, 962, 964, + 965, 967, 975, 1007, 1012, 1014, 1021, 1026, + 968, 969, 970, 971, 972, 973, 974, 976, + 977, 978, 979, 980, 981, 982, 983, 984, + 985, 986, 987, 988, 989, 990, 991, 992, + 993, 994, 995, 996, 997, 998, 999, 1000, + 1001, 1002, 1003, 1004, 1005, 1006, 1008, 1009, + 1010, 1011, 1013, 1015, 1016, 1017, 1018, 1019, + 1020, 1022, 1023, 1024, 1025, 852, 1027, 1028, + 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, + 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, + 1046, 1047, 853, 1049, 1051, 1052, 1066, 1544, + 1056, 1545, 1059, 1062, 1064, 1065, 1068, 1069, + 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1546, + 1072, 1083, 1086, 1245, 1246, 1247, 1248, 1249, + 1250, 1251, 1252, 1253, 1254, 1255, 1256, 1257, + 1258, 1259, 1260, 1261, 1547, 1528, 1100, 1101, + 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, + 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, + 1118, 1119, 1120, 1121, 1122, 1123, 1124, 1125, + 1126, 1127, 1129, 1130, 1131, 1132, 1133, 1134, + 1135, 1136, 1137, 1138, 1139, 1140, 1141, 1142, + 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1151, + 1152, 1153, 1154, 1155, 1157, 1158, 1160, 1161, + 1162, 1163, 1164, 1165, 1166, 1167, 1168, 1169, + 1170, 1171, 1172, 1173, 1174, 1176, 1177, 1179, + 1187, 1219, 1224, 1226, 1233, 1238, 1180, 1181, + 1182, 1183, 1184, 1185, 1186, 1188, 1189, 1190, + 1191, 1192, 1193, 1194, 1195, 1196, 1197, 1198, + 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, + 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, + 1215, 1216, 1217, 1218, 1220, 1221, 1222, 1223, + 1225, 1227, 1228, 1229, 1230, 1231, 1232, 1234, + 1235, 1236, 1237, 1239, 1241, 1242, 1243, 1087, + 1244, 1088, 1263, 1264, 1267, 1268, 1269, 1270, + 1271, 1272, 1273, 1274, 1278, 1279, 1281, 1282, + 1265, 1284, 1291, 1293, 1295, 1297, 1285, 1286, + 1287, 1288, 1289, 1290, 1292, 1294, 1296, 1298, + 1299, 1300, 1301, 1506, 1507, 1508, 1509, 1510, + 1511, 1512, 1513, 1514, 1515, 1516, 1517, 1518, + 1519, 1548, 1528, 1549, 1315, 1316, 1317, 1318, + 1319, 1320, 1321, 1322, 1323, 1324, 1325, 1326, + 1327, 1328, 1329, 1330, 1331, 1332, 1333, 1334, + 1335, 1336, 1337, 1338, 1339, 1340, 1341, 1342, + 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, + 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1359, + 1360, 1361, 1362, 1363, 1364, 1366, 1371, 1390, + 1391, 1392, 1550, 1369, 1370, 1372, 1373, 1374, + 1375, 1376, 1377, 1378, 1379, 1380, 1381, 1382, + 1383, 1384, 1385, 1386, 1387, 1388, 1389, 1394, + 1395, 1396, 1398, 1399, 1400, 1401, 1402, 1403, + 1404, 1405, 1406, 1407, 1408, 1409, 1410, 1411, + 1412, 1414, 1415, 1417, 1425, 1457, 1462, 1464, + 1471, 1476, 1418, 1419, 1420, 1421, 1422, 1423, + 1424, 1426, 1427, 1428, 1429, 1430, 1431, 1432, + 1433, 1434, 1435, 1436, 1437, 1438, 1439, 1440, + 1441, 1442, 1443, 1444, 1445, 1446, 1447, 1448, + 1449, 1450, 1451, 1452, 1453, 1454, 1455, 1456, + 1458, 1459, 1460, 1461, 1463, 1465, 1466, 1467, + 1468, 1469, 1470, 1472, 1473, 1474, 1475, 1302, + 1477, 1478, 1479, 1480, 1481, 1482, 1483, 1484, + 1485, 1486, 1487, 1488, 1489, 1490, 1491, 1492, + 1493, 1494, 1496, 1497, 1303, 1499, 1501, 1502, + 1504, 1505, 1522, 1523, 1524, 1525, 1526, 1527, + 1528, 1, 1529, 160, 161, 363, 845, 846, + 847, 850, 1085, 1262, 1265, 1266, 1275, 1276, + 1277, 1280, 1283, 1520, 1521, 1528, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, + 14, 43, 65, 71, 74, 90, 93, 155, + 1528, 164, 165, 166, 167, 168, 169, 170, + 171, 172, 173, 174, 203, 225, 358, 257, + 273, 360, 355, 227, 228, 253, 276, 1528, + 523, 725, 726, 727, 728, 731, 765, 784, + 788, 797, 798, 799, 802, 805, 841, 842, + 366, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 405, 427, 433, 436, 452, + 455, 517, 526, 527, 528, 529, 530, 531, + 532, 533, 534, 535, 536, 565, 587, 720, + 619, 635, 722, 717, 589, 590, 615, 638, + 733, 747, 760, 761, 762, 735, 743, 738, + 741, 750, 751, 824, 1528, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 863, 864, + 1053, 915, 1048, 1067, 1080, 1081, 1082, 963, + 1050, 1045, 893, 947, 917, 918, 943, 966, + 1055, 1063, 1058, 1061, 1070, 1071, 1528, 1089, + 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, + 1098, 1099, 1128, 1150, 1156, 1159, 1175, 1178, + 1240, 1528, 1304, 1305, 1306, 1307, 1308, 1309, + 1310, 1311, 1312, 1313, 1314, 1343, 1365, 1498, + 1397, 1413, 1503, 1495, 1500, 1367, 1368, 1393, + 1416, +} + +var _graphclust_trans_actions []byte = []byte{ + 31, 0, 27, 40, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 34, 55, 29, 19, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 55, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 25, 40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 0, 40, 0, + 40, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 40, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 51, + 17, 40, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 40, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 51, + 0, 51, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 40, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 40, 21, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 40, 23, 40, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 40, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 43, 1, 47, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 15, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 7, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 13, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 9, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 11, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, +} + +var _graphclust_to_state_actions []byte = []byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 37, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +} + +var _graphclust_from_state_actions []byte = []byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, +} + +var _graphclust_eof_trans []int16 = []int16{ + 0, 0, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, + 0, 0, 147, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 147, 148, 147, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 147, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 0, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 330, 330, 330, + 330, 330, 330, 330, 330, 0, 0, 0, + 0, 0, 0, 147, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 147, 761, + 761, 147, 761, 761, 147, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 147, + 761, 761, 761, 761, 0, 0, 0, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 982, 982, 982, + 982, 982, 982, 982, 982, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 1171, 1171, 1171, 1171, 1171, 1171, + 1171, 1171, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1382, 1401, 1401, 1424, 1424, 1424, 1424, + 1424, 1424, 1424, 1424, 1424, 1493, 1493, 1493, + 1493, 1493, 1493, 1527, 1546, 1546, 1546, +} + +const graphclust_start int = 1528 +const graphclust_first_final int = 1528 +const graphclust_error int = 0 + +const graphclust_en_main int = 1528 + +//line grapheme_clusters.rl:14 + +var Error = errors.New("invalid UTF8 text") + +// ScanGraphemeClusters is a split function for bufio.Scanner that splits +// on grapheme cluster boundaries. +func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { + if len(data) == 0 { + return 0, nil, nil + } + + // Ragel state + cs := 0 // Current State + p := 0 // "Pointer" into data + pe := len(data) // End-of-data "pointer" + ts := 0 + te := 0 + act := 0 + eof := pe + + // Make Go compiler happy + _ = ts + _ = te + _ = act + _ = eof + + startPos := 0 + endPos := 0 + +//line grapheme_clusters.go:3787 + { + cs = graphclust_start + ts = 0 + te = 0 + act = 0 + } + +//line grapheme_clusters.go:3795 + { + var _klen int + var _trans int + var _acts int + var _nacts uint + var _keys int + if p == pe { + goto _test_eof + } + if cs == 0 { + goto _out + } + _resume: + _acts = int(_graphclust_from_state_actions[cs]) + _nacts = uint(_graphclust_actions[_acts]) + _acts++ + for ; _nacts > 0; _nacts-- { + _acts++ + switch _graphclust_actions[_acts-1] { + case 4: +//line NONE:1 + ts = p + +//line grapheme_clusters.go:3818 + } + } + + _keys = int(_graphclust_key_offsets[cs]) + _trans = int(_graphclust_index_offsets[cs]) + + _klen = int(_graphclust_single_lengths[cs]) + if _klen > 0 { + _lower := int(_keys) + var _mid int + _upper := int(_keys + _klen - 1) + for { + if _upper < _lower { + break + } + + _mid = _lower + ((_upper - _lower) >> 1) + switch { + case data[p] < _graphclust_trans_keys[_mid]: + _upper = _mid - 1 + case data[p] > _graphclust_trans_keys[_mid]: + _lower = _mid + 1 + default: + _trans += int(_mid - int(_keys)) + goto _match + } + } + _keys += _klen + _trans += _klen + } + + _klen = int(_graphclust_range_lengths[cs]) + if _klen > 0 { + _lower := int(_keys) + var _mid int + _upper := int(_keys + (_klen << 1) - 2) + for { + if _upper < _lower { + break + } + + _mid = _lower + (((_upper - _lower) >> 1) & ^1) + switch { + case data[p] < _graphclust_trans_keys[_mid]: + _upper = _mid - 2 + case data[p] > _graphclust_trans_keys[_mid+1]: + _lower = _mid + 2 + default: + _trans += int((_mid - int(_keys)) >> 1) + goto _match + } + } + _trans += _klen + } + + _match: + _trans = int(_graphclust_indicies[_trans]) + _eof_trans: + cs = int(_graphclust_trans_targs[_trans]) + + if _graphclust_trans_actions[_trans] == 0 { + goto _again + } + + _acts = int(_graphclust_trans_actions[_trans]) + _nacts = uint(_graphclust_actions[_acts]) + _acts++ + for ; _nacts > 0; _nacts-- { + _acts++ + switch _graphclust_actions[_acts-1] { + case 0: +//line grapheme_clusters.rl:47 + + startPos = p + + case 1: +//line grapheme_clusters.rl:51 + + endPos = p + + case 5: +//line NONE:1 + te = p + 1 + + case 6: +//line grapheme_clusters.rl:55 + act = 3 + case 7: +//line grapheme_clusters.rl:55 + act = 4 + case 8: +//line grapheme_clusters.rl:55 + te = p + 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 9: +//line grapheme_clusters.rl:55 + te = p + 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 10: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 11: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 12: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 13: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 14: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 15: +//line grapheme_clusters.rl:55 + te = p + p-- + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 16: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 17: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 18: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 19: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 20: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 21: +//line grapheme_clusters.rl:55 + p = (te) - 1 + { + return endPos + 1, data[startPos : endPos+1], nil + } + case 22: +//line NONE:1 + switch act { + case 0: + { + cs = 0 + goto _again + } + case 3: + { + p = (te) - 1 + + return endPos + 1, data[startPos : endPos+1], nil + } + case 4: + { + p = (te) - 1 + + return endPos + 1, data[startPos : endPos+1], nil + } + } + +//line grapheme_clusters.go:4017 + } + } + + _again: + _acts = int(_graphclust_to_state_actions[cs]) + _nacts = uint(_graphclust_actions[_acts]) + _acts++ + for ; _nacts > 0; _nacts-- { + _acts++ + switch _graphclust_actions[_acts-1] { + case 2: +//line NONE:1 + ts = 0 + + case 3: +//line NONE:1 + act = 0 + +//line grapheme_clusters.go:4035 + } + } + + if cs == 0 { + goto _out + } + p++ + if p != pe { + goto _resume + } + _test_eof: + { + } + if p == eof { + if _graphclust_eof_trans[cs] > 0 { + _trans = int(_graphclust_eof_trans[cs] - 1) + goto _eof_trans + } + } + + _out: + { + } + } + +//line grapheme_clusters.rl:117 + + // If we fall out here then we were unable to complete a sequence. + // If we weren't able to complete a sequence then either we've + // reached the end of a partial buffer (so there's more data to come) + // or we have an isolated symbol that would normally be part of a + // grapheme cluster but has appeared in isolation here. + + if !atEOF { + // Request more + return 0, nil, nil + } + + // Just take the first UTF-8 sequence and return that. + _, seqLen := utf8.DecodeRune(data) + return seqLen, data[:seqLen], nil +} diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.rl b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.rl similarity index 92% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.rl rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.rl index 003ffbf5948..737db18b292 100644 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters.rl +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters.rl @@ -42,6 +42,7 @@ func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { %%{ include GraphemeCluster "grapheme_clusters_table.rl"; + include Emoji "emoji_table.rl"; action start { startPos = p @@ -55,7 +56,7 @@ func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { return endPos+1, data[startPos:endPos+1], nil } - ZWJGlue = ZWJ (Glue_After_Zwj | E_Base_GAZ Extend* E_Modifier?)?; + ZWJGlue = ZWJ (Extended_Pictographic Extend*)?; AnyExtender = Extend | ZWJGlue | SpacingMark; Extension = AnyExtender*; ReplacementChar = (0xEF 0xBF 0xBD); @@ -69,8 +70,8 @@ func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { LVT T* | T+ ) Extension; - EmojiSeq = (E_Base | E_Base_GAZ) Extend* E_Modifier? Extension; - ZWJSeq = ZWJGlue Extension; + EmojiSeq = Extended_Pictographic Extend* Extension; + ZWJSeq = ZWJ (ZWJ | Extend | SpacingMark)*; EmojiFlagSeq = Regional_Indicator Regional_Indicator? Extension; UTF8Cont = 0x80 .. 0xBF; @@ -82,7 +83,7 @@ func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { ); # OtherSeq is any character that isn't at the start of one of the extended sequences above, followed by extension - OtherSeq = (AnyUTF8 - (CR|LF|Control|ReplacementChar|L|LV|V|LVT|T|E_Base|E_Base_GAZ|ZWJ|Regional_Indicator|Prepend)) Extension; + OtherSeq = (AnyUTF8 - (CR|LF|Control|ReplacementChar|L|LV|V|LVT|T|Extended_Pictographic|ZWJ|Regional_Indicator|Prepend)) (Extend | ZWJ | SpacingMark)*; # PrependSeq is prepend followed by any of the other patterns above, except control characters which explicitly break PrependSeq = Prepend+ (HangulSeq|EmojiSeq|ZWJSeq|EmojiFlagSeq|OtherSeq)?; @@ -129,4 +130,4 @@ func ScanGraphemeClusters(data []byte, atEOF bool) (int, []byte, error) { // Just take the first UTF-8 sequence and return that. _, seqLen := utf8.DecodeRune(data) return seqLen, data[:seqLen], nil -} +} \ No newline at end of file diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters_table.rl b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters_table.rl similarity index 95% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters_table.rl rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters_table.rl index fb4511825c6..5e4b5881de2 100644 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/grapheme_clusters_table.rl +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/grapheme_clusters_table.rl @@ -1,7 +1,7 @@ # The following Ragel file was autogenerated with unicode2ragel.rb -# from: http://www.unicode.org/Public/9.0.0/ucd/auxiliary/GraphemeBreakProperty.txt +# from: https://www.unicode.org/Public/12.0.0/ucd/auxiliary/GraphemeBreakProperty.txt # -# It defines ["Prepend", "CR", "LF", "Control", "Extend", "Regional_Indicator", "SpacingMark", "L", "V", "T", "LV", "LVT", "E_Base", "E_Modifier", "ZWJ", "Glue_After_Zwj", "E_Base_GAZ"]. +# It defines ["Prepend", "CR", "LF", "Control", "Extend", "Regional_Indicator", "SpacingMark", "L", "V", "T", "LV", "LVT", "ZWJ"]. # # To use this, make sure that your alphtype is set to byte, # and that your input is in utf8. @@ -16,7 +16,11 @@ | 0xE0 0xA3 0xA2 #Cf ARABIC DISPUTED END OF AYAH | 0xE0 0xB5 0x8E #Lo MALAYALAM LETTER DOT REPH | 0xF0 0x91 0x82 0xBD #Cf KAITHI NUMBER SIGN + | 0xF0 0x91 0x83 0x8D #Cf KAITHI NUMBER SIGN ABOVE | 0xF0 0x91 0x87 0x82..0x83 #Lo [2] SHARADA SIGN JIHVAMULIYA..SHARA... + | 0xF0 0x91 0xA8 0xBA #Lo ZANABAZAR SQUARE CLUSTER-INITIAL L... + | 0xF0 0x91 0xAA 0x84..0x89 #Lo [6] SOYOMBO SIGN JIHVAMULIYA..SOYOM... + | 0xF0 0x91 0xB5 0x86 #Lo MASARAM GONDI REPHA ; CR = @@ -44,12 +48,10 @@ | 0xE2 0x81 0xA0..0xA4 #Cf [5] WORD JOINER..INVISIBLE PLUS | 0xE2 0x81 0xA5 #Cn | 0xE2 0x81 0xA6..0xAF #Cf [10] LEFT-TO-RIGHT ISOLATE..NOMINAL DIG... - | 0xED 0xA0 0x80..0xFF #Cs [2048] .... | 0xEF 0xBF 0xB9..0xBB #Cf [3] INTERLINEAR ANNOTATION ANCHOR..INT... + | 0xF0 0x93 0x90 0xB0..0xB8 #Cf [9] EGYPTIAN HIEROGLYPH VERTICAL JO... | 0xF0 0x9B 0xB2 0xA0..0xA3 #Cf [4] SHORTHAND FORMAT LETTER OVERLAP... | 0xF0 0x9D 0x85 0xB3..0xBA #Cf [8] MUSICAL SYMBOL BEGIN BEAM..MUSI... | 0xF3 0xA0 0x80 0x80 #Cn @@ -84,12 +86,13 @@ | 0xDD 0x00..0x8A # | 0xDE 0xA6..0xB0 #Mn [11] THAANA ABAFILI..THAANA SUKUN | 0xDF 0xAB..0xB3 #Mn [9] NKO COMBINING SHORT HIGH TONE..NKO... + | 0xDF 0xBD #Mn NKO DANTAYALAN | 0xE0 0xA0 0x96..0x99 #Mn [4] SAMARITAN MARK IN..SAMARITAN MARK ... | 0xE0 0xA0 0x9B..0xA3 #Mn [9] SAMARITAN MARK EPENTHETIC YUT..SAM... | 0xE0 0xA0 0xA5..0xA7 #Mn [3] SAMARITAN VOWEL SIGN SHORT A..SAMA... | 0xE0 0xA0 0xA9..0xAD #Mn [5] SAMARITAN VOWEL SIGN LONG I..SAMAR... | 0xE0 0xA1 0x99..0x9B #Mn [3] MANDAIC AFFRICATION MARK..MANDAIC ... - | 0xE0 0xA3 0x94..0xA1 #Mn [14] ARABIC SMALL HIGH WORD AR-RUB..ARA... + | 0xE0 0xA3 0x93..0xA1 #Mn [15] ARABIC SMALL LOW WAW..ARABIC SMALL... | 0xE0 0xA3 0xA3..0xFF #Mn [32] ARABIC TURNED DAMMA BELOW..DEVANAG... | 0xE0 0xA4 0x00..0x82 # | 0xE0 0xA4 0xBA #Mn DEVANAGARI VOWEL SIGN OE @@ -105,6 +108,7 @@ | 0xE0 0xA7 0x8D #Mn BENGALI SIGN VIRAMA | 0xE0 0xA7 0x97 #Mc BENGALI AU LENGTH MARK | 0xE0 0xA7 0xA2..0xA3 #Mn [2] BENGALI VOWEL SIGN VOCALIC L..BENG... + | 0xE0 0xA7 0xBE #Mn BENGALI SANDHI MARK | 0xE0 0xA8 0x81..0x82 #Mn [2] GURMUKHI SIGN ADAK BINDI..GURMUKHI... | 0xE0 0xA8 0xBC #Mn GURMUKHI SIGN NUKTA | 0xE0 0xA9 0x81..0x82 #Mn [2] GURMUKHI VOWEL SIGN U..GURMUKHI VO... @@ -119,6 +123,7 @@ | 0xE0 0xAB 0x87..0x88 #Mn [2] GUJARATI VOWEL SIGN E..GUJARATI VO... | 0xE0 0xAB 0x8D #Mn GUJARATI SIGN VIRAMA | 0xE0 0xAB 0xA2..0xA3 #Mn [2] GUJARATI VOWEL SIGN VOCALIC L..GUJ... + | 0xE0 0xAB 0xBA..0xBF #Mn [6] GUJARATI SIGN SUKUN..GUJARATI SIGN... | 0xE0 0xAC 0x81 #Mn ORIYA SIGN CANDRABINDU | 0xE0 0xAC 0xBC #Mn ORIYA SIGN NUKTA | 0xE0 0xAC 0xBE #Mc ORIYA VOWEL SIGN AA @@ -134,6 +139,7 @@ | 0xE0 0xAF 0x8D #Mn TAMIL SIGN VIRAMA | 0xE0 0xAF 0x97 #Mc TAMIL AU LENGTH MARK | 0xE0 0xB0 0x80 #Mn TELUGU SIGN COMBINING CANDRABINDU ... + | 0xE0 0xB0 0x84 #Mn TELUGU SIGN COMBINING ANUSVARA ABOVE | 0xE0 0xB0 0xBE..0xFF #Mn [3] TELUGU VOWEL SIGN AA..TELUGU VOWEL... | 0xE0 0xB1 0x00..0x80 # | 0xE0 0xB1 0x86..0x88 #Mn [3] TELUGU VOWEL SIGN E..TELUGU VOWEL ... @@ -148,7 +154,8 @@ | 0xE0 0xB3 0x8C..0x8D #Mn [2] KANNADA VOWEL SIGN AU..KANNADA SIG... | 0xE0 0xB3 0x95..0x96 #Mc [2] KANNADA LENGTH MARK..KANNADA AI LE... | 0xE0 0xB3 0xA2..0xA3 #Mn [2] KANNADA VOWEL SIGN VOCALIC L..KANN... - | 0xE0 0xB4 0x81 #Mn MALAYALAM SIGN CANDRABINDU + | 0xE0 0xB4 0x80..0x81 #Mn [2] MALAYALAM SIGN COMBINING ANUSVARA ... + | 0xE0 0xB4 0xBB..0xBC #Mn [2] MALAYALAM SIGN VERTICAL BAR VIRAMA... | 0xE0 0xB4 0xBE #Mc MALAYALAM VOWEL SIGN AA | 0xE0 0xB5 0x81..0x84 #Mn [4] MALAYALAM VOWEL SIGN U..MALAYALAM ... | 0xE0 0xB5 0x8D #Mn MALAYALAM SIGN VIRAMA @@ -163,8 +170,7 @@ | 0xE0 0xB8 0xB4..0xBA #Mn [7] THAI CHARACTER SARA I..THAI CHARAC... | 0xE0 0xB9 0x87..0x8E #Mn [8] THAI CHARACTER MAITAIKHU..THAI CHA... | 0xE0 0xBA 0xB1 #Mn LAO VOWEL SIGN MAI KAN - | 0xE0 0xBA 0xB4..0xB9 #Mn [6] LAO VOWEL SIGN I..LAO VOWEL SIGN UU - | 0xE0 0xBA 0xBB..0xBC #Mn [2] LAO VOWEL SIGN MAI KON..LAO SEMIVO... + | 0xE0 0xBA 0xB4..0xBC #Mn [9] LAO VOWEL SIGN I..LAO SEMIVOWEL SI... | 0xE0 0xBB 0x88..0x8D #Mn [6] LAO TONE MAI EK..LAO NIGGAHITA | 0xE0 0xBC 0x98..0x99 #Mn [2] TIBETAN ASTROLOGICAL SIGN -KHYUD P... | 0xE0 0xBC 0xB5 #Mn TIBETAN MARK NGAS BZUNG NYI ZLA @@ -217,6 +223,7 @@ | 0xE1 0xAA 0xBE #Me COMBINING PARENTHESES OVERLAY | 0xE1 0xAC 0x80..0x83 #Mn [4] BALINESE SIGN ULU RICEM..BALINESE ... | 0xE1 0xAC 0xB4 #Mn BALINESE SIGN REREKAN + | 0xE1 0xAC 0xB5 #Mc BALINESE VOWEL SIGN TEDUNG | 0xE1 0xAC 0xB6..0xBA #Mn [5] BALINESE VOWEL SIGN ULU..BALINESE ... | 0xE1 0xAC 0xBC #Mn BALINESE VOWEL SIGN LA LENGA | 0xE1 0xAD 0x82 #Mn BALINESE VOWEL SIGN PEPET @@ -237,7 +244,7 @@ | 0xE1 0xB3 0xAD #Mn VEDIC SIGN TIRYAK | 0xE1 0xB3 0xB4 #Mn VEDIC TONE CANDRA ABOVE | 0xE1 0xB3 0xB8..0xB9 #Mn [2] VEDIC TONE RING ABOVE..VEDIC TONE ... - | 0xE1 0xB7 0x80..0xB5 #Mn [54] COMBINING DOTTED GRAVE ACCENT..COM... + | 0xE1 0xB7 0x80..0xB9 #Mn [58] COMBINING DOTTED GRAVE ACCENT..COM... | 0xE1 0xB7 0xBB..0xBF #Mn [5] COMBINING DELETION MARK..COMBINING... | 0xE2 0x80 0x8C #Cf ZERO WIDTH NON-JOINER | 0xE2 0x83 0x90..0x9C #Mn [13] COMBINING LEFT HARPOON ABOVE..COMB... @@ -262,12 +269,13 @@ | 0xEA 0xA0 0xA5..0xA6 #Mn [2] SYLOTI NAGRI VOWEL SIGN U..SYLOTI ... | 0xEA 0xA3 0x84..0x85 #Mn [2] SAURASHTRA SIGN VIRAMA..SAURASHTRA... | 0xEA 0xA3 0xA0..0xB1 #Mn [18] COMBINING DEVANAGARI DIGIT ZERO..C... + | 0xEA 0xA3 0xBF #Mn DEVANAGARI VOWEL SIGN AY | 0xEA 0xA4 0xA6..0xAD #Mn [8] KAYAH LI VOWEL UE..KAYAH LI TONE C... | 0xEA 0xA5 0x87..0x91 #Mn [11] REJANG VOWEL SIGN I..REJANG CONSON... | 0xEA 0xA6 0x80..0x82 #Mn [3] JAVANESE SIGN PANYANGGA..JAVANESE ... | 0xEA 0xA6 0xB3 #Mn JAVANESE SIGN CECAK TELU | 0xEA 0xA6 0xB6..0xB9 #Mn [4] JAVANESE VOWEL SIGN WULU..JAVANESE... - | 0xEA 0xA6 0xBC #Mn JAVANESE VOWEL SIGN PEPET + | 0xEA 0xA6 0xBC..0xBD #Mn [2] JAVANESE VOWEL SIGN PEPET..JAVANES... | 0xEA 0xA7 0xA5 #Mn MYANMAR SIGN SHAN SAW | 0xEA 0xA8 0xA9..0xAE #Mn [6] CHAM VOWEL SIGN AA..CHAM VOWEL SIG... | 0xEA 0xA8 0xB1..0xB2 #Mn [2] CHAM VOWEL SIGN AU..CHAM VOWEL SIG... @@ -298,6 +306,8 @@ | 0xF0 0x90 0xA8 0xB8..0xBA #Mn [3] KHAROSHTHI SIGN BAR ABOVE..KHAR... | 0xF0 0x90 0xA8 0xBF #Mn KHAROSHTHI VIRAMA | 0xF0 0x90 0xAB 0xA5..0xA6 #Mn [2] MANICHAEAN ABBREVIATION MARK AB... + | 0xF0 0x90 0xB4 0xA4..0xA7 #Mn [4] HANIFI ROHINGYA SIGN HARBAHAY..... + | 0xF0 0x90 0xBD 0x86..0x90 #Mn [11] SOGDIAN COMBINING DOT BELOW..SO... | 0xF0 0x91 0x80 0x81 #Mn BRAHMI SIGN ANUSVARA | 0xF0 0x91 0x80 0xB8..0xFF #Mn [15] BRAHMI VOWEL SIGN AA..BRAHMI VI... | 0xF0 0x91 0x81 0x00..0x86 # @@ -311,7 +321,7 @@ | 0xF0 0x91 0x85 0xB3 #Mn MAHAJANI SIGN NUKTA | 0xF0 0x91 0x86 0x80..0x81 #Mn [2] SHARADA SIGN CANDRABINDU..SHARA... | 0xF0 0x91 0x86 0xB6..0xBE #Mn [9] SHARADA VOWEL SIGN U..SHARADA V... - | 0xF0 0x91 0x87 0x8A..0x8C #Mn [3] SHARADA SIGN NUKTA..SHARADA EXT... + | 0xF0 0x91 0x87 0x89..0x8C #Mn [4] SHARADA SANDHI MARK..SHARADA EX... | 0xF0 0x91 0x88 0xAF..0xB1 #Mn [3] KHOJKI VOWEL SIGN U..KHOJKI VOW... | 0xF0 0x91 0x88 0xB4 #Mn KHOJKI SIGN ANUSVARA | 0xF0 0x91 0x88 0xB6..0xB7 #Mn [2] KHOJKI SIGN NUKTA..KHOJKI SIGN ... @@ -319,7 +329,7 @@ | 0xF0 0x91 0x8B 0x9F #Mn KHUDAWADI SIGN ANUSVARA | 0xF0 0x91 0x8B 0xA3..0xAA #Mn [8] KHUDAWADI VOWEL SIGN U..KHUDAWA... | 0xF0 0x91 0x8C 0x80..0x81 #Mn [2] GRANTHA SIGN COMBINING ANUSVARA... - | 0xF0 0x91 0x8C 0xBC #Mn GRANTHA SIGN NUKTA + | 0xF0 0x91 0x8C 0xBB..0xBC #Mn [2] COMBINING BINDU BELOW..GRANTHA ... | 0xF0 0x91 0x8C 0xBE #Mc GRANTHA VOWEL SIGN AA | 0xF0 0x91 0x8D 0x80 #Mn GRANTHA VOWEL SIGN II | 0xF0 0x91 0x8D 0x97 #Mc GRANTHA AU LENGTH MARK @@ -328,6 +338,7 @@ | 0xF0 0x91 0x90 0xB8..0xBF #Mn [8] NEWA VOWEL SIGN U..NEWA VOWEL S... | 0xF0 0x91 0x91 0x82..0x84 #Mn [3] NEWA SIGN VIRAMA..NEWA SIGN ANU... | 0xF0 0x91 0x91 0x86 #Mn NEWA SIGN NUKTA + | 0xF0 0x91 0x91 0x9E #Mn NEWA SANDHI MARK | 0xF0 0x91 0x92 0xB0 #Mc TIRHUTA VOWEL SIGN AA | 0xF0 0x91 0x92 0xB3..0xB8 #Mn [6] TIRHUTA VOWEL SIGN U..TIRHUTA V... | 0xF0 0x91 0x92 0xBA #Mn TIRHUTA VOWEL SIGN SHORT E @@ -352,6 +363,19 @@ | 0xF0 0x91 0x9C 0x9D..0x9F #Mn [3] AHOM CONSONANT SIGN MEDIAL LA..... | 0xF0 0x91 0x9C 0xA2..0xA5 #Mn [4] AHOM VOWEL SIGN I..AHOM VOWEL S... | 0xF0 0x91 0x9C 0xA7..0xAB #Mn [5] AHOM VOWEL SIGN AW..AHOM SIGN K... + | 0xF0 0x91 0xA0 0xAF..0xB7 #Mn [9] DOGRA VOWEL SIGN U..DOGRA SIGN ... + | 0xF0 0x91 0xA0 0xB9..0xBA #Mn [2] DOGRA SIGN VIRAMA..DOGRA SIGN N... + | 0xF0 0x91 0xA7 0x94..0x97 #Mn [4] NANDINAGARI VOWEL SIGN U..NANDI... + | 0xF0 0x91 0xA7 0x9A..0x9B #Mn [2] NANDINAGARI VOWEL SIGN E..NANDI... + | 0xF0 0x91 0xA7 0xA0 #Mn NANDINAGARI SIGN VIRAMA + | 0xF0 0x91 0xA8 0x81..0x8A #Mn [10] ZANABAZAR SQUARE VOWEL SIGN I..... + | 0xF0 0x91 0xA8 0xB3..0xB8 #Mn [6] ZANABAZAR SQUARE FINAL CONSONAN... + | 0xF0 0x91 0xA8 0xBB..0xBE #Mn [4] ZANABAZAR SQUARE CLUSTER-FINAL ... + | 0xF0 0x91 0xA9 0x87 #Mn ZANABAZAR SQUARE SUBJOINER + | 0xF0 0x91 0xA9 0x91..0x96 #Mn [6] SOYOMBO VOWEL SIGN I..SOYOMBO V... + | 0xF0 0x91 0xA9 0x99..0x9B #Mn [3] SOYOMBO VOWEL SIGN VOCALIC R..S... + | 0xF0 0x91 0xAA 0x8A..0x96 #Mn [13] SOYOMBO FINAL CONSONANT SIGN G.... + | 0xF0 0x91 0xAA 0x98..0x99 #Mn [2] SOYOMBO GEMINATION MARK..SOYOMB... | 0xF0 0x91 0xB0 0xB0..0xB6 #Mn [7] BHAIKSUKI VOWEL SIGN I..BHAIKSU... | 0xF0 0x91 0xB0 0xB8..0xBD #Mn [6] BHAIKSUKI VOWEL SIGN E..BHAIKSU... | 0xF0 0x91 0xB0 0xBF #Mn BHAIKSUKI SIGN VIRAMA @@ -359,8 +383,19 @@ | 0xF0 0x91 0xB2 0xAA..0xB0 #Mn [7] MARCHEN SUBJOINED LETTER RA..MA... | 0xF0 0x91 0xB2 0xB2..0xB3 #Mn [2] MARCHEN VOWEL SIGN U..MARCHEN V... | 0xF0 0x91 0xB2 0xB5..0xB6 #Mn [2] MARCHEN SIGN ANUSVARA..MARCHEN ... + | 0xF0 0x91 0xB4 0xB1..0xB6 #Mn [6] MASARAM GONDI VOWEL SIGN AA..MA... + | 0xF0 0x91 0xB4 0xBA #Mn MASARAM GONDI VOWEL SIGN E + | 0xF0 0x91 0xB4 0xBC..0xBD #Mn [2] MASARAM GONDI VOWEL SIGN AI..MA... + | 0xF0 0x91 0xB4 0xBF..0xFF #Mn [7] MASARAM GONDI VOWEL SIGN AU..MA... + | 0xF0 0x91 0xB5 0x00..0x85 # + | 0xF0 0x91 0xB5 0x87 #Mn MASARAM GONDI RA-KARA + | 0xF0 0x91 0xB6 0x90..0x91 #Mn [2] GUNJALA GONDI VOWEL SIGN EE..GU... + | 0xF0 0x91 0xB6 0x95 #Mn GUNJALA GONDI SIGN ANUSVARA + | 0xF0 0x91 0xB6 0x97 #Mn GUNJALA GONDI VIRAMA + | 0xF0 0x91 0xBB 0xB3..0xB4 #Mn [2] MAKASAR VOWEL SIGN I..MAKASAR V... | 0xF0 0x96 0xAB 0xB0..0xB4 #Mn [5] BASSA VAH COMBINING HIGH TONE..... | 0xF0 0x96 0xAC 0xB0..0xB6 #Mn [7] PAHAWH HMONG MARK CIM TUB..PAHA... + | 0xF0 0x96 0xBD 0x8F #Mn MIAO SIGN CONSONANT MODIFIER BAR | 0xF0 0x96 0xBE 0x8F..0x92 #Mn [4] MIAO TONE RIGHT..MIAO TONE BELOW | 0xF0 0x9B 0xB2 0x9D..0x9E #Mn [2] DUPLOYAN THICK LETTER SELECTOR.... | 0xF0 0x9D 0x85 0xA5 #Mc MUSICAL SYMBOL COMBINING STEM @@ -383,8 +418,11 @@ | 0xF0 0x9E 0x80 0x9B..0xA1 #Mn [7] COMBINING GLAGOLITIC LETTER SHT... | 0xF0 0x9E 0x80 0xA3..0xA4 #Mn [2] COMBINING GLAGOLITIC LETTER YU.... | 0xF0 0x9E 0x80 0xA6..0xAA #Mn [5] COMBINING GLAGOLITIC LETTER YO.... + | 0xF0 0x9E 0x84 0xB0..0xB6 #Mn [7] NYIAKENG PUACHUE HMONG TONE-B..... + | 0xF0 0x9E 0x8B 0xAC..0xAF #Mn [4] WANCHO TONE TUP..WANCHO TONE KOINI | 0xF0 0x9E 0xA3 0x90..0x96 #Mn [7] MENDE KIKAKUI COMBINING NUMBER ... | 0xF0 0x9E 0xA5 0x84..0x8A #Mn [7] ADLAM ALIF LENGTHENER..ADLAM NUKTA + | 0xF0 0x9F 0x8F 0xBB..0xBF #Sk [5] EMOJI MODIFIER FITZPATRICK TYPE... | 0xF3 0xA0 0x80 0xA0..0xFF #Cf [96] TAG SPACE..CANCEL TAG | 0xF3 0xA0 0x81 0x00..0xBF # | 0xF3 0xA0 0x84 0x80..0xFF #Mn [240] VARIATION SELECTOR-17..VA... @@ -462,7 +500,6 @@ | 0xE1 0xA9 0x97 #Mc TAI THAM CONSONANT SIGN LA TANG LAI | 0xE1 0xA9 0xAD..0xB2 #Mc [6] TAI THAM VOWEL SIGN OY..TAI THAM V... | 0xE1 0xAC 0x84 #Mc BALINESE SIGN BISAH - | 0xE1 0xAC 0xB5 #Mc BALINESE VOWEL SIGN TEDUNG | 0xE1 0xAC 0xBB #Mc BALINESE VOWEL SIGN RA REPA TEDUNG | 0xE1 0xAC 0xBD..0xFF #Mc [5] BALINESE VOWEL SIGN LA LENGA TEDUN... | 0xE1 0xAD 0x00..0x81 # @@ -478,7 +515,7 @@ | 0xE1 0xB0 0xA4..0xAB #Mc [8] LEPCHA SUBJOINED LETTER YA..LEPCHA... | 0xE1 0xB0 0xB4..0xB5 #Mc [2] LEPCHA CONSONANT SIGN NYIN-DO..LEP... | 0xE1 0xB3 0xA1 #Mc VEDIC TONE ATHARVAVEDIC INDEPENDEN... - | 0xE1 0xB3 0xB2..0xB3 #Mc [2] VEDIC SIGN ARDHAVISARGA..VEDIC SIG... + | 0xE1 0xB3 0xB7 #Mc VEDIC SIGN ATIKRAMA | 0xEA 0xA0 0xA3..0xA4 #Mc [2] SYLOTI NAGRI VOWEL SIGN A..SYLOTI ... | 0xEA 0xA0 0xA7 #Mc SYLOTI NAGRI VOWEL SIGN OO | 0xEA 0xA2 0x80..0x81 #Mc [2] SAURASHTRA SIGN ANUSVARA..SAURASHT... @@ -488,7 +525,7 @@ | 0xEA 0xA6 0x83 #Mc JAVANESE SIGN WIGNYAN | 0xEA 0xA6 0xB4..0xB5 #Mc [2] JAVANESE VOWEL SIGN TARUNG..JAVANE... | 0xEA 0xA6 0xBA..0xBB #Mc [2] JAVANESE VOWEL SIGN TALING..JAVANE... - | 0xEA 0xA6 0xBD..0xFF #Mc [4] JAVANESE CONSONANT SIGN KERET..JAV... + | 0xEA 0xA6 0xBE..0xFF #Mc [3] JAVANESE CONSONANT SIGN PENGKAL..J... | 0xEA 0xA7 0x00..0x80 # | 0xEA 0xA8 0xAF..0xB0 #Mc [2] CHAM VOWEL SIGN O..CHAM VOWEL SIGN AI | 0xEA 0xA8 0xB3..0xB4 #Mc [2] CHAM CONSONANT SIGN YA..CHAM CONSO... @@ -506,6 +543,7 @@ | 0xF0 0x91 0x82 0xB0..0xB2 #Mc [3] KAITHI VOWEL SIGN AA..KAITHI VO... | 0xF0 0x91 0x82 0xB7..0xB8 #Mc [2] KAITHI VOWEL SIGN O..KAITHI VOW... | 0xF0 0x91 0x84 0xAC #Mc CHAKMA VOWEL SIGN E + | 0xF0 0x91 0x85 0x85..0x86 #Mc [2] CHAKMA VOWEL SIGN AA..CHAKMA VO... | 0xF0 0x91 0x86 0x82 #Mc SHARADA SIGN VISARGA | 0xF0 0x91 0x86 0xB3..0xB5 #Mc [3] SHARADA VOWEL SIGN AA..SHARADA ... | 0xF0 0x91 0x86 0xBF..0xFF #Mc [2] SHARADA VOWEL SIGN AU..SHARADA ... @@ -539,12 +577,25 @@ | 0xF0 0x91 0x9A 0xB6 #Mc TAKRI SIGN VIRAMA | 0xF0 0x91 0x9C 0xA0..0xA1 #Mc [2] AHOM VOWEL SIGN A..AHOM VOWEL S... | 0xF0 0x91 0x9C 0xA6 #Mc AHOM VOWEL SIGN E + | 0xF0 0x91 0xA0 0xAC..0xAE #Mc [3] DOGRA VOWEL SIGN AA..DOGRA VOWE... + | 0xF0 0x91 0xA0 0xB8 #Mc DOGRA SIGN VISARGA + | 0xF0 0x91 0xA7 0x91..0x93 #Mc [3] NANDINAGARI VOWEL SIGN AA..NAND... + | 0xF0 0x91 0xA7 0x9C..0x9F #Mc [4] NANDINAGARI VOWEL SIGN O..NANDI... + | 0xF0 0x91 0xA7 0xA4 #Mc NANDINAGARI VOWEL SIGN PRISHTHAMAT... + | 0xF0 0x91 0xA8 0xB9 #Mc ZANABAZAR SQUARE SIGN VISARGA + | 0xF0 0x91 0xA9 0x97..0x98 #Mc [2] SOYOMBO VOWEL SIGN AI..SOYOMBO ... + | 0xF0 0x91 0xAA 0x97 #Mc SOYOMBO SIGN VISARGA | 0xF0 0x91 0xB0 0xAF #Mc BHAIKSUKI VOWEL SIGN AA | 0xF0 0x91 0xB0 0xBE #Mc BHAIKSUKI SIGN VISARGA | 0xF0 0x91 0xB2 0xA9 #Mc MARCHEN SUBJOINED LETTER YA | 0xF0 0x91 0xB2 0xB1 #Mc MARCHEN VOWEL SIGN I | 0xF0 0x91 0xB2 0xB4 #Mc MARCHEN VOWEL SIGN O - | 0xF0 0x96 0xBD 0x91..0xBE #Mc [46] MIAO SIGN ASPIRATION..MIAO VOWE... + | 0xF0 0x91 0xB6 0x8A..0x8E #Mc [5] GUNJALA GONDI VOWEL SIGN AA..GU... + | 0xF0 0x91 0xB6 0x93..0x94 #Mc [2] GUNJALA GONDI VOWEL SIGN OO..GU... + | 0xF0 0x91 0xB6 0x96 #Mc GUNJALA GONDI SIGN VISARGA + | 0xF0 0x91 0xBB 0xB5..0xB6 #Mc [2] MAKASAR VOWEL SIGN E..MAKASAR V... + | 0xF0 0x96 0xBD 0x91..0xFF #Mc [55] MIAO SIGN ASPIRATION..MIAO VOWE... + | 0xF0 0x96 0xBE 0x00..0x87 # | 0xF0 0x9D 0x85 0xA6 #Mc MUSICAL SYMBOL COMBINING SPRECHGES... | 0xF0 0x9D 0x85 0xAD #Mc MUSICAL SYMBOL COMBINING AUGMENTAT... ; @@ -1531,53 +1582,8 @@ | 0xED 0x9E 0x89..0xA3 #Lo [27] HANGUL SYLLABLE HIG..HANGUL SYLLAB... ; - E_Base = - 0xE2 0x98 0x9D #So WHITE UP POINTING INDEX - | 0xE2 0x9B 0xB9 #So PERSON WITH BALL - | 0xE2 0x9C 0x8A..0x8D #So [4] RAISED FIST..WRITING HAND - | 0xF0 0x9F 0x8E 0x85 #So FATHER CHRISTMAS - | 0xF0 0x9F 0x8F 0x83..0x84 #So [2] RUNNER..SURFER - | 0xF0 0x9F 0x8F 0x8A..0x8B #So [2] SWIMMER..WEIGHT LIFTER - | 0xF0 0x9F 0x91 0x82..0x83 #So [2] EAR..NOSE - | 0xF0 0x9F 0x91 0x86..0x90 #So [11] WHITE UP POINTING BACKHAND INDE... - | 0xF0 0x9F 0x91 0xAE #So POLICE OFFICER - | 0xF0 0x9F 0x91 0xB0..0xB8 #So [9] BRIDE WITH VEIL..PRINCESS - | 0xF0 0x9F 0x91 0xBC #So BABY ANGEL - | 0xF0 0x9F 0x92 0x81..0x83 #So [3] INFORMATION DESK PERSON..DANCER - | 0xF0 0x9F 0x92 0x85..0x87 #So [3] NAIL POLISH..HAIRCUT - | 0xF0 0x9F 0x92 0xAA #So FLEXED BICEPS - | 0xF0 0x9F 0x95 0xB5 #So SLEUTH OR SPY - | 0xF0 0x9F 0x95 0xBA #So MAN DANCING - | 0xF0 0x9F 0x96 0x90 #So RAISED HAND WITH FINGERS SPLAYED - | 0xF0 0x9F 0x96 0x95..0x96 #So [2] REVERSED HAND WITH MIDDLE FINGE... - | 0xF0 0x9F 0x99 0x85..0x87 #So [3] FACE WITH NO GOOD GESTURE..PERS... - | 0xF0 0x9F 0x99 0x8B..0x8F #So [5] HAPPY PERSON RAISING ONE HAND..... - | 0xF0 0x9F 0x9A 0xA3 #So ROWBOAT - | 0xF0 0x9F 0x9A 0xB4..0xB6 #So [3] BICYCLIST..PEDESTRIAN - | 0xF0 0x9F 0x9B 0x80 #So BATH - | 0xF0 0x9F 0xA4 0x98..0x9E #So [7] SIGN OF THE HORNS..HAND WITH IN... - | 0xF0 0x9F 0xA4 0xA6 #So FACE PALM - | 0xF0 0x9F 0xA4 0xB0 #So PREGNANT WOMAN - | 0xF0 0x9F 0xA4 0xB3..0xB9 #So [7] SELFIE..JUGGLING - | 0xF0 0x9F 0xA4 0xBC..0xBE #So [3] WRESTLERS..HANDBALL - ; - - E_Modifier = - 0xF0 0x9F 0x8F 0xBB..0xBF #Sk [5] EMOJI MODIFIER FITZPATRICK TYPE... - ; - ZWJ = 0xE2 0x80 0x8D #Cf ZERO WIDTH JOINER ; - Glue_After_Zwj = - 0xE2 0x9D 0xA4 #So HEAVY BLACK HEART - | 0xF0 0x9F 0x92 0x8B #So KISS MARK - | 0xF0 0x9F 0x97 0xA8 #So LEFT SPEECH BUBBLE - ; - - E_Base_GAZ = - 0xF0 0x9F 0x91 0xA6..0xA9 #So [4] BOY..WOMAN - ; - }%% diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/tables.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/tables.go similarity index 93% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/tables.go rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/tables.go index fab7e842955..b3f22ad432f 100644 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/tables.go +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/tables.go @@ -1,5 +1,5 @@ // Generated by running -// maketables --url=http://www.unicode.org/Public/9.0.0/ucd/auxiliary/ +// maketables --url=http://www.unicode.org/Public/12.0.0/ucd/auxiliary/ // DO NOT EDIT package textseg @@ -32,12 +32,12 @@ var _GraphemeControl = &unicode.RangeTable{ unicode.Range16{Lo: 0x2060, Hi: 0x2064, Stride: 0x1}, unicode.Range16{Lo: 0x2065, Hi: 0x2065, Stride: 0x1}, unicode.Range16{Lo: 0x2066, Hi: 0x206f, Stride: 0x1}, - unicode.Range16{Lo: 0xd800, Hi: 0xdfff, Stride: 0x1}, unicode.Range16{Lo: 0xfeff, Hi: 0xfeff, Stride: 0x1}, unicode.Range16{Lo: 0xfff0, Hi: 0xfff8, Stride: 0x1}, unicode.Range16{Lo: 0xfff9, Hi: 0xfffb, Stride: 0x1}, }, R32: []unicode.Range32{ + unicode.Range32{Lo: 0x13430, Hi: 0x13438, Stride: 0x1}, unicode.Range32{Lo: 0x1bca0, Hi: 0x1bca3, Stride: 0x1}, unicode.Range32{Lo: 0x1d173, Hi: 0x1d17a, Stride: 0x1}, unicode.Range32{Lo: 0xe0000, Hi: 0xe0000, Stride: 0x1}, @@ -49,56 +49,6 @@ var _GraphemeControl = &unicode.RangeTable{ LatinOffset: 5, } -var _GraphemeE_Base = &unicode.RangeTable{ - R16: []unicode.Range16{ - unicode.Range16{Lo: 0x261d, Hi: 0x261d, Stride: 0x1}, - unicode.Range16{Lo: 0x26f9, Hi: 0x26f9, Stride: 0x1}, - unicode.Range16{Lo: 0x270a, Hi: 0x270d, Stride: 0x1}, - }, - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f385, Hi: 0x1f385, Stride: 0x1}, - unicode.Range32{Lo: 0x1f3c3, Hi: 0x1f3c4, Stride: 0x1}, - unicode.Range32{Lo: 0x1f3ca, Hi: 0x1f3cb, Stride: 0x1}, - unicode.Range32{Lo: 0x1f442, Hi: 0x1f443, Stride: 0x1}, - unicode.Range32{Lo: 0x1f446, Hi: 0x1f450, Stride: 0x1}, - unicode.Range32{Lo: 0x1f46e, Hi: 0x1f46e, Stride: 0x1}, - unicode.Range32{Lo: 0x1f470, Hi: 0x1f478, Stride: 0x1}, - unicode.Range32{Lo: 0x1f47c, Hi: 0x1f47c, Stride: 0x1}, - unicode.Range32{Lo: 0x1f481, Hi: 0x1f483, Stride: 0x1}, - unicode.Range32{Lo: 0x1f485, Hi: 0x1f487, Stride: 0x1}, - unicode.Range32{Lo: 0x1f4aa, Hi: 0x1f4aa, Stride: 0x1}, - unicode.Range32{Lo: 0x1f575, Hi: 0x1f575, Stride: 0x1}, - unicode.Range32{Lo: 0x1f57a, Hi: 0x1f57a, Stride: 0x1}, - unicode.Range32{Lo: 0x1f590, Hi: 0x1f590, Stride: 0x1}, - unicode.Range32{Lo: 0x1f595, Hi: 0x1f596, Stride: 0x1}, - unicode.Range32{Lo: 0x1f645, Hi: 0x1f647, Stride: 0x1}, - unicode.Range32{Lo: 0x1f64b, Hi: 0x1f64f, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6a3, Hi: 0x1f6a3, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6b4, Hi: 0x1f6b6, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6c0, Hi: 0x1f6c0, Stride: 0x1}, - unicode.Range32{Lo: 0x1f918, Hi: 0x1f91e, Stride: 0x1}, - unicode.Range32{Lo: 0x1f926, Hi: 0x1f926, Stride: 0x1}, - unicode.Range32{Lo: 0x1f930, Hi: 0x1f930, Stride: 0x1}, - unicode.Range32{Lo: 0x1f933, Hi: 0x1f939, Stride: 0x1}, - unicode.Range32{Lo: 0x1f93c, Hi: 0x1f93e, Stride: 0x1}, - }, - LatinOffset: 0, -} - -var _GraphemeE_Base_GAZ = &unicode.RangeTable{ - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f466, Hi: 0x1f469, Stride: 0x1}, - }, - LatinOffset: 0, -} - -var _GraphemeE_Modifier = &unicode.RangeTable{ - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f3fb, Hi: 0x1f3ff, Stride: 0x1}, - }, - LatinOffset: 0, -} - var _GraphemeExtend = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x300, Hi: 0x36f, Stride: 0x1}, @@ -120,12 +70,13 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x730, Hi: 0x74a, Stride: 0x1}, unicode.Range16{Lo: 0x7a6, Hi: 0x7b0, Stride: 0x1}, unicode.Range16{Lo: 0x7eb, Hi: 0x7f3, Stride: 0x1}, + unicode.Range16{Lo: 0x7fd, Hi: 0x7fd, Stride: 0x1}, unicode.Range16{Lo: 0x816, Hi: 0x819, Stride: 0x1}, unicode.Range16{Lo: 0x81b, Hi: 0x823, Stride: 0x1}, unicode.Range16{Lo: 0x825, Hi: 0x827, Stride: 0x1}, unicode.Range16{Lo: 0x829, Hi: 0x82d, Stride: 0x1}, unicode.Range16{Lo: 0x859, Hi: 0x85b, Stride: 0x1}, - unicode.Range16{Lo: 0x8d4, Hi: 0x8e1, Stride: 0x1}, + unicode.Range16{Lo: 0x8d3, Hi: 0x8e1, Stride: 0x1}, unicode.Range16{Lo: 0x8e3, Hi: 0x902, Stride: 0x1}, unicode.Range16{Lo: 0x93a, Hi: 0x93a, Stride: 0x1}, unicode.Range16{Lo: 0x93c, Hi: 0x93c, Stride: 0x1}, @@ -140,6 +91,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x9cd, Hi: 0x9cd, Stride: 0x1}, unicode.Range16{Lo: 0x9d7, Hi: 0x9d7, Stride: 0x1}, unicode.Range16{Lo: 0x9e2, Hi: 0x9e3, Stride: 0x1}, + unicode.Range16{Lo: 0x9fe, Hi: 0x9fe, Stride: 0x1}, unicode.Range16{Lo: 0xa01, Hi: 0xa02, Stride: 0x1}, unicode.Range16{Lo: 0xa3c, Hi: 0xa3c, Stride: 0x1}, unicode.Range16{Lo: 0xa41, Hi: 0xa42, Stride: 0x1}, @@ -154,6 +106,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xac7, Hi: 0xac8, Stride: 0x1}, unicode.Range16{Lo: 0xacd, Hi: 0xacd, Stride: 0x1}, unicode.Range16{Lo: 0xae2, Hi: 0xae3, Stride: 0x1}, + unicode.Range16{Lo: 0xafa, Hi: 0xaff, Stride: 0x1}, unicode.Range16{Lo: 0xb01, Hi: 0xb01, Stride: 0x1}, unicode.Range16{Lo: 0xb3c, Hi: 0xb3c, Stride: 0x1}, unicode.Range16{Lo: 0xb3e, Hi: 0xb3e, Stride: 0x1}, @@ -169,6 +122,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xbcd, Hi: 0xbcd, Stride: 0x1}, unicode.Range16{Lo: 0xbd7, Hi: 0xbd7, Stride: 0x1}, unicode.Range16{Lo: 0xc00, Hi: 0xc00, Stride: 0x1}, + unicode.Range16{Lo: 0xc04, Hi: 0xc04, Stride: 0x1}, unicode.Range16{Lo: 0xc3e, Hi: 0xc40, Stride: 0x1}, unicode.Range16{Lo: 0xc46, Hi: 0xc48, Stride: 0x1}, unicode.Range16{Lo: 0xc4a, Hi: 0xc4d, Stride: 0x1}, @@ -182,7 +136,8 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xccc, Hi: 0xccd, Stride: 0x1}, unicode.Range16{Lo: 0xcd5, Hi: 0xcd6, Stride: 0x1}, unicode.Range16{Lo: 0xce2, Hi: 0xce3, Stride: 0x1}, - unicode.Range16{Lo: 0xd01, Hi: 0xd01, Stride: 0x1}, + unicode.Range16{Lo: 0xd00, Hi: 0xd01, Stride: 0x1}, + unicode.Range16{Lo: 0xd3b, Hi: 0xd3c, Stride: 0x1}, unicode.Range16{Lo: 0xd3e, Hi: 0xd3e, Stride: 0x1}, unicode.Range16{Lo: 0xd41, Hi: 0xd44, Stride: 0x1}, unicode.Range16{Lo: 0xd4d, Hi: 0xd4d, Stride: 0x1}, @@ -197,8 +152,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xe34, Hi: 0xe3a, Stride: 0x1}, unicode.Range16{Lo: 0xe47, Hi: 0xe4e, Stride: 0x1}, unicode.Range16{Lo: 0xeb1, Hi: 0xeb1, Stride: 0x1}, - unicode.Range16{Lo: 0xeb4, Hi: 0xeb9, Stride: 0x1}, - unicode.Range16{Lo: 0xebb, Hi: 0xebc, Stride: 0x1}, + unicode.Range16{Lo: 0xeb4, Hi: 0xebc, Stride: 0x1}, unicode.Range16{Lo: 0xec8, Hi: 0xecd, Stride: 0x1}, unicode.Range16{Lo: 0xf18, Hi: 0xf19, Stride: 0x1}, unicode.Range16{Lo: 0xf35, Hi: 0xf35, Stride: 0x1}, @@ -251,6 +205,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x1abe, Hi: 0x1abe, Stride: 0x1}, unicode.Range16{Lo: 0x1b00, Hi: 0x1b03, Stride: 0x1}, unicode.Range16{Lo: 0x1b34, Hi: 0x1b34, Stride: 0x1}, + unicode.Range16{Lo: 0x1b35, Hi: 0x1b35, Stride: 0x1}, unicode.Range16{Lo: 0x1b36, Hi: 0x1b3a, Stride: 0x1}, unicode.Range16{Lo: 0x1b3c, Hi: 0x1b3c, Stride: 0x1}, unicode.Range16{Lo: 0x1b42, Hi: 0x1b42, Stride: 0x1}, @@ -271,7 +226,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x1ced, Hi: 0x1ced, Stride: 0x1}, unicode.Range16{Lo: 0x1cf4, Hi: 0x1cf4, Stride: 0x1}, unicode.Range16{Lo: 0x1cf8, Hi: 0x1cf9, Stride: 0x1}, - unicode.Range16{Lo: 0x1dc0, Hi: 0x1df5, Stride: 0x1}, + unicode.Range16{Lo: 0x1dc0, Hi: 0x1df9, Stride: 0x1}, unicode.Range16{Lo: 0x1dfb, Hi: 0x1dff, Stride: 0x1}, unicode.Range16{Lo: 0x200c, Hi: 0x200c, Stride: 0x1}, unicode.Range16{Lo: 0x20d0, Hi: 0x20dc, Stride: 0x1}, @@ -296,12 +251,13 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xa825, Hi: 0xa826, Stride: 0x1}, unicode.Range16{Lo: 0xa8c4, Hi: 0xa8c5, Stride: 0x1}, unicode.Range16{Lo: 0xa8e0, Hi: 0xa8f1, Stride: 0x1}, + unicode.Range16{Lo: 0xa8ff, Hi: 0xa8ff, Stride: 0x1}, unicode.Range16{Lo: 0xa926, Hi: 0xa92d, Stride: 0x1}, unicode.Range16{Lo: 0xa947, Hi: 0xa951, Stride: 0x1}, unicode.Range16{Lo: 0xa980, Hi: 0xa982, Stride: 0x1}, unicode.Range16{Lo: 0xa9b3, Hi: 0xa9b3, Stride: 0x1}, unicode.Range16{Lo: 0xa9b6, Hi: 0xa9b9, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bc, Stride: 0x1}, + unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bd, Stride: 0x1}, unicode.Range16{Lo: 0xa9e5, Hi: 0xa9e5, Stride: 0x1}, unicode.Range16{Lo: 0xaa29, Hi: 0xaa2e, Stride: 0x1}, unicode.Range16{Lo: 0xaa31, Hi: 0xaa32, Stride: 0x1}, @@ -334,6 +290,8 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x10a38, Hi: 0x10a3a, Stride: 0x1}, unicode.Range32{Lo: 0x10a3f, Hi: 0x10a3f, Stride: 0x1}, unicode.Range32{Lo: 0x10ae5, Hi: 0x10ae6, Stride: 0x1}, + unicode.Range32{Lo: 0x10d24, Hi: 0x10d27, Stride: 0x1}, + unicode.Range32{Lo: 0x10f46, Hi: 0x10f50, Stride: 0x1}, unicode.Range32{Lo: 0x11001, Hi: 0x11001, Stride: 0x1}, unicode.Range32{Lo: 0x11038, Hi: 0x11046, Stride: 0x1}, unicode.Range32{Lo: 0x1107f, Hi: 0x11081, Stride: 0x1}, @@ -345,7 +303,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11173, Hi: 0x11173, Stride: 0x1}, unicode.Range32{Lo: 0x11180, Hi: 0x11181, Stride: 0x1}, unicode.Range32{Lo: 0x111b6, Hi: 0x111be, Stride: 0x1}, - unicode.Range32{Lo: 0x111ca, Hi: 0x111cc, Stride: 0x1}, + unicode.Range32{Lo: 0x111c9, Hi: 0x111cc, Stride: 0x1}, unicode.Range32{Lo: 0x1122f, Hi: 0x11231, Stride: 0x1}, unicode.Range32{Lo: 0x11234, Hi: 0x11234, Stride: 0x1}, unicode.Range32{Lo: 0x11236, Hi: 0x11237, Stride: 0x1}, @@ -353,7 +311,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x112df, Hi: 0x112df, Stride: 0x1}, unicode.Range32{Lo: 0x112e3, Hi: 0x112ea, Stride: 0x1}, unicode.Range32{Lo: 0x11300, Hi: 0x11301, Stride: 0x1}, - unicode.Range32{Lo: 0x1133c, Hi: 0x1133c, Stride: 0x1}, + unicode.Range32{Lo: 0x1133b, Hi: 0x1133c, Stride: 0x1}, unicode.Range32{Lo: 0x1133e, Hi: 0x1133e, Stride: 0x1}, unicode.Range32{Lo: 0x11340, Hi: 0x11340, Stride: 0x1}, unicode.Range32{Lo: 0x11357, Hi: 0x11357, Stride: 0x1}, @@ -362,6 +320,7 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11438, Hi: 0x1143f, Stride: 0x1}, unicode.Range32{Lo: 0x11442, Hi: 0x11444, Stride: 0x1}, unicode.Range32{Lo: 0x11446, Hi: 0x11446, Stride: 0x1}, + unicode.Range32{Lo: 0x1145e, Hi: 0x1145e, Stride: 0x1}, unicode.Range32{Lo: 0x114b0, Hi: 0x114b0, Stride: 0x1}, unicode.Range32{Lo: 0x114b3, Hi: 0x114b8, Stride: 0x1}, unicode.Range32{Lo: 0x114ba, Hi: 0x114ba, Stride: 0x1}, @@ -383,6 +342,19 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x1171d, Hi: 0x1171f, Stride: 0x1}, unicode.Range32{Lo: 0x11722, Hi: 0x11725, Stride: 0x1}, unicode.Range32{Lo: 0x11727, Hi: 0x1172b, Stride: 0x1}, + unicode.Range32{Lo: 0x1182f, Hi: 0x11837, Stride: 0x1}, + unicode.Range32{Lo: 0x11839, Hi: 0x1183a, Stride: 0x1}, + unicode.Range32{Lo: 0x119d4, Hi: 0x119d7, Stride: 0x1}, + unicode.Range32{Lo: 0x119da, Hi: 0x119db, Stride: 0x1}, + unicode.Range32{Lo: 0x119e0, Hi: 0x119e0, Stride: 0x1}, + unicode.Range32{Lo: 0x11a01, Hi: 0x11a0a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a33, Hi: 0x11a38, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3b, Hi: 0x11a3e, Stride: 0x1}, + unicode.Range32{Lo: 0x11a47, Hi: 0x11a47, Stride: 0x1}, + unicode.Range32{Lo: 0x11a51, Hi: 0x11a56, Stride: 0x1}, + unicode.Range32{Lo: 0x11a59, Hi: 0x11a5b, Stride: 0x1}, + unicode.Range32{Lo: 0x11a8a, Hi: 0x11a96, Stride: 0x1}, + unicode.Range32{Lo: 0x11a98, Hi: 0x11a99, Stride: 0x1}, unicode.Range32{Lo: 0x11c30, Hi: 0x11c36, Stride: 0x1}, unicode.Range32{Lo: 0x11c38, Hi: 0x11c3d, Stride: 0x1}, unicode.Range32{Lo: 0x11c3f, Hi: 0x11c3f, Stride: 0x1}, @@ -390,8 +362,18 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11caa, Hi: 0x11cb0, Stride: 0x1}, unicode.Range32{Lo: 0x11cb2, Hi: 0x11cb3, Stride: 0x1}, unicode.Range32{Lo: 0x11cb5, Hi: 0x11cb6, Stride: 0x1}, + unicode.Range32{Lo: 0x11d31, Hi: 0x11d36, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3a, Hi: 0x11d3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3c, Hi: 0x11d3d, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3f, Hi: 0x11d45, Stride: 0x1}, + unicode.Range32{Lo: 0x11d47, Hi: 0x11d47, Stride: 0x1}, + unicode.Range32{Lo: 0x11d90, Hi: 0x11d91, Stride: 0x1}, + unicode.Range32{Lo: 0x11d95, Hi: 0x11d95, Stride: 0x1}, + unicode.Range32{Lo: 0x11d97, Hi: 0x11d97, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef3, Hi: 0x11ef4, Stride: 0x1}, unicode.Range32{Lo: 0x16af0, Hi: 0x16af4, Stride: 0x1}, unicode.Range32{Lo: 0x16b30, Hi: 0x16b36, Stride: 0x1}, + unicode.Range32{Lo: 0x16f4f, Hi: 0x16f4f, Stride: 0x1}, unicode.Range32{Lo: 0x16f8f, Hi: 0x16f92, Stride: 0x1}, unicode.Range32{Lo: 0x1bc9d, Hi: 0x1bc9e, Stride: 0x1}, unicode.Range32{Lo: 0x1d165, Hi: 0x1d165, Stride: 0x1}, @@ -412,25 +394,17 @@ var _GraphemeExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x1e01b, Hi: 0x1e021, Stride: 0x1}, unicode.Range32{Lo: 0x1e023, Hi: 0x1e024, Stride: 0x1}, unicode.Range32{Lo: 0x1e026, Hi: 0x1e02a, Stride: 0x1}, + unicode.Range32{Lo: 0x1e130, Hi: 0x1e136, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2ec, Hi: 0x1e2ef, Stride: 0x1}, unicode.Range32{Lo: 0x1e8d0, Hi: 0x1e8d6, Stride: 0x1}, unicode.Range32{Lo: 0x1e944, Hi: 0x1e94a, Stride: 0x1}, + unicode.Range32{Lo: 0x1f3fb, Hi: 0x1f3ff, Stride: 0x1}, unicode.Range32{Lo: 0xe0020, Hi: 0xe007f, Stride: 0x1}, unicode.Range32{Lo: 0xe0100, Hi: 0xe01ef, Stride: 0x1}, }, LatinOffset: 0, } -var _GraphemeGlue_After_Zwj = &unicode.RangeTable{ - R16: []unicode.Range16{ - unicode.Range16{Lo: 0x2764, Hi: 0x2764, Stride: 0x1}, - }, - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f48b, Hi: 0x1f48b, Stride: 0x1}, - unicode.Range32{Lo: 0x1f5e8, Hi: 0x1f5e8, Stride: 0x1}, - }, - LatinOffset: 0, -} - var _GraphemeL = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x1100, Hi: 0x115f, Stride: 0x1}, @@ -1266,7 +1240,11 @@ var _GraphemePrepend = &unicode.RangeTable{ }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x110bd, Hi: 0x110bd, Stride: 0x1}, + unicode.Range32{Lo: 0x110cd, Hi: 0x110cd, Stride: 0x1}, unicode.Range32{Lo: 0x111c2, Hi: 0x111c3, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3a, Hi: 0x11a3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a84, Hi: 0x11a89, Stride: 0x1}, + unicode.Range32{Lo: 0x11d46, Hi: 0x11d46, Stride: 0x1}, }, LatinOffset: 0, } @@ -1339,7 +1317,6 @@ var _GraphemeSpacingMark = &unicode.RangeTable{ unicode.Range16{Lo: 0x1a57, Hi: 0x1a57, Stride: 0x1}, unicode.Range16{Lo: 0x1a6d, Hi: 0x1a72, Stride: 0x1}, unicode.Range16{Lo: 0x1b04, Hi: 0x1b04, Stride: 0x1}, - unicode.Range16{Lo: 0x1b35, Hi: 0x1b35, Stride: 0x1}, unicode.Range16{Lo: 0x1b3b, Hi: 0x1b3b, Stride: 0x1}, unicode.Range16{Lo: 0x1b3d, Hi: 0x1b41, Stride: 0x1}, unicode.Range16{Lo: 0x1b43, Hi: 0x1b44, Stride: 0x1}, @@ -1354,7 +1331,7 @@ var _GraphemeSpacingMark = &unicode.RangeTable{ unicode.Range16{Lo: 0x1c24, Hi: 0x1c2b, Stride: 0x1}, unicode.Range16{Lo: 0x1c34, Hi: 0x1c35, Stride: 0x1}, unicode.Range16{Lo: 0x1ce1, Hi: 0x1ce1, Stride: 0x1}, - unicode.Range16{Lo: 0x1cf2, Hi: 0x1cf3, Stride: 0x1}, + unicode.Range16{Lo: 0x1cf7, Hi: 0x1cf7, Stride: 0x1}, unicode.Range16{Lo: 0xa823, Hi: 0xa824, Stride: 0x1}, unicode.Range16{Lo: 0xa827, Hi: 0xa827, Stride: 0x1}, unicode.Range16{Lo: 0xa880, Hi: 0xa881, Stride: 0x1}, @@ -1363,7 +1340,7 @@ var _GraphemeSpacingMark = &unicode.RangeTable{ unicode.Range16{Lo: 0xa983, Hi: 0xa983, Stride: 0x1}, unicode.Range16{Lo: 0xa9b4, Hi: 0xa9b5, Stride: 0x1}, unicode.Range16{Lo: 0xa9ba, Hi: 0xa9bb, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bd, Hi: 0xa9c0, Stride: 0x1}, + unicode.Range16{Lo: 0xa9be, Hi: 0xa9c0, Stride: 0x1}, unicode.Range16{Lo: 0xaa2f, Hi: 0xaa30, Stride: 0x1}, unicode.Range16{Lo: 0xaa33, Hi: 0xaa34, Stride: 0x1}, unicode.Range16{Lo: 0xaa4d, Hi: 0xaa4d, Stride: 0x1}, @@ -1382,6 +1359,7 @@ var _GraphemeSpacingMark = &unicode.RangeTable{ unicode.Range32{Lo: 0x110b0, Hi: 0x110b2, Stride: 0x1}, unicode.Range32{Lo: 0x110b7, Hi: 0x110b8, Stride: 0x1}, unicode.Range32{Lo: 0x1112c, Hi: 0x1112c, Stride: 0x1}, + unicode.Range32{Lo: 0x11145, Hi: 0x11146, Stride: 0x1}, unicode.Range32{Lo: 0x11182, Hi: 0x11182, Stride: 0x1}, unicode.Range32{Lo: 0x111b3, Hi: 0x111b5, Stride: 0x1}, unicode.Range32{Lo: 0x111bf, Hi: 0x111c0, Stride: 0x1}, @@ -1414,12 +1392,24 @@ var _GraphemeSpacingMark = &unicode.RangeTable{ unicode.Range32{Lo: 0x116b6, Hi: 0x116b6, Stride: 0x1}, unicode.Range32{Lo: 0x11720, Hi: 0x11721, Stride: 0x1}, unicode.Range32{Lo: 0x11726, Hi: 0x11726, Stride: 0x1}, + unicode.Range32{Lo: 0x1182c, Hi: 0x1182e, Stride: 0x1}, + unicode.Range32{Lo: 0x11838, Hi: 0x11838, Stride: 0x1}, + unicode.Range32{Lo: 0x119d1, Hi: 0x119d3, Stride: 0x1}, + unicode.Range32{Lo: 0x119dc, Hi: 0x119df, Stride: 0x1}, + unicode.Range32{Lo: 0x119e4, Hi: 0x119e4, Stride: 0x1}, + unicode.Range32{Lo: 0x11a39, Hi: 0x11a39, Stride: 0x1}, + unicode.Range32{Lo: 0x11a57, Hi: 0x11a58, Stride: 0x1}, + unicode.Range32{Lo: 0x11a97, Hi: 0x11a97, Stride: 0x1}, unicode.Range32{Lo: 0x11c2f, Hi: 0x11c2f, Stride: 0x1}, unicode.Range32{Lo: 0x11c3e, Hi: 0x11c3e, Stride: 0x1}, unicode.Range32{Lo: 0x11ca9, Hi: 0x11ca9, Stride: 0x1}, unicode.Range32{Lo: 0x11cb1, Hi: 0x11cb1, Stride: 0x1}, unicode.Range32{Lo: 0x11cb4, Hi: 0x11cb4, Stride: 0x1}, - unicode.Range32{Lo: 0x16f51, Hi: 0x16f7e, Stride: 0x1}, + unicode.Range32{Lo: 0x11d8a, Hi: 0x11d8e, Stride: 0x1}, + unicode.Range32{Lo: 0x11d93, Hi: 0x11d94, Stride: 0x1}, + unicode.Range32{Lo: 0x11d96, Hi: 0x11d96, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef5, Hi: 0x11ef6, Stride: 0x1}, + unicode.Range32{Lo: 0x16f51, Hi: 0x16f87, Stride: 0x1}, unicode.Range32{Lo: 0x1d166, Hi: 0x1d166, Stride: 0x1}, unicode.Range32{Lo: 0x1d16d, Hi: 0x1d16d, Stride: 0x1}, }, @@ -1457,16 +1447,8 @@ func _GraphemeRuneType(r rune) *_GraphemeRuneRange { return (*_GraphemeRuneRange)(_GraphemeCR) case unicode.Is(_GraphemeControl, r): return (*_GraphemeRuneRange)(_GraphemeControl) - case unicode.Is(_GraphemeE_Base, r): - return (*_GraphemeRuneRange)(_GraphemeE_Base) - case unicode.Is(_GraphemeE_Base_GAZ, r): - return (*_GraphemeRuneRange)(_GraphemeE_Base_GAZ) - case unicode.Is(_GraphemeE_Modifier, r): - return (*_GraphemeRuneRange)(_GraphemeE_Modifier) case unicode.Is(_GraphemeExtend, r): return (*_GraphemeRuneRange)(_GraphemeExtend) - case unicode.Is(_GraphemeGlue_After_Zwj, r): - return (*_GraphemeRuneRange)(_GraphemeGlue_After_Zwj) case unicode.Is(_GraphemeL, r): return (*_GraphemeRuneRange)(_GraphemeL) case unicode.Is(_GraphemeLF, r): @@ -1497,16 +1479,8 @@ func (rng *_GraphemeRuneRange) String() string { return "CR" case _GraphemeControl: return "Control" - case _GraphemeE_Base: - return "E_Base" - case _GraphemeE_Base_GAZ: - return "E_Base_GAZ" - case _GraphemeE_Modifier: - return "E_Modifier" case _GraphemeExtend: return "Extend" - case _GraphemeGlue_After_Zwj: - return "Glue_After_Zwj" case _GraphemeL: return "L" case _GraphemeLF: @@ -1549,10 +1523,15 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x294, Hi: 0x294, Stride: 0x1}, unicode.Range16{Lo: 0x295, Hi: 0x2af, Stride: 0x1}, unicode.Range16{Lo: 0x2b0, Hi: 0x2c1, Stride: 0x1}, + unicode.Range16{Lo: 0x2c2, Hi: 0x2c5, Stride: 0x1}, unicode.Range16{Lo: 0x2c6, Hi: 0x2d1, Stride: 0x1}, + unicode.Range16{Lo: 0x2d2, Hi: 0x2d7, Stride: 0x1}, + unicode.Range16{Lo: 0x2de, Hi: 0x2df, Stride: 0x1}, unicode.Range16{Lo: 0x2e0, Hi: 0x2e4, Stride: 0x1}, unicode.Range16{Lo: 0x2ec, Hi: 0x2ec, Stride: 0x1}, + unicode.Range16{Lo: 0x2ed, Hi: 0x2ed, Stride: 0x1}, unicode.Range16{Lo: 0x2ee, Hi: 0x2ee, Stride: 0x1}, + unicode.Range16{Lo: 0x2ef, Hi: 0x2ff, Stride: 0x1}, unicode.Range16{Lo: 0x370, Hi: 0x373, Stride: 0x1}, unicode.Range16{Lo: 0x374, Hi: 0x374, Stride: 0x1}, unicode.Range16{Lo: 0x376, Hi: 0x377, Stride: 0x1}, @@ -1568,7 +1547,9 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x48a, Hi: 0x52f, Stride: 0x1}, unicode.Range16{Lo: 0x531, Hi: 0x556, Stride: 0x1}, unicode.Range16{Lo: 0x559, Hi: 0x559, Stride: 0x1}, - unicode.Range16{Lo: 0x561, Hi: 0x587, Stride: 0x1}, + unicode.Range16{Lo: 0x55b, Hi: 0x55c, Stride: 0x1}, + unicode.Range16{Lo: 0x55e, Hi: 0x55e, Stride: 0x1}, + unicode.Range16{Lo: 0x560, Hi: 0x588, Stride: 0x1}, unicode.Range16{Lo: 0x5f3, Hi: 0x5f3, Stride: 0x1}, unicode.Range16{Lo: 0x620, Hi: 0x63f, Stride: 0x1}, unicode.Range16{Lo: 0x640, Hi: 0x640, Stride: 0x1}, @@ -1592,6 +1573,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x824, Hi: 0x824, Stride: 0x1}, unicode.Range16{Lo: 0x828, Hi: 0x828, Stride: 0x1}, unicode.Range16{Lo: 0x840, Hi: 0x858, Stride: 0x1}, + unicode.Range16{Lo: 0x860, Hi: 0x86a, Stride: 0x1}, unicode.Range16{Lo: 0x8a0, Hi: 0x8b4, Stride: 0x1}, unicode.Range16{Lo: 0x8b6, Hi: 0x8bd, Stride: 0x1}, unicode.Range16{Lo: 0x904, Hi: 0x939, Stride: 0x1}, @@ -1611,6 +1593,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x9dc, Hi: 0x9dd, Stride: 0x1}, unicode.Range16{Lo: 0x9df, Hi: 0x9e1, Stride: 0x1}, unicode.Range16{Lo: 0x9f0, Hi: 0x9f1, Stride: 0x1}, + unicode.Range16{Lo: 0x9fc, Hi: 0x9fc, Stride: 0x1}, unicode.Range16{Lo: 0xa05, Hi: 0xa0a, Stride: 0x1}, unicode.Range16{Lo: 0xa0f, Hi: 0xa10, Stride: 0x1}, unicode.Range16{Lo: 0xa13, Hi: 0xa28, Stride: 0x1}, @@ -1691,7 +1674,8 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x10cd, Hi: 0x10cd, Stride: 0x1}, unicode.Range16{Lo: 0x10d0, Hi: 0x10fa, Stride: 0x1}, unicode.Range16{Lo: 0x10fc, Hi: 0x10fc, Stride: 0x1}, - unicode.Range16{Lo: 0x10fd, Hi: 0x1248, Stride: 0x1}, + unicode.Range16{Lo: 0x10fd, Hi: 0x10ff, Stride: 0x1}, + unicode.Range16{Lo: 0x1100, Hi: 0x1248, Stride: 0x1}, unicode.Range16{Lo: 0x124a, Hi: 0x124d, Stride: 0x1}, unicode.Range16{Lo: 0x1250, Hi: 0x1256, Stride: 0x1}, unicode.Range16{Lo: 0x1258, Hi: 0x1258, Stride: 0x1}, @@ -1724,7 +1708,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x176e, Hi: 0x1770, Stride: 0x1}, unicode.Range16{Lo: 0x1820, Hi: 0x1842, Stride: 0x1}, unicode.Range16{Lo: 0x1843, Hi: 0x1843, Stride: 0x1}, - unicode.Range16{Lo: 0x1844, Hi: 0x1877, Stride: 0x1}, + unicode.Range16{Lo: 0x1844, Hi: 0x1878, Stride: 0x1}, unicode.Range16{Lo: 0x1880, Hi: 0x1884, Stride: 0x1}, unicode.Range16{Lo: 0x1887, Hi: 0x18a8, Stride: 0x1}, unicode.Range16{Lo: 0x18aa, Hi: 0x18aa, Stride: 0x1}, @@ -1741,9 +1725,12 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x1c5a, Hi: 0x1c77, Stride: 0x1}, unicode.Range16{Lo: 0x1c78, Hi: 0x1c7d, Stride: 0x1}, unicode.Range16{Lo: 0x1c80, Hi: 0x1c88, Stride: 0x1}, + unicode.Range16{Lo: 0x1c90, Hi: 0x1cba, Stride: 0x1}, + unicode.Range16{Lo: 0x1cbd, Hi: 0x1cbf, Stride: 0x1}, unicode.Range16{Lo: 0x1ce9, Hi: 0x1cec, Stride: 0x1}, - unicode.Range16{Lo: 0x1cee, Hi: 0x1cf1, Stride: 0x1}, + unicode.Range16{Lo: 0x1cee, Hi: 0x1cf3, Stride: 0x1}, unicode.Range16{Lo: 0x1cf5, Hi: 0x1cf6, Stride: 0x1}, + unicode.Range16{Lo: 0x1cfa, Hi: 0x1cfa, Stride: 0x1}, unicode.Range16{Lo: 0x1d00, Hi: 0x1d2b, Stride: 0x1}, unicode.Range16{Lo: 0x1d2c, Hi: 0x1d6a, Stride: 0x1}, unicode.Range16{Lo: 0x1d6b, Hi: 0x1d77, Stride: 0x1}, @@ -1816,7 +1803,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x3005, Hi: 0x3005, Stride: 0x1}, unicode.Range16{Lo: 0x303b, Hi: 0x303b, Stride: 0x1}, unicode.Range16{Lo: 0x303c, Hi: 0x303c, Stride: 0x1}, - unicode.Range16{Lo: 0x3105, Hi: 0x312d, Stride: 0x1}, + unicode.Range16{Lo: 0x3105, Hi: 0x312f, Stride: 0x1}, unicode.Range16{Lo: 0x3131, Hi: 0x318e, Stride: 0x1}, unicode.Range16{Lo: 0x31a0, Hi: 0x31ba, Stride: 0x1}, unicode.Range16{Lo: 0xa000, Hi: 0xa014, Stride: 0x1}, @@ -1836,14 +1823,16 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0xa6a0, Hi: 0xa6e5, Stride: 0x1}, unicode.Range16{Lo: 0xa6e6, Hi: 0xa6ef, Stride: 0x1}, unicode.Range16{Lo: 0xa717, Hi: 0xa71f, Stride: 0x1}, + unicode.Range16{Lo: 0xa720, Hi: 0xa721, Stride: 0x1}, unicode.Range16{Lo: 0xa722, Hi: 0xa76f, Stride: 0x1}, unicode.Range16{Lo: 0xa770, Hi: 0xa770, Stride: 0x1}, unicode.Range16{Lo: 0xa771, Hi: 0xa787, Stride: 0x1}, unicode.Range16{Lo: 0xa788, Hi: 0xa788, Stride: 0x1}, + unicode.Range16{Lo: 0xa789, Hi: 0xa78a, Stride: 0x1}, unicode.Range16{Lo: 0xa78b, Hi: 0xa78e, Stride: 0x1}, unicode.Range16{Lo: 0xa78f, Hi: 0xa78f, Stride: 0x1}, - unicode.Range16{Lo: 0xa790, Hi: 0xa7ae, Stride: 0x1}, - unicode.Range16{Lo: 0xa7b0, Hi: 0xa7b7, Stride: 0x1}, + unicode.Range16{Lo: 0xa790, Hi: 0xa7bf, Stride: 0x1}, + unicode.Range16{Lo: 0xa7c2, Hi: 0xa7c6, Stride: 0x1}, unicode.Range16{Lo: 0xa7f7, Hi: 0xa7f7, Stride: 0x1}, unicode.Range16{Lo: 0xa7f8, Hi: 0xa7f9, Stride: 0x1}, unicode.Range16{Lo: 0xa7fa, Hi: 0xa7fa, Stride: 0x1}, @@ -1855,7 +1844,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0xa882, Hi: 0xa8b3, Stride: 0x1}, unicode.Range16{Lo: 0xa8f2, Hi: 0xa8f7, Stride: 0x1}, unicode.Range16{Lo: 0xa8fb, Hi: 0xa8fb, Stride: 0x1}, - unicode.Range16{Lo: 0xa8fd, Hi: 0xa8fd, Stride: 0x1}, + unicode.Range16{Lo: 0xa8fd, Hi: 0xa8fe, Stride: 0x1}, unicode.Range16{Lo: 0xa90a, Hi: 0xa925, Stride: 0x1}, unicode.Range16{Lo: 0xa930, Hi: 0xa946, Stride: 0x1}, unicode.Range16{Lo: 0xa960, Hi: 0xa97c, Stride: 0x1}, @@ -1873,8 +1862,9 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range16{Lo: 0xab20, Hi: 0xab26, Stride: 0x1}, unicode.Range16{Lo: 0xab28, Hi: 0xab2e, Stride: 0x1}, unicode.Range16{Lo: 0xab30, Hi: 0xab5a, Stride: 0x1}, + unicode.Range16{Lo: 0xab5b, Hi: 0xab5b, Stride: 0x1}, unicode.Range16{Lo: 0xab5c, Hi: 0xab5f, Stride: 0x1}, - unicode.Range16{Lo: 0xab60, Hi: 0xab65, Stride: 0x1}, + unicode.Range16{Lo: 0xab60, Hi: 0xab67, Stride: 0x1}, unicode.Range16{Lo: 0xab70, Hi: 0xabbf, Stride: 0x1}, unicode.Range16{Lo: 0xabc0, Hi: 0xabe2, Stride: 0x1}, unicode.Range16{Lo: 0xac00, Hi: 0xd7a3, Stride: 0x1}, @@ -1909,7 +1899,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10280, Hi: 0x1029c, Stride: 0x1}, unicode.Range32{Lo: 0x102a0, Hi: 0x102d0, Stride: 0x1}, unicode.Range32{Lo: 0x10300, Hi: 0x1031f, Stride: 0x1}, - unicode.Range32{Lo: 0x10330, Hi: 0x10340, Stride: 0x1}, + unicode.Range32{Lo: 0x1032d, Hi: 0x10340, Stride: 0x1}, unicode.Range32{Lo: 0x10341, Hi: 0x10341, Stride: 0x1}, unicode.Range32{Lo: 0x10342, Hi: 0x10349, Stride: 0x1}, unicode.Range32{Lo: 0x1034a, Hi: 0x1034a, Stride: 0x1}, @@ -1944,7 +1934,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10a00, Hi: 0x10a00, Stride: 0x1}, unicode.Range32{Lo: 0x10a10, Hi: 0x10a13, Stride: 0x1}, unicode.Range32{Lo: 0x10a15, Hi: 0x10a17, Stride: 0x1}, - unicode.Range32{Lo: 0x10a19, Hi: 0x10a33, Stride: 0x1}, + unicode.Range32{Lo: 0x10a19, Hi: 0x10a35, Stride: 0x1}, unicode.Range32{Lo: 0x10a60, Hi: 0x10a7c, Stride: 0x1}, unicode.Range32{Lo: 0x10a80, Hi: 0x10a9c, Stride: 0x1}, unicode.Range32{Lo: 0x10ac0, Hi: 0x10ac7, Stride: 0x1}, @@ -1956,10 +1946,16 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10c00, Hi: 0x10c48, Stride: 0x1}, unicode.Range32{Lo: 0x10c80, Hi: 0x10cb2, Stride: 0x1}, unicode.Range32{Lo: 0x10cc0, Hi: 0x10cf2, Stride: 0x1}, + unicode.Range32{Lo: 0x10d00, Hi: 0x10d23, Stride: 0x1}, + unicode.Range32{Lo: 0x10f00, Hi: 0x10f1c, Stride: 0x1}, + unicode.Range32{Lo: 0x10f27, Hi: 0x10f27, Stride: 0x1}, + unicode.Range32{Lo: 0x10f30, Hi: 0x10f45, Stride: 0x1}, + unicode.Range32{Lo: 0x10fe0, Hi: 0x10ff6, Stride: 0x1}, unicode.Range32{Lo: 0x11003, Hi: 0x11037, Stride: 0x1}, unicode.Range32{Lo: 0x11083, Hi: 0x110af, Stride: 0x1}, unicode.Range32{Lo: 0x110d0, Hi: 0x110e8, Stride: 0x1}, unicode.Range32{Lo: 0x11103, Hi: 0x11126, Stride: 0x1}, + unicode.Range32{Lo: 0x11144, Hi: 0x11144, Stride: 0x1}, unicode.Range32{Lo: 0x11150, Hi: 0x11172, Stride: 0x1}, unicode.Range32{Lo: 0x11176, Hi: 0x11176, Stride: 0x1}, unicode.Range32{Lo: 0x11183, Hi: 0x111b2, Stride: 0x1}, @@ -1985,6 +1981,7 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x1135d, Hi: 0x11361, Stride: 0x1}, unicode.Range32{Lo: 0x11400, Hi: 0x11434, Stride: 0x1}, unicode.Range32{Lo: 0x11447, Hi: 0x1144a, Stride: 0x1}, + unicode.Range32{Lo: 0x1145f, Hi: 0x1145f, Stride: 0x1}, unicode.Range32{Lo: 0x11480, Hi: 0x114af, Stride: 0x1}, unicode.Range32{Lo: 0x114c4, Hi: 0x114c5, Stride: 0x1}, unicode.Range32{Lo: 0x114c7, Hi: 0x114c7, Stride: 0x1}, @@ -1993,13 +1990,34 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x11600, Hi: 0x1162f, Stride: 0x1}, unicode.Range32{Lo: 0x11644, Hi: 0x11644, Stride: 0x1}, unicode.Range32{Lo: 0x11680, Hi: 0x116aa, Stride: 0x1}, + unicode.Range32{Lo: 0x116b8, Hi: 0x116b8, Stride: 0x1}, + unicode.Range32{Lo: 0x11800, Hi: 0x1182b, Stride: 0x1}, unicode.Range32{Lo: 0x118a0, Hi: 0x118df, Stride: 0x1}, unicode.Range32{Lo: 0x118ff, Hi: 0x118ff, Stride: 0x1}, + unicode.Range32{Lo: 0x119a0, Hi: 0x119a7, Stride: 0x1}, + unicode.Range32{Lo: 0x119aa, Hi: 0x119d0, Stride: 0x1}, + unicode.Range32{Lo: 0x119e1, Hi: 0x119e1, Stride: 0x1}, + unicode.Range32{Lo: 0x119e3, Hi: 0x119e3, Stride: 0x1}, + unicode.Range32{Lo: 0x11a00, Hi: 0x11a00, Stride: 0x1}, + unicode.Range32{Lo: 0x11a0b, Hi: 0x11a32, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3a, Hi: 0x11a3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a50, Hi: 0x11a50, Stride: 0x1}, + unicode.Range32{Lo: 0x11a5c, Hi: 0x11a89, Stride: 0x1}, + unicode.Range32{Lo: 0x11a9d, Hi: 0x11a9d, Stride: 0x1}, unicode.Range32{Lo: 0x11ac0, Hi: 0x11af8, Stride: 0x1}, unicode.Range32{Lo: 0x11c00, Hi: 0x11c08, Stride: 0x1}, unicode.Range32{Lo: 0x11c0a, Hi: 0x11c2e, Stride: 0x1}, unicode.Range32{Lo: 0x11c40, Hi: 0x11c40, Stride: 0x1}, unicode.Range32{Lo: 0x11c72, Hi: 0x11c8f, Stride: 0x1}, + unicode.Range32{Lo: 0x11d00, Hi: 0x11d06, Stride: 0x1}, + unicode.Range32{Lo: 0x11d08, Hi: 0x11d09, Stride: 0x1}, + unicode.Range32{Lo: 0x11d0b, Hi: 0x11d30, Stride: 0x1}, + unicode.Range32{Lo: 0x11d46, Hi: 0x11d46, Stride: 0x1}, + unicode.Range32{Lo: 0x11d60, Hi: 0x11d65, Stride: 0x1}, + unicode.Range32{Lo: 0x11d67, Hi: 0x11d68, Stride: 0x1}, + unicode.Range32{Lo: 0x11d6a, Hi: 0x11d89, Stride: 0x1}, + unicode.Range32{Lo: 0x11d98, Hi: 0x11d98, Stride: 0x1}, + unicode.Range32{Lo: 0x11ee0, Hi: 0x11ef2, Stride: 0x1}, unicode.Range32{Lo: 0x12000, Hi: 0x12399, Stride: 0x1}, unicode.Range32{Lo: 0x12400, Hi: 0x1246e, Stride: 0x1}, unicode.Range32{Lo: 0x12480, Hi: 0x12543, Stride: 0x1}, @@ -2012,10 +2030,12 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x16b40, Hi: 0x16b43, Stride: 0x1}, unicode.Range32{Lo: 0x16b63, Hi: 0x16b77, Stride: 0x1}, unicode.Range32{Lo: 0x16b7d, Hi: 0x16b8f, Stride: 0x1}, - unicode.Range32{Lo: 0x16f00, Hi: 0x16f44, Stride: 0x1}, + unicode.Range32{Lo: 0x16e40, Hi: 0x16e7f, Stride: 0x1}, + unicode.Range32{Lo: 0x16f00, Hi: 0x16f4a, Stride: 0x1}, unicode.Range32{Lo: 0x16f50, Hi: 0x16f50, Stride: 0x1}, unicode.Range32{Lo: 0x16f93, Hi: 0x16f9f, Stride: 0x1}, - unicode.Range32{Lo: 0x16fe0, Hi: 0x16fe0, Stride: 0x1}, + unicode.Range32{Lo: 0x16fe0, Hi: 0x16fe1, Stride: 0x1}, + unicode.Range32{Lo: 0x16fe3, Hi: 0x16fe3, Stride: 0x1}, unicode.Range32{Lo: 0x1bc00, Hi: 0x1bc6a, Stride: 0x1}, unicode.Range32{Lo: 0x1bc70, Hi: 0x1bc7c, Stride: 0x1}, unicode.Range32{Lo: 0x1bc80, Hi: 0x1bc88, Stride: 0x1}, @@ -2050,8 +2070,13 @@ var _WordALetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x1d78a, Hi: 0x1d7a8, Stride: 0x1}, unicode.Range32{Lo: 0x1d7aa, Hi: 0x1d7c2, Stride: 0x1}, unicode.Range32{Lo: 0x1d7c4, Hi: 0x1d7cb, Stride: 0x1}, + unicode.Range32{Lo: 0x1e100, Hi: 0x1e12c, Stride: 0x1}, + unicode.Range32{Lo: 0x1e137, Hi: 0x1e13d, Stride: 0x1}, + unicode.Range32{Lo: 0x1e14e, Hi: 0x1e14e, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2c0, Hi: 0x1e2eb, Stride: 0x1}, unicode.Range32{Lo: 0x1e800, Hi: 0x1e8c4, Stride: 0x1}, unicode.Range32{Lo: 0x1e900, Hi: 0x1e943, Stride: 0x1}, + unicode.Range32{Lo: 0x1e94b, Hi: 0x1e94b, Stride: 0x1}, unicode.Range32{Lo: 0x1ee00, Hi: 0x1ee03, Stride: 0x1}, unicode.Range32{Lo: 0x1ee05, Hi: 0x1ee1f, Stride: 0x1}, unicode.Range32{Lo: 0x1ee21, Hi: 0x1ee22, Stride: 0x1}, @@ -2106,56 +2131,6 @@ var _WordDouble_Quote = &unicode.RangeTable{ LatinOffset: 1, } -var _WordE_Base = &unicode.RangeTable{ - R16: []unicode.Range16{ - unicode.Range16{Lo: 0x261d, Hi: 0x261d, Stride: 0x1}, - unicode.Range16{Lo: 0x26f9, Hi: 0x26f9, Stride: 0x1}, - unicode.Range16{Lo: 0x270a, Hi: 0x270d, Stride: 0x1}, - }, - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f385, Hi: 0x1f385, Stride: 0x1}, - unicode.Range32{Lo: 0x1f3c3, Hi: 0x1f3c4, Stride: 0x1}, - unicode.Range32{Lo: 0x1f3ca, Hi: 0x1f3cb, Stride: 0x1}, - unicode.Range32{Lo: 0x1f442, Hi: 0x1f443, Stride: 0x1}, - unicode.Range32{Lo: 0x1f446, Hi: 0x1f450, Stride: 0x1}, - unicode.Range32{Lo: 0x1f46e, Hi: 0x1f46e, Stride: 0x1}, - unicode.Range32{Lo: 0x1f470, Hi: 0x1f478, Stride: 0x1}, - unicode.Range32{Lo: 0x1f47c, Hi: 0x1f47c, Stride: 0x1}, - unicode.Range32{Lo: 0x1f481, Hi: 0x1f483, Stride: 0x1}, - unicode.Range32{Lo: 0x1f485, Hi: 0x1f487, Stride: 0x1}, - unicode.Range32{Lo: 0x1f4aa, Hi: 0x1f4aa, Stride: 0x1}, - unicode.Range32{Lo: 0x1f575, Hi: 0x1f575, Stride: 0x1}, - unicode.Range32{Lo: 0x1f57a, Hi: 0x1f57a, Stride: 0x1}, - unicode.Range32{Lo: 0x1f590, Hi: 0x1f590, Stride: 0x1}, - unicode.Range32{Lo: 0x1f595, Hi: 0x1f596, Stride: 0x1}, - unicode.Range32{Lo: 0x1f645, Hi: 0x1f647, Stride: 0x1}, - unicode.Range32{Lo: 0x1f64b, Hi: 0x1f64f, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6a3, Hi: 0x1f6a3, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6b4, Hi: 0x1f6b6, Stride: 0x1}, - unicode.Range32{Lo: 0x1f6c0, Hi: 0x1f6c0, Stride: 0x1}, - unicode.Range32{Lo: 0x1f918, Hi: 0x1f91e, Stride: 0x1}, - unicode.Range32{Lo: 0x1f926, Hi: 0x1f926, Stride: 0x1}, - unicode.Range32{Lo: 0x1f930, Hi: 0x1f930, Stride: 0x1}, - unicode.Range32{Lo: 0x1f933, Hi: 0x1f939, Stride: 0x1}, - unicode.Range32{Lo: 0x1f93c, Hi: 0x1f93e, Stride: 0x1}, - }, - LatinOffset: 0, -} - -var _WordE_Base_GAZ = &unicode.RangeTable{ - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f466, Hi: 0x1f469, Stride: 0x1}, - }, - LatinOffset: 0, -} - -var _WordE_Modifier = &unicode.RangeTable{ - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f3fb, Hi: 0x1f3ff, Stride: 0x1}, - }, - LatinOffset: 0, -} - var _WordExtend = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x300, Hi: 0x36f, Stride: 0x1}, @@ -2177,12 +2152,13 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x730, Hi: 0x74a, Stride: 0x1}, unicode.Range16{Lo: 0x7a6, Hi: 0x7b0, Stride: 0x1}, unicode.Range16{Lo: 0x7eb, Hi: 0x7f3, Stride: 0x1}, + unicode.Range16{Lo: 0x7fd, Hi: 0x7fd, Stride: 0x1}, unicode.Range16{Lo: 0x816, Hi: 0x819, Stride: 0x1}, unicode.Range16{Lo: 0x81b, Hi: 0x823, Stride: 0x1}, unicode.Range16{Lo: 0x825, Hi: 0x827, Stride: 0x1}, unicode.Range16{Lo: 0x829, Hi: 0x82d, Stride: 0x1}, unicode.Range16{Lo: 0x859, Hi: 0x85b, Stride: 0x1}, - unicode.Range16{Lo: 0x8d4, Hi: 0x8e1, Stride: 0x1}, + unicode.Range16{Lo: 0x8d3, Hi: 0x8e1, Stride: 0x1}, unicode.Range16{Lo: 0x8e3, Hi: 0x902, Stride: 0x1}, unicode.Range16{Lo: 0x903, Hi: 0x903, Stride: 0x1}, unicode.Range16{Lo: 0x93a, Hi: 0x93a, Stride: 0x1}, @@ -2205,6 +2181,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x9cd, Hi: 0x9cd, Stride: 0x1}, unicode.Range16{Lo: 0x9d7, Hi: 0x9d7, Stride: 0x1}, unicode.Range16{Lo: 0x9e2, Hi: 0x9e3, Stride: 0x1}, + unicode.Range16{Lo: 0x9fe, Hi: 0x9fe, Stride: 0x1}, unicode.Range16{Lo: 0xa01, Hi: 0xa02, Stride: 0x1}, unicode.Range16{Lo: 0xa03, Hi: 0xa03, Stride: 0x1}, unicode.Range16{Lo: 0xa3c, Hi: 0xa3c, Stride: 0x1}, @@ -2225,6 +2202,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xacb, Hi: 0xacc, Stride: 0x1}, unicode.Range16{Lo: 0xacd, Hi: 0xacd, Stride: 0x1}, unicode.Range16{Lo: 0xae2, Hi: 0xae3, Stride: 0x1}, + unicode.Range16{Lo: 0xafa, Hi: 0xaff, Stride: 0x1}, unicode.Range16{Lo: 0xb01, Hi: 0xb01, Stride: 0x1}, unicode.Range16{Lo: 0xb02, Hi: 0xb03, Stride: 0x1}, unicode.Range16{Lo: 0xb3c, Hi: 0xb3c, Stride: 0x1}, @@ -2248,6 +2226,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xbd7, Hi: 0xbd7, Stride: 0x1}, unicode.Range16{Lo: 0xc00, Hi: 0xc00, Stride: 0x1}, unicode.Range16{Lo: 0xc01, Hi: 0xc03, Stride: 0x1}, + unicode.Range16{Lo: 0xc04, Hi: 0xc04, Stride: 0x1}, unicode.Range16{Lo: 0xc3e, Hi: 0xc40, Stride: 0x1}, unicode.Range16{Lo: 0xc41, Hi: 0xc44, Stride: 0x1}, unicode.Range16{Lo: 0xc46, Hi: 0xc48, Stride: 0x1}, @@ -2266,8 +2245,9 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xccc, Hi: 0xccd, Stride: 0x1}, unicode.Range16{Lo: 0xcd5, Hi: 0xcd6, Stride: 0x1}, unicode.Range16{Lo: 0xce2, Hi: 0xce3, Stride: 0x1}, - unicode.Range16{Lo: 0xd01, Hi: 0xd01, Stride: 0x1}, + unicode.Range16{Lo: 0xd00, Hi: 0xd01, Stride: 0x1}, unicode.Range16{Lo: 0xd02, Hi: 0xd03, Stride: 0x1}, + unicode.Range16{Lo: 0xd3b, Hi: 0xd3c, Stride: 0x1}, unicode.Range16{Lo: 0xd3e, Hi: 0xd40, Stride: 0x1}, unicode.Range16{Lo: 0xd41, Hi: 0xd44, Stride: 0x1}, unicode.Range16{Lo: 0xd46, Hi: 0xd48, Stride: 0x1}, @@ -2286,8 +2266,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xe34, Hi: 0xe3a, Stride: 0x1}, unicode.Range16{Lo: 0xe47, Hi: 0xe4e, Stride: 0x1}, unicode.Range16{Lo: 0xeb1, Hi: 0xeb1, Stride: 0x1}, - unicode.Range16{Lo: 0xeb4, Hi: 0xeb9, Stride: 0x1}, - unicode.Range16{Lo: 0xebb, Hi: 0xebc, Stride: 0x1}, + unicode.Range16{Lo: 0xeb4, Hi: 0xebc, Stride: 0x1}, unicode.Range16{Lo: 0xec8, Hi: 0xecd, Stride: 0x1}, unicode.Range16{Lo: 0xf18, Hi: 0xf19, Stride: 0x1}, unicode.Range16{Lo: 0xf35, Hi: 0xf35, Stride: 0x1}, @@ -2400,10 +2379,10 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x1ce1, Hi: 0x1ce1, Stride: 0x1}, unicode.Range16{Lo: 0x1ce2, Hi: 0x1ce8, Stride: 0x1}, unicode.Range16{Lo: 0x1ced, Hi: 0x1ced, Stride: 0x1}, - unicode.Range16{Lo: 0x1cf2, Hi: 0x1cf3, Stride: 0x1}, unicode.Range16{Lo: 0x1cf4, Hi: 0x1cf4, Stride: 0x1}, + unicode.Range16{Lo: 0x1cf7, Hi: 0x1cf7, Stride: 0x1}, unicode.Range16{Lo: 0x1cf8, Hi: 0x1cf9, Stride: 0x1}, - unicode.Range16{Lo: 0x1dc0, Hi: 0x1df5, Stride: 0x1}, + unicode.Range16{Lo: 0x1dc0, Hi: 0x1df9, Stride: 0x1}, unicode.Range16{Lo: 0x1dfb, Hi: 0x1dff, Stride: 0x1}, unicode.Range16{Lo: 0x200c, Hi: 0x200c, Stride: 0x1}, unicode.Range16{Lo: 0x20d0, Hi: 0x20dc, Stride: 0x1}, @@ -2432,6 +2411,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xa8b4, Hi: 0xa8c3, Stride: 0x1}, unicode.Range16{Lo: 0xa8c4, Hi: 0xa8c5, Stride: 0x1}, unicode.Range16{Lo: 0xa8e0, Hi: 0xa8f1, Stride: 0x1}, + unicode.Range16{Lo: 0xa8ff, Hi: 0xa8ff, Stride: 0x1}, unicode.Range16{Lo: 0xa926, Hi: 0xa92d, Stride: 0x1}, unicode.Range16{Lo: 0xa947, Hi: 0xa951, Stride: 0x1}, unicode.Range16{Lo: 0xa952, Hi: 0xa953, Stride: 0x1}, @@ -2441,8 +2421,8 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xa9b4, Hi: 0xa9b5, Stride: 0x1}, unicode.Range16{Lo: 0xa9b6, Hi: 0xa9b9, Stride: 0x1}, unicode.Range16{Lo: 0xa9ba, Hi: 0xa9bb, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bc, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bd, Hi: 0xa9c0, Stride: 0x1}, + unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bd, Stride: 0x1}, + unicode.Range16{Lo: 0xa9be, Hi: 0xa9c0, Stride: 0x1}, unicode.Range16{Lo: 0xa9e5, Hi: 0xa9e5, Stride: 0x1}, unicode.Range16{Lo: 0xaa29, Hi: 0xaa2e, Stride: 0x1}, unicode.Range16{Lo: 0xaa2f, Hi: 0xaa30, Stride: 0x1}, @@ -2487,6 +2467,8 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x10a38, Hi: 0x10a3a, Stride: 0x1}, unicode.Range32{Lo: 0x10a3f, Hi: 0x10a3f, Stride: 0x1}, unicode.Range32{Lo: 0x10ae5, Hi: 0x10ae6, Stride: 0x1}, + unicode.Range32{Lo: 0x10d24, Hi: 0x10d27, Stride: 0x1}, + unicode.Range32{Lo: 0x10f46, Hi: 0x10f50, Stride: 0x1}, unicode.Range32{Lo: 0x11000, Hi: 0x11000, Stride: 0x1}, unicode.Range32{Lo: 0x11001, Hi: 0x11001, Stride: 0x1}, unicode.Range32{Lo: 0x11002, Hi: 0x11002, Stride: 0x1}, @@ -2501,13 +2483,14 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11127, Hi: 0x1112b, Stride: 0x1}, unicode.Range32{Lo: 0x1112c, Hi: 0x1112c, Stride: 0x1}, unicode.Range32{Lo: 0x1112d, Hi: 0x11134, Stride: 0x1}, + unicode.Range32{Lo: 0x11145, Hi: 0x11146, Stride: 0x1}, unicode.Range32{Lo: 0x11173, Hi: 0x11173, Stride: 0x1}, unicode.Range32{Lo: 0x11180, Hi: 0x11181, Stride: 0x1}, unicode.Range32{Lo: 0x11182, Hi: 0x11182, Stride: 0x1}, unicode.Range32{Lo: 0x111b3, Hi: 0x111b5, Stride: 0x1}, unicode.Range32{Lo: 0x111b6, Hi: 0x111be, Stride: 0x1}, unicode.Range32{Lo: 0x111bf, Hi: 0x111c0, Stride: 0x1}, - unicode.Range32{Lo: 0x111ca, Hi: 0x111cc, Stride: 0x1}, + unicode.Range32{Lo: 0x111c9, Hi: 0x111cc, Stride: 0x1}, unicode.Range32{Lo: 0x1122c, Hi: 0x1122e, Stride: 0x1}, unicode.Range32{Lo: 0x1122f, Hi: 0x11231, Stride: 0x1}, unicode.Range32{Lo: 0x11232, Hi: 0x11233, Stride: 0x1}, @@ -2520,7 +2503,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x112e3, Hi: 0x112ea, Stride: 0x1}, unicode.Range32{Lo: 0x11300, Hi: 0x11301, Stride: 0x1}, unicode.Range32{Lo: 0x11302, Hi: 0x11303, Stride: 0x1}, - unicode.Range32{Lo: 0x1133c, Hi: 0x1133c, Stride: 0x1}, + unicode.Range32{Lo: 0x1133b, Hi: 0x1133c, Stride: 0x1}, unicode.Range32{Lo: 0x1133e, Hi: 0x1133f, Stride: 0x1}, unicode.Range32{Lo: 0x11340, Hi: 0x11340, Stride: 0x1}, unicode.Range32{Lo: 0x11341, Hi: 0x11344, Stride: 0x1}, @@ -2536,6 +2519,7 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11442, Hi: 0x11444, Stride: 0x1}, unicode.Range32{Lo: 0x11445, Hi: 0x11445, Stride: 0x1}, unicode.Range32{Lo: 0x11446, Hi: 0x11446, Stride: 0x1}, + unicode.Range32{Lo: 0x1145e, Hi: 0x1145e, Stride: 0x1}, unicode.Range32{Lo: 0x114b0, Hi: 0x114b2, Stride: 0x1}, unicode.Range32{Lo: 0x114b3, Hi: 0x114b8, Stride: 0x1}, unicode.Range32{Lo: 0x114b9, Hi: 0x114b9, Stride: 0x1}, @@ -2569,6 +2553,27 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11722, Hi: 0x11725, Stride: 0x1}, unicode.Range32{Lo: 0x11726, Hi: 0x11726, Stride: 0x1}, unicode.Range32{Lo: 0x11727, Hi: 0x1172b, Stride: 0x1}, + unicode.Range32{Lo: 0x1182c, Hi: 0x1182e, Stride: 0x1}, + unicode.Range32{Lo: 0x1182f, Hi: 0x11837, Stride: 0x1}, + unicode.Range32{Lo: 0x11838, Hi: 0x11838, Stride: 0x1}, + unicode.Range32{Lo: 0x11839, Hi: 0x1183a, Stride: 0x1}, + unicode.Range32{Lo: 0x119d1, Hi: 0x119d3, Stride: 0x1}, + unicode.Range32{Lo: 0x119d4, Hi: 0x119d7, Stride: 0x1}, + unicode.Range32{Lo: 0x119da, Hi: 0x119db, Stride: 0x1}, + unicode.Range32{Lo: 0x119dc, Hi: 0x119df, Stride: 0x1}, + unicode.Range32{Lo: 0x119e0, Hi: 0x119e0, Stride: 0x1}, + unicode.Range32{Lo: 0x119e4, Hi: 0x119e4, Stride: 0x1}, + unicode.Range32{Lo: 0x11a01, Hi: 0x11a0a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a33, Hi: 0x11a38, Stride: 0x1}, + unicode.Range32{Lo: 0x11a39, Hi: 0x11a39, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3b, Hi: 0x11a3e, Stride: 0x1}, + unicode.Range32{Lo: 0x11a47, Hi: 0x11a47, Stride: 0x1}, + unicode.Range32{Lo: 0x11a51, Hi: 0x11a56, Stride: 0x1}, + unicode.Range32{Lo: 0x11a57, Hi: 0x11a58, Stride: 0x1}, + unicode.Range32{Lo: 0x11a59, Hi: 0x11a5b, Stride: 0x1}, + unicode.Range32{Lo: 0x11a8a, Hi: 0x11a96, Stride: 0x1}, + unicode.Range32{Lo: 0x11a97, Hi: 0x11a97, Stride: 0x1}, + unicode.Range32{Lo: 0x11a98, Hi: 0x11a99, Stride: 0x1}, unicode.Range32{Lo: 0x11c2f, Hi: 0x11c2f, Stride: 0x1}, unicode.Range32{Lo: 0x11c30, Hi: 0x11c36, Stride: 0x1}, unicode.Range32{Lo: 0x11c38, Hi: 0x11c3d, Stride: 0x1}, @@ -2581,9 +2586,23 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11cb2, Hi: 0x11cb3, Stride: 0x1}, unicode.Range32{Lo: 0x11cb4, Hi: 0x11cb4, Stride: 0x1}, unicode.Range32{Lo: 0x11cb5, Hi: 0x11cb6, Stride: 0x1}, + unicode.Range32{Lo: 0x11d31, Hi: 0x11d36, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3a, Hi: 0x11d3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3c, Hi: 0x11d3d, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3f, Hi: 0x11d45, Stride: 0x1}, + unicode.Range32{Lo: 0x11d47, Hi: 0x11d47, Stride: 0x1}, + unicode.Range32{Lo: 0x11d8a, Hi: 0x11d8e, Stride: 0x1}, + unicode.Range32{Lo: 0x11d90, Hi: 0x11d91, Stride: 0x1}, + unicode.Range32{Lo: 0x11d93, Hi: 0x11d94, Stride: 0x1}, + unicode.Range32{Lo: 0x11d95, Hi: 0x11d95, Stride: 0x1}, + unicode.Range32{Lo: 0x11d96, Hi: 0x11d96, Stride: 0x1}, + unicode.Range32{Lo: 0x11d97, Hi: 0x11d97, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef3, Hi: 0x11ef4, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef5, Hi: 0x11ef6, Stride: 0x1}, unicode.Range32{Lo: 0x16af0, Hi: 0x16af4, Stride: 0x1}, unicode.Range32{Lo: 0x16b30, Hi: 0x16b36, Stride: 0x1}, - unicode.Range32{Lo: 0x16f51, Hi: 0x16f7e, Stride: 0x1}, + unicode.Range32{Lo: 0x16f4f, Hi: 0x16f4f, Stride: 0x1}, + unicode.Range32{Lo: 0x16f51, Hi: 0x16f87, Stride: 0x1}, unicode.Range32{Lo: 0x16f8f, Hi: 0x16f92, Stride: 0x1}, unicode.Range32{Lo: 0x1bc9d, Hi: 0x1bc9e, Stride: 0x1}, unicode.Range32{Lo: 0x1d165, Hi: 0x1d166, Stride: 0x1}, @@ -2604,8 +2623,11 @@ var _WordExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x1e01b, Hi: 0x1e021, Stride: 0x1}, unicode.Range32{Lo: 0x1e023, Hi: 0x1e024, Stride: 0x1}, unicode.Range32{Lo: 0x1e026, Hi: 0x1e02a, Stride: 0x1}, + unicode.Range32{Lo: 0x1e130, Hi: 0x1e136, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2ec, Hi: 0x1e2ef, Stride: 0x1}, unicode.Range32{Lo: 0x1e8d0, Hi: 0x1e8d6, Stride: 0x1}, unicode.Range32{Lo: 0x1e944, Hi: 0x1e94a, Stride: 0x1}, + unicode.Range32{Lo: 0x1f3fb, Hi: 0x1f3ff, Stride: 0x1}, unicode.Range32{Lo: 0xe0020, Hi: 0xe007f, Stride: 0x1}, unicode.Range32{Lo: 0xe0100, Hi: 0xe01ef, Stride: 0x1}, }, @@ -2643,6 +2665,8 @@ var _WordFormat = &unicode.RangeTable{ }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x110bd, Hi: 0x110bd, Stride: 0x1}, + unicode.Range32{Lo: 0x110cd, Hi: 0x110cd, Stride: 0x1}, + unicode.Range32{Lo: 0x13430, Hi: 0x13438, Stride: 0x1}, unicode.Range32{Lo: 0x1bca0, Hi: 0x1bca3, Stride: 0x1}, unicode.Range32{Lo: 0x1d173, Hi: 0x1d17a, Stride: 0x1}, unicode.Range32{Lo: 0xe0001, Hi: 0xe0001, Stride: 0x1}, @@ -2650,21 +2674,10 @@ var _WordFormat = &unicode.RangeTable{ LatinOffset: 1, } -var _WordGlue_After_Zwj = &unicode.RangeTable{ - R16: []unicode.Range16{ - unicode.Range16{Lo: 0x2764, Hi: 0x2764, Stride: 0x1}, - }, - R32: []unicode.Range32{ - unicode.Range32{Lo: 0x1f48b, Hi: 0x1f48b, Stride: 0x1}, - unicode.Range32{Lo: 0x1f5e8, Hi: 0x1f5e8, Stride: 0x1}, - }, - LatinOffset: 0, -} - var _WordHebrew_Letter = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x5d0, Hi: 0x5ea, Stride: 0x1}, - unicode.Range16{Lo: 0x5f0, Hi: 0x5f2, Stride: 0x1}, + unicode.Range16{Lo: 0x5ef, Hi: 0x5f2, Stride: 0x1}, unicode.Range16{Lo: 0xfb1d, Hi: 0xfb1d, Stride: 0x1}, unicode.Range16{Lo: 0xfb1f, Hi: 0xfb28, Stride: 0x1}, unicode.Range16{Lo: 0xfb2a, Hi: 0xfb36, Stride: 0x1}, @@ -2694,6 +2707,7 @@ var _WordKatakana = &unicode.RangeTable{ }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x1b000, Hi: 0x1b000, Stride: 0x1}, + unicode.Range32{Lo: 0x1b164, Hi: 0x1b167, Stride: 0x1}, }, LatinOffset: 0, } @@ -2709,7 +2723,6 @@ var _WordMidLetter = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x3a, Hi: 0x3a, Stride: 0x1}, unicode.Range16{Lo: 0xb7, Hi: 0xb7, Stride: 0x1}, - unicode.Range16{Lo: 0x2d7, Hi: 0x2d7, Stride: 0x1}, unicode.Range16{Lo: 0x387, Hi: 0x387, Stride: 0x1}, unicode.Range16{Lo: 0x5f4, Hi: 0x5f4, Stride: 0x1}, unicode.Range16{Lo: 0x2027, Hi: 0x2027, Stride: 0x1}, @@ -2802,9 +2815,11 @@ var _WordNumeric = &unicode.RangeTable{ unicode.Range16{Lo: 0xa9f0, Hi: 0xa9f9, Stride: 0x1}, unicode.Range16{Lo: 0xaa50, Hi: 0xaa59, Stride: 0x1}, unicode.Range16{Lo: 0xabf0, Hi: 0xabf9, Stride: 0x1}, + unicode.Range16{Lo: 0xff10, Hi: 0xff19, Stride: 0x1}, }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x104a0, Hi: 0x104a9, Stride: 0x1}, + unicode.Range32{Lo: 0x10d30, Hi: 0x10d39, Stride: 0x1}, unicode.Range32{Lo: 0x11066, Hi: 0x1106f, Stride: 0x1}, unicode.Range32{Lo: 0x110f0, Hi: 0x110f9, Stride: 0x1}, unicode.Range32{Lo: 0x11136, Hi: 0x1113f, Stride: 0x1}, @@ -2817,9 +2832,13 @@ var _WordNumeric = &unicode.RangeTable{ unicode.Range32{Lo: 0x11730, Hi: 0x11739, Stride: 0x1}, unicode.Range32{Lo: 0x118e0, Hi: 0x118e9, Stride: 0x1}, unicode.Range32{Lo: 0x11c50, Hi: 0x11c59, Stride: 0x1}, + unicode.Range32{Lo: 0x11d50, Hi: 0x11d59, Stride: 0x1}, + unicode.Range32{Lo: 0x11da0, Hi: 0x11da9, Stride: 0x1}, unicode.Range32{Lo: 0x16a60, Hi: 0x16a69, Stride: 0x1}, unicode.Range32{Lo: 0x16b50, Hi: 0x16b59, Stride: 0x1}, unicode.Range32{Lo: 0x1d7ce, Hi: 0x1d7ff, Stride: 0x1}, + unicode.Range32{Lo: 0x1e140, Hi: 0x1e149, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2f0, Hi: 0x1e2f9, Stride: 0x1}, unicode.Range32{Lo: 0x1e950, Hi: 0x1e959, Stride: 0x1}, }, LatinOffset: 1, @@ -2839,6 +2858,18 @@ var _WordSingle_Quote = &unicode.RangeTable{ LatinOffset: 1, } +var _WordWSegSpace = &unicode.RangeTable{ + R16: []unicode.Range16{ + unicode.Range16{Lo: 0x20, Hi: 0x20, Stride: 0x1}, + unicode.Range16{Lo: 0x1680, Hi: 0x1680, Stride: 0x1}, + unicode.Range16{Lo: 0x2000, Hi: 0x2006, Stride: 0x1}, + unicode.Range16{Lo: 0x2008, Hi: 0x200a, Stride: 0x1}, + unicode.Range16{Lo: 0x205f, Hi: 0x205f, Stride: 0x1}, + unicode.Range16{Lo: 0x3000, Hi: 0x3000, Stride: 0x1}, + }, + LatinOffset: 1, +} + var _WordZWJ = &unicode.RangeTable{ R16: []unicode.Range16{ unicode.Range16{Lo: 0x200d, Hi: 0x200d, Stride: 0x1}, @@ -2856,20 +2887,12 @@ func _WordRuneType(r rune) *_WordRuneRange { return (*_WordRuneRange)(_WordCR) case unicode.Is(_WordDouble_Quote, r): return (*_WordRuneRange)(_WordDouble_Quote) - case unicode.Is(_WordE_Base, r): - return (*_WordRuneRange)(_WordE_Base) - case unicode.Is(_WordE_Base_GAZ, r): - return (*_WordRuneRange)(_WordE_Base_GAZ) - case unicode.Is(_WordE_Modifier, r): - return (*_WordRuneRange)(_WordE_Modifier) case unicode.Is(_WordExtend, r): return (*_WordRuneRange)(_WordExtend) case unicode.Is(_WordExtendNumLet, r): return (*_WordRuneRange)(_WordExtendNumLet) case unicode.Is(_WordFormat, r): return (*_WordRuneRange)(_WordFormat) - case unicode.Is(_WordGlue_After_Zwj, r): - return (*_WordRuneRange)(_WordGlue_After_Zwj) case unicode.Is(_WordHebrew_Letter, r): return (*_WordRuneRange)(_WordHebrew_Letter) case unicode.Is(_WordKatakana, r): @@ -2890,6 +2913,8 @@ func _WordRuneType(r rune) *_WordRuneRange { return (*_WordRuneRange)(_WordRegional_Indicator) case unicode.Is(_WordSingle_Quote, r): return (*_WordRuneRange)(_WordSingle_Quote) + case unicode.Is(_WordWSegSpace, r): + return (*_WordRuneRange)(_WordWSegSpace) case unicode.Is(_WordZWJ, r): return (*_WordRuneRange)(_WordZWJ) default: @@ -2904,20 +2929,12 @@ func (rng *_WordRuneRange) String() string { return "CR" case _WordDouble_Quote: return "Double_Quote" - case _WordE_Base: - return "E_Base" - case _WordE_Base_GAZ: - return "E_Base_GAZ" - case _WordE_Modifier: - return "E_Modifier" case _WordExtend: return "Extend" case _WordExtendNumLet: return "ExtendNumLet" case _WordFormat: return "Format" - case _WordGlue_After_Zwj: - return "Glue_After_Zwj" case _WordHebrew_Letter: return "Hebrew_Letter" case _WordKatakana: @@ -2938,6 +2955,8 @@ func (rng *_WordRuneRange) String() string { return "Regional_Indicator" case _WordSingle_Quote: return "Single_Quote" + case _WordWSegSpace: + return "WSegSpace" case _WordZWJ: return "ZWJ" default: @@ -3166,12 +3185,13 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x730, Hi: 0x74a, Stride: 0x1}, unicode.Range16{Lo: 0x7a6, Hi: 0x7b0, Stride: 0x1}, unicode.Range16{Lo: 0x7eb, Hi: 0x7f3, Stride: 0x1}, + unicode.Range16{Lo: 0x7fd, Hi: 0x7fd, Stride: 0x1}, unicode.Range16{Lo: 0x816, Hi: 0x819, Stride: 0x1}, unicode.Range16{Lo: 0x81b, Hi: 0x823, Stride: 0x1}, unicode.Range16{Lo: 0x825, Hi: 0x827, Stride: 0x1}, unicode.Range16{Lo: 0x829, Hi: 0x82d, Stride: 0x1}, unicode.Range16{Lo: 0x859, Hi: 0x85b, Stride: 0x1}, - unicode.Range16{Lo: 0x8d4, Hi: 0x8e1, Stride: 0x1}, + unicode.Range16{Lo: 0x8d3, Hi: 0x8e1, Stride: 0x1}, unicode.Range16{Lo: 0x8e3, Hi: 0x902, Stride: 0x1}, unicode.Range16{Lo: 0x903, Hi: 0x903, Stride: 0x1}, unicode.Range16{Lo: 0x93a, Hi: 0x93a, Stride: 0x1}, @@ -3194,6 +3214,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x9cd, Hi: 0x9cd, Stride: 0x1}, unicode.Range16{Lo: 0x9d7, Hi: 0x9d7, Stride: 0x1}, unicode.Range16{Lo: 0x9e2, Hi: 0x9e3, Stride: 0x1}, + unicode.Range16{Lo: 0x9fe, Hi: 0x9fe, Stride: 0x1}, unicode.Range16{Lo: 0xa01, Hi: 0xa02, Stride: 0x1}, unicode.Range16{Lo: 0xa03, Hi: 0xa03, Stride: 0x1}, unicode.Range16{Lo: 0xa3c, Hi: 0xa3c, Stride: 0x1}, @@ -3214,6 +3235,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xacb, Hi: 0xacc, Stride: 0x1}, unicode.Range16{Lo: 0xacd, Hi: 0xacd, Stride: 0x1}, unicode.Range16{Lo: 0xae2, Hi: 0xae3, Stride: 0x1}, + unicode.Range16{Lo: 0xafa, Hi: 0xaff, Stride: 0x1}, unicode.Range16{Lo: 0xb01, Hi: 0xb01, Stride: 0x1}, unicode.Range16{Lo: 0xb02, Hi: 0xb03, Stride: 0x1}, unicode.Range16{Lo: 0xb3c, Hi: 0xb3c, Stride: 0x1}, @@ -3237,6 +3259,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xbd7, Hi: 0xbd7, Stride: 0x1}, unicode.Range16{Lo: 0xc00, Hi: 0xc00, Stride: 0x1}, unicode.Range16{Lo: 0xc01, Hi: 0xc03, Stride: 0x1}, + unicode.Range16{Lo: 0xc04, Hi: 0xc04, Stride: 0x1}, unicode.Range16{Lo: 0xc3e, Hi: 0xc40, Stride: 0x1}, unicode.Range16{Lo: 0xc41, Hi: 0xc44, Stride: 0x1}, unicode.Range16{Lo: 0xc46, Hi: 0xc48, Stride: 0x1}, @@ -3255,8 +3278,9 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xccc, Hi: 0xccd, Stride: 0x1}, unicode.Range16{Lo: 0xcd5, Hi: 0xcd6, Stride: 0x1}, unicode.Range16{Lo: 0xce2, Hi: 0xce3, Stride: 0x1}, - unicode.Range16{Lo: 0xd01, Hi: 0xd01, Stride: 0x1}, + unicode.Range16{Lo: 0xd00, Hi: 0xd01, Stride: 0x1}, unicode.Range16{Lo: 0xd02, Hi: 0xd03, Stride: 0x1}, + unicode.Range16{Lo: 0xd3b, Hi: 0xd3c, Stride: 0x1}, unicode.Range16{Lo: 0xd3e, Hi: 0xd40, Stride: 0x1}, unicode.Range16{Lo: 0xd41, Hi: 0xd44, Stride: 0x1}, unicode.Range16{Lo: 0xd46, Hi: 0xd48, Stride: 0x1}, @@ -3275,8 +3299,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xe34, Hi: 0xe3a, Stride: 0x1}, unicode.Range16{Lo: 0xe47, Hi: 0xe4e, Stride: 0x1}, unicode.Range16{Lo: 0xeb1, Hi: 0xeb1, Stride: 0x1}, - unicode.Range16{Lo: 0xeb4, Hi: 0xeb9, Stride: 0x1}, - unicode.Range16{Lo: 0xebb, Hi: 0xebc, Stride: 0x1}, + unicode.Range16{Lo: 0xeb4, Hi: 0xebc, Stride: 0x1}, unicode.Range16{Lo: 0xec8, Hi: 0xecd, Stride: 0x1}, unicode.Range16{Lo: 0xf18, Hi: 0xf19, Stride: 0x1}, unicode.Range16{Lo: 0xf35, Hi: 0xf35, Stride: 0x1}, @@ -3389,10 +3412,10 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0x1ce1, Hi: 0x1ce1, Stride: 0x1}, unicode.Range16{Lo: 0x1ce2, Hi: 0x1ce8, Stride: 0x1}, unicode.Range16{Lo: 0x1ced, Hi: 0x1ced, Stride: 0x1}, - unicode.Range16{Lo: 0x1cf2, Hi: 0x1cf3, Stride: 0x1}, unicode.Range16{Lo: 0x1cf4, Hi: 0x1cf4, Stride: 0x1}, + unicode.Range16{Lo: 0x1cf7, Hi: 0x1cf7, Stride: 0x1}, unicode.Range16{Lo: 0x1cf8, Hi: 0x1cf9, Stride: 0x1}, - unicode.Range16{Lo: 0x1dc0, Hi: 0x1df5, Stride: 0x1}, + unicode.Range16{Lo: 0x1dc0, Hi: 0x1df9, Stride: 0x1}, unicode.Range16{Lo: 0x1dfb, Hi: 0x1dff, Stride: 0x1}, unicode.Range16{Lo: 0x200c, Hi: 0x200d, Stride: 0x1}, unicode.Range16{Lo: 0x20d0, Hi: 0x20dc, Stride: 0x1}, @@ -3421,6 +3444,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xa8b4, Hi: 0xa8c3, Stride: 0x1}, unicode.Range16{Lo: 0xa8c4, Hi: 0xa8c5, Stride: 0x1}, unicode.Range16{Lo: 0xa8e0, Hi: 0xa8f1, Stride: 0x1}, + unicode.Range16{Lo: 0xa8ff, Hi: 0xa8ff, Stride: 0x1}, unicode.Range16{Lo: 0xa926, Hi: 0xa92d, Stride: 0x1}, unicode.Range16{Lo: 0xa947, Hi: 0xa951, Stride: 0x1}, unicode.Range16{Lo: 0xa952, Hi: 0xa953, Stride: 0x1}, @@ -3430,8 +3454,8 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range16{Lo: 0xa9b4, Hi: 0xa9b5, Stride: 0x1}, unicode.Range16{Lo: 0xa9b6, Hi: 0xa9b9, Stride: 0x1}, unicode.Range16{Lo: 0xa9ba, Hi: 0xa9bb, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bc, Stride: 0x1}, - unicode.Range16{Lo: 0xa9bd, Hi: 0xa9c0, Stride: 0x1}, + unicode.Range16{Lo: 0xa9bc, Hi: 0xa9bd, Stride: 0x1}, + unicode.Range16{Lo: 0xa9be, Hi: 0xa9c0, Stride: 0x1}, unicode.Range16{Lo: 0xa9e5, Hi: 0xa9e5, Stride: 0x1}, unicode.Range16{Lo: 0xaa29, Hi: 0xaa2e, Stride: 0x1}, unicode.Range16{Lo: 0xaa2f, Hi: 0xaa30, Stride: 0x1}, @@ -3476,6 +3500,8 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x10a38, Hi: 0x10a3a, Stride: 0x1}, unicode.Range32{Lo: 0x10a3f, Hi: 0x10a3f, Stride: 0x1}, unicode.Range32{Lo: 0x10ae5, Hi: 0x10ae6, Stride: 0x1}, + unicode.Range32{Lo: 0x10d24, Hi: 0x10d27, Stride: 0x1}, + unicode.Range32{Lo: 0x10f46, Hi: 0x10f50, Stride: 0x1}, unicode.Range32{Lo: 0x11000, Hi: 0x11000, Stride: 0x1}, unicode.Range32{Lo: 0x11001, Hi: 0x11001, Stride: 0x1}, unicode.Range32{Lo: 0x11002, Hi: 0x11002, Stride: 0x1}, @@ -3490,13 +3516,14 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11127, Hi: 0x1112b, Stride: 0x1}, unicode.Range32{Lo: 0x1112c, Hi: 0x1112c, Stride: 0x1}, unicode.Range32{Lo: 0x1112d, Hi: 0x11134, Stride: 0x1}, + unicode.Range32{Lo: 0x11145, Hi: 0x11146, Stride: 0x1}, unicode.Range32{Lo: 0x11173, Hi: 0x11173, Stride: 0x1}, unicode.Range32{Lo: 0x11180, Hi: 0x11181, Stride: 0x1}, unicode.Range32{Lo: 0x11182, Hi: 0x11182, Stride: 0x1}, unicode.Range32{Lo: 0x111b3, Hi: 0x111b5, Stride: 0x1}, unicode.Range32{Lo: 0x111b6, Hi: 0x111be, Stride: 0x1}, unicode.Range32{Lo: 0x111bf, Hi: 0x111c0, Stride: 0x1}, - unicode.Range32{Lo: 0x111ca, Hi: 0x111cc, Stride: 0x1}, + unicode.Range32{Lo: 0x111c9, Hi: 0x111cc, Stride: 0x1}, unicode.Range32{Lo: 0x1122c, Hi: 0x1122e, Stride: 0x1}, unicode.Range32{Lo: 0x1122f, Hi: 0x11231, Stride: 0x1}, unicode.Range32{Lo: 0x11232, Hi: 0x11233, Stride: 0x1}, @@ -3509,7 +3536,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x112e3, Hi: 0x112ea, Stride: 0x1}, unicode.Range32{Lo: 0x11300, Hi: 0x11301, Stride: 0x1}, unicode.Range32{Lo: 0x11302, Hi: 0x11303, Stride: 0x1}, - unicode.Range32{Lo: 0x1133c, Hi: 0x1133c, Stride: 0x1}, + unicode.Range32{Lo: 0x1133b, Hi: 0x1133c, Stride: 0x1}, unicode.Range32{Lo: 0x1133e, Hi: 0x1133f, Stride: 0x1}, unicode.Range32{Lo: 0x11340, Hi: 0x11340, Stride: 0x1}, unicode.Range32{Lo: 0x11341, Hi: 0x11344, Stride: 0x1}, @@ -3525,6 +3552,7 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11442, Hi: 0x11444, Stride: 0x1}, unicode.Range32{Lo: 0x11445, Hi: 0x11445, Stride: 0x1}, unicode.Range32{Lo: 0x11446, Hi: 0x11446, Stride: 0x1}, + unicode.Range32{Lo: 0x1145e, Hi: 0x1145e, Stride: 0x1}, unicode.Range32{Lo: 0x114b0, Hi: 0x114b2, Stride: 0x1}, unicode.Range32{Lo: 0x114b3, Hi: 0x114b8, Stride: 0x1}, unicode.Range32{Lo: 0x114b9, Hi: 0x114b9, Stride: 0x1}, @@ -3558,6 +3586,27 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11722, Hi: 0x11725, Stride: 0x1}, unicode.Range32{Lo: 0x11726, Hi: 0x11726, Stride: 0x1}, unicode.Range32{Lo: 0x11727, Hi: 0x1172b, Stride: 0x1}, + unicode.Range32{Lo: 0x1182c, Hi: 0x1182e, Stride: 0x1}, + unicode.Range32{Lo: 0x1182f, Hi: 0x11837, Stride: 0x1}, + unicode.Range32{Lo: 0x11838, Hi: 0x11838, Stride: 0x1}, + unicode.Range32{Lo: 0x11839, Hi: 0x1183a, Stride: 0x1}, + unicode.Range32{Lo: 0x119d1, Hi: 0x119d3, Stride: 0x1}, + unicode.Range32{Lo: 0x119d4, Hi: 0x119d7, Stride: 0x1}, + unicode.Range32{Lo: 0x119da, Hi: 0x119db, Stride: 0x1}, + unicode.Range32{Lo: 0x119dc, Hi: 0x119df, Stride: 0x1}, + unicode.Range32{Lo: 0x119e0, Hi: 0x119e0, Stride: 0x1}, + unicode.Range32{Lo: 0x119e4, Hi: 0x119e4, Stride: 0x1}, + unicode.Range32{Lo: 0x11a01, Hi: 0x11a0a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a33, Hi: 0x11a38, Stride: 0x1}, + unicode.Range32{Lo: 0x11a39, Hi: 0x11a39, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3b, Hi: 0x11a3e, Stride: 0x1}, + unicode.Range32{Lo: 0x11a47, Hi: 0x11a47, Stride: 0x1}, + unicode.Range32{Lo: 0x11a51, Hi: 0x11a56, Stride: 0x1}, + unicode.Range32{Lo: 0x11a57, Hi: 0x11a58, Stride: 0x1}, + unicode.Range32{Lo: 0x11a59, Hi: 0x11a5b, Stride: 0x1}, + unicode.Range32{Lo: 0x11a8a, Hi: 0x11a96, Stride: 0x1}, + unicode.Range32{Lo: 0x11a97, Hi: 0x11a97, Stride: 0x1}, + unicode.Range32{Lo: 0x11a98, Hi: 0x11a99, Stride: 0x1}, unicode.Range32{Lo: 0x11c2f, Hi: 0x11c2f, Stride: 0x1}, unicode.Range32{Lo: 0x11c30, Hi: 0x11c36, Stride: 0x1}, unicode.Range32{Lo: 0x11c38, Hi: 0x11c3d, Stride: 0x1}, @@ -3570,9 +3619,23 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x11cb2, Hi: 0x11cb3, Stride: 0x1}, unicode.Range32{Lo: 0x11cb4, Hi: 0x11cb4, Stride: 0x1}, unicode.Range32{Lo: 0x11cb5, Hi: 0x11cb6, Stride: 0x1}, + unicode.Range32{Lo: 0x11d31, Hi: 0x11d36, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3a, Hi: 0x11d3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3c, Hi: 0x11d3d, Stride: 0x1}, + unicode.Range32{Lo: 0x11d3f, Hi: 0x11d45, Stride: 0x1}, + unicode.Range32{Lo: 0x11d47, Hi: 0x11d47, Stride: 0x1}, + unicode.Range32{Lo: 0x11d8a, Hi: 0x11d8e, Stride: 0x1}, + unicode.Range32{Lo: 0x11d90, Hi: 0x11d91, Stride: 0x1}, + unicode.Range32{Lo: 0x11d93, Hi: 0x11d94, Stride: 0x1}, + unicode.Range32{Lo: 0x11d95, Hi: 0x11d95, Stride: 0x1}, + unicode.Range32{Lo: 0x11d96, Hi: 0x11d96, Stride: 0x1}, + unicode.Range32{Lo: 0x11d97, Hi: 0x11d97, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef3, Hi: 0x11ef4, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef5, Hi: 0x11ef6, Stride: 0x1}, unicode.Range32{Lo: 0x16af0, Hi: 0x16af4, Stride: 0x1}, unicode.Range32{Lo: 0x16b30, Hi: 0x16b36, Stride: 0x1}, - unicode.Range32{Lo: 0x16f51, Hi: 0x16f7e, Stride: 0x1}, + unicode.Range32{Lo: 0x16f4f, Hi: 0x16f4f, Stride: 0x1}, + unicode.Range32{Lo: 0x16f51, Hi: 0x16f87, Stride: 0x1}, unicode.Range32{Lo: 0x16f8f, Hi: 0x16f92, Stride: 0x1}, unicode.Range32{Lo: 0x1bc9d, Hi: 0x1bc9e, Stride: 0x1}, unicode.Range32{Lo: 0x1d165, Hi: 0x1d166, Stride: 0x1}, @@ -3593,6 +3656,8 @@ var _SentenceExtend = &unicode.RangeTable{ unicode.Range32{Lo: 0x1e01b, Hi: 0x1e021, Stride: 0x1}, unicode.Range32{Lo: 0x1e023, Hi: 0x1e024, Stride: 0x1}, unicode.Range32{Lo: 0x1e026, Hi: 0x1e02a, Stride: 0x1}, + unicode.Range32{Lo: 0x1e130, Hi: 0x1e136, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2ec, Hi: 0x1e2ef, Stride: 0x1}, unicode.Range32{Lo: 0x1e8d0, Hi: 0x1e8d6, Stride: 0x1}, unicode.Range32{Lo: 0x1e944, Hi: 0x1e94a, Stride: 0x1}, unicode.Range32{Lo: 0xe0020, Hi: 0xe007f, Stride: 0x1}, @@ -3620,6 +3685,8 @@ var _SentenceFormat = &unicode.RangeTable{ }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x110bd, Hi: 0x110bd, Stride: 0x1}, + unicode.Range32{Lo: 0x110cd, Hi: 0x110cd, Stride: 0x1}, + unicode.Range32{Lo: 0x13430, Hi: 0x13438, Stride: 0x1}, unicode.Range32{Lo: 0x1bca0, Hi: 0x1bca3, Stride: 0x1}, unicode.Range32{Lo: 0x1d173, Hi: 0x1d17a, Stride: 0x1}, unicode.Range32{Lo: 0xe0001, Hi: 0xe0001, Stride: 0x1}, @@ -3911,7 +3978,7 @@ var _SentenceLower = &unicode.RangeTable{ unicode.Range16{Lo: 0x52b, Hi: 0x52b, Stride: 0x1}, unicode.Range16{Lo: 0x52d, Hi: 0x52d, Stride: 0x1}, unicode.Range16{Lo: 0x52f, Hi: 0x52f, Stride: 0x1}, - unicode.Range16{Lo: 0x561, Hi: 0x587, Stride: 0x1}, + unicode.Range16{Lo: 0x560, Hi: 0x588, Stride: 0x1}, unicode.Range16{Lo: 0x13f8, Hi: 0x13fd, Stride: 0x1}, unicode.Range16{Lo: 0x1c80, Hi: 0x1c88, Stride: 0x1}, unicode.Range16{Lo: 0x1d00, Hi: 0x1d2b, Stride: 0x1}, @@ -4244,13 +4311,19 @@ var _SentenceLower = &unicode.RangeTable{ unicode.Range16{Lo: 0xa7a5, Hi: 0xa7a5, Stride: 0x1}, unicode.Range16{Lo: 0xa7a7, Hi: 0xa7a7, Stride: 0x1}, unicode.Range16{Lo: 0xa7a9, Hi: 0xa7a9, Stride: 0x1}, + unicode.Range16{Lo: 0xa7af, Hi: 0xa7af, Stride: 0x1}, unicode.Range16{Lo: 0xa7b5, Hi: 0xa7b5, Stride: 0x1}, unicode.Range16{Lo: 0xa7b7, Hi: 0xa7b7, Stride: 0x1}, + unicode.Range16{Lo: 0xa7b9, Hi: 0xa7b9, Stride: 0x1}, + unicode.Range16{Lo: 0xa7bb, Hi: 0xa7bb, Stride: 0x1}, + unicode.Range16{Lo: 0xa7bd, Hi: 0xa7bd, Stride: 0x1}, + unicode.Range16{Lo: 0xa7bf, Hi: 0xa7bf, Stride: 0x1}, + unicode.Range16{Lo: 0xa7c3, Hi: 0xa7c3, Stride: 0x1}, unicode.Range16{Lo: 0xa7f8, Hi: 0xa7f9, Stride: 0x1}, unicode.Range16{Lo: 0xa7fa, Hi: 0xa7fa, Stride: 0x1}, unicode.Range16{Lo: 0xab30, Hi: 0xab5a, Stride: 0x1}, unicode.Range16{Lo: 0xab5c, Hi: 0xab5f, Stride: 0x1}, - unicode.Range16{Lo: 0xab60, Hi: 0xab65, Stride: 0x1}, + unicode.Range16{Lo: 0xab60, Hi: 0xab67, Stride: 0x1}, unicode.Range16{Lo: 0xab70, Hi: 0xabbf, Stride: 0x1}, unicode.Range16{Lo: 0xfb00, Hi: 0xfb06, Stride: 0x1}, unicode.Range16{Lo: 0xfb13, Hi: 0xfb17, Stride: 0x1}, @@ -4261,6 +4334,7 @@ var _SentenceLower = &unicode.RangeTable{ unicode.Range32{Lo: 0x104d8, Hi: 0x104fb, Stride: 0x1}, unicode.Range32{Lo: 0x10cc0, Hi: 0x10cf2, Stride: 0x1}, unicode.Range32{Lo: 0x118c0, Hi: 0x118df, Stride: 0x1}, + unicode.Range32{Lo: 0x16e60, Hi: 0x16e7f, Stride: 0x1}, unicode.Range32{Lo: 0x1d41a, Hi: 0x1d433, Stride: 0x1}, unicode.Range32{Lo: 0x1d44e, Hi: 0x1d454, Stride: 0x1}, unicode.Range32{Lo: 0x1d456, Hi: 0x1d467, Stride: 0x1}, @@ -4333,9 +4407,11 @@ var _SentenceNumeric = &unicode.RangeTable{ unicode.Range16{Lo: 0xa9f0, Hi: 0xa9f9, Stride: 0x1}, unicode.Range16{Lo: 0xaa50, Hi: 0xaa59, Stride: 0x1}, unicode.Range16{Lo: 0xabf0, Hi: 0xabf9, Stride: 0x1}, + unicode.Range16{Lo: 0xff10, Hi: 0xff19, Stride: 0x1}, }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x104a0, Hi: 0x104a9, Stride: 0x1}, + unicode.Range32{Lo: 0x10d30, Hi: 0x10d39, Stride: 0x1}, unicode.Range32{Lo: 0x11066, Hi: 0x1106f, Stride: 0x1}, unicode.Range32{Lo: 0x110f0, Hi: 0x110f9, Stride: 0x1}, unicode.Range32{Lo: 0x11136, Hi: 0x1113f, Stride: 0x1}, @@ -4348,9 +4424,13 @@ var _SentenceNumeric = &unicode.RangeTable{ unicode.Range32{Lo: 0x11730, Hi: 0x11739, Stride: 0x1}, unicode.Range32{Lo: 0x118e0, Hi: 0x118e9, Stride: 0x1}, unicode.Range32{Lo: 0x11c50, Hi: 0x11c59, Stride: 0x1}, + unicode.Range32{Lo: 0x11d50, Hi: 0x11d59, Stride: 0x1}, + unicode.Range32{Lo: 0x11da0, Hi: 0x11da9, Stride: 0x1}, unicode.Range32{Lo: 0x16a60, Hi: 0x16a69, Stride: 0x1}, unicode.Range32{Lo: 0x16b50, Hi: 0x16b59, Stride: 0x1}, unicode.Range32{Lo: 0x1d7ce, Hi: 0x1d7ff, Stride: 0x1}, + unicode.Range32{Lo: 0x1e140, Hi: 0x1e149, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2f0, Hi: 0x1e2f9, Stride: 0x1}, unicode.Range32{Lo: 0x1e950, Hi: 0x1e959, Stride: 0x1}, }, LatinOffset: 1, @@ -4368,7 +4448,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x374, Hi: 0x374, Stride: 0x1}, unicode.Range16{Lo: 0x559, Hi: 0x559, Stride: 0x1}, unicode.Range16{Lo: 0x5d0, Hi: 0x5ea, Stride: 0x1}, - unicode.Range16{Lo: 0x5f0, Hi: 0x5f2, Stride: 0x1}, + unicode.Range16{Lo: 0x5ef, Hi: 0x5f2, Stride: 0x1}, unicode.Range16{Lo: 0x5f3, Hi: 0x5f3, Stride: 0x1}, unicode.Range16{Lo: 0x620, Hi: 0x63f, Stride: 0x1}, unicode.Range16{Lo: 0x640, Hi: 0x640, Stride: 0x1}, @@ -4392,6 +4472,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x824, Hi: 0x824, Stride: 0x1}, unicode.Range16{Lo: 0x828, Hi: 0x828, Stride: 0x1}, unicode.Range16{Lo: 0x840, Hi: 0x858, Stride: 0x1}, + unicode.Range16{Lo: 0x860, Hi: 0x86a, Stride: 0x1}, unicode.Range16{Lo: 0x8a0, Hi: 0x8b4, Stride: 0x1}, unicode.Range16{Lo: 0x8b6, Hi: 0x8bd, Stride: 0x1}, unicode.Range16{Lo: 0x904, Hi: 0x939, Stride: 0x1}, @@ -4411,6 +4492,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x9dc, Hi: 0x9dd, Stride: 0x1}, unicode.Range16{Lo: 0x9df, Hi: 0x9e1, Stride: 0x1}, unicode.Range16{Lo: 0x9f0, Hi: 0x9f1, Stride: 0x1}, + unicode.Range16{Lo: 0x9fc, Hi: 0x9fc, Stride: 0x1}, unicode.Range16{Lo: 0xa05, Hi: 0xa0a, Stride: 0x1}, unicode.Range16{Lo: 0xa0f, Hi: 0xa10, Stride: 0x1}, unicode.Range16{Lo: 0xa13, Hi: 0xa28, Stride: 0x1}, @@ -4488,16 +4570,10 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0xe46, Hi: 0xe46, Stride: 0x1}, unicode.Range16{Lo: 0xe81, Hi: 0xe82, Stride: 0x1}, unicode.Range16{Lo: 0xe84, Hi: 0xe84, Stride: 0x1}, - unicode.Range16{Lo: 0xe87, Hi: 0xe88, Stride: 0x1}, - unicode.Range16{Lo: 0xe8a, Hi: 0xe8a, Stride: 0x1}, - unicode.Range16{Lo: 0xe8d, Hi: 0xe8d, Stride: 0x1}, - unicode.Range16{Lo: 0xe94, Hi: 0xe97, Stride: 0x1}, - unicode.Range16{Lo: 0xe99, Hi: 0xe9f, Stride: 0x1}, - unicode.Range16{Lo: 0xea1, Hi: 0xea3, Stride: 0x1}, + unicode.Range16{Lo: 0xe86, Hi: 0xe8a, Stride: 0x1}, + unicode.Range16{Lo: 0xe8c, Hi: 0xea3, Stride: 0x1}, unicode.Range16{Lo: 0xea5, Hi: 0xea5, Stride: 0x1}, - unicode.Range16{Lo: 0xea7, Hi: 0xea7, Stride: 0x1}, - unicode.Range16{Lo: 0xeaa, Hi: 0xeab, Stride: 0x1}, - unicode.Range16{Lo: 0xead, Hi: 0xeb0, Stride: 0x1}, + unicode.Range16{Lo: 0xea7, Hi: 0xeb0, Stride: 0x1}, unicode.Range16{Lo: 0xeb2, Hi: 0xeb3, Stride: 0x1}, unicode.Range16{Lo: 0xebd, Hi: 0xebd, Stride: 0x1}, unicode.Range16{Lo: 0xec0, Hi: 0xec4, Stride: 0x1}, @@ -4518,7 +4594,8 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x108e, Hi: 0x108e, Stride: 0x1}, unicode.Range16{Lo: 0x10d0, Hi: 0x10fa, Stride: 0x1}, unicode.Range16{Lo: 0x10fc, Hi: 0x10fc, Stride: 0x1}, - unicode.Range16{Lo: 0x10fd, Hi: 0x1248, Stride: 0x1}, + unicode.Range16{Lo: 0x10fd, Hi: 0x10ff, Stride: 0x1}, + unicode.Range16{Lo: 0x1100, Hi: 0x1248, Stride: 0x1}, unicode.Range16{Lo: 0x124a, Hi: 0x124d, Stride: 0x1}, unicode.Range16{Lo: 0x1250, Hi: 0x1256, Stride: 0x1}, unicode.Range16{Lo: 0x1258, Hi: 0x1258, Stride: 0x1}, @@ -4552,7 +4629,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x17dc, Hi: 0x17dc, Stride: 0x1}, unicode.Range16{Lo: 0x1820, Hi: 0x1842, Stride: 0x1}, unicode.Range16{Lo: 0x1843, Hi: 0x1843, Stride: 0x1}, - unicode.Range16{Lo: 0x1844, Hi: 0x1877, Stride: 0x1}, + unicode.Range16{Lo: 0x1844, Hi: 0x1878, Stride: 0x1}, unicode.Range16{Lo: 0x1880, Hi: 0x1884, Stride: 0x1}, unicode.Range16{Lo: 0x1887, Hi: 0x18a8, Stride: 0x1}, unicode.Range16{Lo: 0x18aa, Hi: 0x18aa, Stride: 0x1}, @@ -4574,9 +4651,12 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x1c4d, Hi: 0x1c4f, Stride: 0x1}, unicode.Range16{Lo: 0x1c5a, Hi: 0x1c77, Stride: 0x1}, unicode.Range16{Lo: 0x1c78, Hi: 0x1c7d, Stride: 0x1}, + unicode.Range16{Lo: 0x1c90, Hi: 0x1cba, Stride: 0x1}, + unicode.Range16{Lo: 0x1cbd, Hi: 0x1cbf, Stride: 0x1}, unicode.Range16{Lo: 0x1ce9, Hi: 0x1cec, Stride: 0x1}, - unicode.Range16{Lo: 0x1cee, Hi: 0x1cf1, Stride: 0x1}, + unicode.Range16{Lo: 0x1cee, Hi: 0x1cf3, Stride: 0x1}, unicode.Range16{Lo: 0x1cf5, Hi: 0x1cf6, Stride: 0x1}, + unicode.Range16{Lo: 0x1cfa, Hi: 0x1cfa, Stride: 0x1}, unicode.Range16{Lo: 0x2135, Hi: 0x2138, Stride: 0x1}, unicode.Range16{Lo: 0x2180, Hi: 0x2182, Stride: 0x1}, unicode.Range16{Lo: 0x2185, Hi: 0x2188, Stride: 0x1}, @@ -4606,12 +4686,12 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0x30a1, Hi: 0x30fa, Stride: 0x1}, unicode.Range16{Lo: 0x30fc, Hi: 0x30fe, Stride: 0x1}, unicode.Range16{Lo: 0x30ff, Hi: 0x30ff, Stride: 0x1}, - unicode.Range16{Lo: 0x3105, Hi: 0x312d, Stride: 0x1}, + unicode.Range16{Lo: 0x3105, Hi: 0x312f, Stride: 0x1}, unicode.Range16{Lo: 0x3131, Hi: 0x318e, Stride: 0x1}, unicode.Range16{Lo: 0x31a0, Hi: 0x31ba, Stride: 0x1}, unicode.Range16{Lo: 0x31f0, Hi: 0x31ff, Stride: 0x1}, unicode.Range16{Lo: 0x3400, Hi: 0x4db5, Stride: 0x1}, - unicode.Range16{Lo: 0x4e00, Hi: 0x9fd5, Stride: 0x1}, + unicode.Range16{Lo: 0x4e00, Hi: 0x9fef, Stride: 0x1}, unicode.Range16{Lo: 0xa000, Hi: 0xa014, Stride: 0x1}, unicode.Range16{Lo: 0xa015, Hi: 0xa015, Stride: 0x1}, unicode.Range16{Lo: 0xa016, Hi: 0xa48c, Stride: 0x1}, @@ -4637,7 +4717,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range16{Lo: 0xa882, Hi: 0xa8b3, Stride: 0x1}, unicode.Range16{Lo: 0xa8f2, Hi: 0xa8f7, Stride: 0x1}, unicode.Range16{Lo: 0xa8fb, Hi: 0xa8fb, Stride: 0x1}, - unicode.Range16{Lo: 0xa8fd, Hi: 0xa8fd, Stride: 0x1}, + unicode.Range16{Lo: 0xa8fd, Hi: 0xa8fe, Stride: 0x1}, unicode.Range16{Lo: 0xa90a, Hi: 0xa925, Stride: 0x1}, unicode.Range16{Lo: 0xa930, Hi: 0xa946, Stride: 0x1}, unicode.Range16{Lo: 0xa960, Hi: 0xa97c, Stride: 0x1}, @@ -4711,7 +4791,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10280, Hi: 0x1029c, Stride: 0x1}, unicode.Range32{Lo: 0x102a0, Hi: 0x102d0, Stride: 0x1}, unicode.Range32{Lo: 0x10300, Hi: 0x1031f, Stride: 0x1}, - unicode.Range32{Lo: 0x10330, Hi: 0x10340, Stride: 0x1}, + unicode.Range32{Lo: 0x1032d, Hi: 0x10340, Stride: 0x1}, unicode.Range32{Lo: 0x10341, Hi: 0x10341, Stride: 0x1}, unicode.Range32{Lo: 0x10342, Hi: 0x10349, Stride: 0x1}, unicode.Range32{Lo: 0x1034a, Hi: 0x1034a, Stride: 0x1}, @@ -4743,7 +4823,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10a00, Hi: 0x10a00, Stride: 0x1}, unicode.Range32{Lo: 0x10a10, Hi: 0x10a13, Stride: 0x1}, unicode.Range32{Lo: 0x10a15, Hi: 0x10a17, Stride: 0x1}, - unicode.Range32{Lo: 0x10a19, Hi: 0x10a33, Stride: 0x1}, + unicode.Range32{Lo: 0x10a19, Hi: 0x10a35, Stride: 0x1}, unicode.Range32{Lo: 0x10a60, Hi: 0x10a7c, Stride: 0x1}, unicode.Range32{Lo: 0x10a80, Hi: 0x10a9c, Stride: 0x1}, unicode.Range32{Lo: 0x10ac0, Hi: 0x10ac7, Stride: 0x1}, @@ -4753,10 +4833,16 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x10b60, Hi: 0x10b72, Stride: 0x1}, unicode.Range32{Lo: 0x10b80, Hi: 0x10b91, Stride: 0x1}, unicode.Range32{Lo: 0x10c00, Hi: 0x10c48, Stride: 0x1}, + unicode.Range32{Lo: 0x10d00, Hi: 0x10d23, Stride: 0x1}, + unicode.Range32{Lo: 0x10f00, Hi: 0x10f1c, Stride: 0x1}, + unicode.Range32{Lo: 0x10f27, Hi: 0x10f27, Stride: 0x1}, + unicode.Range32{Lo: 0x10f30, Hi: 0x10f45, Stride: 0x1}, + unicode.Range32{Lo: 0x10fe0, Hi: 0x10ff6, Stride: 0x1}, unicode.Range32{Lo: 0x11003, Hi: 0x11037, Stride: 0x1}, unicode.Range32{Lo: 0x11083, Hi: 0x110af, Stride: 0x1}, unicode.Range32{Lo: 0x110d0, Hi: 0x110e8, Stride: 0x1}, unicode.Range32{Lo: 0x11103, Hi: 0x11126, Stride: 0x1}, + unicode.Range32{Lo: 0x11144, Hi: 0x11144, Stride: 0x1}, unicode.Range32{Lo: 0x11150, Hi: 0x11172, Stride: 0x1}, unicode.Range32{Lo: 0x11176, Hi: 0x11176, Stride: 0x1}, unicode.Range32{Lo: 0x11183, Hi: 0x111b2, Stride: 0x1}, @@ -4782,6 +4868,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x1135d, Hi: 0x11361, Stride: 0x1}, unicode.Range32{Lo: 0x11400, Hi: 0x11434, Stride: 0x1}, unicode.Range32{Lo: 0x11447, Hi: 0x1144a, Stride: 0x1}, + unicode.Range32{Lo: 0x1145f, Hi: 0x1145f, Stride: 0x1}, unicode.Range32{Lo: 0x11480, Hi: 0x114af, Stride: 0x1}, unicode.Range32{Lo: 0x114c4, Hi: 0x114c5, Stride: 0x1}, unicode.Range32{Lo: 0x114c7, Hi: 0x114c7, Stride: 0x1}, @@ -4790,13 +4877,34 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x11600, Hi: 0x1162f, Stride: 0x1}, unicode.Range32{Lo: 0x11644, Hi: 0x11644, Stride: 0x1}, unicode.Range32{Lo: 0x11680, Hi: 0x116aa, Stride: 0x1}, - unicode.Range32{Lo: 0x11700, Hi: 0x11719, Stride: 0x1}, + unicode.Range32{Lo: 0x116b8, Hi: 0x116b8, Stride: 0x1}, + unicode.Range32{Lo: 0x11700, Hi: 0x1171a, Stride: 0x1}, + unicode.Range32{Lo: 0x11800, Hi: 0x1182b, Stride: 0x1}, unicode.Range32{Lo: 0x118ff, Hi: 0x118ff, Stride: 0x1}, + unicode.Range32{Lo: 0x119a0, Hi: 0x119a7, Stride: 0x1}, + unicode.Range32{Lo: 0x119aa, Hi: 0x119d0, Stride: 0x1}, + unicode.Range32{Lo: 0x119e1, Hi: 0x119e1, Stride: 0x1}, + unicode.Range32{Lo: 0x119e3, Hi: 0x119e3, Stride: 0x1}, + unicode.Range32{Lo: 0x11a00, Hi: 0x11a00, Stride: 0x1}, + unicode.Range32{Lo: 0x11a0b, Hi: 0x11a32, Stride: 0x1}, + unicode.Range32{Lo: 0x11a3a, Hi: 0x11a3a, Stride: 0x1}, + unicode.Range32{Lo: 0x11a50, Hi: 0x11a50, Stride: 0x1}, + unicode.Range32{Lo: 0x11a5c, Hi: 0x11a89, Stride: 0x1}, + unicode.Range32{Lo: 0x11a9d, Hi: 0x11a9d, Stride: 0x1}, unicode.Range32{Lo: 0x11ac0, Hi: 0x11af8, Stride: 0x1}, unicode.Range32{Lo: 0x11c00, Hi: 0x11c08, Stride: 0x1}, unicode.Range32{Lo: 0x11c0a, Hi: 0x11c2e, Stride: 0x1}, unicode.Range32{Lo: 0x11c40, Hi: 0x11c40, Stride: 0x1}, unicode.Range32{Lo: 0x11c72, Hi: 0x11c8f, Stride: 0x1}, + unicode.Range32{Lo: 0x11d00, Hi: 0x11d06, Stride: 0x1}, + unicode.Range32{Lo: 0x11d08, Hi: 0x11d09, Stride: 0x1}, + unicode.Range32{Lo: 0x11d0b, Hi: 0x11d30, Stride: 0x1}, + unicode.Range32{Lo: 0x11d46, Hi: 0x11d46, Stride: 0x1}, + unicode.Range32{Lo: 0x11d60, Hi: 0x11d65, Stride: 0x1}, + unicode.Range32{Lo: 0x11d67, Hi: 0x11d68, Stride: 0x1}, + unicode.Range32{Lo: 0x11d6a, Hi: 0x11d89, Stride: 0x1}, + unicode.Range32{Lo: 0x11d98, Hi: 0x11d98, Stride: 0x1}, + unicode.Range32{Lo: 0x11ee0, Hi: 0x11ef2, Stride: 0x1}, unicode.Range32{Lo: 0x12000, Hi: 0x12399, Stride: 0x1}, unicode.Range32{Lo: 0x12400, Hi: 0x1246e, Stride: 0x1}, unicode.Range32{Lo: 0x12480, Hi: 0x12543, Stride: 0x1}, @@ -4809,18 +4917,27 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x16b40, Hi: 0x16b43, Stride: 0x1}, unicode.Range32{Lo: 0x16b63, Hi: 0x16b77, Stride: 0x1}, unicode.Range32{Lo: 0x16b7d, Hi: 0x16b8f, Stride: 0x1}, - unicode.Range32{Lo: 0x16f00, Hi: 0x16f44, Stride: 0x1}, + unicode.Range32{Lo: 0x16f00, Hi: 0x16f4a, Stride: 0x1}, unicode.Range32{Lo: 0x16f50, Hi: 0x16f50, Stride: 0x1}, unicode.Range32{Lo: 0x16f93, Hi: 0x16f9f, Stride: 0x1}, - unicode.Range32{Lo: 0x16fe0, Hi: 0x16fe0, Stride: 0x1}, - unicode.Range32{Lo: 0x17000, Hi: 0x187ec, Stride: 0x1}, + unicode.Range32{Lo: 0x16fe0, Hi: 0x16fe1, Stride: 0x1}, + unicode.Range32{Lo: 0x16fe3, Hi: 0x16fe3, Stride: 0x1}, + unicode.Range32{Lo: 0x17000, Hi: 0x187f7, Stride: 0x1}, unicode.Range32{Lo: 0x18800, Hi: 0x18af2, Stride: 0x1}, - unicode.Range32{Lo: 0x1b000, Hi: 0x1b001, Stride: 0x1}, + unicode.Range32{Lo: 0x1b000, Hi: 0x1b11e, Stride: 0x1}, + unicode.Range32{Lo: 0x1b150, Hi: 0x1b152, Stride: 0x1}, + unicode.Range32{Lo: 0x1b164, Hi: 0x1b167, Stride: 0x1}, + unicode.Range32{Lo: 0x1b170, Hi: 0x1b2fb, Stride: 0x1}, unicode.Range32{Lo: 0x1bc00, Hi: 0x1bc6a, Stride: 0x1}, unicode.Range32{Lo: 0x1bc70, Hi: 0x1bc7c, Stride: 0x1}, unicode.Range32{Lo: 0x1bc80, Hi: 0x1bc88, Stride: 0x1}, unicode.Range32{Lo: 0x1bc90, Hi: 0x1bc99, Stride: 0x1}, + unicode.Range32{Lo: 0x1e100, Hi: 0x1e12c, Stride: 0x1}, + unicode.Range32{Lo: 0x1e137, Hi: 0x1e13d, Stride: 0x1}, + unicode.Range32{Lo: 0x1e14e, Hi: 0x1e14e, Stride: 0x1}, + unicode.Range32{Lo: 0x1e2c0, Hi: 0x1e2eb, Stride: 0x1}, unicode.Range32{Lo: 0x1e800, Hi: 0x1e8c4, Stride: 0x1}, + unicode.Range32{Lo: 0x1e94b, Hi: 0x1e94b, Stride: 0x1}, unicode.Range32{Lo: 0x1ee00, Hi: 0x1ee03, Stride: 0x1}, unicode.Range32{Lo: 0x1ee05, Hi: 0x1ee1f, Stride: 0x1}, unicode.Range32{Lo: 0x1ee21, Hi: 0x1ee22, Stride: 0x1}, @@ -4858,6 +4975,7 @@ var _SentenceOLetter = &unicode.RangeTable{ unicode.Range32{Lo: 0x2a700, Hi: 0x2b734, Stride: 0x1}, unicode.Range32{Lo: 0x2b740, Hi: 0x2b81d, Stride: 0x1}, unicode.Range32{Lo: 0x2b820, Hi: 0x2cea1, Stride: 0x1}, + unicode.Range32{Lo: 0x2ceb0, Hi: 0x2ebe0, Stride: 0x1}, unicode.Range32{Lo: 0x2f800, Hi: 0x2fa1d, Stride: 0x1}, }, LatinOffset: 0, @@ -4895,10 +5013,13 @@ var _SentenceSTerm = &unicode.RangeTable{ unicode.Range16{Lo: 0x21, Hi: 0x21, Stride: 0x1}, unicode.Range16{Lo: 0x3f, Hi: 0x3f, Stride: 0x1}, unicode.Range16{Lo: 0x589, Hi: 0x589, Stride: 0x1}, - unicode.Range16{Lo: 0x61f, Hi: 0x61f, Stride: 0x1}, + unicode.Range16{Lo: 0x61e, Hi: 0x61f, Stride: 0x1}, unicode.Range16{Lo: 0x6d4, Hi: 0x6d4, Stride: 0x1}, unicode.Range16{Lo: 0x700, Hi: 0x702, Stride: 0x1}, unicode.Range16{Lo: 0x7f9, Hi: 0x7f9, Stride: 0x1}, + unicode.Range16{Lo: 0x837, Hi: 0x837, Stride: 0x1}, + unicode.Range16{Lo: 0x839, Hi: 0x839, Stride: 0x1}, + unicode.Range16{Lo: 0x83d, Hi: 0x83e, Stride: 0x1}, unicode.Range16{Lo: 0x964, Hi: 0x965, Stride: 0x1}, unicode.Range16{Lo: 0x104a, Hi: 0x104b, Stride: 0x1}, unicode.Range16{Lo: 0x1362, Hi: 0x1362, Stride: 0x1}, @@ -4936,6 +5057,7 @@ var _SentenceSTerm = &unicode.RangeTable{ }, R32: []unicode.Range32{ unicode.Range32{Lo: 0x10a56, Hi: 0x10a57, Stride: 0x1}, + unicode.Range32{Lo: 0x10f55, Hi: 0x10f59, Stride: 0x1}, unicode.Range32{Lo: 0x11047, Hi: 0x11048, Stride: 0x1}, unicode.Range32{Lo: 0x110be, Hi: 0x110c1, Stride: 0x1}, unicode.Range32{Lo: 0x11141, Hi: 0x11143, Stride: 0x1}, @@ -4950,11 +5072,15 @@ var _SentenceSTerm = &unicode.RangeTable{ unicode.Range32{Lo: 0x115c9, Hi: 0x115d7, Stride: 0x1}, unicode.Range32{Lo: 0x11641, Hi: 0x11642, Stride: 0x1}, unicode.Range32{Lo: 0x1173c, Hi: 0x1173e, Stride: 0x1}, + unicode.Range32{Lo: 0x11a42, Hi: 0x11a43, Stride: 0x1}, + unicode.Range32{Lo: 0x11a9b, Hi: 0x11a9c, Stride: 0x1}, unicode.Range32{Lo: 0x11c41, Hi: 0x11c42, Stride: 0x1}, + unicode.Range32{Lo: 0x11ef7, Hi: 0x11ef8, Stride: 0x1}, unicode.Range32{Lo: 0x16a6e, Hi: 0x16a6f, Stride: 0x1}, unicode.Range32{Lo: 0x16af5, Hi: 0x16af5, Stride: 0x1}, unicode.Range32{Lo: 0x16b37, Hi: 0x16b38, Stride: 0x1}, unicode.Range32{Lo: 0x16b44, Hi: 0x16b44, Stride: 0x1}, + unicode.Range32{Lo: 0x16e98, Hi: 0x16e98, Stride: 0x1}, unicode.Range32{Lo: 0x1bc9f, Hi: 0x1bc9f, Stride: 0x1}, unicode.Range32{Lo: 0x1da88, Hi: 0x1da88, Stride: 0x1}, }, @@ -5582,6 +5708,12 @@ var _SentenceUpper = &unicode.RangeTable{ unicode.Range16{Lo: 0xa7aa, Hi: 0xa7ae, Stride: 0x1}, unicode.Range16{Lo: 0xa7b0, Hi: 0xa7b4, Stride: 0x1}, unicode.Range16{Lo: 0xa7b6, Hi: 0xa7b6, Stride: 0x1}, + unicode.Range16{Lo: 0xa7b8, Hi: 0xa7b8, Stride: 0x1}, + unicode.Range16{Lo: 0xa7ba, Hi: 0xa7ba, Stride: 0x1}, + unicode.Range16{Lo: 0xa7bc, Hi: 0xa7bc, Stride: 0x1}, + unicode.Range16{Lo: 0xa7be, Hi: 0xa7be, Stride: 0x1}, + unicode.Range16{Lo: 0xa7c2, Hi: 0xa7c2, Stride: 0x1}, + unicode.Range16{Lo: 0xa7c4, Hi: 0xa7c6, Stride: 0x1}, unicode.Range16{Lo: 0xff21, Hi: 0xff3a, Stride: 0x1}, }, R32: []unicode.Range32{ @@ -5589,6 +5721,7 @@ var _SentenceUpper = &unicode.RangeTable{ unicode.Range32{Lo: 0x104b0, Hi: 0x104d3, Stride: 0x1}, unicode.Range32{Lo: 0x10c80, Hi: 0x10cb2, Stride: 0x1}, unicode.Range32{Lo: 0x118a0, Hi: 0x118bf, Stride: 0x1}, + unicode.Range32{Lo: 0x16e40, Hi: 0x16e5f, Stride: 0x1}, unicode.Range32{Lo: 0x1d400, Hi: 0x1d419, Stride: 0x1}, unicode.Range32{Lo: 0x1d434, Hi: 0x1d44d, Stride: 0x1}, unicode.Range32{Lo: 0x1d468, Hi: 0x1d481, Stride: 0x1}, diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/unicode2ragel.rb b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/unicode2ragel.rb similarity index 99% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/unicode2ragel.rb rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/unicode2ragel.rb index 422e4e5ccd0..bfb7b7268a1 100644 --- a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/unicode2ragel.rb +++ b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/unicode2ragel.rb @@ -82,7 +82,7 @@ def each_alpha( url, property ) open( url ) do |file| file.each_line do |line| next if line =~ /^#/; - next if line !~ /; #{property} #/; + next if line !~ /; #{property} *#/; range, description = line.split(/;/) range.strip! diff --git a/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/utf8_seqs.go b/awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/utf8_seqs.go similarity index 100% rename from awsproviderlint/vendor/github.com/apparentlymart/go-textseg/textseg/utf8_seqs.go rename to awsproviderlint/vendor/github.com/apparentlymart/go-textseg/v12/textseg/utf8_seqs.go diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go index bbad5f99725..f55ae3c78c7 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go @@ -9,6 +9,7 @@ import ( const ( TestCaseFieldCheckDestroy = `CheckDestroy` + TestCaseFieldErrorCheck = `ErrorCheck` TestCaseFieldIDRefreshName = `IDRefreshName` TestCaseFieldIDRefreshIgnore = `IDRefreshIgnore` TestCaseFieldIsUnitTest = `IsUnitTest` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/README.md new file mode 100644 index 00000000000..5f65fb6c05b --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/README.md @@ -0,0 +1,69 @@ +# XAT001 + +The XAT001 analyzer reports uses of `TestCase` which do not define an `ErrorCheck` function. `ErrorCheck` can be used to skip tests for known environmental issues. + +## Flagged Code + +NOTE: This analyzer does not differentiate between resource acceptance tests and data source acceptance tests. This is by design to ensure authors add the equivalent resource `CheckDestroy` function to data source testing, if available. + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckExampleThingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + ErrorCheck: testAccErrorCheck, + CheckDestroy: testAccCheckExampleThingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XAT001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + //lintignore:XAT001 + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckExampleThingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/XAT001.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/XAT001.go new file mode 100644 index 00000000000..a675c94e101 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XAT001/XAT001.go @@ -0,0 +1,46 @@ +package XAT001 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for TestCase missing ErrorCheck + +The XAT001 analyzer reports uses of TestCase which do not define an ErrorCheck +function. ErrorCheck can be used to skip tests for known environmental issues.` + +const analyzerName = "XAT001" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testcaseinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + testCases := pass.ResultOf[testcaseinfo.Analyzer].([]*resource.TestCaseInfo) + + for _, testCase := range testCases { + if ignorer.ShouldIgnore(analyzerName, testCase.AstCompositeLit) { + continue + } + + if testCase.DeclaresField(resource.TestCaseFieldErrorCheck) { + continue + } + + pass.Reportf(testCase.AstCompositeLit.Type.(*ast.SelectorExpr).Sel.Pos(), "%s: missing ErrorCheck", analyzerName) + } + + return nil, nil +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go index f08386bd61a..bbd0f03f57e 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go @@ -1,6 +1,7 @@ package xpasses import ( + "github.com/bflad/tfproviderlint/xpasses/XAT001" "github.com/bflad/tfproviderlint/xpasses/XR001" "github.com/bflad/tfproviderlint/xpasses/XR002" "github.com/bflad/tfproviderlint/xpasses/XR003" @@ -16,6 +17,7 @@ import ( // This can be consumed via multichecker.Main(xpasses.AllChecks...) or by // combining these Analyzers with additional custom Analyzers var AllChecks = []*analysis.Analyzer{ + XAT001.Analyzer, XR001.Analyzer, XR002.Analyzer, XR003.Analyzer, diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/.goreleaser.yml b/awsproviderlint/vendor/github.com/hashicorp/go-getter/.goreleaser.yml new file mode 100644 index 00000000000..e23ee051fb6 --- /dev/null +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/.goreleaser.yml @@ -0,0 +1,50 @@ +env: + - GOPRIVATE=github.com/hashicorp + +builds: + - id: signable + mod_timestamp: '{{ .CommitTimestamp }}' + targets: + - darwin_amd64 + - windows_386 + - windows_amd64 + hooks: + post: | + docker run + -e ARTIFACTORY_TOKEN={{ .Env.ARTIFACTORY_TOKEN }} + -e ARTIFACTORY_USER={{ .Env.ARTIFACTORY_USER }} + -e CIRCLE_TOKEN={{ .Env.CIRCLE_TOKEN }} + -v {{ dir .Path }}:/workdir + {{ .Env.CODESIGN_IMAGE }} + sign -product-name={{ .ProjectName }} {{ .Name }} + dir: ./cmd/go-getter/ + flags: + - -trimpath + ldflags: + - -X main.GitCommit={{ .Commit }} + - mod_timestamp: '{{ .CommitTimestamp }}' + targets: + - linux_386 + - linux_amd64 + dir: ./cmd/go-getter/ + flags: + - -trimpath + ldflags: + - -X main.GitCommit={{ .Commit }} + +archives: + - format: zip + name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + files: + - none* + +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 + +signs: + - args: ["-u", "{{ .Env.PGP_KEY_ID }}", "--output", "${signature}", "--detach-sign", "${artifact}"] + artifacts: checksum + +changelog: + skip: true diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/README.md b/awsproviderlint/vendor/github.com/hashicorp/go-getter/README.md index e5395894d8c..a27e0f2623d 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/README.md +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/README.md @@ -1,9 +1,9 @@ # go-getter -[![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/master.svg?style=svg)][circleci] +[![CircleCI](https://circleci.com/gh/hashicorp/go-getter/tree/main.svg?style=svg)][circleci] [![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs] -[circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/master +[circleci]: https://circleci.com/gh/hashicorp/go-getter/tree/main [godocs]: http://godoc.org/github.com/hashicorp/go-getter go-getter is a library for Go (golang) for downloading files or directories diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/checksum.go b/awsproviderlint/vendor/github.com/hashicorp/go-getter/checksum.go index eeccfea9d3b..f1090839fbe 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/checksum.go +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/checksum.go @@ -259,7 +259,10 @@ func (c *Client) ChecksumFromFile(checksumFile string, src *url.URL) (*FileCheck return nil, fmt.Errorf( "Error reading checksum file: %s", err) } - break + if line == "" { + break + } + // parse the line, if we hit EOF, but the line is not empty } checksum, err := parseChecksumLine(line) if err != nil || checksum == nil { diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress.go b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress.go index 62ca1060f6f..d0ad4390036 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress.go +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress.go @@ -26,6 +26,7 @@ func init() { tbzDecompressor := new(TarBzip2Decompressor) tgzDecompressor := new(TarGzipDecompressor) txzDecompressor := new(TarXzDecompressor) + tzstDecompressor := new(TarZstdDecompressor) Decompressors = map[string]Decompressor{ "bz2": new(Bzip2Decompressor), @@ -34,10 +35,13 @@ func init() { "tar.bz2": tbzDecompressor, "tar.gz": tgzDecompressor, "tar.xz": txzDecompressor, + "tar.zst": tzstDecompressor, "tbz2": tbzDecompressor, "tgz": tgzDecompressor, "txz": txzDecompressor, + "tzst": tzstDecompressor, "zip": new(ZipDecompressor), + "zst": new(ZstdDecompressor), } } diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_tzst.go b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_tzst.go new file mode 100644 index 00000000000..a9f3da51e40 --- /dev/null +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_tzst.go @@ -0,0 +1,39 @@ +package getter + +import ( + "fmt" + "github.com/klauspost/compress/zstd" + "os" + "path/filepath" +) + +// TarZstdDecompressor is an implementation of Decompressor that can +// decompress tar.zstd files. +type TarZstdDecompressor struct{} + +func (d *TarZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + // If we're going into a directory we should make that first + mkdir := dst + if !dir { + mkdir = filepath.Dir(dst) + } + if err := os.MkdirAll(mkdir, mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // Zstd compression is second + zstdR, err := zstd.NewReader(f) + if err != nil { + return fmt.Errorf("Error opening a zstd reader for %s: %s", src, err) + } + defer zstdR.Close() + + return untar(zstdR, dst, src, dir, umask) +} diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_zstd.go b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_zstd.go new file mode 100644 index 00000000000..6ff6c86a945 --- /dev/null +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/decompress_zstd.go @@ -0,0 +1,40 @@ +package getter + +import ( + "fmt" + "github.com/klauspost/compress/zstd" + "os" + "path/filepath" +) + +// ZstdDecompressor is an implementation of Decompressor that +// can decompress .zst files. +type ZstdDecompressor struct{} + +func (d *ZstdDecompressor) Decompress(dst, src string, dir bool, umask os.FileMode) error { + if dir { + return fmt.Errorf("zstd-compressed files can only unarchive to a single file") + } + + // If we're going into a directory we should make that first + if err := os.MkdirAll(filepath.Dir(dst), mode(0755, umask)); err != nil { + return err + } + + // File first + f, err := os.Open(src) + if err != nil { + return err + } + defer f.Close() + + // zstd compression is second + zstdR, err := zstd.NewReader(f) + if err != nil { + return err + } + defer zstdR.Close() + + // Copy it out + return copyReader(dst, zstdR, 0622, umask) +} diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/get_s3.go b/awsproviderlint/vendor/github.com/hashicorp/go-getter/get_s3.go index 5b2dd5e0c80..dc577c07042 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/get_s3.go +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/get_s3.go @@ -213,28 +213,49 @@ func (g *S3Getter) parseUrl(u *url.URL) (region, bucket, path, version string, c // any other S3 compliant service. S3 has a predictable // url as others do not if strings.Contains(u.Host, "amazonaws.com") { - // Expected host style: s3.amazonaws.com. They always have 3 parts, - // although the first may differ if we're accessing a specific region. + // Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket, although path-style is deprecated + // In both cases few older regions supports dash-style region indication (s3-Region) even if AWS discourages their use. + // The same bucket could be reached with: + // bucket.s3.region.amazonaws.com/path + // bucket.s3-region.amazonaws.com/path + // s3.amazonaws.com/bucket/path + // s3-region.amazonaws.com/bucket/path + hostParts := strings.Split(u.Host, ".") - if len(hostParts) != 3 { - err = fmt.Errorf("URL is not a valid S3 URL") - return - } + switch len(hostParts) { + // path-style + case 3: + // Parse the region out of the first part of the host + region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") + if region == "" { + region = "us-east-1" + } + pathParts := strings.SplitN(u.Path, "/", 3) + bucket = pathParts[1] + path = pathParts[2] + // vhost-style, dash region indication + case 4: + // Parse the region out of the first part of the host + region = strings.TrimPrefix(strings.TrimPrefix(hostParts[1], "s3-"), "s3") + if region == "" { + err = fmt.Errorf("URL is not a valid S3 URL") + return + } + pathParts := strings.SplitN(u.Path, "/", 2) + bucket = hostParts[0] + path = pathParts[1] + //vhost-style, dot region indication + case 5: + region = hostParts[2] + pathParts := strings.SplitN(u.Path, "/", 2) + bucket = hostParts[0] + path = pathParts[1] - // Parse the region out of the first part of the host - region = strings.TrimPrefix(strings.TrimPrefix(hostParts[0], "s3-"), "s3") - if region == "" { - region = "us-east-1" } - - pathParts := strings.SplitN(u.Path, "/", 3) - if len(pathParts) != 3 { + if len(hostParts) < 3 && len(hostParts) > 5 { err = fmt.Errorf("URL is not a valid S3 URL") return } - - bucket = pathParts[1] - path = pathParts[2] version = u.Query().Get("version") } else { diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.mod b/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.mod index 14af6b7181a..9c0ae09b7a7 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.mod +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.mod @@ -10,6 +10,7 @@ require ( github.com/hashicorp/go-cleanhttp v0.5.0 github.com/hashicorp/go-safetemp v1.0.0 github.com/hashicorp/go-version v1.1.0 + github.com/klauspost/compress v1.11.2 github.com/mattn/go-colorable v0.0.9 // indirect github.com/mattn/go-isatty v0.0.4 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect diff --git a/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.sum b/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.sum index c16d1b4c26a..99c5ea66b0c 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.sum +++ b/awsproviderlint/vendor/github.com/hashicorp/go-getter/go.sum @@ -54,6 +54,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8 h1:12VvqtR6Aowv3l/EQUlocDHW2Cp4G9WJVH7uyH8QFJE= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/klauspost/compress v1.11.2 h1:MiK62aErc3gIiVEtyzKfeOHgW7atJb5g/KNX5m3c2nQ= +github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md index 4c644fcfb12..025c4a1a414 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -1,5 +1,95 @@ # HCL Changelog +## v2.8.2 (Unreleased) + +### Bugs Fixed + +* hclsyntax: Fix panic for marked collection splat. ([#436](https://github.com/hashicorp/hcl/pull/436)) +* hclsyntax: Fix panic for marked template loops. ([#437](https://github.com/hashicorp/hcl/pull/437)) +* hclsyntax: Fix `for` expression marked conditional.([#438](https://github.com/hashicorp/hcl/pull/438)) +* hclsyntax: Mark objects with keys that are sensitive ([#440](https://github.com/hashicorp/hcl/pull/440)) + +## v2.8.1 (December 17, 2020) + +### Bugs Fixed + +* hclsyntax: Fix panic when expanding marked function arguments. ([#429](https://github.com/hashicorp/hcl/pull/429)) +* hclsyntax: Error when attempting to use a marked value as an object key. ([#434](https://github.com/hashicorp/hcl/pull/434)) +* hclsyntax: Error when attempting to use a marked value as an object key in expressions. ([#433](https://github.com/hashicorp/hcl/pull/433)) + +## v2.8.0 (December 7, 2020) + +### Enhancements + +* hclsyntax: Expression grouping parentheses will now be reflected by an explicit node in the AST, whereas before they were only considered during parsing. ([#426](https://github.com/hashicorp/hcl/pull/426)) + +### Bugs Fixed + +* hclwrite: The parser will now correctly include the `(` and `)` tokens when an expression is surrounded by parentheses. Previously it would incorrectly recognize those tokens as being extraneous tokens outside of the expression. ([#426](https://github.com/hashicorp/hcl/pull/426)) +* hclwrite: The formatter will now remove (rather than insert) spaces between the `!` (unary boolean "not") operator and its subsequent operand. ([#403](https://github.com/hashicorp/hcl/pull/403)) +* hclsyntax: Unmark conditional values in expressions before checking their truthfulness ([#427](https://github.com/hashicorp/hcl/pull/427)) + +## v2.7.2 (November 30, 2020) + +### Bugs Fixed + +* gohcl: Fix panic when decoding into type containing value slices. ([#335](https://github.com/hashicorp/hcl/pull/335)) +* hclsyntax: The unusual expression `null[*]` was previously always returning an unknown value, even though the rules for `[*]` normally call for it to return an empty tuple when applied to a null. As well as being a surprising result, it was particularly problematic because it violated the rule that a calling application may assume that an expression result will always be known unless the application itself introduces unknown values via the evaluation context. `null[*]` will now produce an empty tuple. ([#416](https://github.com/hashicorp/hcl/pull/416)) +* hclsyntax: Fix panic when traversing a list, tuple, or map with cty "marks" ([#424](https://github.com/hashicorp/hcl/pull/424)) + +## v2.7.1 (November 18, 2020) + +### Bugs Fixed + +* hclwrite: Correctly handle blank quoted string block labels, instead of dropping them ([#422](https://github.com/hashicorp/hcl/pull/422)) + +## v2.7.0 (October 14, 2020) + +### Enhancements + +* json: There is a new function `ParseWithStartPos`, which allows overriding the starting position for parsing in case the given JSON bytes are a fragment of a larger document, such as might happen when decoding with `encoding/json` into a `json.RawMessage`. ([#389](https://github.com/hashicorp/hcl/pull/389)) +* json: There is a new function `ParseExpression`, which allows parsing a JSON string directly in expression mode, whereas previously it was only possible to parse a JSON string in body mode. ([#381](https://github.com/hashicorp/hcl/pull/381)) +* hclwrite: `Block` type now supports `SetType` and `SetLabels`, allowing surgical changes to the type and labels of an existing block without having to reconstruct the entire block. ([#340](https://github.com/hashicorp/hcl/pull/340)) + +### Bugs Fixed + +* hclsyntax: Fix confusing error message for bitwise OR operator ([#380](https://github.com/hashicorp/hcl/pull/380)) +* hclsyntax: Several bug fixes for using HCL with values containing cty "marks" ([#404](https://github.com/hashicorp/hcl/pull/404), [#406](https://github.com/hashicorp/hcl/pull/404), [#407](https://github.com/hashicorp/hcl/pull/404)) + +## v2.6.0 (June 4, 2020) + +### Enhancements + +* hcldec: Add a new `Spec`, `ValidateSpec`, which allows custom validation of values at decode-time. ([#387](https://github.com/hashicorp/hcl/pull/387)) + +### Bugs Fixed + +* hclsyntax: Fix panic with combination of sequences and null arguments ([#386](https://github.com/hashicorp/hcl/pull/386)) +* hclsyntax: Fix handling of unknown values and sequences ([#386](https://github.com/hashicorp/hcl/pull/386)) + +## v2.5.1 (May 14, 2020) + +### Bugs Fixed + +* hclwrite: handle legacy dot access of numeric indexes. ([#369](https://github.com/hashicorp/hcl/pull/369)) +* hclwrite: Fix panic for dotted full splat (`foo.*`) ([#374](https://github.com/hashicorp/hcl/pull/374)) + +## v2.5.0 (May 6, 2020) + +### Enhancements + +* hclwrite: Generate multi-line objects and maps. ([#372](https://github.com/hashicorp/hcl/pull/372)) + +## v2.4.0 (Apr 13, 2020) + +### Enhancements + +* The Unicode data tables that HCL uses to produce user-perceived "column" positions in diagnostics and other source ranges are now updated to Unicode 12.0.0, which will cause HCL to produce more accurate column numbers for combining characters introduced to Unicode since Unicode 9.0.0. + +### Bugs Fixed + +* json: Fix panic when parsing malformed JSON. ([#358](https://github.com/hashicorp/hcl/pull/358)) + ## v2.3.0 (Jan 3, 2020) ### Enhancements diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/README.md b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/README.md index 3d0d509d53e..9af736c9dd5 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/README.md +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/README.md @@ -33,11 +33,25 @@ package main import ( "log" + "github.com/hashicorp/hcl/v2/hclsimple" ) type Config struct { - LogLevel string `hcl:"log_level"` + IOMode string `hcl:"io_mode"` + Service ServiceConfig `hcl:"service,block"` +} + +type ServiceConfig struct { + Protocol string `hcl:"protocol,label"` + Type string `hcl:"type,label"` + ListenAddr string `hcl:"listen_addr"` + Processes []ProcessConfig `hcl:"process,block"` +} + +type ProcessConfig struct { + Type string `hcl:"type,label"` + Command []string `hcl:"command"` } func main() { diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/appveyor.yml b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/appveyor.yml deleted file mode 100644 index e382f8f5717..00000000000 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/appveyor.yml +++ /dev/null @@ -1,13 +0,0 @@ -build: off - -clone_folder: c:\gopath\src\github.com\hashicorp\hcl - -environment: - GOPATH: c:\gopath - GO111MODULE: on - GOPROXY: https://goproxy.io - -stack: go 1.12 - -test_script: - - go test ./... diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/diagnostic.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/diagnostic.go index c320961e11e..c80535b7a73 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/diagnostic.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/diagnostic.go @@ -22,14 +22,14 @@ const ( ) // Diagnostic represents information to be presented to a user about an -// error or anomoly in parsing or evaluating configuration. +// error or anomaly in parsing or evaluating configuration. type Diagnostic struct { Severity DiagnosticSeverity // Summary and Detail contain the English-language description of the // problem. Summary is a terse description of the general problem and // detail is a more elaborate, often-multi-sentence description of - // the probem and what might be done to solve it. + // the problem and what might be done to solve it. Summary string Detail string diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.mod b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.mod index d80c99d9b6d..c8c289d9fa4 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.mod +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.mod @@ -1,9 +1,11 @@ module github.com/hashicorp/hcl/v2 +go 1.12 + require ( github.com/agext/levenshtein v1.2.1 github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 - github.com/apparentlymart/go-textseg v1.0.0 + github.com/apparentlymart/go-textseg/v12 v12.0.0 github.com/davecgh/go-spew v1.1.1 github.com/go-test/deep v1.0.3 github.com/google/go-cmp v0.3.1 diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.sum b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.sum index 76b135fb473..2a1073d117b 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.sum +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/go.sum @@ -4,6 +4,8 @@ github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhi github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go index 3fe84ddc383..63f2e88ec77 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go @@ -27,6 +27,32 @@ type Expression interface { // Assert that Expression implements hcl.Expression var assertExprImplExpr hcl.Expression = Expression(nil) +// ParenthesesExpr represents an expression written in grouping +// parentheses. +// +// The parser takes care of the precedence effect of the parentheses, so the +// only purpose of this separate expression node is to capture the source range +// of the parentheses themselves, rather than the source range of the +// expression within. All of the other expression operations just pass through +// to the underlying expression. +type ParenthesesExpr struct { + Expression + SrcRange hcl.Range +} + +var _ hcl.Expression = (*ParenthesesExpr)(nil) + +func (e *ParenthesesExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *ParenthesesExpr) walkChildNodes(w internalWalkFunc) { + // We override the walkChildNodes from the embedded Expression to + // ensure that both the parentheses _and_ the content are visible + // in a walk. + w(e.Expression) +} + // LiteralValueExpr is an expression that just always returns a given value. type LiteralValueExpr struct { Val cty.Value @@ -260,6 +286,20 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti } switch { + case expandVal.Type().Equals(cty.DynamicPseudoType): + if expandVal.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid expanding argument value", + Detail: "The expanding argument (indicated by ...) must not be null.", + Subject: expandExpr.Range().Ptr(), + Context: e.Range().Ptr(), + Expression: expandExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + return cty.DynamicVal, diags case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType(): if expandVal.IsNull() { diags = append(diags, &hcl.Diagnostic{ @@ -277,13 +317,17 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti return cty.DynamicVal, diags } + // When expanding arguments from a collection, we must first unmark + // the collection itself, and apply any marks directly to the + // elements. This ensures that marks propagate correctly. + expandVal, marks := expandVal.Unmark() newArgs := make([]Expression, 0, (len(args)-1)+expandVal.LengthInt()) newArgs = append(newArgs, args[:len(args)-1]...) it := expandVal.ElementIterator() for it.Next() { _, val := it.Element() newArgs = append(newArgs, &LiteralValueExpr{ - Val: val, + Val: val.WithMarks(marks), SrcRange: expandExpr.Range(), }) } @@ -406,22 +450,39 @@ func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti } else { param = varParam } - argExpr := e.Args[i] - // TODO: we should also unpick a PathError here and show the - // path to the deep value where the error was detected. - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid function argument", - Detail: fmt.Sprintf( - "Invalid value for %q parameter: %s.", - param.Name, err, - ), - Subject: argExpr.StartRange().Ptr(), - Context: e.Range().Ptr(), - Expression: argExpr, - EvalContext: ctx, - }) + // this can happen if an argument is (incorrectly) null. + if i > len(e.Args)-1 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid function argument", + Detail: fmt.Sprintf( + "Invalid value for %q parameter: %s.", + param.Name, err, + ), + Subject: args[len(params)].StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }) + } else { + argExpr := e.Args[i] + + // TODO: we should also unpick a PathError here and show the + // path to the deep value where the error was detected. + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid function argument", + Detail: fmt.Sprintf( + "Invalid value for %q parameter: %s.", + param.Name, err, + ), + Subject: argExpr.StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: argExpr, + EvalContext: ctx, + }) + } default: diags = append(diags, &hcl.Diagnostic{ @@ -567,6 +628,8 @@ func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostic return cty.UnknownVal(resultType), diags } + // Unmark result before testing for truthiness + condResult, _ = condResult.UnmarkDeep() if condResult.True() { diags = append(diags, trueDiags...) if convs[0] != nil { @@ -725,6 +788,7 @@ func (e *ObjectConsExpr) walkChildNodes(w internalWalkFunc) { func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var vals map[string]cty.Value var diags hcl.Diagnostics + var marks []cty.ValueMarks // This will get set to true if we fail to produce any of our keys, // either because they are actually unknown or if the evaluation produces @@ -762,6 +826,9 @@ func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics continue } + key, keyMarks := key.Unmark() + marks = append(marks, keyMarks) + var err error key, err = convert.Convert(key, cty.String) if err != nil { @@ -791,7 +858,7 @@ func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics return cty.DynamicVal, diags } - return cty.ObjectVal(vals), diags + return cty.ObjectVal(vals).WithMarks(marks...), diags } func (e *ObjectConsExpr) Range() hcl.Range { @@ -921,6 +988,7 @@ type ForExpr struct { func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { var diags hcl.Diagnostics + var marks []cty.ValueMarks collVal, collDiags := e.CollExpr.Value(ctx) diags = append(diags, collDiags...) @@ -940,6 +1008,10 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { if collVal.Type() == cty.DynamicPseudoType { return cty.DynamicVal, diags } + // Unmark collection before checking for iterability, because marked + // values cannot be iterated + collVal, collMarks := collVal.Unmark() + marks = append(marks, collMarks) if !collVal.CanIterateElements() { diags = append(diags, &hcl.Diagnostic{ Severity: hcl.DiagError, @@ -1064,7 +1136,11 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { continue } - if include.False() { + // Extract and merge marks from the include expression into the + // main set of marks + includeUnmarked, includeMarks := include.Unmark() + marks = append(marks, includeMarks) + if includeUnmarked.False() { // Skip this element continue } @@ -1109,6 +1185,9 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { continue } + key, keyMarks := key.Unmark() + marks = append(marks, keyMarks) + val, valDiags := e.ValExpr.Value(childCtx) diags = append(diags, valDiags...) @@ -1147,7 +1226,7 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { } } - return cty.ObjectVal(vals), diags + return cty.ObjectVal(vals).WithMarks(marks...), diags } else { // Producing a tuple @@ -1208,7 +1287,11 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { continue } - if include.False() { + // Extract and merge marks from the include expression into the + // main set of marks + includeUnmarked, includeMarks := include.Unmark() + marks = append(marks, includeMarks) + if includeUnmarked.False() { // Skip this element continue } @@ -1223,7 +1306,7 @@ func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return cty.DynamicVal, diags } - return cty.TupleVal(vals), diags + return cty.TupleVal(vals).WithMarks(marks...), diags } } @@ -1286,12 +1369,6 @@ func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { } sourceTy := sourceVal.Type() - if sourceTy == cty.DynamicPseudoType { - // If we don't even know the _type_ of our source value yet then - // we'll need to defer all processing, since we can't decide our - // result type either. - return cty.DynamicVal, diags - } // A "special power" of splat expressions is that they can be applied // both to tuples/lists and to other values, and in the latter case @@ -1315,6 +1392,13 @@ func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return cty.DynamicVal, diags } + if sourceTy == cty.DynamicPseudoType { + // If we don't even know the _type_ of our source value yet then + // we'll need to defer all processing, since we can't decide our + // result type either. + return cty.DynamicVal, diags + } + if autoUpgrade { sourceVal = cty.TupleVal([]cty.Value{sourceVal}) sourceTy = sourceVal.Type() @@ -1359,6 +1443,9 @@ func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { return cty.UnknownVal(ty), diags } + // Unmark the collection, and save the marks to apply to the returned + // collection result + sourceVal, marks := sourceVal.Unmark() vals := make([]cty.Value, 0, sourceVal.LengthInt()) it := sourceVal.ElementIterator() if ctx == nil { @@ -1393,9 +1480,9 @@ func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { diags = append(diags, tyDiags...) return cty.ListValEmpty(ty.ElementType()), diags } - return cty.ListVal(vals), diags + return cty.ListVal(vals).WithMarks(marks), diags default: - return cty.TupleVal(vals), diags + return cty.TupleVal(vals).WithMarks(marks), diags } } diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go index 9d425115f95..0b7e07a5b15 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go @@ -26,6 +26,9 @@ func (e *TemplateExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) var diags hcl.Diagnostics isKnown := true + // Maintain a set of marks for values used in the template + marks := make(cty.ValueMarks) + for _, part := range e.Parts { partVal, partDiags := part.Value(ctx) diags = append(diags, partDiags...) @@ -71,14 +74,24 @@ func (e *TemplateExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) continue } - buf.WriteString(strVal.AsString()) + // Unmark the part and merge its marks into the set + unmarked, partMarks := strVal.Unmark() + for k, v := range partMarks { + marks[k] = v + } + + buf.WriteString(unmarked.AsString()) } + var ret cty.Value if !isKnown { - return cty.UnknownVal(cty.String), diags + ret = cty.UnknownVal(cty.String) + } else { + ret = cty.StringVal(buf.String()) } - return cty.StringVal(buf.String()), diags + // Apply the full set of marks to the returned value + return ret.WithMarks(marks), diags } func (e *TemplateExpr) Range() hcl.Range { @@ -139,6 +152,8 @@ func (e *TemplateJoinExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti return cty.UnknownVal(cty.String), diags } + tuple, marks := tuple.Unmark() + allMarks := []cty.ValueMarks{marks} buf := &bytes.Buffer{} it := tuple.ElementIterator() for it.Next() { @@ -158,7 +173,7 @@ func (e *TemplateJoinExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti continue } if val.Type() == cty.DynamicPseudoType { - return cty.UnknownVal(cty.String), diags + return cty.UnknownVal(cty.String).WithMarks(marks), diags } strVal, err := convert.Convert(val, cty.String) if err != nil { @@ -176,13 +191,17 @@ func (e *TemplateJoinExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnosti continue } if !val.IsKnown() { - return cty.UnknownVal(cty.String), diags + return cty.UnknownVal(cty.String).WithMarks(marks), diags } + strVal, strValMarks := strVal.Unmark() + if len(strValMarks) > 0 { + allMarks = append(allMarks, strValMarks) + } buf.WriteString(strVal.AsString()) } - return cty.StringVal(buf.String()), diags + return cty.StringVal(buf.String()).WithMarks(allMarks...), diags } func (e *TemplateJoinExpr) Range() hcl.Range { diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go index f67d989e541..0998cc41222 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go @@ -6,7 +6,7 @@ import ( "strconv" "unicode/utf8" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) @@ -670,6 +670,7 @@ Traversal: trav := make(hcl.Traversal, 0, 1) var firstRange, lastRange hcl.Range firstRange = p.NextRange() + lastRange = marker.Range for p.Peek().Type == TokenDot { dot := p.Read() @@ -910,7 +911,7 @@ func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { switch start.Type { case TokenOParen: - p.Read() // eat open paren + oParen := p.Read() // eat open paren p.PushIncludeNewlines(false) @@ -936,9 +937,19 @@ func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { p.setRecovery() } - p.Read() // eat closing paren + cParen := p.Read() // eat closing paren p.PopIncludeNewlines() + // Our parser's already taken care of the precedence effect of the + // parentheses by considering them to be a kind of "term", but we + // still need to include the parentheses in our AST so we can give + // an accurate representation of the source range that includes the + // open and closing parentheses. + expr = &ParenthesesExpr{ + Expression: expr, + SrcRange: hcl.RangeBetween(oParen.Range, cParen.Range), + } + return expr, diags case TokenNumberLit: diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go index eb8f7ea38cc..bb856461031 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go @@ -5,7 +5,7 @@ import ( "strings" "unicode" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md index 3fc5f5f1bfc..550bd93adf1 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md @@ -273,7 +273,7 @@ tuple = "[" ( object = "{" ( (objectelem ("," objectelem)* ","?)? ) "}"; -objectelem = (Identifier | Expression) "=" Expression; +objectelem = (Identifier | Expression) ("=" | ":") Expression; ``` Only tuple and object values can be directly constructed via native syntax. diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go index c7ffe207381..59f4c434787 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/hashicorp/hcl/v2" ) @@ -202,7 +202,7 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { case TokenBitwiseAnd: suggestion = " Did you mean boolean AND (\"&&\")?" case TokenBitwiseOr: - suggestion = " Did you mean boolean OR (\"&&\")?" + suggestion = " Did you mean boolean OR (\"||\")?" case TokenBitwiseNot: suggestion = " Did you mean boolean NOT (\"!\")?" } @@ -294,12 +294,23 @@ func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { Subject: &tok.Range, }) case TokenInvalid: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid character", - Detail: "This character is not used within the language.", - Subject: &tok.Range, - }) + chars := string(tok.Bytes) + switch chars { + case "“", "”": + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid character", + Detail: "\"Curly quotes\" are not valid here. These can sometimes be inadvertently introduced when sharing code via documents or discussion forums. It might help to replace the character with a \"straight quote\".", + Subject: &tok.Range, + }) + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid character", + Detail: "This character is not used within the language.", + Subject: &tok.Range, + }) + } } } return diags diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/ops.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/ops.go index 5d2910c1301..f69de5b9334 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/ops.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/ops.go @@ -76,7 +76,10 @@ func Index(collection, key cty.Value, srcRange *Range) (cty.Value, Diagnostics) } } - has := collection.HasIndex(key) + // Here we drop marks from HasIndex result, in order to allow basic + // traversal of a marked list, tuple, or map in the same way we can + // traverse a marked object + has, _ := collection.HasIndex(key).Unmark() if !has.IsKnown() { if ty.IsTupleType() { return cty.DynamicVal, nil @@ -217,7 +220,12 @@ func GetAttr(obj cty.Value, attrName string, srcRange *Range) (cty.Value, Diagno } idx := cty.StringVal(attrName) - if obj.HasIndex(idx).False() { + + // Here we drop marks from HasIndex result, in order to allow basic + // traversal of a marked map in the same way we can traverse a marked + // object + hasIndex, _ := obj.HasIndex(idx).Unmark() + if hasIndex.False() { return cty.DynamicVal, Diagnostics{ { Severity: DiagError, diff --git a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go index 17c0d7c6b1e..ef0aa1015b1 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go +++ b/awsproviderlint/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go @@ -4,7 +4,7 @@ import ( "bufio" "bytes" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" ) // RangeScanner is a helper that will scan over a buffer using a bufio.SplitFunc diff --git a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go index d9c824d26d8..25108493c83 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go +++ b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/grpc_provider.go @@ -1152,6 +1152,9 @@ func pathToAttributePath(path cty.Path) *tftypes.AttributePath { } } + if len(steps) < 1 { + return nil + } return &tftypes.AttributePath{Steps: steps} } diff --git a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go index ac66eb71e10..799a2fb8a71 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go +++ b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/internal/plugin/convert/diagnostics.go @@ -107,6 +107,9 @@ func AttributePathToPath(ap *tftypes.AttributePath) cty.Path { // PathToAttributePath takes a cty.Path and converts it to a proto-encoded path. func PathToAttributePath(p cty.Path) *tftypes.AttributePath { + if p == nil || len(p) < 1 { + return nil + } ap := &tftypes.AttributePath{} for _, step := range p { switch selector := step.(type) { diff --git a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go index eb7b3f08e41..83537555fb7 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go +++ b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var SDKVersion = "2.4.3" +var SDKVersion = "2.4.4" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/LICENSE b/awsproviderlint/vendor/github.com/klauspost/compress/LICENSE new file mode 100644 index 00000000000..1eb75ef68e4 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/LICENSE @@ -0,0 +1,28 @@ +Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2019 Klaus Post. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/README.md b/awsproviderlint/vendor/github.com/klauspost/compress/fse/README.md new file mode 100644 index 00000000000..ea7324da671 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/README.md @@ -0,0 +1,79 @@ +# Finite State Entropy + +This package provides Finite State Entropy encoding and decoding. + +Finite State Entropy (also referenced as [tANS](https://en.wikipedia.org/wiki/Asymmetric_numeral_systems#tANS)) +encoding provides a fast near-optimal symbol encoding/decoding +for byte blocks as implemented in [zstandard](https://github.com/facebook/zstd). + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/fse) + +## News + + * Feb 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress`](https://godoc.org/github.com/klauspost/compress/fse#Compress) function. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `(error)` | An internal error occurred. | + +As can be seen above there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/fse#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +Decompressing is done by calling the [`Decompress`](https://godoc.org/github.com/klauspost/compress/fse#Decompress) function. +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +For more detailed usage, see examples in the [godoc documentation](https://godoc.org/github.com/klauspost/compress/fse#pkg-examples). + +# Performance + +A lot of factors are affecting speed. Block sizes and compressibility of the material are primary factors. +All compression functions are currently only running on the calling goroutine so only one core will be used per block. + +The compressor is significantly faster if symbols are kept as small as possible. The highest byte value of the input +is used to reduce some of the processing, so if all your input is above byte value 64 for instance, it may be +beneficial to transpose all your input values down by 64. + +With moderate block sizes around 64k speed are typically 200MB/s per core for compression and +around 300MB/s decompression speed. + +The same hardware typically does Huffman (deflate) encoding at 125MB/s and decompression at 100MB/s. + +# Plans + +At one point, more internals will be exposed to facilitate more "expert" usage of the components. + +A streaming interface is also likely to be implemented. Likely compatible with [FSE stream format](https://github.com/Cyan4973/FiniteStateEntropy/blob/dev/programs/fileio.c#L261). + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. \ No newline at end of file diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitreader.go b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitreader.go new file mode 100644 index 00000000000..f65eb3909cf --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitreader.go @@ -0,0 +1,122 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import ( + "encoding/binary" + "errors" + "io" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReader struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReader) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.bitsRead += 8 - uint8(highBits(uint32(v))) + return nil +} + +// getBits will return n bits. n can be 0. +func (b *bitReader) getBits(n uint8) uint16 { + if n == 0 || b.bitsRead >= 64 { + return 0 + } + return b.getBitsFast(n) +} + +// getBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) getBitsFast(n uint8) uint16 { + const regMask = 64 - 1 + v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + b.bitsRead += n + return v +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReader) fillFast() { + if b.bitsRead < 32 { + return + } + // 2 bounds checks. + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReader) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value = (b.value << 8) | uint64(b.in[b.off-1]) + b.bitsRead -= 8 + b.off-- + } +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReader) finished() bool { + return b.bitsRead >= 64 && b.off == 0 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReader) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitwriter.go b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitwriter.go new file mode 100644 index 00000000000..43e463611b1 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bitwriter.go @@ -0,0 +1,168 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import "fmt" + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// bitMask16 is bitmasks. Has extra to avoid bounds check. +var bitMask16 = [32]uint16{ + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF} /* up to 16 bits */ + +// addBits16NC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16NC(value uint16, bits uint8) { + b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16ZeroNC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +// This is fastest if bits can be zero. +func (b *bitWriter) addBits16ZeroNC(value uint16, bits uint8) { + if bits == 0 { + return + } + value <<= (16 - bits) & 15 + value >>= (16 - bits) & 15 + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// flush will flush all pending full bytes. +// There will be at least 56 bits available for writing when this has been called. +// Using flush32 is faster, but leaves less space for writing. +func (b *bitWriter) flush() { + v := b.nBits >> 3 + switch v { + case 0: + case 1: + b.out = append(b.out, + byte(b.bitContainer), + ) + case 2: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + ) + case 3: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + ) + case 4: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + ) + case 5: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + ) + case 6: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + ) + case 7: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + ) + case 8: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + byte(b.bitContainer>>56), + ) + default: + panic(fmt.Errorf("bits (%d) > 64", b.nBits)) + } + b.bitContainer >>= v << 3 + b.nBits &= 7 +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() error { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() + return nil +} + +// reset and continue writing by appending to out. +func (b *bitWriter) reset(out []byte) { + b.bitContainer = 0 + b.nBits = 0 + b.out = out +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/bytereader.go b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bytereader.go new file mode 100644 index 00000000000..abade2d6052 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/bytereader.go @@ -0,0 +1,47 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +// byteReader provides a byte reader that reads +// little endian values from a byte stream. +// The input stream is manually advanced. +// The reader performs no bounds checks. +type byteReader struct { + b []byte + off int +} + +// init will initialize the reader and set the input. +func (b *byteReader) init(in []byte) { + b.b = in + b.off = 0 +} + +// advance the stream b n bytes. +func (b *byteReader) advance(n uint) { + b.off += int(n) +} + +// Uint32 returns a little endian uint32 starting at current offset. +func (b byteReader) Uint32() uint32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// unread returns the unread portion of the input. +func (b byteReader) unread() []byte { + return b.b[b.off:] +} + +// remain will return the number of bytes remaining. +func (b byteReader) remain() int { + return len(b.b) - b.off +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/compress.go b/awsproviderlint/vendor/github.com/klauspost/compress/fse/compress.go new file mode 100644 index 00000000000..b69237c9b8f --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/compress.go @@ -0,0 +1,684 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package fse + +import ( + "errors" + "fmt" +) + +// Compress the input bytes. Input must be < 2GB. +// Provide a Scratch buffer to avoid memory allocations. +// Note that the output is also kept in the scratch buffer. +// If input is too hard to compress, ErrIncompressible is returned. +// If input is a single byte value repeated ErrUseRLE is returned. +func Compress(in []byte, s *Scratch) ([]byte, error) { + if len(in) <= 1 { + return nil, ErrIncompressible + } + if len(in) > (2<<30)-1 { + return nil, errors.New("input too big, must be < 2GB") + } + s, err := s.prepare(in) + if err != nil { + return nil, err + } + + // Create histogram, if none was provided. + maxCount := s.maxCount + if maxCount == 0 { + maxCount = s.countSimple(in) + } + // Reset for next run. + s.clearCount = true + s.maxCount = 0 + if maxCount == len(in) { + // One symbol, use RLE + return nil, ErrUseRLE + } + if maxCount == 1 || maxCount < (len(in)>>7) { + // Each symbol present maximum once or too well distributed. + return nil, ErrIncompressible + } + s.optimalTableLog() + err = s.normalizeCount() + if err != nil { + return nil, err + } + err = s.writeCount() + if err != nil { + return nil, err + } + + if false { + err = s.validateNorm() + if err != nil { + return nil, err + } + } + + err = s.buildCTable() + if err != nil { + return nil, err + } + err = s.compress(in) + if err != nil { + return nil, err + } + s.Out = s.bw.out + // Check if we compressed. + if len(s.Out) >= len(in) { + return nil, ErrIncompressible + } + return s.Out, nil +} + +// cState contains the compression state of a stream. +type cState struct { + bw *bitWriter + stateTable []uint16 + state uint16 +} + +// init will initialize the compression state to the first symbol of the stream. +func (c *cState) init(bw *bitWriter, ct *cTable, tableLog uint8, first symbolTransform) { + c.bw = bw + c.stateTable = ct.stateTable + + nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16 + im := int32((nbBitsOut << 16) - first.deltaNbBits) + lu := (im >> nbBitsOut) + first.deltaFindState + c.state = c.stateTable[lu] + return +} + +// encode the output symbol provided and write it to the bitstream. +func (c *cState) encode(symbolTT symbolTransform) { + nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 + dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState + c.bw.addBits16NC(c.state, uint8(nbBitsOut)) + c.state = c.stateTable[dstState] +} + +// encode the output symbol provided and write it to the bitstream. +func (c *cState) encodeZero(symbolTT symbolTransform) { + nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 + dstState := int32(c.state>>(nbBitsOut&15)) + symbolTT.deltaFindState + c.bw.addBits16ZeroNC(c.state, uint8(nbBitsOut)) + c.state = c.stateTable[dstState] +} + +// flush will write the tablelog to the output and flush the remaining full bytes. +func (c *cState) flush(tableLog uint8) { + c.bw.flush32() + c.bw.addBits16NC(c.state, tableLog) + c.bw.flush() +} + +// compress is the main compression loop that will encode the input from the last byte to the first. +func (s *Scratch) compress(src []byte) error { + if len(src) <= 2 { + return errors.New("compress: src too small") + } + tt := s.ct.symbolTT[:256] + s.bw.reset(s.Out) + + // Our two states each encodes every second byte. + // Last byte encoded (first byte decoded) will always be encoded by c1. + var c1, c2 cState + + // Encode so remaining size is divisible by 4. + ip := len(src) + if ip&1 == 1 { + c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]]) + c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]]) + c1.encodeZero(tt[src[ip-3]]) + ip -= 3 + } else { + c2.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-1]]) + c1.init(&s.bw, &s.ct, s.actualTableLog, tt[src[ip-2]]) + ip -= 2 + } + if ip&2 != 0 { + c2.encodeZero(tt[src[ip-1]]) + c1.encodeZero(tt[src[ip-2]]) + ip -= 2 + } + + // Main compression loop. + switch { + case !s.zeroBits && s.actualTableLog <= 8: + // We can encode 4 symbols without requiring a flush. + // We do not need to check if any output is 0 bits. + for ip >= 4 { + s.bw.flush32() + v3, v2, v1, v0 := src[ip-4], src[ip-3], src[ip-2], src[ip-1] + c2.encode(tt[v0]) + c1.encode(tt[v1]) + c2.encode(tt[v2]) + c1.encode(tt[v3]) + ip -= 4 + } + case !s.zeroBits: + // We do not need to check if any output is 0 bits. + for ip >= 4 { + s.bw.flush32() + v3, v2, v1, v0 := src[ip-4], src[ip-3], src[ip-2], src[ip-1] + c2.encode(tt[v0]) + c1.encode(tt[v1]) + s.bw.flush32() + c2.encode(tt[v2]) + c1.encode(tt[v3]) + ip -= 4 + } + case s.actualTableLog <= 8: + // We can encode 4 symbols without requiring a flush + for ip >= 4 { + s.bw.flush32() + v3, v2, v1, v0 := src[ip-4], src[ip-3], src[ip-2], src[ip-1] + c2.encodeZero(tt[v0]) + c1.encodeZero(tt[v1]) + c2.encodeZero(tt[v2]) + c1.encodeZero(tt[v3]) + ip -= 4 + } + default: + for ip >= 4 { + s.bw.flush32() + v3, v2, v1, v0 := src[ip-4], src[ip-3], src[ip-2], src[ip-1] + c2.encodeZero(tt[v0]) + c1.encodeZero(tt[v1]) + s.bw.flush32() + c2.encodeZero(tt[v2]) + c1.encodeZero(tt[v3]) + ip -= 4 + } + } + + // Flush final state. + // Used to initialize state when decoding. + c2.flush(s.actualTableLog) + c1.flush(s.actualTableLog) + + return s.bw.close() +} + +// writeCount will write the normalized histogram count to header. +// This is read back by readNCount. +func (s *Scratch) writeCount() error { + var ( + tableLog = s.actualTableLog + tableSize = 1 << tableLog + previous0 bool + charnum uint16 + + maxHeaderSize = ((int(s.symbolLen) * int(tableLog)) >> 3) + 3 + + // Write Table Size + bitStream = uint32(tableLog - minTablelog) + bitCount = uint(4) + remaining = int16(tableSize + 1) /* +1 for extra accuracy */ + threshold = int16(tableSize) + nbBits = uint(tableLog + 1) + ) + if cap(s.Out) < maxHeaderSize { + s.Out = make([]byte, 0, s.br.remain()+maxHeaderSize) + } + outP := uint(0) + out := s.Out[:maxHeaderSize] + + // stops at 1 + for remaining > 1 { + if previous0 { + start := charnum + for s.norm[charnum] == 0 { + charnum++ + } + for charnum >= start+24 { + start += 24 + bitStream += uint32(0xFFFF) << bitCount + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + } + for charnum >= start+3 { + start += 3 + bitStream += 3 << bitCount + bitCount += 2 + } + bitStream += uint32(charnum-start) << bitCount + bitCount += 2 + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + count := s.norm[charnum] + charnum++ + max := (2*threshold - 1) - remaining + if count < 0 { + remaining += count + } else { + remaining -= count + } + count++ // +1 for extra accuracy + if count >= threshold { + count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ + } + bitStream += uint32(count) << bitCount + bitCount += nbBits + if count < max { + bitCount-- + } + + previous0 = count == 1 + if remaining < 1 { + return errors.New("internal error: remaining<1") + } + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += (bitCount + 7) / 8 + + if uint16(charnum) > s.symbolLen { + return errors.New("internal error: charnum > s.symbolLen") + } + s.Out = out[:outP] + return nil +} + +// symbolTransform contains the state transform for a symbol. +type symbolTransform struct { + deltaFindState int32 + deltaNbBits uint32 +} + +// String prints values as a human readable string. +func (s symbolTransform) String() string { + return fmt.Sprintf("dnbits: %08x, fs:%d", s.deltaNbBits, s.deltaFindState) +} + +// cTable contains tables used for compression. +type cTable struct { + tableSymbol []byte + stateTable []uint16 + symbolTT []symbolTransform +} + +// allocCtable will allocate tables needed for compression. +// If existing tables a re big enough, they are simply re-used. +func (s *Scratch) allocCtable() { + tableSize := 1 << s.actualTableLog + // get tableSymbol that is big enough. + if cap(s.ct.tableSymbol) < int(tableSize) { + s.ct.tableSymbol = make([]byte, tableSize) + } + s.ct.tableSymbol = s.ct.tableSymbol[:tableSize] + + ctSize := tableSize + if cap(s.ct.stateTable) < ctSize { + s.ct.stateTable = make([]uint16, ctSize) + } + s.ct.stateTable = s.ct.stateTable[:ctSize] + + if cap(s.ct.symbolTT) < 256 { + s.ct.symbolTT = make([]symbolTransform, 256) + } + s.ct.symbolTT = s.ct.symbolTT[:256] +} + +// buildCTable will populate the compression table so it is ready to be used. +func (s *Scratch) buildCTable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + var cumul [maxSymbolValue + 2]int16 + + s.allocCtable() + tableSymbol := s.ct.tableSymbol[:tableSize] + // symbol start positions + { + cumul[0] = 0 + for ui, v := range s.norm[:s.symbolLen-1] { + u := byte(ui) // one less than reference + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = u + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + } + // Encode last symbol separately to avoid overflowing u + u := int(s.symbolLen - 1) + v := s.norm[s.symbolLen-1] + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = byte(u) + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + if uint32(cumul[s.symbolLen]) != tableSize { + return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize) + } + cumul[s.symbolLen] = int16(tableSize) + 1 + } + // Spread symbols + s.zeroBits = false + { + step := tableStep(tableSize) + tableMask := tableSize - 1 + var position uint32 + // if any symbol > largeLimit, we may have 0 bits output. + largeLimit := int16(1 << (s.actualTableLog - 1)) + for ui, v := range s.norm[:s.symbolLen] { + symbol := byte(ui) + if v > largeLimit { + s.zeroBits = true + } + for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + tableSymbol[position] = symbol + position = (position + step) & tableMask + for position > highThreshold { + position = (position + step) & tableMask + } /* Low proba area */ + } + } + + // Check if we have gone through all positions + if position != 0 { + return errors.New("position!=0") + } + } + + // Build table + table := s.ct.stateTable + { + tsi := int(tableSize) + for u, v := range tableSymbol { + // TableU16 : sorted by symbol order; gives next state value + table[cumul[v]] = uint16(tsi + u) + cumul[v]++ + } + } + + // Build Symbol Transformation Table + { + total := int16(0) + symbolTT := s.ct.symbolTT[:s.symbolLen] + tableLog := s.actualTableLog + tl := (uint32(tableLog) << 16) - (1 << tableLog) + for i, v := range s.norm[:s.symbolLen] { + switch v { + case 0: + case -1, 1: + symbolTT[i].deltaNbBits = tl + symbolTT[i].deltaFindState = int32(total - 1) + total++ + default: + maxBitsOut := uint32(tableLog) - highBits(uint32(v-1)) + minStatePlus := uint32(v) << maxBitsOut + symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus + symbolTT[i].deltaFindState = int32(total - v) + total += v + } + } + if total != int16(tableSize) { + return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize) + } + } + return nil +} + +// countSimple will create a simple histogram in s.count. +// Returns the biggest count. +// Does not update s.clearCount. +func (s *Scratch) countSimple(in []byte) (max int) { + for _, v := range in { + s.count[v]++ + } + m := uint32(0) + for i, v := range s.count[:] { + if v > m { + m = v + } + if v > 0 { + s.symbolLen = uint16(i) + 1 + } + } + return int(m) +} + +// minTableLog provides the minimum logSize to safely represent a distribution. +func (s *Scratch) minTableLog() uint8 { + minBitsSrc := highBits(uint32(s.br.remain()-1)) + 1 + minBitsSymbols := highBits(uint32(s.symbolLen-1)) + 2 + if minBitsSrc < minBitsSymbols { + return uint8(minBitsSrc) + } + return uint8(minBitsSymbols) +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *Scratch) optimalTableLog() { + tableLog := s.TableLog + minBits := s.minTableLog() + maxBitsSrc := uint8(highBits(uint32(s.br.remain()-1))) - 2 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minTablelog { + tableLog = minTablelog + } + if tableLog > maxTableLog { + tableLog = maxTableLog + } + s.actualTableLog = tableLog +} + +var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000} + +// normalizeCount will normalize the count of the symbols so +// the total is equal to the table size. +func (s *Scratch) normalizeCount() error { + var ( + tableLog = s.actualTableLog + scale = 62 - uint64(tableLog) + step = (1 << 62) / uint64(s.br.remain()) + vStep = uint64(1) << (scale - 20) + stillToDistribute = int16(1 << tableLog) + largest int + largestP int16 + lowThreshold = (uint32)(s.br.remain() >> tableLog) + ) + + for i, cnt := range s.count[:s.symbolLen] { + // already handled + // if (count[s] == s.length) return 0; /* rle special case */ + + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + stillToDistribute-- + } else { + proba := (int16)((uint64(cnt) * step) >> scale) + if proba < 8 { + restToBeat := vStep * uint64(rtbTable[proba]) + v := uint64(cnt)*step - (uint64(proba) << scale) + if v > restToBeat { + proba++ + } + } + if proba > largestP { + largestP = proba + largest = i + } + s.norm[i] = proba + stillToDistribute -= proba + } + } + + if -stillToDistribute >= (s.norm[largest] >> 1) { + // corner case, need another normalization method + return s.normalizeCount2() + } + s.norm[largest] += stillToDistribute + return nil +} + +// Secondary normalization method. +// To be used when primary method fails. +func (s *Scratch) normalizeCount2() error { + const notYetAssigned = -2 + var ( + distributed uint32 + total = uint32(s.br.remain()) + tableLog = s.actualTableLog + lowThreshold = uint32(total >> tableLog) + lowOne = uint32((total * 3) >> (tableLog + 1)) + ) + for i, cnt := range s.count[:s.symbolLen] { + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + distributed++ + total -= cnt + continue + } + if cnt <= lowOne { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + s.norm[i] = notYetAssigned + } + toDistribute := (1 << tableLog) - distributed + + if (total / toDistribute) > lowOne { + // risk of rounding to zero + lowOne = uint32((total * 3) / (toDistribute * 2)) + for i, cnt := range s.count[:s.symbolLen] { + if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + } + toDistribute = (1 << tableLog) - distributed + } + if distributed == uint32(s.symbolLen)+1 { + // all values are pretty poor; + // probably incompressible data (should have already been detected); + // find max, then give all remaining points to max + var maxV int + var maxC uint32 + for i, cnt := range s.count[:s.symbolLen] { + if cnt > maxC { + maxV = i + maxC = cnt + } + } + s.norm[maxV] += int16(toDistribute) + return nil + } + + if total == 0 { + // all of the symbols were low enough for the lowOne or lowThreshold + for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) { + if s.norm[i] > 0 { + toDistribute-- + s.norm[i]++ + } + } + return nil + } + + var ( + vStepLog = 62 - uint64(tableLog) + mid = uint64((1 << (vStepLog - 1)) - 1) + rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining + tmpTotal = mid + ) + for i, cnt := range s.count[:s.symbolLen] { + if s.norm[i] == notYetAssigned { + var ( + end = tmpTotal + uint64(cnt)*rStep + sStart = uint32(tmpTotal >> vStepLog) + sEnd = uint32(end >> vStepLog) + weight = sEnd - sStart + ) + if weight < 1 { + return errors.New("weight < 1") + } + s.norm[i] = int16(weight) + tmpTotal = end + } + } + return nil +} + +// validateNorm validates the normalized histogram table. +func (s *Scratch) validateNorm() (err error) { + var total int + for _, v := range s.norm[:s.symbolLen] { + if v >= 0 { + total += int(v) + } else { + total -= int(v) + } + } + defer func() { + if err == nil { + return + } + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen) + for i, v := range s.norm[:s.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v) + } + }() + if total != (1 << s.actualTableLog) { + return fmt.Errorf("warning: Total == %d != %d", total, 1< tablelogAbsoluteMax { + return errors.New("tableLog too large") + } + bitStream >>= 4 + bitCount := uint(4) + + s.actualTableLog = uint8(nbBits) + remaining := int32((1 << nbBits) + 1) + threshold := int32(1 << nbBits) + gotTotal := int32(0) + nbBits++ + + for remaining > 1 { + if previous0 { + n0 := charnum + for (bitStream & 0xFFFF) == 0xFFFF { + n0 += 24 + if b.off < iend-5 { + b.advance(2) + bitStream = b.Uint32() >> bitCount + } else { + bitStream >>= 16 + bitCount += 16 + } + } + for (bitStream & 3) == 3 { + n0 += 3 + bitStream >>= 2 + bitCount += 2 + } + n0 += uint16(bitStream & 3) + bitCount += 2 + if n0 > maxSymbolValue { + return errors.New("maxSymbolValue too small") + } + for charnum < n0 { + s.norm[charnum&0xff] = 0 + charnum++ + } + + if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 { + b.advance(bitCount >> 3) + bitCount &= 7 + bitStream = b.Uint32() >> bitCount + } else { + bitStream >>= 2 + } + } + + max := (2*(threshold) - 1) - (remaining) + var count int32 + + if (int32(bitStream) & (threshold - 1)) < max { + count = int32(bitStream) & (threshold - 1) + bitCount += nbBits - 1 + } else { + count = int32(bitStream) & (2*threshold - 1) + if count >= threshold { + count -= max + } + bitCount += nbBits + } + + count-- // extra accuracy + if count < 0 { + // -1 means +1 + remaining += count + gotTotal -= count + } else { + remaining -= count + gotTotal += count + } + s.norm[charnum&0xff] = int16(count) + charnum++ + previous0 = count == 0 + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + if b.off <= iend-7 || b.off+int(bitCount>>3) <= iend-4 { + b.advance(bitCount >> 3) + bitCount &= 7 + } else { + bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) + b.off = len(b.b) - 4 + } + bitStream = b.Uint32() >> (bitCount & 31) + } + s.symbolLen = charnum + + if s.symbolLen <= 1 { + return fmt.Errorf("symbolLen (%d) too small", s.symbolLen) + } + if s.symbolLen > maxSymbolValue+1 { + return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) + } + if remaining != 1 { + return fmt.Errorf("corruption detected (remaining %d != 1)", remaining) + } + if bitCount > 32 { + return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount) + } + if gotTotal != 1<> 3) + return nil +} + +// decSymbol contains information about a state entry, +// Including the state offset base, the output symbol and +// the number of bits to read for the low part of the destination state. +type decSymbol struct { + newState uint16 + symbol uint8 + nbBits uint8 +} + +// allocDtable will allocate decoding tables if they are not big enough. +func (s *Scratch) allocDtable() { + tableSize := 1 << s.actualTableLog + if cap(s.decTable) < int(tableSize) { + s.decTable = make([]decSymbol, tableSize) + } + s.decTable = s.decTable[:tableSize] + + if cap(s.ct.tableSymbol) < 256 { + s.ct.tableSymbol = make([]byte, 256) + } + s.ct.tableSymbol = s.ct.tableSymbol[:256] + + if cap(s.ct.stateTable) < 256 { + s.ct.stateTable = make([]uint16, 256) + } + s.ct.stateTable = s.ct.stateTable[:256] +} + +// buildDtable will build the decoding table. +func (s *Scratch) buildDtable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + s.allocDtable() + symbolNext := s.ct.stateTable[:256] + + // Init, lay down lowprob symbols + s.zeroBits = false + { + largeLimit := int16(1 << (s.actualTableLog - 1)) + for i, v := range s.norm[:s.symbolLen] { + if v == -1 { + s.decTable[highThreshold].symbol = uint8(i) + highThreshold-- + symbolNext[i] = 1 + } else { + if v >= largeLimit { + s.zeroBits = true + } + symbolNext[i] = uint16(v) + } + } + } + // Spread symbols + { + tableMask := tableSize - 1 + step := tableStep(tableSize) + position := uint32(0) + for ss, v := range s.norm[:s.symbolLen] { + for i := 0; i < int(v); i++ { + s.decTable[position].symbol = uint8(ss) + position = (position + step) & tableMask + for position > highThreshold { + // lowprob area + position = (position + step) & tableMask + } + } + } + if position != 0 { + // position must reach all cells once, otherwise normalizedCounter is incorrect + return errors.New("corrupted input (position != 0)") + } + } + + // Build Decoding table + { + tableSize := uint16(1 << s.actualTableLog) + for u, v := range s.decTable { + symbol := v.symbol + nextState := symbolNext[symbol] + symbolNext[symbol] = nextState + 1 + nBits := s.actualTableLog - byte(highBits(uint32(nextState))) + s.decTable[u].nbBits = nBits + newState := (nextState << nBits) - tableSize + if newState >= tableSize { + return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize) + } + if newState == uint16(u) && nBits == 0 { + // Seems weird that this is possible with nbits > 0. + return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u) + } + s.decTable[u].newState = newState + } + } + return nil +} + +// decompress will decompress the bitstream. +// If the buffer is over-read an error is returned. +func (s *Scratch) decompress() error { + br := &s.bits + br.init(s.br.unread()) + + var s1, s2 decoder + // Initialize and decode first state and symbol. + s1.init(br, s.decTable, s.actualTableLog) + s2.init(br, s.decTable, s.actualTableLog) + + // Use temp table to avoid bound checks/append penalty. + var tmp = s.ct.tableSymbol[:256] + var off uint8 + + // Main part + if !s.zeroBits { + for br.off >= 8 { + br.fillFast() + tmp[off+0] = s1.nextFast() + tmp[off+1] = s2.nextFast() + br.fillFast() + tmp[off+2] = s1.nextFast() + tmp[off+3] = s2.nextFast() + off += 4 + // When off is 0, we have overflowed and should write. + if off == 0 { + s.Out = append(s.Out, tmp...) + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + } + } else { + for br.off >= 8 { + br.fillFast() + tmp[off+0] = s1.next() + tmp[off+1] = s2.next() + br.fillFast() + tmp[off+2] = s1.next() + tmp[off+3] = s2.next() + off += 4 + if off == 0 { + s.Out = append(s.Out, tmp...) + // When off is 0, we have overflowed and should write. + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + } + } + s.Out = append(s.Out, tmp[:off]...) + + // Final bits, a bit more expensive check + for { + if s1.finished() { + s.Out = append(s.Out, s1.final(), s2.final()) + break + } + br.fill() + s.Out = append(s.Out, s1.next()) + if s2.finished() { + s.Out = append(s.Out, s2.final(), s1.final()) + break + } + s.Out = append(s.Out, s2.next()) + if len(s.Out) >= s.DecompressLimit { + return fmt.Errorf("output size (%d) > DecompressLimit (%d)", len(s.Out), s.DecompressLimit) + } + } + return br.close() +} + +// decoder keeps track of the current state and updates it from the bitstream. +type decoder struct { + state uint16 + br *bitReader + dt []decSymbol +} + +// init will initialize the decoder and read the first state from the stream. +func (d *decoder) init(in *bitReader, dt []decSymbol, tableLog uint8) { + d.dt = dt + d.br = in + d.state = uint16(in.getBits(tableLog)) +} + +// next returns the next symbol and sets the next state. +// At least tablelog bits must be available in the bit reader. +func (d *decoder) next() uint8 { + n := &d.dt[d.state] + lowBits := d.br.getBits(n.nbBits) + d.state = n.newState + lowBits + return n.symbol +} + +// finished returns true if all bits have been read from the bitstream +// and the next state would require reading bits from the input. +func (d *decoder) finished() bool { + return d.br.finished() && d.dt[d.state].nbBits > 0 +} + +// final returns the current state symbol without decoding the next. +func (d *decoder) final() uint8 { + return d.dt[d.state].symbol +} + +// nextFast returns the next symbol and sets the next state. +// This can only be used if no symbols are 0 bits. +// At least tablelog bits must be available in the bit reader. +func (d *decoder) nextFast() uint8 { + n := d.dt[d.state] + lowBits := d.br.getBitsFast(n.nbBits) + d.state = n.newState + lowBits + return n.symbol +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/fse/fse.go b/awsproviderlint/vendor/github.com/klauspost/compress/fse/fse.go new file mode 100644 index 00000000000..535cbadfdea --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/fse/fse.go @@ -0,0 +1,144 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +// Package fse provides Finite State Entropy encoding and decoding. +// +// Finite State Entropy encoding provides a fast near-optimal symbol encoding/decoding +// for byte blocks as implemented in zstd. +// +// See https://github.com/klauspost/compress/tree/master/fse for more information. +package fse + +import ( + "errors" + "fmt" + "math/bits" +) + +const ( + /*!MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ + maxMemoryUsage = 14 + defaultMemoryUsage = 13 + + maxTableLog = maxMemoryUsage - 2 + maxTablesize = 1 << maxTableLog + defaultTablelog = defaultMemoryUsage - 2 + minTablelog = 5 + maxSymbolValue = 255 +) + +var ( + // ErrIncompressible is returned when input is judged to be too hard to compress. + ErrIncompressible = errors.New("input is not compressible") + + // ErrUseRLE is returned from the compressor when the input is a single byte value repeated. + ErrUseRLE = errors.New("input is single value repeated") +) + +// Scratch provides temporary storage for compression and decompression. +type Scratch struct { + // Private + count [maxSymbolValue + 1]uint32 + norm [maxSymbolValue + 1]int16 + br byteReader + bits bitReader + bw bitWriter + ct cTable // Compression tables. + decTable []decSymbol // Decompression table. + maxCount int // count of the most probable symbol + + // Per block parameters. + // These can be used to override compression parameters of the block. + // Do not touch, unless you know what you are doing. + + // Out is output buffer. + // If the scratch is re-used before the caller is done processing the output, + // set this field to nil. + // Otherwise the output buffer will be re-used for next Compression/Decompression step + // and allocation will be avoided. + Out []byte + + // DecompressLimit limits the maximum decoded size acceptable. + // If > 0 decompression will stop when approximately this many bytes + // has been decoded. + // If 0, maximum size will be 2GB. + DecompressLimit int + + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + + // MaxSymbolValue will override the maximum symbol value of the next block. + MaxSymbolValue uint8 + + // TableLog will attempt to override the tablelog for the next block. + TableLog uint8 +} + +// Histogram allows to populate the histogram and skip that step in the compression, +// It otherwise allows to inspect the histogram when compression is done. +// To indicate that you have populated the histogram call HistogramFinished +// with the value of the highest populated symbol, as well as the number of entries +// in the most populated entry. These are accepted at face value. +// The returned slice will always be length 256. +func (s *Scratch) Histogram() []uint32 { + return s.count[:] +} + +// HistogramFinished can be called to indicate that the histogram has been populated. +// maxSymbol is the index of the highest set symbol of the next data segment. +// maxCount is the number of entries in the most populated entry. +// These are accepted at face value. +func (s *Scratch) HistogramFinished(maxSymbol uint8, maxCount int) { + s.maxCount = maxCount + s.symbolLen = uint16(maxSymbol) + 1 + s.clearCount = maxCount != 0 +} + +// prepare will prepare and allocate scratch tables used for both compression and decompression. +func (s *Scratch) prepare(in []byte) (*Scratch, error) { + if s == nil { + s = &Scratch{} + } + if s.MaxSymbolValue == 0 { + s.MaxSymbolValue = 255 + } + if s.TableLog == 0 { + s.TableLog = defaultTablelog + } + if s.TableLog > maxTableLog { + return nil, fmt.Errorf("tableLog (%d) > maxTableLog (%d)", s.TableLog, maxTableLog) + } + if cap(s.Out) == 0 { + s.Out = make([]byte, 0, len(in)) + } + if s.clearCount && s.maxCount == 0 { + for i := range s.count { + s.count[i] = 0 + } + s.clearCount = false + } + s.br.init(in) + if s.DecompressLimit == 0 { + // Max size 2GB. + s.DecompressLimit = (2 << 30) - 1 + } + + return s, nil +} + +// tableStep returns the next table index. +func tableStep(tableSize uint32) uint32 { + return (tableSize >> 1) + (tableSize >> 3) + 3 +} + +func highBits(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/.gitignore b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/.gitignore new file mode 100644 index 00000000000..b3d262958f8 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/.gitignore @@ -0,0 +1 @@ +/huff0-fuzz.zip diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/README.md b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/README.md new file mode 100644 index 00000000000..e12da4db2fd --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/README.md @@ -0,0 +1,87 @@ +# Huff0 entropy compression + +This package provides Huff0 encoding and decoding as used in zstd. + +[Huff0](https://github.com/Cyan4973/FiniteStateEntropy#new-generation-entropy-coders), +a Huffman codec designed for modern CPU, featuring OoO (Out of Order) operations on multiple ALU +(Arithmetic Logic Unit), achieving extremely fast compression and decompression speeds. + +This can be used for compressing input with a lot of similar input values to the smallest number of bytes. +This does not perform any multi-byte [dictionary coding](https://en.wikipedia.org/wiki/Dictionary_coder) as LZ coders, +but it can be used as a secondary step to compressors (like Snappy) that does not do entropy encoding. + +* [Godoc documentation](https://godoc.org/github.com/klauspost/compress/huff0) + +## News + + * Mar 2018: First implementation released. Consider this beta software for now. + +# Usage + +This package provides a low level interface that allows to compress single independent blocks. + +Each block is separate, and there is no built in integrity checks. +This means that the caller should keep track of block sizes and also do checksums if needed. + +Compressing a block is done via the [`Compress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress1X) and +[`Compress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Compress4X) functions. +You must provide input and will receive the output and maybe an error. + +These error values can be returned: + +| Error | Description | +|---------------------|-----------------------------------------------------------------------------| +| `` | Everything ok, output is returned | +| `ErrIncompressible` | Returned when input is judged to be too hard to compress | +| `ErrUseRLE` | Returned from the compressor when the input is a single byte value repeated | +| `ErrTooBig` | Returned if the input block exceeds the maximum allowed size (128 Kib) | +| `(error)` | An internal error occurred. | + + +As can be seen above some of there are errors that will be returned even under normal operation so it is important to handle these. + +To reduce allocations you can provide a [`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object +that can be re-used for successive calls. Both compression and decompression accepts a `Scratch` object, and the same +object can be used for both. + +Be aware, that when re-using a `Scratch` object that the *output* buffer is also re-used, so if you are still using this +you must set the `Out` field in the scratch to nil. The same buffer is used for compression and decompression output. + +The `Scratch` object will retain state that allows to re-use previous tables for encoding and decoding. + +## Tables and re-use + +Huff0 allows for reusing tables from the previous block to save space if that is expected to give better/faster results. + +The Scratch object allows you to set a [`ReusePolicy`](https://godoc.org/github.com/klauspost/compress/huff0#ReusePolicy) +that controls this behaviour. See the documentation for details. This can be altered between each block. + +Do however note that this information is *not* stored in the output block and it is up to the users of the package to +record whether [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable) should be called, +based on the boolean reported back from the CompressXX call. + +If you want to store the table separate from the data, you can access them as `OutData` and `OutTable` on the +[`Scratch`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch) object. + +## Decompressing + +The first part of decoding is to initialize the decoding table through [`ReadTable`](https://godoc.org/github.com/klauspost/compress/huff0#ReadTable). +This will initialize the decoding tables. +You can supply the complete block to `ReadTable` and it will return the data part of the block +which can be given to the decompressor. + +Decompressing is done by calling the [`Decompress1X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress1X) +or [`Decompress4X`](https://godoc.org/github.com/klauspost/compress/huff0#Scratch.Decompress4X) function. + +For concurrently decompressing content with a fixed table a stateless [`Decoder`](https://godoc.org/github.com/klauspost/compress/huff0#Decoder) can be requested which will remain correct as long as the scratch is unchanged. The capacity of the provided slice indicates the expected output size. + +You must provide the output from the compression stage, at exactly the size you got back. If you receive an error back +your input was likely corrupted. + +It is important to note that a successful decoding does *not* mean your output matches your original input. +There are no integrity checks, so relying on errors from the decompressor does not assure your data is valid. + +# Contributing + +Contributions are always welcome. Be aware that adding public functions will require good justification and breaking +changes will likely not be accepted. If in doubt open an issue before writing the PR. diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitreader.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitreader.go new file mode 100644 index 00000000000..a4979e8868a --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitreader.go @@ -0,0 +1,329 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package huff0 + +import ( + "encoding/binary" + "errors" + "io" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReader struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReader) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.bitsRead += 8 - uint8(highBit32(uint32(v))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) peekBitsFast(n uint8) uint16 { + const regMask = 64 - 1 + v := uint16((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + return v +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReader) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 +} + +func (b *bitReader) advance(n uint8) { + b.bitsRead += n +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReader) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value = (b.value << 8) | uint64(b.in[b.off-1]) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReader) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReader) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderBytes struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderBytes) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderBytes) peekByteFast() uint8 { + got := uint8(b.value >> 56) + return got +} + +func (b *bitReaderBytes) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderBytes) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderBytes is empty and there is at least 8 bytes to read. +func (b *bitReaderBytes) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderBytes) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << (b.bitsRead - 32) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << (b.bitsRead - 8) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReaderBytes) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderBytes) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +// bitReaderShifted reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReaderShifted struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReaderShifted) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.advance(8 - uint8(highBit32(uint32(v)))) + return nil +} + +// peekBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReaderShifted) peekBitsFast(n uint8) uint16 { + return uint16(b.value >> ((64 - n) & 63)) +} + +func (b *bitReaderShifted) advance(n uint8) { + b.bitsRead += n + b.value <<= n & 63 +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReaderShifted) fillFast() { + if b.bitsRead < 32 { + return + } + + // 2 bounds checks. + v := b.in[b.off-4 : b.off] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitReaderShifted is empty and there is at least 8 bytes to read. +func (b *bitReaderShifted) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReaderShifted) fill() { + if b.bitsRead < 32 { + return + } + if b.off > 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value |= uint64(low) << ((b.bitsRead - 32) & 63) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value |= uint64(b.in[b.off-1]) << ((b.bitsRead - 8) & 63) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReaderShifted) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReaderShifted) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitwriter.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitwriter.go new file mode 100644 index 00000000000..6bce4e87d4f --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bitwriter.go @@ -0,0 +1,210 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package huff0 + +import "fmt" + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// bitMask16 is bitmasks. Has extra to avoid bounds check. +var bitMask16 = [32]uint16{ + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF} /* up to 16 bits */ + +// addBits16NC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16NC(value uint16, bits uint8) { + b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// encSymbol will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) encSymbol(ct cTable, symbol byte) { + enc := ct[symbol] + b.bitContainer |= uint64(enc.val) << (b.nBits & 63) + if false { + if enc.nBits == 0 { + panic("nbits 0") + } + } + b.nBits += enc.nBits +} + +// encTwoSymbols will add up to 32 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) encTwoSymbols(ct cTable, av, bv byte) { + encA := ct[av] + encB := ct[bv] + sh := b.nBits & 63 + combined := uint64(encA.val) | (uint64(encB.val) << (encA.nBits & 63)) + b.bitContainer |= combined << sh + if false { + if encA.nBits == 0 { + panic("nbitsA 0") + } + if encB.nBits == 0 { + panic("nbitsB 0") + } + } + b.nBits += encA.nBits + encB.nBits +} + +// addBits16ZeroNC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +// This is fastest if bits can be zero. +func (b *bitWriter) addBits16ZeroNC(value uint16, bits uint8) { + if bits == 0 { + return + } + value <<= (16 - bits) & 15 + value >>= (16 - bits) & 15 + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// flush will flush all pending full bytes. +// There will be at least 56 bits available for writing when this has been called. +// Using flush32 is faster, but leaves less space for writing. +func (b *bitWriter) flush() { + v := b.nBits >> 3 + switch v { + case 0: + return + case 1: + b.out = append(b.out, + byte(b.bitContainer), + ) + b.bitContainer >>= 1 << 3 + case 2: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + ) + b.bitContainer >>= 2 << 3 + case 3: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + ) + b.bitContainer >>= 3 << 3 + case 4: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + ) + b.bitContainer >>= 4 << 3 + case 5: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + ) + b.bitContainer >>= 5 << 3 + case 6: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + ) + b.bitContainer >>= 6 << 3 + case 7: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + ) + b.bitContainer >>= 7 << 3 + case 8: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + byte(b.bitContainer>>56), + ) + b.bitContainer = 0 + b.nBits = 0 + return + default: + panic(fmt.Errorf("bits (%d) > 64", b.nBits)) + } + b.nBits &= 7 +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() error { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() + return nil +} + +// reset and continue writing by appending to out. +func (b *bitWriter) reset(out []byte) { + b.bitContainer = 0 + b.nBits = 0 + b.out = out +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bytereader.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bytereader.go new file mode 100644 index 00000000000..50bcdf6ea99 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/bytereader.go @@ -0,0 +1,54 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package huff0 + +// byteReader provides a byte reader that reads +// little endian values from a byte stream. +// The input stream is manually advanced. +// The reader performs no bounds checks. +type byteReader struct { + b []byte + off int +} + +// init will initialize the reader and set the input. +func (b *byteReader) init(in []byte) { + b.b = in + b.off = 0 +} + +// advance the stream b n bytes. +func (b *byteReader) advance(n uint) { + b.off += int(n) +} + +// Int32 returns a little endian int32 starting at current offset. +func (b byteReader) Int32() int32 { + v3 := int32(b.b[b.off+3]) + v2 := int32(b.b[b.off+2]) + v1 := int32(b.b[b.off+1]) + v0 := int32(b.b[b.off]) + return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0 +} + +// Uint32 returns a little endian uint32 starting at current offset. +func (b byteReader) Uint32() uint32 { + v3 := uint32(b.b[b.off+3]) + v2 := uint32(b.b[b.off+2]) + v1 := uint32(b.b[b.off+1]) + v0 := uint32(b.b[b.off]) + return (v3 << 24) | (v2 << 16) | (v1 << 8) | v0 +} + +// unread returns the unread portion of the input. +func (b byteReader) unread() []byte { + return b.b[b.off:] +} + +// remain will return the number of bytes remaining. +func (b byteReader) remain() int { + return len(b.b) - b.off +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/compress.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/compress.go new file mode 100644 index 00000000000..f9ed5f8306e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/compress.go @@ -0,0 +1,657 @@ +package huff0 + +import ( + "fmt" + "runtime" + "sync" +) + +// Compress1X will compress the input. +// The output can be decoded using Decompress1X. +// Supply a Scratch object. The scratch object contains state about re-use, +// So when sharing across independent encodes, be sure to set the re-use policy. +func Compress1X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) { + s, err = s.prepare(in) + if err != nil { + return nil, false, err + } + return compress(in, s, s.compress1X) +} + +// Compress4X will compress the input. The input is split into 4 independent blocks +// and compressed similar to Compress1X. +// The output can be decoded using Decompress4X. +// Supply a Scratch object. The scratch object contains state about re-use, +// So when sharing across independent encodes, be sure to set the re-use policy. +func Compress4X(in []byte, s *Scratch) (out []byte, reUsed bool, err error) { + s, err = s.prepare(in) + if err != nil { + return nil, false, err + } + if false { + // TODO: compress4Xp only slightly faster. + const parallelThreshold = 8 << 10 + if len(in) < parallelThreshold || runtime.GOMAXPROCS(0) == 1 { + return compress(in, s, s.compress4X) + } + return compress(in, s, s.compress4Xp) + } + return compress(in, s, s.compress4X) +} + +func compress(in []byte, s *Scratch, compressor func(src []byte) ([]byte, error)) (out []byte, reUsed bool, err error) { + // Nuke previous table if we cannot reuse anyway. + if s.Reuse == ReusePolicyNone { + s.prevTable = s.prevTable[:0] + } + + // Create histogram, if none was provided. + maxCount := s.maxCount + var canReuse = false + if maxCount == 0 { + maxCount, canReuse = s.countSimple(in) + } else { + canReuse = s.canUseTable(s.prevTable) + } + + // We want the output size to be less than this: + wantSize := len(in) + if s.WantLogLess > 0 { + wantSize -= wantSize >> s.WantLogLess + } + + // Reset for next run. + s.clearCount = true + s.maxCount = 0 + if maxCount >= len(in) { + if maxCount > len(in) { + return nil, false, fmt.Errorf("maxCount (%d) > length (%d)", maxCount, len(in)) + } + if len(in) == 1 { + return nil, false, ErrIncompressible + } + // One symbol, use RLE + return nil, false, ErrUseRLE + } + if maxCount == 1 || maxCount < (len(in)>>7) { + // Each symbol present maximum once or too well distributed. + return nil, false, ErrIncompressible + } + if s.Reuse == ReusePolicyMust && !canReuse { + // We must reuse, but we can't. + return nil, false, ErrIncompressible + } + if (s.Reuse == ReusePolicyPrefer || s.Reuse == ReusePolicyMust) && canReuse { + keepTable := s.cTable + keepTL := s.actualTableLog + s.cTable = s.prevTable + s.actualTableLog = s.prevTableLog + s.Out, err = compressor(in) + s.cTable = keepTable + s.actualTableLog = keepTL + if err == nil && len(s.Out) < wantSize { + s.OutData = s.Out + return s.Out, true, nil + } + if s.Reuse == ReusePolicyMust { + return nil, false, ErrIncompressible + } + // Do not attempt to re-use later. + s.prevTable = s.prevTable[:0] + } + + // Calculate new table. + err = s.buildCTable() + if err != nil { + return nil, false, err + } + + if false && !s.canUseTable(s.cTable) { + panic("invalid table generated") + } + + if s.Reuse == ReusePolicyAllow && canReuse { + hSize := len(s.Out) + oldSize := s.prevTable.estimateSize(s.count[:s.symbolLen]) + newSize := s.cTable.estimateSize(s.count[:s.symbolLen]) + if oldSize <= hSize+newSize || hSize+12 >= wantSize { + // Retain cTable even if we re-use. + keepTable := s.cTable + keepTL := s.actualTableLog + + s.cTable = s.prevTable + s.actualTableLog = s.prevTableLog + s.Out, err = compressor(in) + + // Restore ctable. + s.cTable = keepTable + s.actualTableLog = keepTL + if err != nil { + return nil, false, err + } + if len(s.Out) >= wantSize { + return nil, false, ErrIncompressible + } + s.OutData = s.Out + return s.Out, true, nil + } + } + + // Use new table + err = s.cTable.write(s) + if err != nil { + s.OutTable = nil + return nil, false, err + } + s.OutTable = s.Out + + // Compress using new table + s.Out, err = compressor(in) + if err != nil { + s.OutTable = nil + return nil, false, err + } + if len(s.Out) >= wantSize { + s.OutTable = nil + return nil, false, ErrIncompressible + } + // Move current table into previous. + s.prevTable, s.prevTableLog, s.cTable = s.cTable, s.actualTableLog, s.prevTable[:0] + s.OutData = s.Out[len(s.OutTable):] + return s.Out, false, nil +} + +func (s *Scratch) compress1X(src []byte) ([]byte, error) { + return s.compress1xDo(s.Out, src) +} + +func (s *Scratch) compress1xDo(dst, src []byte) ([]byte, error) { + var bw = bitWriter{out: dst} + + // N is length divisible by 4. + n := len(src) + n -= n & 3 + cTable := s.cTable[:256] + + // Encode last bytes. + for i := len(src) & 3; i > 0; i-- { + bw.encSymbol(cTable, src[n+i-1]) + } + n -= 4 + if s.actualTableLog <= 8 { + for ; n >= 0; n -= 4 { + tmp := src[n : n+4] + // tmp should be len 4 + bw.flush32() + bw.encTwoSymbols(cTable, tmp[3], tmp[2]) + bw.encTwoSymbols(cTable, tmp[1], tmp[0]) + } + } else { + for ; n >= 0; n -= 4 { + tmp := src[n : n+4] + // tmp should be len 4 + bw.flush32() + bw.encTwoSymbols(cTable, tmp[3], tmp[2]) + bw.flush32() + bw.encTwoSymbols(cTable, tmp[1], tmp[0]) + } + } + err := bw.close() + return bw.out, err +} + +var sixZeros [6]byte + +func (s *Scratch) compress4X(src []byte) ([]byte, error) { + if len(src) < 12 { + return nil, ErrIncompressible + } + segmentSize := (len(src) + 3) / 4 + + // Add placeholder for output length + offsetIdx := len(s.Out) + s.Out = append(s.Out, sixZeros[:]...) + + for i := 0; i < 4; i++ { + toDo := src + if len(toDo) > segmentSize { + toDo = toDo[:segmentSize] + } + src = src[len(toDo):] + + var err error + idx := len(s.Out) + s.Out, err = s.compress1xDo(s.Out, toDo) + if err != nil { + return nil, err + } + // Write compressed length as little endian before block. + if i < 3 { + // Last length is not written. + length := len(s.Out) - idx + s.Out[i*2+offsetIdx] = byte(length) + s.Out[i*2+offsetIdx+1] = byte(length >> 8) + } + } + + return s.Out, nil +} + +// compress4Xp will compress 4 streams using separate goroutines. +func (s *Scratch) compress4Xp(src []byte) ([]byte, error) { + if len(src) < 12 { + return nil, ErrIncompressible + } + // Add placeholder for output length + s.Out = s.Out[:6] + + segmentSize := (len(src) + 3) / 4 + var wg sync.WaitGroup + var errs [4]error + wg.Add(4) + for i := 0; i < 4; i++ { + toDo := src + if len(toDo) > segmentSize { + toDo = toDo[:segmentSize] + } + src = src[len(toDo):] + + // Separate goroutine for each block. + go func(i int) { + s.tmpOut[i], errs[i] = s.compress1xDo(s.tmpOut[i][:0], toDo) + wg.Done() + }(i) + } + wg.Wait() + for i := 0; i < 4; i++ { + if errs[i] != nil { + return nil, errs[i] + } + o := s.tmpOut[i] + // Write compressed length as little endian before block. + if i < 3 { + // Last length is not written. + s.Out[i*2] = byte(len(o)) + s.Out[i*2+1] = byte(len(o) >> 8) + } + + // Write output. + s.Out = append(s.Out, o...) + } + return s.Out, nil +} + +// countSimple will create a simple histogram in s.count. +// Returns the biggest count. +// Does not update s.clearCount. +func (s *Scratch) countSimple(in []byte) (max int, reuse bool) { + reuse = true + for _, v := range in { + s.count[v]++ + } + m := uint32(0) + if len(s.prevTable) > 0 { + for i, v := range s.count[:] { + if v > m { + m = v + } + if v > 0 { + s.symbolLen = uint16(i) + 1 + if i >= len(s.prevTable) { + reuse = false + } else { + if s.prevTable[i].nBits == 0 { + reuse = false + } + } + } + } + return int(m), reuse + } + for i, v := range s.count[:] { + if v > m { + m = v + } + if v > 0 { + s.symbolLen = uint16(i) + 1 + } + } + return int(m), false +} + +func (s *Scratch) canUseTable(c cTable) bool { + if len(c) < int(s.symbolLen) { + return false + } + for i, v := range s.count[:s.symbolLen] { + if v != 0 && c[i].nBits == 0 { + return false + } + } + return true +} + +func (s *Scratch) validateTable(c cTable) bool { + if len(c) < int(s.symbolLen) { + return false + } + for i, v := range s.count[:s.symbolLen] { + if v != 0 { + if c[i].nBits == 0 { + return false + } + if c[i].nBits > s.actualTableLog { + return false + } + } + } + return true +} + +// minTableLog provides the minimum logSize to safely represent a distribution. +func (s *Scratch) minTableLog() uint8 { + minBitsSrc := highBit32(uint32(s.br.remain())) + 1 + minBitsSymbols := highBit32(uint32(s.symbolLen-1)) + 2 + if minBitsSrc < minBitsSymbols { + return uint8(minBitsSrc) + } + return uint8(minBitsSymbols) +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *Scratch) optimalTableLog() { + tableLog := s.TableLog + minBits := s.minTableLog() + maxBitsSrc := uint8(highBit32(uint32(s.br.remain()-1))) - 1 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minTablelog { + tableLog = minTablelog + } + if tableLog > tableLogMax { + tableLog = tableLogMax + } + s.actualTableLog = tableLog +} + +type cTableEntry struct { + val uint16 + nBits uint8 + // We have 8 bits extra +} + +const huffNodesMask = huffNodesLen - 1 + +func (s *Scratch) buildCTable() error { + s.optimalTableLog() + s.huffSort() + if cap(s.cTable) < maxSymbolValue+1 { + s.cTable = make([]cTableEntry, s.symbolLen, maxSymbolValue+1) + } else { + s.cTable = s.cTable[:s.symbolLen] + for i := range s.cTable { + s.cTable[i] = cTableEntry{} + } + } + + var startNode = int16(s.symbolLen) + nonNullRank := s.symbolLen - 1 + + nodeNb := int16(startNode) + huffNode := s.nodes[1 : huffNodesLen+1] + + // This overlays the slice above, but allows "-1" index lookups. + // Different from reference implementation. + huffNode0 := s.nodes[0 : huffNodesLen+1] + + for huffNode[nonNullRank].count == 0 { + nonNullRank-- + } + + lowS := int16(nonNullRank) + nodeRoot := nodeNb + lowS - 1 + lowN := nodeNb + huffNode[nodeNb].count = huffNode[lowS].count + huffNode[lowS-1].count + huffNode[lowS].parent, huffNode[lowS-1].parent = uint16(nodeNb), uint16(nodeNb) + nodeNb++ + lowS -= 2 + for n := nodeNb; n <= nodeRoot; n++ { + huffNode[n].count = 1 << 30 + } + // fake entry, strong barrier + huffNode0[0].count = 1 << 31 + + // create parents + for nodeNb <= nodeRoot { + var n1, n2 int16 + if huffNode0[lowS+1].count < huffNode0[lowN+1].count { + n1 = lowS + lowS-- + } else { + n1 = lowN + lowN++ + } + if huffNode0[lowS+1].count < huffNode0[lowN+1].count { + n2 = lowS + lowS-- + } else { + n2 = lowN + lowN++ + } + + huffNode[nodeNb].count = huffNode0[n1+1].count + huffNode0[n2+1].count + huffNode0[n1+1].parent, huffNode0[n2+1].parent = uint16(nodeNb), uint16(nodeNb) + nodeNb++ + } + + // distribute weights (unlimited tree height) + huffNode[nodeRoot].nbBits = 0 + for n := nodeRoot - 1; n >= startNode; n-- { + huffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1 + } + for n := uint16(0); n <= nonNullRank; n++ { + huffNode[n].nbBits = huffNode[huffNode[n].parent].nbBits + 1 + } + s.actualTableLog = s.setMaxHeight(int(nonNullRank)) + maxNbBits := s.actualTableLog + + // fill result into tree (val, nbBits) + if maxNbBits > tableLogMax { + return fmt.Errorf("internal error: maxNbBits (%d) > tableLogMax (%d)", maxNbBits, tableLogMax) + } + var nbPerRank [tableLogMax + 1]uint16 + var valPerRank [16]uint16 + for _, v := range huffNode[:nonNullRank+1] { + nbPerRank[v.nbBits]++ + } + // determine stating value per rank + { + min := uint16(0) + for n := maxNbBits; n > 0; n-- { + // get starting value within each rank + valPerRank[n] = min + min += nbPerRank[n] + min >>= 1 + } + } + + // push nbBits per symbol, symbol order + for _, v := range huffNode[:nonNullRank+1] { + s.cTable[v.symbol].nBits = v.nbBits + } + + // assign value within rank, symbol order + t := s.cTable[:s.symbolLen] + for n, val := range t { + nbits := val.nBits & 15 + v := valPerRank[nbits] + t[n].val = v + valPerRank[nbits] = v + 1 + } + + return nil +} + +// huffSort will sort symbols, decreasing order. +func (s *Scratch) huffSort() { + type rankPos struct { + base uint32 + current uint32 + } + + // Clear nodes + nodes := s.nodes[:huffNodesLen+1] + s.nodes = nodes + nodes = nodes[1 : huffNodesLen+1] + + // Sort into buckets based on length of symbol count. + var rank [32]rankPos + for _, v := range s.count[:s.symbolLen] { + r := highBit32(v+1) & 31 + rank[r].base++ + } + // maxBitLength is log2(BlockSizeMax) + 1 + const maxBitLength = 18 + 1 + for n := maxBitLength; n > 0; n-- { + rank[n-1].base += rank[n].base + } + for n := range rank[:maxBitLength] { + rank[n].current = rank[n].base + } + for n, c := range s.count[:s.symbolLen] { + r := (highBit32(c+1) + 1) & 31 + pos := rank[r].current + rank[r].current++ + prev := nodes[(pos-1)&huffNodesMask] + for pos > rank[r].base && c > prev.count { + nodes[pos&huffNodesMask] = prev + pos-- + prev = nodes[(pos-1)&huffNodesMask] + } + nodes[pos&huffNodesMask] = nodeElt{count: c, symbol: byte(n)} + } + return +} + +func (s *Scratch) setMaxHeight(lastNonNull int) uint8 { + maxNbBits := s.actualTableLog + huffNode := s.nodes[1 : huffNodesLen+1] + //huffNode = huffNode[: huffNodesLen] + + largestBits := huffNode[lastNonNull].nbBits + + // early exit : no elt > maxNbBits + if largestBits <= maxNbBits { + return largestBits + } + totalCost := int(0) + baseCost := int(1) << (largestBits - maxNbBits) + n := uint32(lastNonNull) + + for huffNode[n].nbBits > maxNbBits { + totalCost += baseCost - (1 << (largestBits - huffNode[n].nbBits)) + huffNode[n].nbBits = maxNbBits + n-- + } + // n stops at huffNode[n].nbBits <= maxNbBits + + for huffNode[n].nbBits == maxNbBits { + n-- + } + // n end at index of smallest symbol using < maxNbBits + + // renorm totalCost + totalCost >>= largestBits - maxNbBits /* note : totalCost is necessarily a multiple of baseCost */ + + // repay normalized cost + { + const noSymbol = 0xF0F0F0F0 + var rankLast [tableLogMax + 2]uint32 + + for i := range rankLast[:] { + rankLast[i] = noSymbol + } + + // Get pos of last (smallest) symbol per rank + { + currentNbBits := uint8(maxNbBits) + for pos := int(n); pos >= 0; pos-- { + if huffNode[pos].nbBits >= currentNbBits { + continue + } + currentNbBits = huffNode[pos].nbBits // < maxNbBits + rankLast[maxNbBits-currentNbBits] = uint32(pos) + } + } + + for totalCost > 0 { + nBitsToDecrease := uint8(highBit32(uint32(totalCost))) + 1 + + for ; nBitsToDecrease > 1; nBitsToDecrease-- { + highPos := rankLast[nBitsToDecrease] + lowPos := rankLast[nBitsToDecrease-1] + if highPos == noSymbol { + continue + } + if lowPos == noSymbol { + break + } + highTotal := huffNode[highPos].count + lowTotal := 2 * huffNode[lowPos].count + if highTotal <= lowTotal { + break + } + } + // only triggered when no more rank 1 symbol left => find closest one (note : there is necessarily at least one !) + // HUF_MAX_TABLELOG test just to please gcc 5+; but it should not be necessary + // FIXME: try to remove + for (nBitsToDecrease <= tableLogMax) && (rankLast[nBitsToDecrease] == noSymbol) { + nBitsToDecrease++ + } + totalCost -= 1 << (nBitsToDecrease - 1) + if rankLast[nBitsToDecrease-1] == noSymbol { + // this rank is no longer empty + rankLast[nBitsToDecrease-1] = rankLast[nBitsToDecrease] + } + huffNode[rankLast[nBitsToDecrease]].nbBits++ + if rankLast[nBitsToDecrease] == 0 { + /* special case, reached largest symbol */ + rankLast[nBitsToDecrease] = noSymbol + } else { + rankLast[nBitsToDecrease]-- + if huffNode[rankLast[nBitsToDecrease]].nbBits != maxNbBits-nBitsToDecrease { + rankLast[nBitsToDecrease] = noSymbol /* this rank is now empty */ + } + } + } + + for totalCost < 0 { /* Sometimes, cost correction overshoot */ + if rankLast[1] == noSymbol { /* special case : no rank 1 symbol (using maxNbBits-1); let's create one from largest rank 0 (using maxNbBits) */ + for huffNode[n].nbBits == maxNbBits { + n-- + } + huffNode[n+1].nbBits-- + rankLast[1] = n + 1 + totalCost++ + continue + } + huffNode[rankLast[1]+1].nbBits-- + rankLast[1]++ + totalCost++ + } + } + return maxNbBits +} + +type nodeElt struct { + count uint32 + parent uint16 + symbol byte + nbBits uint8 +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/decompress.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/decompress.go new file mode 100644 index 00000000000..41703bba4d6 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/decompress.go @@ -0,0 +1,1164 @@ +package huff0 + +import ( + "errors" + "fmt" + "io" + + "github.com/klauspost/compress/fse" +) + +type dTable struct { + single []dEntrySingle + double []dEntryDouble +} + +// single-symbols decoding +type dEntrySingle struct { + entry uint16 +} + +// double-symbols decoding +type dEntryDouble struct { + seq uint16 + nBits uint8 + len uint8 +} + +// Uses special code for all tables that are < 8 bits. +const use8BitTables = true + +// ReadTable will read a table from the input. +// The size of the input may be larger than the table definition. +// Any content remaining after the table definition will be returned. +// If no Scratch is provided a new one is allocated. +// The returned Scratch can be used for encoding or decoding input using this table. +func ReadTable(in []byte, s *Scratch) (s2 *Scratch, remain []byte, err error) { + s, err = s.prepare(in) + if err != nil { + return s, nil, err + } + if len(in) <= 1 { + return s, nil, errors.New("input too small for table") + } + iSize := in[0] + in = in[1:] + if iSize >= 128 { + // Uncompressed + oSize := iSize - 127 + iSize = (oSize + 1) / 2 + if int(iSize) > len(in) { + return s, nil, errors.New("input too small for table") + } + for n := uint8(0); n < oSize; n += 2 { + v := in[n/2] + s.huffWeight[n] = v >> 4 + s.huffWeight[n+1] = v & 15 + } + s.symbolLen = uint16(oSize) + in = in[iSize:] + } else { + if len(in) < int(iSize) { + return s, nil, fmt.Errorf("input too small for table, want %d bytes, have %d", iSize, len(in)) + } + // FSE compressed weights + s.fse.DecompressLimit = 255 + hw := s.huffWeight[:] + s.fse.Out = hw + b, err := fse.Decompress(in[:iSize], s.fse) + s.fse.Out = nil + if err != nil { + return s, nil, err + } + if len(b) > 255 { + return s, nil, errors.New("corrupt input: output table too large") + } + s.symbolLen = uint16(len(b)) + in = in[iSize:] + } + + // collect weight stats + var rankStats [16]uint32 + weightTotal := uint32(0) + for _, v := range s.huffWeight[:s.symbolLen] { + if v > tableLogMax { + return s, nil, errors.New("corrupt input: weight too large") + } + v2 := v & 15 + rankStats[v2]++ + // (1 << (v2-1)) is slower since the compiler cannot prove that v2 isn't 0. + weightTotal += (1 << v2) >> 1 + } + if weightTotal == 0 { + return s, nil, errors.New("corrupt input: weights zero") + } + + // get last non-null symbol weight (implied, total must be 2^n) + { + tableLog := highBit32(weightTotal) + 1 + if tableLog > tableLogMax { + return s, nil, errors.New("corrupt input: tableLog too big") + } + s.actualTableLog = uint8(tableLog) + // determine last weight + { + total := uint32(1) << tableLog + rest := total - weightTotal + verif := uint32(1) << highBit32(rest) + lastWeight := highBit32(rest) + 1 + if verif != rest { + // last value must be a clean power of 2 + return s, nil, errors.New("corrupt input: last value not power of two") + } + s.huffWeight[s.symbolLen] = uint8(lastWeight) + s.symbolLen++ + rankStats[lastWeight]++ + } + } + + if (rankStats[1] < 2) || (rankStats[1]&1 != 0) { + // by construction : at least 2 elts of rank 1, must be even + return s, nil, errors.New("corrupt input: min elt size, even check failed ") + } + + // TODO: Choose between single/double symbol decoding + + // Calculate starting value for each rank + { + var nextRankStart uint32 + for n := uint8(1); n < s.actualTableLog+1; n++ { + current := nextRankStart + nextRankStart += rankStats[n] << (n - 1) + rankStats[n] = current + } + } + + // fill DTable (always full size) + tSize := 1 << tableLogMax + if len(s.dt.single) != tSize { + s.dt.single = make([]dEntrySingle, tSize) + } + cTable := s.prevTable + if cap(cTable) < maxSymbolValue+1 { + cTable = make([]cTableEntry, 0, maxSymbolValue+1) + } + cTable = cTable[:maxSymbolValue+1] + s.prevTable = cTable[:s.symbolLen] + s.prevTableLog = s.actualTableLog + + for n, w := range s.huffWeight[:s.symbolLen] { + if w == 0 { + cTable[n] = cTableEntry{ + val: 0, + nBits: 0, + } + continue + } + length := (uint32(1) << w) >> 1 + d := dEntrySingle{ + entry: uint16(s.actualTableLog+1-w) | (uint16(n) << 8), + } + + rank := &rankStats[w] + cTable[n] = cTableEntry{ + val: uint16(*rank >> (w - 1)), + nBits: uint8(d.entry), + } + + single := s.dt.single[*rank : *rank+length] + for i := range single { + single[i] = d + } + *rank += length + } + + return s, in, nil +} + +// Decompress1X will decompress a 1X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. +// deprecated: Use the stateless Decoder() to get a concurrent version. +func (s *Scratch) Decompress1X(in []byte) (out []byte, err error) { + if cap(s.Out) < s.MaxDecodedSize { + s.Out = make([]byte, s.MaxDecodedSize) + } + s.Out = s.Out[:0:s.MaxDecodedSize] + s.Out, err = s.Decoder().Decompress1X(s.Out, in) + return s.Out, err +} + +// Decompress4X will decompress a 4X encoded stream. +// Before this is called, the table must be initialized with ReadTable unless +// the encoder re-used the table. +// The length of the supplied input must match the end of a block exactly. +// The destination size of the uncompressed data must be known and provided. +// deprecated: Use the stateless Decoder() to get a concurrent version. +func (s *Scratch) Decompress4X(in []byte, dstSize int) (out []byte, err error) { + if dstSize > s.MaxDecodedSize { + return nil, ErrMaxDecodedSizeExceeded + } + if cap(s.Out) < dstSize { + s.Out = make([]byte, s.MaxDecodedSize) + } + s.Out = s.Out[:0:dstSize] + s.Out, err = s.Decoder().Decompress4X(s.Out, in) + return s.Out, err +} + +// Decoder will return a stateless decoder that can be used by multiple +// decompressors concurrently. +// Before this is called, the table must be initialized with ReadTable. +// The Decoder is still linked to the scratch buffer so that cannot be reused. +// However, it is safe to discard the scratch. +func (s *Scratch) Decoder() *Decoder { + return &Decoder{ + dt: s.dt, + actualTableLog: s.actualTableLog, + } +} + +// Decoder provides stateless decoding. +type Decoder struct { + dt dTable + actualTableLog uint8 +} + +// Decompress1X will decompress a 1X encoded stream. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) Decompress1X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress1X8Bit(dst, src) + } + var br bitReaderShifted + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + dt := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + + for br.off >= 8 { + br.fillFast() + v := dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + // Refill + br.fillFast() + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekBitsFast(d.actualTableLog)&tlMask] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 8, so uint8 is fine + bitsLeft := uint8(br.off)*8 + 64 - br.bitsRead + for bitsLeft > 0 { + br.fill() + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := d.dt.single[br.peekBitsFast(d.actualTableLog)&tlMask] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= nBits + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8Bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress1X8BitExactly(dst, src) + } + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + + shift := (8 - d.actualTableLog) & 7 + + //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) + for br.off >= 4 { + br.fillFast() + v := dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := dt[br.peekByteFast()>>shift] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} + +// decompress1X8Bit will decompress a 1X encoded stream with tablelog <= 8. +// The cap of the output buffer will be the maximum decompressed size. +// The length of the supplied input must match the end of a block exactly. +func (d *Decoder) decompress1X8BitExactly(dst, src []byte) ([]byte, error) { + var br bitReaderBytes + err := br.init(src) + if err != nil { + return dst, err + } + maxDecodedSize := cap(dst) + dst = dst[:0] + + // Avoid bounds check by always having full sized table. + dt := d.dt.single[:256] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + + const shift = 0 + + //fmt.Printf("mask: %b, tl:%d\n", mask, d.actualTableLog) + for br.off >= 4 { + br.fillFast() + v := dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+0] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+1] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+2] = uint8(v.entry >> 8) + + v = dt[br.peekByteFast()>>shift] + br.advance(uint8(v.entry)) + buf[off+3] = uint8(v.entry >> 8) + + off += 4 + if off == 0 { + if len(dst)+256 > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:]...) + } + } + + if len(dst)+int(off) > maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + dst = append(dst, buf[:off]...) + + // br < 4, so uint8 is fine + bitsLeft := int8(uint8(br.off)*8 + (64 - br.bitsRead)) + for bitsLeft > 0 { + if br.bitsRead >= 64-8 { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + if len(dst) >= maxDecodedSize { + br.close() + return nil, ErrMaxDecodedSizeExceeded + } + v := dt[br.peekByteFast()>>shift] + nBits := uint8(v.entry) + br.advance(nBits) + bitsLeft -= int8(nBits) + dst = append(dst, uint8(v.entry>>8)) + } + return dst, br.close() +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) Decompress4X(dst, src []byte) ([]byte, error) { + if len(d.dt.single) == 0 { + return nil, errors.New("no table loaded") + } + if len(src) < 6+(4*1) { + return nil, errors.New("input too small") + } + if use8BitTables && d.actualTableLog <= 8 { + return d.decompress4X8bit(dst, src) + } + + var br [4]bitReaderShifted + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const tlSize = 1 << tableLogMax + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + var decoded int + + // Decode 2 values from each decoder/loop. + const bufoff = 256 / 4 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) + v := single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream] = uint8(v.entry >> 8) + + val2 := br[stream2].peekBitsFast(d.actualTableLog) + v2 := single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream+1] = uint8(v.entry >> 8) + + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v2 = single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) + } + + { + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + val := br[stream].peekBitsFast(d.actualTableLog) + v := single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream] = uint8(v.entry >> 8) + + val2 := br[stream2].peekBitsFast(d.actualTableLog) + v2 := single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2] = uint8(v2.entry >> 8) + + val = br[stream].peekBitsFast(d.actualTableLog) + v = single[val&tlMask] + br[stream].advance(uint8(v.entry)) + buf[off+bufoff*stream+1] = uint8(v.entry >> 8) + + val2 = br[stream2].peekBitsFast(d.actualTableLog) + v2 = single[val2&tlMask] + br[stream2].advance(uint8(v2.entry)) + buf[off+bufoff*stream2+1] = uint8(v2.entry >> 8) + } + + off += 2 + + if off == bufoff { + if bufoff > dstEvery { + return nil, errors.New("corruption detected: stream overrun 1") + } + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + off = 0 + out = out[bufoff:] + decoded += 256 + // There must at least be 3 buffers left. + if len(out) < dstEvery*3 { + return nil, errors.New("corruption detected: stream overrun 2") + } + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + for i := range br { + offset := dstEvery * i + br := &br[i] + bitsLeft := br.off*8 + uint(64-br.bitsRead) + for bitsLeft > 0 { + br.fill() + if false && br.bitsRead >= 32 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value = (br.value << 32) | uint64(low) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value = (br.value << 8) | uint64(br.in[br.off-1]) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + val := br.peekBitsFast(d.actualTableLog) + v := single[val&tlMask].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= uint(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bit(dst, src []byte) ([]byte, error) { + if d.actualTableLog == 8 { + return d.decompress4X8bitExactly(dst, src) + } + + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + shift := (8 - d.actualTableLog) & 7 + + const tlSize = 1 << 8 + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 / 4 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + { + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + off += 4 + + if off == bufoff { + if bufoff > dstEvery { + return nil, errors.New("corruption detected: stream overrun 1") + } + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + off = 0 + out = out[bufoff:] + decoded += 256 + // There must at least be 3 buffers left. + if len(out) < dstEvery*3 { + return nil, errors.New("corruption detected: stream overrun 2") + } + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + for i := range br { + offset := dstEvery * i + br := &br[i] + bitsLeft := int(br.off*8) + int(64-br.bitsRead) + for bitsLeft > 0 { + if br.finished() { + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + v := single[br.peekByteFast()>>shift].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= int(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// Decompress4X will decompress a 4X encoded stream. +// The length of the supplied input must match the end of a block exactly. +// The *capacity* of the dst slice must match the destination size of +// the uncompressed data exactly. +func (d *Decoder) decompress4X8bitExactly(dst, src []byte) ([]byte, error) { + var br [4]bitReaderBytes + start := 6 + for i := 0; i < 3; i++ { + length := int(src[i*2]) | (int(src[i*2+1]) << 8) + if start+length >= len(src) { + return nil, errors.New("truncated input (or invalid offset)") + } + err := br[i].init(src[start : start+length]) + if err != nil { + return nil, err + } + start += length + } + err := br[3].init(src[start:]) + if err != nil { + return nil, err + } + + // destination, offset to match first output + dstSize := cap(dst) + dst = dst[:dstSize] + out := dst + dstEvery := (dstSize + 3) / 4 + + const shift = 0 + const tlSize = 1 << 8 + const tlMask = tlSize - 1 + single := d.dt.single[:tlSize] + + // Use temp table to avoid bound checks/append penalty. + var buf [256]byte + var off uint8 + var decoded int + + // Decode 4 values from each decoder/loop. + const bufoff = 256 / 4 + for { + if br[0].off < 4 || br[1].off < 4 || br[2].off < 4 || br[3].off < 4 { + break + } + + { + // Interleave 2 decodes. + const stream = 0 + const stream2 = 1 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + { + const stream = 2 + const stream2 = 3 + br[stream].fillFast() + br[stream2].fillFast() + + v := single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 := single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+1] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+1] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+2] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+2] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + + v = single[br[stream].peekByteFast()>>shift].entry + buf[off+bufoff*stream+3] = uint8(v >> 8) + br[stream].advance(uint8(v)) + + v2 = single[br[stream2].peekByteFast()>>shift].entry + buf[off+bufoff*stream2+3] = uint8(v2 >> 8) + br[stream2].advance(uint8(v2)) + } + + off += 4 + + if off == bufoff { + if bufoff > dstEvery { + return nil, errors.New("corruption detected: stream overrun 1") + } + copy(out, buf[:bufoff]) + copy(out[dstEvery:], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:], buf[bufoff*3:bufoff*4]) + off = 0 + out = out[bufoff:] + decoded += 256 + // There must at least be 3 buffers left. + if len(out) < dstEvery*3 { + return nil, errors.New("corruption detected: stream overrun 2") + } + } + } + if off > 0 { + ioff := int(off) + if len(out) < dstEvery*3+ioff { + return nil, errors.New("corruption detected: stream overrun 3") + } + copy(out, buf[:off]) + copy(out[dstEvery:dstEvery+ioff], buf[bufoff:bufoff*2]) + copy(out[dstEvery*2:dstEvery*2+ioff], buf[bufoff*2:bufoff*3]) + copy(out[dstEvery*3:dstEvery*3+ioff], buf[bufoff*3:bufoff*4]) + decoded += int(off) * 4 + out = out[off:] + } + + // Decode remaining. + for i := range br { + offset := dstEvery * i + br := &br[i] + bitsLeft := int(br.off*8) + int(64-br.bitsRead) + for bitsLeft > 0 { + if br.finished() { + return nil, io.ErrUnexpectedEOF + } + if br.bitsRead >= 56 { + if br.off >= 4 { + v := br.in[br.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + br.value |= uint64(low) << (br.bitsRead - 32) + br.bitsRead -= 32 + br.off -= 4 + } else { + for br.off > 0 { + br.value |= uint64(br.in[br.off-1]) << (br.bitsRead - 8) + br.bitsRead -= 8 + br.off-- + } + } + } + // end inline... + if offset >= len(out) { + return nil, errors.New("corruption detected: stream overrun 4") + } + + // Read value and increment offset. + v := single[br.peekByteFast()>>shift].entry + nBits := uint8(v) + br.advance(nBits) + bitsLeft -= int(nBits) + out[offset] = uint8(v >> 8) + offset++ + } + decoded += offset - dstEvery*i + err = br.close() + if err != nil { + return nil, err + } + } + if dstSize != decoded { + return nil, errors.New("corruption detected: short output block") + } + return dst, nil +} + +// matches will compare a decoding table to a coding table. +// Errors are written to the writer. +// Nothing will be written if table is ok. +func (s *Scratch) matches(ct cTable, w io.Writer) { + if s == nil || len(s.dt.single) == 0 { + return + } + dt := s.dt.single[:1<>8) == byte(sym) { + fmt.Fprintf(w, "symbol %x has decoder, but no encoder\n", sym) + errs++ + break + } + } + if errs == 0 { + broken-- + } + continue + } + // Unused bits in input + ub := tablelog - enc.nBits + top := enc.val << ub + // decoder looks at top bits. + dec := dt[top] + if uint8(dec.entry) != enc.nBits { + fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", sym, enc.nBits, uint8(dec.entry)) + errs++ + } + if uint8(dec.entry>>8) != uint8(sym) { + fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", sym, sym, uint8(dec.entry>>8)) + errs++ + } + if errs > 0 { + fmt.Fprintf(w, "%d errros in base, stopping\n", errs) + continue + } + // Ensure that all combinations are covered. + for i := uint16(0); i < (1 << ub); i++ { + vval := top | i + dec := dt[vval] + if uint8(dec.entry) != enc.nBits { + fmt.Fprintf(w, "symbol 0x%x bit size mismatch (enc: %d, dec:%d).\n", vval, enc.nBits, uint8(dec.entry)) + errs++ + } + if uint8(dec.entry>>8) != uint8(sym) { + fmt.Fprintf(w, "symbol 0x%x decoder output mismatch (enc: %d, dec:%d).\n", vval, sym, uint8(dec.entry>>8)) + errs++ + } + if errs > 20 { + fmt.Fprintf(w, "%d errros, stopping\n", errs) + break + } + } + if errs == 0 { + ok++ + broken-- + } + } + if broken > 0 { + fmt.Fprintf(w, "%d broken, %d ok\n", broken, ok) + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/huff0/huff0.go b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/huff0.go new file mode 100644 index 00000000000..7ec2022b650 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/huff0/huff0.go @@ -0,0 +1,273 @@ +// Package huff0 provides fast huffman encoding as used in zstd. +// +// See README.md at https://github.com/klauspost/compress/tree/master/huff0 for details. +package huff0 + +import ( + "errors" + "fmt" + "math" + "math/bits" + + "github.com/klauspost/compress/fse" +) + +const ( + maxSymbolValue = 255 + + // zstandard limits tablelog to 11, see: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#huffman-tree-description + tableLogMax = 11 + tableLogDefault = 11 + minTablelog = 5 + huffNodesLen = 512 + + // BlockSizeMax is maximum input size for a single block uncompressed. + BlockSizeMax = 1<<18 - 1 +) + +var ( + // ErrIncompressible is returned when input is judged to be too hard to compress. + ErrIncompressible = errors.New("input is not compressible") + + // ErrUseRLE is returned from the compressor when the input is a single byte value repeated. + ErrUseRLE = errors.New("input is single value repeated") + + // ErrTooBig is return if input is too large for a single block. + ErrTooBig = errors.New("input too big") + + // ErrMaxDecodedSizeExceeded is return if input is too large for a single block. + ErrMaxDecodedSizeExceeded = errors.New("maximum output size exceeded") +) + +type ReusePolicy uint8 + +const ( + // ReusePolicyAllow will allow reuse if it produces smaller output. + ReusePolicyAllow ReusePolicy = iota + + // ReusePolicyPrefer will re-use aggressively if possible. + // This will not check if a new table will produce smaller output, + // except if the current table is impossible to use or + // compressed output is bigger than input. + ReusePolicyPrefer + + // ReusePolicyNone will disable re-use of tables. + // This is slightly faster than ReusePolicyAllow but may produce larger output. + ReusePolicyNone + + // ReusePolicyMust must allow reuse and produce smaller output. + ReusePolicyMust +) + +type Scratch struct { + count [maxSymbolValue + 1]uint32 + + // Per block parameters. + // These can be used to override compression parameters of the block. + // Do not touch, unless you know what you are doing. + + // Out is output buffer. + // If the scratch is re-used before the caller is done processing the output, + // set this field to nil. + // Otherwise the output buffer will be re-used for next Compression/Decompression step + // and allocation will be avoided. + Out []byte + + // OutTable will contain the table data only, if a new table has been generated. + // Slice of the returned data. + OutTable []byte + + // OutData will contain the compressed data. + // Slice of the returned data. + OutData []byte + + // MaxDecodedSize will set the maximum allowed output size. + // This value will automatically be set to BlockSizeMax if not set. + // Decoders will return ErrMaxDecodedSizeExceeded is this limit is exceeded. + MaxDecodedSize int + + br byteReader + + // MaxSymbolValue will override the maximum symbol value of the next block. + MaxSymbolValue uint8 + + // TableLog will attempt to override the tablelog for the next block. + // Must be <= 11 and >= 5. + TableLog uint8 + + // Reuse will specify the reuse policy + Reuse ReusePolicy + + // WantLogLess allows to specify a log 2 reduction that should at least be achieved, + // otherwise the block will be returned as incompressible. + // The reduction should then at least be (input size >> WantLogLess) + // If WantLogLess == 0 any improvement will do. + WantLogLess uint8 + + symbolLen uint16 // Length of active part of the symbol table. + maxCount int // count of the most probable symbol + clearCount bool // clear count + actualTableLog uint8 // Selected tablelog. + prevTableLog uint8 // Tablelog for previous table + prevTable cTable // Table used for previous compression. + cTable cTable // compression table + dt dTable // decompression table + nodes []nodeElt + tmpOut [4][]byte + fse *fse.Scratch + huffWeight [maxSymbolValue + 1]byte +} + +// TransferCTable will transfer the previously used compression table. +func (s *Scratch) TransferCTable(src *Scratch) { + if cap(s.prevTable) < len(src.prevTable) { + s.prevTable = make(cTable, 0, maxSymbolValue+1) + } + s.prevTable = s.prevTable[:len(src.prevTable)] + copy(s.prevTable, src.prevTable) + s.prevTableLog = src.prevTableLog +} + +func (s *Scratch) prepare(in []byte) (*Scratch, error) { + if len(in) > BlockSizeMax { + return nil, ErrTooBig + } + if s == nil { + s = &Scratch{} + } + if s.MaxSymbolValue == 0 { + s.MaxSymbolValue = maxSymbolValue + } + if s.TableLog == 0 { + s.TableLog = tableLogDefault + } + if s.TableLog > tableLogMax || s.TableLog < minTablelog { + return nil, fmt.Errorf(" invalid tableLog %d (%d -> %d)", s.TableLog, minTablelog, tableLogMax) + } + if s.MaxDecodedSize <= 0 || s.MaxDecodedSize > BlockSizeMax { + s.MaxDecodedSize = BlockSizeMax + } + if s.clearCount && s.maxCount == 0 { + for i := range s.count { + s.count[i] = 0 + } + s.clearCount = false + } + if cap(s.Out) == 0 { + s.Out = make([]byte, 0, len(in)) + } + s.Out = s.Out[:0] + + s.OutTable = nil + s.OutData = nil + if cap(s.nodes) < huffNodesLen+1 { + s.nodes = make([]nodeElt, 0, huffNodesLen+1) + } + s.nodes = s.nodes[:0] + if s.fse == nil { + s.fse = &fse.Scratch{} + } + s.br.init(in) + + return s, nil +} + +type cTable []cTableEntry + +func (c cTable) write(s *Scratch) error { + var ( + // precomputed conversion table + bitsToWeight [tableLogMax + 1]byte + huffLog = s.actualTableLog + // last weight is not saved. + maxSymbolValue = uint8(s.symbolLen - 1) + huffWeight = s.huffWeight[:256] + ) + const ( + maxFSETableLog = 6 + ) + // convert to weight + bitsToWeight[0] = 0 + for n := uint8(1); n < huffLog+1; n++ { + bitsToWeight[n] = huffLog + 1 - n + } + + // Acquire histogram for FSE. + hist := s.fse.Histogram() + hist = hist[:256] + for i := range hist[:16] { + hist[i] = 0 + } + for n := uint8(0); n < maxSymbolValue; n++ { + v := bitsToWeight[c[n].nBits] & 15 + huffWeight[n] = v + hist[v]++ + } + + // FSE compress if feasible. + if maxSymbolValue >= 2 { + huffMaxCnt := uint32(0) + huffMax := uint8(0) + for i, v := range hist[:16] { + if v == 0 { + continue + } + huffMax = byte(i) + if v > huffMaxCnt { + huffMaxCnt = v + } + } + s.fse.HistogramFinished(huffMax, int(huffMaxCnt)) + s.fse.TableLog = maxFSETableLog + b, err := fse.Compress(huffWeight[:maxSymbolValue], s.fse) + if err == nil && len(b) < int(s.symbolLen>>1) { + s.Out = append(s.Out, uint8(len(b))) + s.Out = append(s.Out, b...) + return nil + } + // Unable to compress (RLE/uncompressible) + } + // write raw values as 4-bits (max : 15) + if maxSymbolValue > (256 - 128) { + // should not happen : likely means source cannot be compressed + return ErrIncompressible + } + op := s.Out + // special case, pack weights 4 bits/weight. + op = append(op, 128|(maxSymbolValue-1)) + // be sure it doesn't cause msan issue in final combination + huffWeight[maxSymbolValue] = 0 + for n := uint16(0); n < uint16(maxSymbolValue); n += 2 { + op = append(op, (huffWeight[n]<<4)|huffWeight[n+1]) + } + s.Out = op + return nil +} + +// estimateSize returns the estimated size in bytes of the input represented in the +// histogram supplied. +func (c cTable) estimateSize(hist []uint32) int { + nbBits := uint32(7) + for i, v := range c[:len(hist)] { + nbBits += uint32(v.nBits) * hist[i] + } + return int(nbBits >> 3) +} + +// minSize returns the minimum possible size considering the shannon limit. +func (s *Scratch) minSize(total int) int { + nbBits := float64(7) + fTotal := float64(total) + for _, v := range s.count[:s.symbolLen] { + n := float64(v) + if n > 0 { + nbBits += math.Log2(fTotal/n) * n + } + } + return int(nbBits) >> 3 +} + +func highBit32(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/.gitignore b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/.gitignore new file mode 100644 index 00000000000..042091d9b3b --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/.gitignore @@ -0,0 +1,16 @@ +cmd/snappytool/snappytool +testdata/bench + +# These explicitly listed benchmark data files are for an obsolete version of +# snappy_test.go. +testdata/alice29.txt +testdata/asyoulik.txt +testdata/fireworks.jpeg +testdata/geo.protodata +testdata/html +testdata/html_x_4 +testdata/kppkn.gtb +testdata/lcet10.txt +testdata/paper-100k.pdf +testdata/plrabn12.txt +testdata/urls.10K diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/AUTHORS b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/AUTHORS new file mode 100644 index 00000000000..bcfa19520af --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/AUTHORS @@ -0,0 +1,15 @@ +# This is the official list of Snappy-Go authors for copyright purposes. +# This file is distinct from the CONTRIBUTORS files. +# See the latter for an explanation. + +# Names should be added to this file as +# Name or Organization +# The email address is not required for organizations. + +# Please keep the list sorted. + +Damian Gryski +Google Inc. +Jan Mercl <0xjnml@gmail.com> +Rodolfo Carvalho +Sebastien Binet diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS new file mode 100644 index 00000000000..931ae31606f --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/CONTRIBUTORS @@ -0,0 +1,37 @@ +# This is the official list of people who can contribute +# (and typically have contributed) code to the Snappy-Go repository. +# The AUTHORS file lists the copyright holders; this file +# lists people. For example, Google employees are listed here +# but not in AUTHORS, because Google holds the copyright. +# +# The submission process automatically checks to make sure +# that people submitting code are listed in this file (by email address). +# +# Names should be added to this file only after verifying that +# the individual or the individual's organization has agreed to +# the appropriate Contributor License Agreement, found here: +# +# http://code.google.com/legal/individual-cla-v1.0.html +# http://code.google.com/legal/corporate-cla-v1.0.html +# +# The agreement for individuals can be filled out on the web. +# +# When adding J Random Contributor's name to this file, +# either J's name or J's organization's name should be +# added to the AUTHORS file, depending on whether the +# individual or corporate CLA was used. + +# Names should be added to this file like so: +# Name + +# Please keep the list sorted. + +Damian Gryski +Jan Mercl <0xjnml@gmail.com> +Kai Backman +Marc-Antoine Ruel +Nigel Tao +Rob Pike +Rodolfo Carvalho +Russ Cox +Sebastien Binet diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/LICENSE b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/LICENSE new file mode 100644 index 00000000000..6050c10f4c8 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2011 The Snappy-Go Authors. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/README b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/README new file mode 100644 index 00000000000..cea12879a0e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/README @@ -0,0 +1,107 @@ +The Snappy compression format in the Go programming language. + +To download and install from source: +$ go get github.com/golang/snappy + +Unless otherwise noted, the Snappy-Go source files are distributed +under the BSD-style license found in the LICENSE file. + + + +Benchmarks. + +The golang/snappy benchmarks include compressing (Z) and decompressing (U) ten +or so files, the same set used by the C++ Snappy code (github.com/google/snappy +and note the "google", not "golang"). On an "Intel(R) Core(TM) i7-3770 CPU @ +3.40GHz", Go's GOARCH=amd64 numbers as of 2016-05-29: + +"go test -test.bench=." + +_UFlat0-8 2.19GB/s ± 0% html +_UFlat1-8 1.41GB/s ± 0% urls +_UFlat2-8 23.5GB/s ± 2% jpg +_UFlat3-8 1.91GB/s ± 0% jpg_200 +_UFlat4-8 14.0GB/s ± 1% pdf +_UFlat5-8 1.97GB/s ± 0% html4 +_UFlat6-8 814MB/s ± 0% txt1 +_UFlat7-8 785MB/s ± 0% txt2 +_UFlat8-8 857MB/s ± 0% txt3 +_UFlat9-8 719MB/s ± 1% txt4 +_UFlat10-8 2.84GB/s ± 0% pb +_UFlat11-8 1.05GB/s ± 0% gaviota + +_ZFlat0-8 1.04GB/s ± 0% html +_ZFlat1-8 534MB/s ± 0% urls +_ZFlat2-8 15.7GB/s ± 1% jpg +_ZFlat3-8 740MB/s ± 3% jpg_200 +_ZFlat4-8 9.20GB/s ± 1% pdf +_ZFlat5-8 991MB/s ± 0% html4 +_ZFlat6-8 379MB/s ± 0% txt1 +_ZFlat7-8 352MB/s ± 0% txt2 +_ZFlat8-8 396MB/s ± 1% txt3 +_ZFlat9-8 327MB/s ± 1% txt4 +_ZFlat10-8 1.33GB/s ± 1% pb +_ZFlat11-8 605MB/s ± 1% gaviota + + + +"go test -test.bench=. -tags=noasm" + +_UFlat0-8 621MB/s ± 2% html +_UFlat1-8 494MB/s ± 1% urls +_UFlat2-8 23.2GB/s ± 1% jpg +_UFlat3-8 1.12GB/s ± 1% jpg_200 +_UFlat4-8 4.35GB/s ± 1% pdf +_UFlat5-8 609MB/s ± 0% html4 +_UFlat6-8 296MB/s ± 0% txt1 +_UFlat7-8 288MB/s ± 0% txt2 +_UFlat8-8 309MB/s ± 1% txt3 +_UFlat9-8 280MB/s ± 1% txt4 +_UFlat10-8 753MB/s ± 0% pb +_UFlat11-8 400MB/s ± 0% gaviota + +_ZFlat0-8 409MB/s ± 1% html +_ZFlat1-8 250MB/s ± 1% urls +_ZFlat2-8 12.3GB/s ± 1% jpg +_ZFlat3-8 132MB/s ± 0% jpg_200 +_ZFlat4-8 2.92GB/s ± 0% pdf +_ZFlat5-8 405MB/s ± 1% html4 +_ZFlat6-8 179MB/s ± 1% txt1 +_ZFlat7-8 170MB/s ± 1% txt2 +_ZFlat8-8 189MB/s ± 1% txt3 +_ZFlat9-8 164MB/s ± 1% txt4 +_ZFlat10-8 479MB/s ± 1% pb +_ZFlat11-8 270MB/s ± 1% gaviota + + + +For comparison (Go's encoded output is byte-for-byte identical to C++'s), here +are the numbers from C++ Snappy's + +make CXXFLAGS="-O2 -DNDEBUG -g" clean snappy_unittest.log && cat snappy_unittest.log + +BM_UFlat/0 2.4GB/s html +BM_UFlat/1 1.4GB/s urls +BM_UFlat/2 21.8GB/s jpg +BM_UFlat/3 1.5GB/s jpg_200 +BM_UFlat/4 13.3GB/s pdf +BM_UFlat/5 2.1GB/s html4 +BM_UFlat/6 1.0GB/s txt1 +BM_UFlat/7 959.4MB/s txt2 +BM_UFlat/8 1.0GB/s txt3 +BM_UFlat/9 864.5MB/s txt4 +BM_UFlat/10 2.9GB/s pb +BM_UFlat/11 1.2GB/s gaviota + +BM_ZFlat/0 944.3MB/s html (22.31 %) +BM_ZFlat/1 501.6MB/s urls (47.78 %) +BM_ZFlat/2 14.3GB/s jpg (99.95 %) +BM_ZFlat/3 538.3MB/s jpg_200 (73.00 %) +BM_ZFlat/4 8.3GB/s pdf (83.30 %) +BM_ZFlat/5 903.5MB/s html4 (22.52 %) +BM_ZFlat/6 336.0MB/s txt1 (57.88 %) +BM_ZFlat/7 312.3MB/s txt2 (61.91 %) +BM_ZFlat/8 353.1MB/s txt3 (54.99 %) +BM_ZFlat/9 289.9MB/s txt4 (66.26 %) +BM_ZFlat/10 1.2GB/s pb (19.68 %) +BM_ZFlat/11 527.4MB/s gaviota (37.72 %) diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode.go new file mode 100644 index 00000000000..72efb0353dd --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode.go @@ -0,0 +1,237 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package snappy + +import ( + "encoding/binary" + "errors" + "io" +) + +var ( + // ErrCorrupt reports that the input is invalid. + ErrCorrupt = errors.New("snappy: corrupt input") + // ErrTooLarge reports that the uncompressed length is too large. + ErrTooLarge = errors.New("snappy: decoded block is too large") + // ErrUnsupported reports that the input isn't supported. + ErrUnsupported = errors.New("snappy: unsupported input") + + errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length") +) + +// DecodedLen returns the length of the decoded block. +func DecodedLen(src []byte) (int, error) { + v, _, err := decodedLen(src) + return v, err +} + +// decodedLen returns the length of the decoded block and the number of bytes +// that the length header occupied. +func decodedLen(src []byte) (blockLen, headerLen int, err error) { + v, n := binary.Uvarint(src) + if n <= 0 || v > 0xffffffff { + return 0, 0, ErrCorrupt + } + + const wordSize = 32 << (^uint(0) >> 32 & 1) + if wordSize == 32 && v > 0x7fffffff { + return 0, 0, ErrTooLarge + } + return int(v), n, nil +} + +const ( + decodeErrCodeCorrupt = 1 + decodeErrCodeUnsupportedLiteralLength = 2 +) + +// Decode returns the decoded form of src. The returned slice may be a sub- +// slice of dst if dst was large enough to hold the entire decoded block. +// Otherwise, a newly allocated slice will be returned. +// +// The dst and src must not overlap. It is valid to pass a nil dst. +func Decode(dst, src []byte) ([]byte, error) { + dLen, s, err := decodedLen(src) + if err != nil { + return nil, err + } + if dLen <= len(dst) { + dst = dst[:dLen] + } else { + dst = make([]byte, dLen) + } + switch decode(dst, src[s:]) { + case 0: + return dst, nil + case decodeErrCodeUnsupportedLiteralLength: + return nil, errUnsupportedLiteralLength + } + return nil, ErrCorrupt +} + +// NewReader returns a new Reader that decompresses from r, using the framing +// format described at +// https://github.com/google/snappy/blob/master/framing_format.txt +func NewReader(r io.Reader) *Reader { + return &Reader{ + r: r, + decoded: make([]byte, maxBlockSize), + buf: make([]byte, maxEncodedLenOfMaxBlockSize+checksumSize), + } +} + +// Reader is an io.Reader that can read Snappy-compressed bytes. +type Reader struct { + r io.Reader + err error + decoded []byte + buf []byte + // decoded[i:j] contains decoded bytes that have not yet been passed on. + i, j int + readHeader bool +} + +// Reset discards any buffered data, resets all state, and switches the Snappy +// reader to read from r. This permits reusing a Reader rather than allocating +// a new one. +func (r *Reader) Reset(reader io.Reader) { + r.r = reader + r.err = nil + r.i = 0 + r.j = 0 + r.readHeader = false +} + +func (r *Reader) readFull(p []byte, allowEOF bool) (ok bool) { + if _, r.err = io.ReadFull(r.r, p); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrCorrupt + } + return false + } + return true +} + +// Read satisfies the io.Reader interface. +func (r *Reader) Read(p []byte) (int, error) { + if r.err != nil { + return 0, r.err + } + for { + if r.i < r.j { + n := copy(p, r.decoded[r.i:r.j]) + r.i += n + return n, nil + } + if !r.readFull(r.buf[:4], true) { + return 0, r.err + } + chunkType := r.buf[0] + if !r.readHeader { + if chunkType != chunkTypeStreamIdentifier { + r.err = ErrCorrupt + return 0, r.err + } + r.readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + if chunkLen > len(r.buf) { + r.err = ErrUnsupported + return 0, r.err + } + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[checksumSize:] + + n, err := DecodedLen(buf) + if err != nil { + r.err = err + return 0, r.err + } + if n > len(r.decoded) { + r.err = ErrCorrupt + return 0, r.err + } + if _, err := Decode(r.decoded, buf); err != nil { + r.err = err + return 0, r.err + } + if crc(r.decoded[:n]) != checksum { + r.err = ErrCorrupt + return 0, r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeUncompressedData: + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < checksumSize { + r.err = ErrCorrupt + return 0, r.err + } + buf := r.buf[:checksumSize] + if !r.readFull(buf, false) { + return 0, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n := chunkLen - checksumSize + if n > len(r.decoded) { + r.err = ErrCorrupt + return 0, r.err + } + if !r.readFull(r.decoded[:n], false) { + return 0, r.err + } + if crc(r.decoded[:n]) != checksum { + r.err = ErrCorrupt + return 0, r.err + } + r.i, r.j = 0, n + continue + + case chunkTypeStreamIdentifier: + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(magicBody) { + r.err = ErrCorrupt + return 0, r.err + } + if !r.readFull(r.buf[:len(magicBody)], false) { + return 0, r.err + } + for i := 0; i < len(magicBody); i++ { + if r.buf[i] != magicBody[i] { + r.err = ErrCorrupt + return 0, r.err + } + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + r.err = ErrUnsupported + return 0, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if !r.readFull(r.buf[:chunkLen], false) { + return 0, r.err + } + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.go new file mode 100644 index 00000000000..fcd192b849e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.go @@ -0,0 +1,14 @@ +// Copyright 2016 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !appengine +// +build gc +// +build !noasm + +package snappy + +// decode has the same semantics as in decode_other.go. +// +//go:noescape +func decode(dst, src []byte) int diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.s b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.s new file mode 100644 index 00000000000..1c66e37234d --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_amd64.s @@ -0,0 +1,482 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !appengine +// +build gc +// +build !noasm + +#include "textflag.h" + +// The asm code generally follows the pure Go code in decode_other.go, except +// where marked with a "!!!". + +// func decode(dst, src []byte) int +// +// All local variables fit into registers. The non-zero stack size is only to +// spill registers and push args when issuing a CALL. The register allocation: +// - AX scratch +// - BX scratch +// - CX length or x +// - DX offset +// - SI &src[s] +// - DI &dst[d] +// + R8 dst_base +// + R9 dst_len +// + R10 dst_base + dst_len +// + R11 src_base +// + R12 src_len +// + R13 src_base + src_len +// - R14 used by doCopy +// - R15 used by doCopy +// +// The registers R8-R13 (marked with a "+") are set at the start of the +// function, and after a CALL returns, and are not otherwise modified. +// +// The d variable is implicitly DI - R8, and len(dst)-d is R10 - DI. +// The s variable is implicitly SI - R11, and len(src)-s is R13 - SI. +TEXT ·decode(SB), NOSPLIT, $48-56 + // Initialize SI, DI and R8-R13. + MOVQ dst_base+0(FP), R8 + MOVQ dst_len+8(FP), R9 + MOVQ R8, DI + MOVQ R8, R10 + ADDQ R9, R10 + MOVQ src_base+24(FP), R11 + MOVQ src_len+32(FP), R12 + MOVQ R11, SI + MOVQ R11, R13 + ADDQ R12, R13 + +loop: + // for s < len(src) + CMPQ SI, R13 + JEQ end + + // CX = uint32(src[s]) + // + // switch src[s] & 0x03 + MOVBLZX (SI), CX + MOVL CX, BX + ANDL $3, BX + CMPL BX, $1 + JAE tagCopy + + // ---------------------------------------- + // The code below handles literal tags. + + // case tagLiteral: + // x := uint32(src[s] >> 2) + // switch + SHRL $2, CX + CMPL CX, $60 + JAE tagLit60Plus + + // case x < 60: + // s++ + INCQ SI + +doLit: + // This is the end of the inner "switch", when we have a literal tag. + // + // We assume that CX == x and x fits in a uint32, where x is the variable + // used in the pure Go decode_other.go code. + + // length = int(x) + 1 + // + // Unlike the pure Go code, we don't need to check if length <= 0 because + // CX can hold 64 bits, so the increment cannot overflow. + INCQ CX + + // Prepare to check if copying length bytes will run past the end of dst or + // src. + // + // AX = len(dst) - d + // BX = len(src) - s + MOVQ R10, AX + SUBQ DI, AX + MOVQ R13, BX + SUBQ SI, BX + + // !!! Try a faster technique for short (16 or fewer bytes) copies. + // + // if length > 16 || len(dst)-d < 16 || len(src)-s < 16 { + // goto callMemmove // Fall back on calling runtime·memmove. + // } + // + // The C++ snappy code calls this TryFastAppend. It also checks len(src)-s + // against 21 instead of 16, because it cannot assume that all of its input + // is contiguous in memory and so it needs to leave enough source bytes to + // read the next tag without refilling buffers, but Go's Decode assumes + // contiguousness (the src argument is a []byte). + CMPQ CX, $16 + JGT callMemmove + CMPQ AX, $16 + JLT callMemmove + CMPQ BX, $16 + JLT callMemmove + + // !!! Implement the copy from src to dst as a 16-byte load and store. + // (Decode's documentation says that dst and src must not overlap.) + // + // This always copies 16 bytes, instead of only length bytes, but that's + // OK. If the input is a valid Snappy encoding then subsequent iterations + // will fix up the overrun. Otherwise, Decode returns a nil []byte (and a + // non-nil error), so the overrun will be ignored. + // + // Note that on amd64, it is legal and cheap to issue unaligned 8-byte or + // 16-byte loads and stores. This technique probably wouldn't be as + // effective on architectures that are fussier about alignment. + MOVOU 0(SI), X0 + MOVOU X0, 0(DI) + + // d += length + // s += length + ADDQ CX, DI + ADDQ CX, SI + JMP loop + +callMemmove: + // if length > len(dst)-d || length > len(src)-s { etc } + CMPQ CX, AX + JGT errCorrupt + CMPQ CX, BX + JGT errCorrupt + + // copy(dst[d:], src[s:s+length]) + // + // This means calling runtime·memmove(&dst[d], &src[s], length), so we push + // DI, SI and CX as arguments. Coincidentally, we also need to spill those + // three registers to the stack, to save local variables across the CALL. + MOVQ DI, 0(SP) + MOVQ SI, 8(SP) + MOVQ CX, 16(SP) + MOVQ DI, 24(SP) + MOVQ SI, 32(SP) + MOVQ CX, 40(SP) + CALL runtime·memmove(SB) + + // Restore local variables: unspill registers from the stack and + // re-calculate R8-R13. + MOVQ 24(SP), DI + MOVQ 32(SP), SI + MOVQ 40(SP), CX + MOVQ dst_base+0(FP), R8 + MOVQ dst_len+8(FP), R9 + MOVQ R8, R10 + ADDQ R9, R10 + MOVQ src_base+24(FP), R11 + MOVQ src_len+32(FP), R12 + MOVQ R11, R13 + ADDQ R12, R13 + + // d += length + // s += length + ADDQ CX, DI + ADDQ CX, SI + JMP loop + +tagLit60Plus: + // !!! This fragment does the + // + // s += x - 58; if uint(s) > uint(len(src)) { etc } + // + // checks. In the asm version, we code it once instead of once per switch case. + ADDQ CX, SI + SUBQ $58, SI + CMPQ SI, R13 + JA errCorrupt + + // case x == 60: + CMPL CX, $61 + JEQ tagLit61 + JA tagLit62Plus + + // x = uint32(src[s-1]) + MOVBLZX -1(SI), CX + JMP doLit + +tagLit61: + // case x == 61: + // x = uint32(src[s-2]) | uint32(src[s-1])<<8 + MOVWLZX -2(SI), CX + JMP doLit + +tagLit62Plus: + CMPL CX, $62 + JA tagLit63 + + // case x == 62: + // x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16 + MOVWLZX -3(SI), CX + MOVBLZX -1(SI), BX + SHLL $16, BX + ORL BX, CX + JMP doLit + +tagLit63: + // case x == 63: + // x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + MOVL -4(SI), CX + JMP doLit + +// The code above handles literal tags. +// ---------------------------------------- +// The code below handles copy tags. + +tagCopy4: + // case tagCopy4: + // s += 5 + ADDQ $5, SI + + // if uint(s) > uint(len(src)) { etc } + CMPQ SI, R13 + JA errCorrupt + + // length = 1 + int(src[s-5])>>2 + SHRQ $2, CX + INCQ CX + + // offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24) + MOVLQZX -4(SI), DX + JMP doCopy + +tagCopy2: + // case tagCopy2: + // s += 3 + ADDQ $3, SI + + // if uint(s) > uint(len(src)) { etc } + CMPQ SI, R13 + JA errCorrupt + + // length = 1 + int(src[s-3])>>2 + SHRQ $2, CX + INCQ CX + + // offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8) + MOVWQZX -2(SI), DX + JMP doCopy + +tagCopy: + // We have a copy tag. We assume that: + // - BX == src[s] & 0x03 + // - CX == src[s] + CMPQ BX, $2 + JEQ tagCopy2 + JA tagCopy4 + + // case tagCopy1: + // s += 2 + ADDQ $2, SI + + // if uint(s) > uint(len(src)) { etc } + CMPQ SI, R13 + JA errCorrupt + + // offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1])) + MOVQ CX, DX + ANDQ $0xe0, DX + SHLQ $3, DX + MOVBQZX -1(SI), BX + ORQ BX, DX + + // length = 4 + int(src[s-2])>>2&0x7 + SHRQ $2, CX + ANDQ $7, CX + ADDQ $4, CX + +doCopy: + // This is the end of the outer "switch", when we have a copy tag. + // + // We assume that: + // - CX == length && CX > 0 + // - DX == offset + + // if offset <= 0 { etc } + CMPQ DX, $0 + JLE errCorrupt + + // if d < offset { etc } + MOVQ DI, BX + SUBQ R8, BX + CMPQ BX, DX + JLT errCorrupt + + // if length > len(dst)-d { etc } + MOVQ R10, BX + SUBQ DI, BX + CMPQ CX, BX + JGT errCorrupt + + // forwardCopy(dst[d:d+length], dst[d-offset:]); d += length + // + // Set: + // - R14 = len(dst)-d + // - R15 = &dst[d-offset] + MOVQ R10, R14 + SUBQ DI, R14 + MOVQ DI, R15 + SUBQ DX, R15 + + // !!! Try a faster technique for short (16 or fewer bytes) forward copies. + // + // First, try using two 8-byte load/stores, similar to the doLit technique + // above. Even if dst[d:d+length] and dst[d-offset:] can overlap, this is + // still OK if offset >= 8. Note that this has to be two 8-byte load/stores + // and not one 16-byte load/store, and the first store has to be before the + // second load, due to the overlap if offset is in the range [8, 16). + // + // if length > 16 || offset < 8 || len(dst)-d < 16 { + // goto slowForwardCopy + // } + // copy 16 bytes + // d += length + CMPQ CX, $16 + JGT slowForwardCopy + CMPQ DX, $8 + JLT slowForwardCopy + CMPQ R14, $16 + JLT slowForwardCopy + MOVQ 0(R15), AX + MOVQ AX, 0(DI) + MOVQ 8(R15), BX + MOVQ BX, 8(DI) + ADDQ CX, DI + JMP loop + +slowForwardCopy: + // !!! If the forward copy is longer than 16 bytes, or if offset < 8, we + // can still try 8-byte load stores, provided we can overrun up to 10 extra + // bytes. As above, the overrun will be fixed up by subsequent iterations + // of the outermost loop. + // + // The C++ snappy code calls this technique IncrementalCopyFastPath. Its + // commentary says: + // + // ---- + // + // The main part of this loop is a simple copy of eight bytes at a time + // until we've copied (at least) the requested amount of bytes. However, + // if d and d-offset are less than eight bytes apart (indicating a + // repeating pattern of length < 8), we first need to expand the pattern in + // order to get the correct results. For instance, if the buffer looks like + // this, with the eight-byte and patterns marked as + // intervals: + // + // abxxxxxxxxxxxx + // [------] d-offset + // [------] d + // + // a single eight-byte copy from to will repeat the pattern + // once, after which we can move two bytes without moving : + // + // ababxxxxxxxxxx + // [------] d-offset + // [------] d + // + // and repeat the exercise until the two no longer overlap. + // + // This allows us to do very well in the special case of one single byte + // repeated many times, without taking a big hit for more general cases. + // + // The worst case of extra writing past the end of the match occurs when + // offset == 1 and length == 1; the last copy will read from byte positions + // [0..7] and write to [4..11], whereas it was only supposed to write to + // position 1. Thus, ten excess bytes. + // + // ---- + // + // That "10 byte overrun" worst case is confirmed by Go's + // TestSlowForwardCopyOverrun, which also tests the fixUpSlowForwardCopy + // and finishSlowForwardCopy algorithm. + // + // if length > len(dst)-d-10 { + // goto verySlowForwardCopy + // } + SUBQ $10, R14 + CMPQ CX, R14 + JGT verySlowForwardCopy + +makeOffsetAtLeast8: + // !!! As above, expand the pattern so that offset >= 8 and we can use + // 8-byte load/stores. + // + // for offset < 8 { + // copy 8 bytes from dst[d-offset:] to dst[d:] + // length -= offset + // d += offset + // offset += offset + // // The two previous lines together means that d-offset, and therefore + // // R15, is unchanged. + // } + CMPQ DX, $8 + JGE fixUpSlowForwardCopy + MOVQ (R15), BX + MOVQ BX, (DI) + SUBQ DX, CX + ADDQ DX, DI + ADDQ DX, DX + JMP makeOffsetAtLeast8 + +fixUpSlowForwardCopy: + // !!! Add length (which might be negative now) to d (implied by DI being + // &dst[d]) so that d ends up at the right place when we jump back to the + // top of the loop. Before we do that, though, we save DI to AX so that, if + // length is positive, copying the remaining length bytes will write to the + // right place. + MOVQ DI, AX + ADDQ CX, DI + +finishSlowForwardCopy: + // !!! Repeat 8-byte load/stores until length <= 0. Ending with a negative + // length means that we overrun, but as above, that will be fixed up by + // subsequent iterations of the outermost loop. + CMPQ CX, $0 + JLE loop + MOVQ (R15), BX + MOVQ BX, (AX) + ADDQ $8, R15 + ADDQ $8, AX + SUBQ $8, CX + JMP finishSlowForwardCopy + +verySlowForwardCopy: + // verySlowForwardCopy is a simple implementation of forward copy. In C + // parlance, this is a do/while loop instead of a while loop, since we know + // that length > 0. In Go syntax: + // + // for { + // dst[d] = dst[d - offset] + // d++ + // length-- + // if length == 0 { + // break + // } + // } + MOVB (R15), BX + MOVB BX, (DI) + INCQ R15 + INCQ DI + DECQ CX + JNZ verySlowForwardCopy + JMP loop + +// The code above handles copy tags. +// ---------------------------------------- + +end: + // This is the end of the "for s < len(src)". + // + // if d != len(dst) { etc } + CMPQ DI, R10 + JNE errCorrupt + + // return 0 + MOVQ $0, ret+48(FP) + RET + +errCorrupt: + // return decodeErrCodeCorrupt + MOVQ $1, ret+48(FP) + RET diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_other.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_other.go new file mode 100644 index 00000000000..94a96c5d7b8 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/decode_other.go @@ -0,0 +1,115 @@ +// Copyright 2016 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64 appengine !gc noasm + +package snappy + +// decode writes the decoding of src to dst. It assumes that the varint-encoded +// length of the decompressed bytes has already been read, and that len(dst) +// equals that length. +// +// It returns 0 on success or a decodeErrCodeXxx error code on failure. +func decode(dst, src []byte) int { + var d, s, offset, length int + for s < len(src) { + switch src[s] & 0x03 { + case tagLiteral: + x := uint32(src[s] >> 2) + switch { + case x < 60: + s++ + case x == 60: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-1]) + case x == 61: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-2]) | uint32(src[s-1])<<8 + case x == 62: + s += 4 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16 + case x == 63: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + length = int(x) + 1 + if length <= 0 { + return decodeErrCodeUnsupportedLiteralLength + } + if length > len(dst)-d || length > len(src)-s { + return decodeErrCodeCorrupt + } + copy(dst[d:], src[s:s+length]) + d += length + s += length + continue + + case tagCopy1: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 4 + int(src[s-2])>>2&0x7 + offset = int(uint32(src[s-2])&0xe0<<3 | uint32(src[s-1])) + + case tagCopy2: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 1 + int(src[s-3])>>2 + offset = int(uint32(src[s-2]) | uint32(src[s-1])<<8) + + case tagCopy4: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + return decodeErrCodeCorrupt + } + length = 1 + int(src[s-5])>>2 + offset = int(uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24) + } + + if offset <= 0 || d < offset || length > len(dst)-d { + return decodeErrCodeCorrupt + } + // Copy from an earlier sub-slice of dst to a later sub-slice. + // If no overlap, use the built-in copy: + if offset > length { + copy(dst[d:d+length], dst[d-offset:]) + d += length + continue + } + + // Unlike the built-in copy function, this byte-by-byte copy always runs + // forwards, even if the slices overlap. Conceptually, this is: + // + // d += forwardCopy(dst[d:d+length], dst[d-offset:]) + // + // We align the slices into a and b and show the compiler they are the same size. + // This allows the loop to run without bounds checks. + a := dst[d : d+length] + b := dst[d-offset:] + b = b[:len(a)] + for i := range a { + a[i] = b[i] + } + d += length + } + if d != len(dst) { + return decodeErrCodeCorrupt + } + return 0 +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode.go new file mode 100644 index 00000000000..8d393e904bb --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode.go @@ -0,0 +1,285 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package snappy + +import ( + "encoding/binary" + "errors" + "io" +) + +// Encode returns the encoded form of src. The returned slice may be a sub- +// slice of dst if dst was large enough to hold the entire encoded block. +// Otherwise, a newly allocated slice will be returned. +// +// The dst and src must not overlap. It is valid to pass a nil dst. +func Encode(dst, src []byte) []byte { + if n := MaxEncodedLen(len(src)); n < 0 { + panic(ErrTooLarge) + } else if len(dst) < n { + dst = make([]byte, n) + } + + // The block starts with the varint-encoded length of the decompressed bytes. + d := binary.PutUvarint(dst, uint64(len(src))) + + for len(src) > 0 { + p := src + src = nil + if len(p) > maxBlockSize { + p, src = p[:maxBlockSize], p[maxBlockSize:] + } + if len(p) < minNonLiteralBlockSize { + d += emitLiteral(dst[d:], p) + } else { + d += encodeBlock(dst[d:], p) + } + } + return dst[:d] +} + +// inputMargin is the minimum number of extra input bytes to keep, inside +// encodeBlock's inner loop. On some architectures, this margin lets us +// implement a fast path for emitLiteral, where the copy of short (<= 16 byte) +// literals can be implemented as a single load to and store from a 16-byte +// register. That literal's actual length can be as short as 1 byte, so this +// can copy up to 15 bytes too much, but that's OK as subsequent iterations of +// the encoding loop will fix up the copy overrun, and this inputMargin ensures +// that we don't overrun the dst and src buffers. +const inputMargin = 16 - 1 + +// minNonLiteralBlockSize is the minimum size of the input to encodeBlock that +// could be encoded with a copy tag. This is the minimum with respect to the +// algorithm used by encodeBlock, not a minimum enforced by the file format. +// +// The encoded output must start with at least a 1 byte literal, as there are +// no previous bytes to copy. A minimal (1 byte) copy after that, generated +// from an emitCopy call in encodeBlock's main loop, would require at least +// another inputMargin bytes, for the reason above: we want any emitLiteral +// calls inside encodeBlock's main loop to use the fast path if possible, which +// requires being able to overrun by inputMargin bytes. Thus, +// minNonLiteralBlockSize equals 1 + 1 + inputMargin. +// +// The C++ code doesn't use this exact threshold, but it could, as discussed at +// https://groups.google.com/d/topic/snappy-compression/oGbhsdIJSJ8/discussion +// The difference between Go (2+inputMargin) and C++ (inputMargin) is purely an +// optimization. It should not affect the encoded form. This is tested by +// TestSameEncodingAsCppShortCopies. +const minNonLiteralBlockSize = 1 + 1 + inputMargin + +// MaxEncodedLen returns the maximum length of a snappy block, given its +// uncompressed length. +// +// It will return a negative value if srcLen is too large to encode. +func MaxEncodedLen(srcLen int) int { + n := uint64(srcLen) + if n > 0xffffffff { + return -1 + } + // Compressed data can be defined as: + // compressed := item* literal* + // item := literal* copy + // + // The trailing literal sequence has a space blowup of at most 62/60 + // since a literal of length 60 needs one tag byte + one extra byte + // for length information. + // + // Item blowup is trickier to measure. Suppose the "copy" op copies + // 4 bytes of data. Because of a special check in the encoding code, + // we produce a 4-byte copy only if the offset is < 65536. Therefore + // the copy op takes 3 bytes to encode, and this type of item leads + // to at most the 62/60 blowup for representing literals. + // + // Suppose the "copy" op copies 5 bytes of data. If the offset is big + // enough, it will take 5 bytes to encode the copy op. Therefore the + // worst case here is a one-byte literal followed by a five-byte copy. + // That is, 6 bytes of input turn into 7 bytes of "compressed" data. + // + // This last factor dominates the blowup, so the final estimate is: + n = 32 + n + n/6 + if n > 0xffffffff { + return -1 + } + return int(n) +} + +var errClosed = errors.New("snappy: Writer is closed") + +// NewWriter returns a new Writer that compresses to w. +// +// The Writer returned does not buffer writes. There is no need to Flush or +// Close such a Writer. +// +// Deprecated: the Writer returned is not suitable for many small writes, only +// for few large writes. Use NewBufferedWriter instead, which is efficient +// regardless of the frequency and shape of the writes, and remember to Close +// that Writer when done. +func NewWriter(w io.Writer) *Writer { + return &Writer{ + w: w, + obuf: make([]byte, obufLen), + } +} + +// NewBufferedWriter returns a new Writer that compresses to w, using the +// framing format described at +// https://github.com/google/snappy/blob/master/framing_format.txt +// +// The Writer returned buffers writes. Users must call Close to guarantee all +// data has been forwarded to the underlying io.Writer. They may also call +// Flush zero or more times before calling Close. +func NewBufferedWriter(w io.Writer) *Writer { + return &Writer{ + w: w, + ibuf: make([]byte, 0, maxBlockSize), + obuf: make([]byte, obufLen), + } +} + +// Writer is an io.Writer that can write Snappy-compressed bytes. +type Writer struct { + w io.Writer + err error + + // ibuf is a buffer for the incoming (uncompressed) bytes. + // + // Its use is optional. For backwards compatibility, Writers created by the + // NewWriter function have ibuf == nil, do not buffer incoming bytes, and + // therefore do not need to be Flush'ed or Close'd. + ibuf []byte + + // obuf is a buffer for the outgoing (compressed) bytes. + obuf []byte + + // wroteStreamHeader is whether we have written the stream header. + wroteStreamHeader bool +} + +// Reset discards the writer's state and switches the Snappy writer to write to +// w. This permits reusing a Writer rather than allocating a new one. +func (w *Writer) Reset(writer io.Writer) { + w.w = writer + w.err = nil + if w.ibuf != nil { + w.ibuf = w.ibuf[:0] + } + w.wroteStreamHeader = false +} + +// Write satisfies the io.Writer interface. +func (w *Writer) Write(p []byte) (nRet int, errRet error) { + if w.ibuf == nil { + // Do not buffer incoming bytes. This does not perform or compress well + // if the caller of Writer.Write writes many small slices. This + // behavior is therefore deprecated, but still supported for backwards + // compatibility with code that doesn't explicitly Flush or Close. + return w.write(p) + } + + // The remainder of this method is based on bufio.Writer.Write from the + // standard library. + + for len(p) > (cap(w.ibuf)-len(w.ibuf)) && w.err == nil { + var n int + if len(w.ibuf) == 0 { + // Large write, empty buffer. + // Write directly from p to avoid copy. + n, _ = w.write(p) + } else { + n = copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + w.Flush() + } + nRet += n + p = p[n:] + } + if w.err != nil { + return nRet, w.err + } + n := copy(w.ibuf[len(w.ibuf):cap(w.ibuf)], p) + w.ibuf = w.ibuf[:len(w.ibuf)+n] + nRet += n + return nRet, nil +} + +func (w *Writer) write(p []byte) (nRet int, errRet error) { + if w.err != nil { + return 0, w.err + } + for len(p) > 0 { + obufStart := len(magicChunk) + if !w.wroteStreamHeader { + w.wroteStreamHeader = true + copy(w.obuf, magicChunk) + obufStart = 0 + } + + var uncompressed []byte + if len(p) > maxBlockSize { + uncompressed, p = p[:maxBlockSize], p[maxBlockSize:] + } else { + uncompressed, p = p, nil + } + checksum := crc(uncompressed) + + // Compress the buffer, discarding the result if the improvement + // isn't at least 12.5%. + compressed := Encode(w.obuf[obufHeaderLen:], uncompressed) + chunkType := uint8(chunkTypeCompressedData) + chunkLen := 4 + len(compressed) + obufEnd := obufHeaderLen + len(compressed) + if len(compressed) >= len(uncompressed)-len(uncompressed)/8 { + chunkType = chunkTypeUncompressedData + chunkLen = 4 + len(uncompressed) + obufEnd = obufHeaderLen + } + + // Fill in the per-chunk header that comes before the body. + w.obuf[len(magicChunk)+0] = chunkType + w.obuf[len(magicChunk)+1] = uint8(chunkLen >> 0) + w.obuf[len(magicChunk)+2] = uint8(chunkLen >> 8) + w.obuf[len(magicChunk)+3] = uint8(chunkLen >> 16) + w.obuf[len(magicChunk)+4] = uint8(checksum >> 0) + w.obuf[len(magicChunk)+5] = uint8(checksum >> 8) + w.obuf[len(magicChunk)+6] = uint8(checksum >> 16) + w.obuf[len(magicChunk)+7] = uint8(checksum >> 24) + + if _, err := w.w.Write(w.obuf[obufStart:obufEnd]); err != nil { + w.err = err + return nRet, err + } + if chunkType == chunkTypeUncompressedData { + if _, err := w.w.Write(uncompressed); err != nil { + w.err = err + return nRet, err + } + } + nRet += len(uncompressed) + } + return nRet, nil +} + +// Flush flushes the Writer to its underlying io.Writer. +func (w *Writer) Flush() error { + if w.err != nil { + return w.err + } + if len(w.ibuf) == 0 { + return nil + } + w.write(w.ibuf) + w.ibuf = w.ibuf[:0] + return w.err +} + +// Close calls Flush and then closes the Writer. +func (w *Writer) Close() error { + w.Flush() + ret := w.err + if w.err == nil { + w.err = errClosed + } + return ret +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.go new file mode 100644 index 00000000000..150d91bc8be --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.go @@ -0,0 +1,29 @@ +// Copyright 2016 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !appengine +// +build gc +// +build !noasm + +package snappy + +// emitLiteral has the same semantics as in encode_other.go. +// +//go:noescape +func emitLiteral(dst, lit []byte) int + +// emitCopy has the same semantics as in encode_other.go. +// +//go:noescape +func emitCopy(dst []byte, offset, length int) int + +// extendMatch has the same semantics as in encode_other.go. +// +//go:noescape +func extendMatch(src []byte, i, j int) int + +// encodeBlock has the same semantics as in encode_other.go. +// +//go:noescape +func encodeBlock(dst, src []byte) (d int) diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.s b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.s new file mode 100644 index 00000000000..adfd979fe27 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_amd64.s @@ -0,0 +1,730 @@ +// Copyright 2016 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !appengine +// +build gc +// +build !noasm + +#include "textflag.h" + +// The XXX lines assemble on Go 1.4, 1.5 and 1.7, but not 1.6, due to a +// Go toolchain regression. See https://github.com/golang/go/issues/15426 and +// https://github.com/golang/snappy/issues/29 +// +// As a workaround, the package was built with a known good assembler, and +// those instructions were disassembled by "objdump -d" to yield the +// 4e 0f b7 7c 5c 78 movzwq 0x78(%rsp,%r11,2),%r15 +// style comments, in AT&T asm syntax. Note that rsp here is a physical +// register, not Go/asm's SP pseudo-register (see https://golang.org/doc/asm). +// The instructions were then encoded as "BYTE $0x.." sequences, which assemble +// fine on Go 1.6. + +// The asm code generally follows the pure Go code in encode_other.go, except +// where marked with a "!!!". + +// ---------------------------------------------------------------------------- + +// func emitLiteral(dst, lit []byte) int +// +// All local variables fit into registers. The register allocation: +// - AX len(lit) +// - BX n +// - DX return value +// - DI &dst[i] +// - R10 &lit[0] +// +// The 24 bytes of stack space is to call runtime·memmove. +// +// The unusual register allocation of local variables, such as R10 for the +// source pointer, matches the allocation used at the call site in encodeBlock, +// which makes it easier to manually inline this function. +TEXT ·emitLiteral(SB), NOSPLIT, $24-56 + MOVQ dst_base+0(FP), DI + MOVQ lit_base+24(FP), R10 + MOVQ lit_len+32(FP), AX + MOVQ AX, DX + MOVL AX, BX + SUBL $1, BX + + CMPL BX, $60 + JLT oneByte + CMPL BX, $256 + JLT twoBytes + +threeBytes: + MOVB $0xf4, 0(DI) + MOVW BX, 1(DI) + ADDQ $3, DI + ADDQ $3, DX + JMP memmove + +twoBytes: + MOVB $0xf0, 0(DI) + MOVB BX, 1(DI) + ADDQ $2, DI + ADDQ $2, DX + JMP memmove + +oneByte: + SHLB $2, BX + MOVB BX, 0(DI) + ADDQ $1, DI + ADDQ $1, DX + +memmove: + MOVQ DX, ret+48(FP) + + // copy(dst[i:], lit) + // + // This means calling runtime·memmove(&dst[i], &lit[0], len(lit)), so we push + // DI, R10 and AX as arguments. + MOVQ DI, 0(SP) + MOVQ R10, 8(SP) + MOVQ AX, 16(SP) + CALL runtime·memmove(SB) + RET + +// ---------------------------------------------------------------------------- + +// func emitCopy(dst []byte, offset, length int) int +// +// All local variables fit into registers. The register allocation: +// - AX length +// - SI &dst[0] +// - DI &dst[i] +// - R11 offset +// +// The unusual register allocation of local variables, such as R11 for the +// offset, matches the allocation used at the call site in encodeBlock, which +// makes it easier to manually inline this function. +TEXT ·emitCopy(SB), NOSPLIT, $0-48 + MOVQ dst_base+0(FP), DI + MOVQ DI, SI + MOVQ offset+24(FP), R11 + MOVQ length+32(FP), AX + +loop0: + // for length >= 68 { etc } + CMPL AX, $68 + JLT step1 + + // Emit a length 64 copy, encoded as 3 bytes. + MOVB $0xfe, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + SUBL $64, AX + JMP loop0 + +step1: + // if length > 64 { etc } + CMPL AX, $64 + JLE step2 + + // Emit a length 60 copy, encoded as 3 bytes. + MOVB $0xee, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + SUBL $60, AX + +step2: + // if length >= 12 || offset >= 2048 { goto step3 } + CMPL AX, $12 + JGE step3 + CMPL R11, $2048 + JGE step3 + + // Emit the remaining copy, encoded as 2 bytes. + MOVB R11, 1(DI) + SHRL $8, R11 + SHLB $5, R11 + SUBB $4, AX + SHLB $2, AX + ORB AX, R11 + ORB $1, R11 + MOVB R11, 0(DI) + ADDQ $2, DI + + // Return the number of bytes written. + SUBQ SI, DI + MOVQ DI, ret+40(FP) + RET + +step3: + // Emit the remaining copy, encoded as 3 bytes. + SUBL $1, AX + SHLB $2, AX + ORB $2, AX + MOVB AX, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + + // Return the number of bytes written. + SUBQ SI, DI + MOVQ DI, ret+40(FP) + RET + +// ---------------------------------------------------------------------------- + +// func extendMatch(src []byte, i, j int) int +// +// All local variables fit into registers. The register allocation: +// - DX &src[0] +// - SI &src[j] +// - R13 &src[len(src) - 8] +// - R14 &src[len(src)] +// - R15 &src[i] +// +// The unusual register allocation of local variables, such as R15 for a source +// pointer, matches the allocation used at the call site in encodeBlock, which +// makes it easier to manually inline this function. +TEXT ·extendMatch(SB), NOSPLIT, $0-48 + MOVQ src_base+0(FP), DX + MOVQ src_len+8(FP), R14 + MOVQ i+24(FP), R15 + MOVQ j+32(FP), SI + ADDQ DX, R14 + ADDQ DX, R15 + ADDQ DX, SI + MOVQ R14, R13 + SUBQ $8, R13 + +cmp8: + // As long as we are 8 or more bytes before the end of src, we can load and + // compare 8 bytes at a time. If those 8 bytes are equal, repeat. + CMPQ SI, R13 + JA cmp1 + MOVQ (R15), AX + MOVQ (SI), BX + CMPQ AX, BX + JNE bsf + ADDQ $8, R15 + ADDQ $8, SI + JMP cmp8 + +bsf: + // If those 8 bytes were not equal, XOR the two 8 byte values, and return + // the index of the first byte that differs. The BSF instruction finds the + // least significant 1 bit, the amd64 architecture is little-endian, and + // the shift by 3 converts a bit index to a byte index. + XORQ AX, BX + BSFQ BX, BX + SHRQ $3, BX + ADDQ BX, SI + + // Convert from &src[ret] to ret. + SUBQ DX, SI + MOVQ SI, ret+40(FP) + RET + +cmp1: + // In src's tail, compare 1 byte at a time. + CMPQ SI, R14 + JAE extendMatchEnd + MOVB (R15), AX + MOVB (SI), BX + CMPB AX, BX + JNE extendMatchEnd + ADDQ $1, R15 + ADDQ $1, SI + JMP cmp1 + +extendMatchEnd: + // Convert from &src[ret] to ret. + SUBQ DX, SI + MOVQ SI, ret+40(FP) + RET + +// ---------------------------------------------------------------------------- + +// func encodeBlock(dst, src []byte) (d int) +// +// All local variables fit into registers, other than "var table". The register +// allocation: +// - AX . . +// - BX . . +// - CX 56 shift (note that amd64 shifts by non-immediates must use CX). +// - DX 64 &src[0], tableSize +// - SI 72 &src[s] +// - DI 80 &dst[d] +// - R9 88 sLimit +// - R10 . &src[nextEmit] +// - R11 96 prevHash, currHash, nextHash, offset +// - R12 104 &src[base], skip +// - R13 . &src[nextS], &src[len(src) - 8] +// - R14 . len(src), bytesBetweenHashLookups, &src[len(src)], x +// - R15 112 candidate +// +// The second column (56, 64, etc) is the stack offset to spill the registers +// when calling other functions. We could pack this slightly tighter, but it's +// simpler to have a dedicated spill map independent of the function called. +// +// "var table [maxTableSize]uint16" takes up 32768 bytes of stack space. An +// extra 56 bytes, to call other functions, and an extra 64 bytes, to spill +// local variables (registers) during calls gives 32768 + 56 + 64 = 32888. +TEXT ·encodeBlock(SB), 0, $32888-56 + MOVQ dst_base+0(FP), DI + MOVQ src_base+24(FP), SI + MOVQ src_len+32(FP), R14 + + // shift, tableSize := uint32(32-8), 1<<8 + MOVQ $24, CX + MOVQ $256, DX + +calcShift: + // for ; tableSize < maxTableSize && tableSize < len(src); tableSize *= 2 { + // shift-- + // } + CMPQ DX, $16384 + JGE varTable + CMPQ DX, R14 + JGE varTable + SUBQ $1, CX + SHLQ $1, DX + JMP calcShift + +varTable: + // var table [maxTableSize]uint16 + // + // In the asm code, unlike the Go code, we can zero-initialize only the + // first tableSize elements. Each uint16 element is 2 bytes and each MOVOU + // writes 16 bytes, so we can do only tableSize/8 writes instead of the + // 2048 writes that would zero-initialize all of table's 32768 bytes. + SHRQ $3, DX + LEAQ table-32768(SP), BX + PXOR X0, X0 + +memclr: + MOVOU X0, 0(BX) + ADDQ $16, BX + SUBQ $1, DX + JNZ memclr + + // !!! DX = &src[0] + MOVQ SI, DX + + // sLimit := len(src) - inputMargin + MOVQ R14, R9 + SUBQ $15, R9 + + // !!! Pre-emptively spill CX, DX and R9 to the stack. Their values don't + // change for the rest of the function. + MOVQ CX, 56(SP) + MOVQ DX, 64(SP) + MOVQ R9, 88(SP) + + // nextEmit := 0 + MOVQ DX, R10 + + // s := 1 + ADDQ $1, SI + + // nextHash := hash(load32(src, s), shift) + MOVL 0(SI), R11 + IMULL $0x1e35a7bd, R11 + SHRL CX, R11 + +outer: + // for { etc } + + // skip := 32 + MOVQ $32, R12 + + // nextS := s + MOVQ SI, R13 + + // candidate := 0 + MOVQ $0, R15 + +inner0: + // for { etc } + + // s := nextS + MOVQ R13, SI + + // bytesBetweenHashLookups := skip >> 5 + MOVQ R12, R14 + SHRQ $5, R14 + + // nextS = s + bytesBetweenHashLookups + ADDQ R14, R13 + + // skip += bytesBetweenHashLookups + ADDQ R14, R12 + + // if nextS > sLimit { goto emitRemainder } + MOVQ R13, AX + SUBQ DX, AX + CMPQ AX, R9 + JA emitRemainder + + // candidate = int(table[nextHash]) + // XXX: MOVWQZX table-32768(SP)(R11*2), R15 + // XXX: 4e 0f b7 7c 5c 78 movzwq 0x78(%rsp,%r11,2),%r15 + BYTE $0x4e + BYTE $0x0f + BYTE $0xb7 + BYTE $0x7c + BYTE $0x5c + BYTE $0x78 + + // table[nextHash] = uint16(s) + MOVQ SI, AX + SUBQ DX, AX + + // XXX: MOVW AX, table-32768(SP)(R11*2) + // XXX: 66 42 89 44 5c 78 mov %ax,0x78(%rsp,%r11,2) + BYTE $0x66 + BYTE $0x42 + BYTE $0x89 + BYTE $0x44 + BYTE $0x5c + BYTE $0x78 + + // nextHash = hash(load32(src, nextS), shift) + MOVL 0(R13), R11 + IMULL $0x1e35a7bd, R11 + SHRL CX, R11 + + // if load32(src, s) != load32(src, candidate) { continue } break + MOVL 0(SI), AX + MOVL (DX)(R15*1), BX + CMPL AX, BX + JNE inner0 + +fourByteMatch: + // As per the encode_other.go code: + // + // A 4-byte match has been found. We'll later see etc. + + // !!! Jump to a fast path for short (<= 16 byte) literals. See the comment + // on inputMargin in encode.go. + MOVQ SI, AX + SUBQ R10, AX + CMPQ AX, $16 + JLE emitLiteralFastPath + + // ---------------------------------------- + // Begin inline of the emitLiteral call. + // + // d += emitLiteral(dst[d:], src[nextEmit:s]) + + MOVL AX, BX + SUBL $1, BX + + CMPL BX, $60 + JLT inlineEmitLiteralOneByte + CMPL BX, $256 + JLT inlineEmitLiteralTwoBytes + +inlineEmitLiteralThreeBytes: + MOVB $0xf4, 0(DI) + MOVW BX, 1(DI) + ADDQ $3, DI + JMP inlineEmitLiteralMemmove + +inlineEmitLiteralTwoBytes: + MOVB $0xf0, 0(DI) + MOVB BX, 1(DI) + ADDQ $2, DI + JMP inlineEmitLiteralMemmove + +inlineEmitLiteralOneByte: + SHLB $2, BX + MOVB BX, 0(DI) + ADDQ $1, DI + +inlineEmitLiteralMemmove: + // Spill local variables (registers) onto the stack; call; unspill. + // + // copy(dst[i:], lit) + // + // This means calling runtime·memmove(&dst[i], &lit[0], len(lit)), so we push + // DI, R10 and AX as arguments. + MOVQ DI, 0(SP) + MOVQ R10, 8(SP) + MOVQ AX, 16(SP) + ADDQ AX, DI // Finish the "d +=" part of "d += emitLiteral(etc)". + MOVQ SI, 72(SP) + MOVQ DI, 80(SP) + MOVQ R15, 112(SP) + CALL runtime·memmove(SB) + MOVQ 56(SP), CX + MOVQ 64(SP), DX + MOVQ 72(SP), SI + MOVQ 80(SP), DI + MOVQ 88(SP), R9 + MOVQ 112(SP), R15 + JMP inner1 + +inlineEmitLiteralEnd: + // End inline of the emitLiteral call. + // ---------------------------------------- + +emitLiteralFastPath: + // !!! Emit the 1-byte encoding "uint8(len(lit)-1)<<2". + MOVB AX, BX + SUBB $1, BX + SHLB $2, BX + MOVB BX, (DI) + ADDQ $1, DI + + // !!! Implement the copy from lit to dst as a 16-byte load and store. + // (Encode's documentation says that dst and src must not overlap.) + // + // This always copies 16 bytes, instead of only len(lit) bytes, but that's + // OK. Subsequent iterations will fix up the overrun. + // + // Note that on amd64, it is legal and cheap to issue unaligned 8-byte or + // 16-byte loads and stores. This technique probably wouldn't be as + // effective on architectures that are fussier about alignment. + MOVOU 0(R10), X0 + MOVOU X0, 0(DI) + ADDQ AX, DI + +inner1: + // for { etc } + + // base := s + MOVQ SI, R12 + + // !!! offset := base - candidate + MOVQ R12, R11 + SUBQ R15, R11 + SUBQ DX, R11 + + // ---------------------------------------- + // Begin inline of the extendMatch call. + // + // s = extendMatch(src, candidate+4, s+4) + + // !!! R14 = &src[len(src)] + MOVQ src_len+32(FP), R14 + ADDQ DX, R14 + + // !!! R13 = &src[len(src) - 8] + MOVQ R14, R13 + SUBQ $8, R13 + + // !!! R15 = &src[candidate + 4] + ADDQ $4, R15 + ADDQ DX, R15 + + // !!! s += 4 + ADDQ $4, SI + +inlineExtendMatchCmp8: + // As long as we are 8 or more bytes before the end of src, we can load and + // compare 8 bytes at a time. If those 8 bytes are equal, repeat. + CMPQ SI, R13 + JA inlineExtendMatchCmp1 + MOVQ (R15), AX + MOVQ (SI), BX + CMPQ AX, BX + JNE inlineExtendMatchBSF + ADDQ $8, R15 + ADDQ $8, SI + JMP inlineExtendMatchCmp8 + +inlineExtendMatchBSF: + // If those 8 bytes were not equal, XOR the two 8 byte values, and return + // the index of the first byte that differs. The BSF instruction finds the + // least significant 1 bit, the amd64 architecture is little-endian, and + // the shift by 3 converts a bit index to a byte index. + XORQ AX, BX + BSFQ BX, BX + SHRQ $3, BX + ADDQ BX, SI + JMP inlineExtendMatchEnd + +inlineExtendMatchCmp1: + // In src's tail, compare 1 byte at a time. + CMPQ SI, R14 + JAE inlineExtendMatchEnd + MOVB (R15), AX + MOVB (SI), BX + CMPB AX, BX + JNE inlineExtendMatchEnd + ADDQ $1, R15 + ADDQ $1, SI + JMP inlineExtendMatchCmp1 + +inlineExtendMatchEnd: + // End inline of the extendMatch call. + // ---------------------------------------- + + // ---------------------------------------- + // Begin inline of the emitCopy call. + // + // d += emitCopy(dst[d:], base-candidate, s-base) + + // !!! length := s - base + MOVQ SI, AX + SUBQ R12, AX + +inlineEmitCopyLoop0: + // for length >= 68 { etc } + CMPL AX, $68 + JLT inlineEmitCopyStep1 + + // Emit a length 64 copy, encoded as 3 bytes. + MOVB $0xfe, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + SUBL $64, AX + JMP inlineEmitCopyLoop0 + +inlineEmitCopyStep1: + // if length > 64 { etc } + CMPL AX, $64 + JLE inlineEmitCopyStep2 + + // Emit a length 60 copy, encoded as 3 bytes. + MOVB $0xee, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + SUBL $60, AX + +inlineEmitCopyStep2: + // if length >= 12 || offset >= 2048 { goto inlineEmitCopyStep3 } + CMPL AX, $12 + JGE inlineEmitCopyStep3 + CMPL R11, $2048 + JGE inlineEmitCopyStep3 + + // Emit the remaining copy, encoded as 2 bytes. + MOVB R11, 1(DI) + SHRL $8, R11 + SHLB $5, R11 + SUBB $4, AX + SHLB $2, AX + ORB AX, R11 + ORB $1, R11 + MOVB R11, 0(DI) + ADDQ $2, DI + JMP inlineEmitCopyEnd + +inlineEmitCopyStep3: + // Emit the remaining copy, encoded as 3 bytes. + SUBL $1, AX + SHLB $2, AX + ORB $2, AX + MOVB AX, 0(DI) + MOVW R11, 1(DI) + ADDQ $3, DI + +inlineEmitCopyEnd: + // End inline of the emitCopy call. + // ---------------------------------------- + + // nextEmit = s + MOVQ SI, R10 + + // if s >= sLimit { goto emitRemainder } + MOVQ SI, AX + SUBQ DX, AX + CMPQ AX, R9 + JAE emitRemainder + + // As per the encode_other.go code: + // + // We could immediately etc. + + // x := load64(src, s-1) + MOVQ -1(SI), R14 + + // prevHash := hash(uint32(x>>0), shift) + MOVL R14, R11 + IMULL $0x1e35a7bd, R11 + SHRL CX, R11 + + // table[prevHash] = uint16(s-1) + MOVQ SI, AX + SUBQ DX, AX + SUBQ $1, AX + + // XXX: MOVW AX, table-32768(SP)(R11*2) + // XXX: 66 42 89 44 5c 78 mov %ax,0x78(%rsp,%r11,2) + BYTE $0x66 + BYTE $0x42 + BYTE $0x89 + BYTE $0x44 + BYTE $0x5c + BYTE $0x78 + + // currHash := hash(uint32(x>>8), shift) + SHRQ $8, R14 + MOVL R14, R11 + IMULL $0x1e35a7bd, R11 + SHRL CX, R11 + + // candidate = int(table[currHash]) + // XXX: MOVWQZX table-32768(SP)(R11*2), R15 + // XXX: 4e 0f b7 7c 5c 78 movzwq 0x78(%rsp,%r11,2),%r15 + BYTE $0x4e + BYTE $0x0f + BYTE $0xb7 + BYTE $0x7c + BYTE $0x5c + BYTE $0x78 + + // table[currHash] = uint16(s) + ADDQ $1, AX + + // XXX: MOVW AX, table-32768(SP)(R11*2) + // XXX: 66 42 89 44 5c 78 mov %ax,0x78(%rsp,%r11,2) + BYTE $0x66 + BYTE $0x42 + BYTE $0x89 + BYTE $0x44 + BYTE $0x5c + BYTE $0x78 + + // if uint32(x>>8) == load32(src, candidate) { continue } + MOVL (DX)(R15*1), BX + CMPL R14, BX + JEQ inner1 + + // nextHash = hash(uint32(x>>16), shift) + SHRQ $8, R14 + MOVL R14, R11 + IMULL $0x1e35a7bd, R11 + SHRL CX, R11 + + // s++ + ADDQ $1, SI + + // break out of the inner1 for loop, i.e. continue the outer loop. + JMP outer + +emitRemainder: + // if nextEmit < len(src) { etc } + MOVQ src_len+32(FP), AX + ADDQ DX, AX + CMPQ R10, AX + JEQ encodeBlockEnd + + // d += emitLiteral(dst[d:], src[nextEmit:]) + // + // Push args. + MOVQ DI, 0(SP) + MOVQ $0, 8(SP) // Unnecessary, as the callee ignores it, but conservative. + MOVQ $0, 16(SP) // Unnecessary, as the callee ignores it, but conservative. + MOVQ R10, 24(SP) + SUBQ R10, AX + MOVQ AX, 32(SP) + MOVQ AX, 40(SP) // Unnecessary, as the callee ignores it, but conservative. + + // Spill local variables (registers) onto the stack; call; unspill. + MOVQ DI, 80(SP) + CALL ·emitLiteral(SB) + MOVQ 80(SP), DI + + // Finish the "d +=" part of "d += emitLiteral(etc)". + ADDQ 48(SP), DI + +encodeBlockEnd: + MOVQ dst_base+0(FP), AX + SUBQ AX, DI + MOVQ DI, d+48(FP) + RET diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_other.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_other.go new file mode 100644 index 00000000000..dbcae905e6e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/encode_other.go @@ -0,0 +1,238 @@ +// Copyright 2016 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// +build !amd64 appengine !gc noasm + +package snappy + +func load32(b []byte, i int) uint32 { + b = b[i : i+4 : len(b)] // Help the compiler eliminate bounds checks on the next line. + return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 +} + +func load64(b []byte, i int) uint64 { + b = b[i : i+8 : len(b)] // Help the compiler eliminate bounds checks on the next line. + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} + +// emitLiteral writes a literal chunk and returns the number of bytes written. +// +// It assumes that: +// dst is long enough to hold the encoded bytes +// 1 <= len(lit) && len(lit) <= 65536 +func emitLiteral(dst, lit []byte) int { + i, n := 0, uint(len(lit)-1) + switch { + case n < 60: + dst[0] = uint8(n)<<2 | tagLiteral + i = 1 + case n < 1<<8: + dst[0] = 60<<2 | tagLiteral + dst[1] = uint8(n) + i = 2 + default: + dst[0] = 61<<2 | tagLiteral + dst[1] = uint8(n) + dst[2] = uint8(n >> 8) + i = 3 + } + return i + copy(dst[i:], lit) +} + +// emitCopy writes a copy chunk and returns the number of bytes written. +// +// It assumes that: +// dst is long enough to hold the encoded bytes +// 1 <= offset && offset <= 65535 +// 4 <= length && length <= 65535 +func emitCopy(dst []byte, offset, length int) int { + i := 0 + // The maximum length for a single tagCopy1 or tagCopy2 op is 64 bytes. The + // threshold for this loop is a little higher (at 68 = 64 + 4), and the + // length emitted down below is is a little lower (at 60 = 64 - 4), because + // it's shorter to encode a length 67 copy as a length 60 tagCopy2 followed + // by a length 7 tagCopy1 (which encodes as 3+2 bytes) than to encode it as + // a length 64 tagCopy2 followed by a length 3 tagCopy2 (which encodes as + // 3+3 bytes). The magic 4 in the 64±4 is because the minimum length for a + // tagCopy1 op is 4 bytes, which is why a length 3 copy has to be an + // encodes-as-3-bytes tagCopy2 instead of an encodes-as-2-bytes tagCopy1. + for length >= 68 { + // Emit a length 64 copy, encoded as 3 bytes. + dst[i+0] = 63<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + i += 3 + length -= 64 + } + if length > 64 { + // Emit a length 60 copy, encoded as 3 bytes. + dst[i+0] = 59<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + i += 3 + length -= 60 + } + if length >= 12 || offset >= 2048 { + // Emit the remaining copy, encoded as 3 bytes. + dst[i+0] = uint8(length-1)<<2 | tagCopy2 + dst[i+1] = uint8(offset) + dst[i+2] = uint8(offset >> 8) + return i + 3 + } + // Emit the remaining copy, encoded as 2 bytes. + dst[i+0] = uint8(offset>>8)<<5 | uint8(length-4)<<2 | tagCopy1 + dst[i+1] = uint8(offset) + return i + 2 +} + +// extendMatch returns the largest k such that k <= len(src) and that +// src[i:i+k-j] and src[j:k] have the same contents. +// +// It assumes that: +// 0 <= i && i < j && j <= len(src) +func extendMatch(src []byte, i, j int) int { + for ; j < len(src) && src[i] == src[j]; i, j = i+1, j+1 { + } + return j +} + +func hash(u, shift uint32) uint32 { + return (u * 0x1e35a7bd) >> shift +} + +// encodeBlock encodes a non-empty src to a guaranteed-large-enough dst. It +// assumes that the varint-encoded length of the decompressed bytes has already +// been written. +// +// It also assumes that: +// len(dst) >= MaxEncodedLen(len(src)) && +// minNonLiteralBlockSize <= len(src) && len(src) <= maxBlockSize +func encodeBlock(dst, src []byte) (d int) { + // Initialize the hash table. Its size ranges from 1<<8 to 1<<14 inclusive. + // The table element type is uint16, as s < sLimit and sLimit < len(src) + // and len(src) <= maxBlockSize and maxBlockSize == 65536. + const ( + maxTableSize = 1 << 14 + // tableMask is redundant, but helps the compiler eliminate bounds + // checks. + tableMask = maxTableSize - 1 + ) + shift := uint32(32 - 8) + for tableSize := 1 << 8; tableSize < maxTableSize && tableSize < len(src); tableSize *= 2 { + shift-- + } + // In Go, all array elements are zero-initialized, so there is no advantage + // to a smaller tableSize per se. However, it matches the C++ algorithm, + // and in the asm versions of this code, we can get away with zeroing only + // the first tableSize elements. + var table [maxTableSize]uint16 + + // sLimit is when to stop looking for offset/length copies. The inputMargin + // lets us use a fast path for emitLiteral in the main loop, while we are + // looking for copies. + sLimit := len(src) - inputMargin + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := 0 + + // The encoded form must start with a literal, as there are no previous + // bytes to copy, so we start looking for hash matches at s == 1. + s := 1 + nextHash := hash(load32(src, s), shift) + + for { + // Copied from the C++ snappy implementation: + // + // Heuristic match skipping: If 32 bytes are scanned with no matches + // found, start looking only at every other byte. If 32 more bytes are + // scanned (or skipped), look at every third byte, etc.. When a match + // is found, immediately go back to looking at every byte. This is a + // small loss (~5% performance, ~0.1% density) for compressible data + // due to more bookkeeping, but for non-compressible data (such as + // JPEG) it's a huge win since the compressor quickly "realizes" the + // data is incompressible and doesn't bother looking for matches + // everywhere. + // + // The "skip" variable keeps track of how many bytes there are since + // the last match; dividing it by 32 (ie. right-shifting by five) gives + // the number of bytes to move ahead for each iteration. + skip := 32 + + nextS := s + candidate := 0 + for { + s = nextS + bytesBetweenHashLookups := skip >> 5 + nextS = s + bytesBetweenHashLookups + skip += bytesBetweenHashLookups + if nextS > sLimit { + goto emitRemainder + } + candidate = int(table[nextHash&tableMask]) + table[nextHash&tableMask] = uint16(s) + nextHash = hash(load32(src, nextS), shift) + if load32(src, s) == load32(src, candidate) { + break + } + } + + // A 4-byte match has been found. We'll later see if more than 4 bytes + // match. But, prior to the match, src[nextEmit:s] are unmatched. Emit + // them as literal bytes. + d += emitLiteral(dst[d:], src[nextEmit:s]) + + // Call emitCopy, and then see if another emitCopy could be our next + // move. Repeat until we find no match for the input immediately after + // what was consumed by the last emitCopy call. + // + // If we exit this loop normally then we need to call emitLiteral next, + // though we don't yet know how big the literal will be. We handle that + // by proceeding to the next iteration of the main loop. We also can + // exit this loop via goto if we get close to exhausting the input. + for { + // Invariant: we have a 4-byte match at s, and no need to emit any + // literal bytes prior to s. + base := s + + // Extend the 4-byte match as long as possible. + // + // This is an inlined version of: + // s = extendMatch(src, candidate+4, s+4) + s += 4 + for i := candidate + 4; s < len(src) && src[i] == src[s]; i, s = i+1, s+1 { + } + + d += emitCopy(dst[d:], base-candidate, s-base) + nextEmit = s + if s >= sLimit { + goto emitRemainder + } + + // We could immediately start working at s now, but to improve + // compression we first update the hash table at s-1 and at s. If + // another emitCopy is not our next move, also calculate nextHash + // at s+1. At least on GOARCH=amd64, these three hash calculations + // are faster as one load64 call (with some shifts) instead of + // three load32 calls. + x := load64(src, s-1) + prevHash := hash(uint32(x>>0), shift) + table[prevHash&tableMask] = uint16(s - 1) + currHash := hash(uint32(x>>8), shift) + candidate = int(table[currHash&tableMask]) + table[currHash&tableMask] = uint16(s) + if uint32(x>>8) != load32(src, candidate) { + nextHash = hash(uint32(x>>16), shift) + s++ + break + } + } + } + +emitRemainder: + if nextEmit < len(src) { + d += emitLiteral(dst[d:], src[nextEmit:]) + } + return d +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/runbench.cmd b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/runbench.cmd new file mode 100644 index 00000000000..d24eb4b47c3 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/runbench.cmd @@ -0,0 +1,2 @@ +del old.txt +go test -bench=. >>old.txt && go test -bench=. >>old.txt && go test -bench=. >>old.txt && benchstat -delta-test=ttest old.txt new.txt diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/snappy/snappy.go b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/snappy.go new file mode 100644 index 00000000000..74a36689e87 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/snappy/snappy.go @@ -0,0 +1,98 @@ +// Copyright 2011 The Snappy-Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package snappy implements the Snappy compression format. It aims for very +// high speeds and reasonable compression. +// +// There are actually two Snappy formats: block and stream. They are related, +// but different: trying to decompress block-compressed data as a Snappy stream +// will fail, and vice versa. The block format is the Decode and Encode +// functions and the stream format is the Reader and Writer types. +// +// The block format, the more common case, is used when the complete size (the +// number of bytes) of the original data is known upfront, at the time +// compression starts. The stream format, also known as the framing format, is +// for when that isn't always true. +// +// The canonical, C++ implementation is at https://github.com/google/snappy and +// it only implements the block format. +package snappy + +import ( + "hash/crc32" +) + +/* +Each encoded block begins with the varint-encoded length of the decoded data, +followed by a sequence of chunks. Chunks begin and end on byte boundaries. The +first byte of each chunk is broken into its 2 least and 6 most significant bits +called l and m: l ranges in [0, 4) and m ranges in [0, 64). l is the chunk tag. +Zero means a literal tag. All other values mean a copy tag. + +For literal tags: + - If m < 60, the next 1 + m bytes are literal bytes. + - Otherwise, let n be the little-endian unsigned integer denoted by the next + m - 59 bytes. The next 1 + n bytes after that are literal bytes. + +For copy tags, length bytes are copied from offset bytes ago, in the style of +Lempel-Ziv compression algorithms. In particular: + - For l == 1, the offset ranges in [0, 1<<11) and the length in [4, 12). + The length is 4 + the low 3 bits of m. The high 3 bits of m form bits 8-10 + of the offset. The next byte is bits 0-7 of the offset. + - For l == 2, the offset ranges in [0, 1<<16) and the length in [1, 65). + The length is 1 + m. The offset is the little-endian unsigned integer + denoted by the next 2 bytes. + - For l == 3, this tag is a legacy format that is no longer issued by most + encoders. Nonetheless, the offset ranges in [0, 1<<32) and the length in + [1, 65). The length is 1 + m. The offset is the little-endian unsigned + integer denoted by the next 4 bytes. +*/ +const ( + tagLiteral = 0x00 + tagCopy1 = 0x01 + tagCopy2 = 0x02 + tagCopy4 = 0x03 +) + +const ( + checksumSize = 4 + chunkHeaderSize = 4 + magicChunk = "\xff\x06\x00\x00" + magicBody + magicBody = "sNaPpY" + + // maxBlockSize is the maximum size of the input to encodeBlock. It is not + // part of the wire format per se, but some parts of the encoder assume + // that an offset fits into a uint16. + // + // Also, for the framing format (Writer type instead of Encode function), + // https://github.com/google/snappy/blob/master/framing_format.txt says + // that "the uncompressed data in a chunk must be no longer than 65536 + // bytes". + maxBlockSize = 65536 + + // maxEncodedLenOfMaxBlockSize equals MaxEncodedLen(maxBlockSize), but is + // hard coded to be a const instead of a variable, so that obufLen can also + // be a const. Their equivalence is confirmed by + // TestMaxEncodedLenOfMaxBlockSize. + maxEncodedLenOfMaxBlockSize = 76490 + + obufHeaderLen = len(magicChunk) + checksumSize + chunkHeaderSize + obufLen = obufHeaderLen + maxEncodedLenOfMaxBlockSize +) + +const ( + chunkTypeCompressedData = 0x00 + chunkTypeUncompressedData = 0x01 + chunkTypePadding = 0xfe + chunkTypeStreamIdentifier = 0xff +) + +var crcTable = crc32.MakeTable(crc32.Castagnoli) + +// crc implements the checksum specified in section 3 of +// https://github.com/google/snappy/blob/master/framing_format.txt +func crc(b []byte) uint32 { + c := crc32.Update(0, crcTable, b) + return uint32(c>>15|c<<17) + 0xa282ead8 +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/README.md b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/README.md new file mode 100644 index 00000000000..07f7285f087 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/README.md @@ -0,0 +1,406 @@ +# zstd + +[Zstandard](https://facebook.github.io/zstd/) is a real-time compression algorithm, providing high compression ratios. +It offers a very wide range of compression / speed trade-off, while being backed by a very fast decoder. +A high performance compression algorithm is implemented. For now focused on speed. + +This package provides [compression](#Compressor) to and [decompression](#Decompressor) of Zstandard content. + +This package is pure Go and without use of "unsafe". + +The `zstd` package is provided as open source software using a Go standard license. + +Currently the package is heavily optimized for 64 bit processors and will be significantly slower on 32 bit processors. + +## Installation + +Install using `go get -u github.com/klauspost/compress`. The package is located in `github.com/klauspost/compress/zstd`. + +Godoc Documentation: https://godoc.org/github.com/klauspost/compress/zstd + + +## Compressor + +### Status: + +STABLE - there may always be subtle bugs, a wide variety of content has been tested and the library is actively +used by several projects. This library is being continuously [fuzz-tested](https://github.com/klauspost/compress-fuzz), +kindly supplied by [fuzzit.dev](https://fuzzit.dev/). + +There may still be specific combinations of data types/size/settings that could lead to edge cases, +so as always, testing is recommended. + +For now, a high speed (fastest) and medium-fast (default) compressor has been implemented. + +The "Fastest" compression ratio is roughly equivalent to zstd level 1. +The "Default" compression ratio is roughly equivalent to zstd level 3 (default). + +In terms of speed, it is typically 2x as fast as the stdlib deflate/gzip in its fastest mode. +The compression ratio compared to stdlib is around level 3, but usually 3x as fast. + +Compared to cgo zstd, the speed is around level 3 (default), but compression slightly worse, between level 1&2. + + +### Usage + +An Encoder can be used for either compressing a stream via the +`io.WriteCloser` interface supported by the Encoder or as multiple independent +tasks via the `EncodeAll` function. +Smaller encodes are encouraged to use the EncodeAll function. +Use `NewWriter` to create a new instance that can be used for both. + +To create a writer with default options, do like this: + +```Go +// Compress input to output. +func Compress(in io.Reader, out io.Writer) error { + w, err := NewWriter(output) + if err != nil { + return err + } + _, err := io.Copy(w, input) + if err != nil { + enc.Close() + return err + } + return enc.Close() +} +``` + +Now you can encode by writing data to `enc`. The output will be finished writing when `Close()` is called. +Even if your encode fails, you should still call `Close()` to release any resources that may be held up. + +The above is fine for big encodes. However, whenever possible try to *reuse* the writer. + +To reuse the encoder, you can use the `Reset(io.Writer)` function to change to another output. +This will allow the encoder to reuse all resources and avoid wasteful allocations. + +Currently stream encoding has 'light' concurrency, meaning up to 2 goroutines can be working on part +of a stream. This is independent of the `WithEncoderConcurrency(n)`, but that is likely to change +in the future. So if you want to limit concurrency for future updates, specify the concurrency +you would like. + +You can specify your desired compression level using `WithEncoderLevel()` option. Currently only pre-defined +compression settings can be specified. + +#### Future Compatibility Guarantees + +This will be an evolving project. When using this package it is important to note that both the compression efficiency and speed may change. + +The goal will be to keep the default efficiency at the default zstd (level 3). +However the encoding should never be assumed to remain the same, +and you should not use hashes of compressed output for similarity checks. + +The Encoder can be assumed to produce the same output from the exact same code version. +However, the may be modes in the future that break this, +although they will not be enabled without an explicit option. + +This encoder is not designed to (and will probably never) output the exact same bitstream as the reference encoder. + +Also note, that the cgo decompressor currently does not [report all errors on invalid input](https://github.com/DataDog/zstd/issues/59), +[omits error checks](https://github.com/DataDog/zstd/issues/61), [ignores checksums](https://github.com/DataDog/zstd/issues/43) +and seems to ignore concatenated streams, even though [it is part of the spec](https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frames). + +#### Blocks + +For compressing small blocks, the returned encoder has a function called `EncodeAll(src, dst []byte) []byte`. + +`EncodeAll` will encode all input in src and append it to dst. +This function can be called concurrently, but each call will only run on a single goroutine. + +Encoded blocks can be concatenated and the result will be the combined input stream. +Data compressed with EncodeAll can be decoded with the Decoder, using either a stream or `DecodeAll`. + +Especially when encoding blocks you should take special care to reuse the encoder. +This will effectively make it run without allocations after a warmup period. +To make it run completely without allocations, supply a destination buffer with space for all content. + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a writer that caches compressors. +// For this operation type we supply a nil Reader. +var encoder, _ = zstd.NewWriter(nil) + +// Compress a buffer. +// If you have a destination buffer, the allocation in the call can also be eliminated. +func Compress(src []byte) []byte { + return encoder.EncodeAll(src, make([]byte, 0, len(src))) +} +``` + +You can control the maximum number of concurrent encodes using the `WithEncoderConcurrency(n)` +option when creating the writer. + +Using the Encoder for both a stream and individual blocks concurrently is safe. + +### Performance + +I have collected some speed examples to compare speed and compression against other compressors. + +* `file` is the input file. +* `out` is the compressor used. `zskp` is this package. `zstd` is the Datadog cgo library. `gzstd/gzkp` is gzip standard and this library. +* `level` is the compression level used. For `zskp` level 1 is "fastest", level 2 is "default". +* `insize`/`outsize` is the input/output size. +* `millis` is the number of milliseconds used for compression. +* `mb/s` is megabytes (2^20 bytes) per second. + +``` +Silesia Corpus: +http://sun.aei.polsl.pl/~sdeor/corpus/silesia.zip + +This package: +file out level insize outsize millis mb/s +silesia.tar zskp 1 211947520 73101992 643 313.87 +silesia.tar zskp 2 211947520 67504318 969 208.38 +silesia.tar zskp 3 211947520 65177448 1899 106.44 + +cgo zstd: +silesia.tar zstd 1 211947520 73605392 543 371.56 +silesia.tar zstd 3 211947520 66793289 864 233.68 +silesia.tar zstd 6 211947520 62916450 1913 105.66 + +gzip, stdlib/this package: +silesia.tar gzstd 1 211947520 80007735 1654 122.21 +silesia.tar gzkp 1 211947520 80369488 1168 173.06 + +GOB stream of binary data. Highly compressible. +https://files.klauspost.com/compress/gob-stream.7z + +file out level insize outsize millis mb/s +gob-stream zskp 1 1911399616 235022249 3088 590.30 +gob-stream zskp 2 1911399616 205669791 3786 481.34 +gob-stream zskp 3 1911399616 185792019 9324 195.48 +gob-stream zstd 1 1911399616 249810424 2637 691.26 +gob-stream zstd 3 1911399616 208192146 3490 522.31 +gob-stream zstd 6 1911399616 193632038 6687 272.56 +gob-stream gzstd 1 1911399616 357382641 10251 177.82 +gob-stream gzkp 1 1911399616 362156523 5695 320.08 + +The test data for the Large Text Compression Benchmark is the first +10^9 bytes of the English Wikipedia dump on Mar. 3, 2006. +http://mattmahoney.net/dc/textdata.html + +file out level insize outsize millis mb/s +enwik9 zskp 1 1000000000 343848582 3609 264.18 +enwik9 zskp 2 1000000000 317276632 5746 165.97 +enwik9 zskp 3 1000000000 294540704 11725 81.34 +enwik9 zstd 1 1000000000 358072021 3110 306.65 +enwik9 zstd 3 1000000000 313734672 4784 199.35 +enwik9 zstd 6 1000000000 295138875 10290 92.68 +enwik9 gzstd 1 1000000000 382578136 9604 99.30 +enwik9 gzkp 1 1000000000 383825945 6544 145.73 + +Highly compressible JSON file. +https://files.klauspost.com/compress/github-june-2days-2019.json.zst + +file out level insize outsize millis mb/s +github-june-2days-2019.json zskp 1 6273951764 699045015 10620 563.40 +github-june-2days-2019.json zskp 2 6273951764 617881763 11687 511.96 +github-june-2days-2019.json zskp 3 6273951764 537511906 29252 204.54 +github-june-2days-2019.json zstd 1 6273951764 766284037 8450 708.00 +github-june-2days-2019.json zstd 3 6273951764 661889476 10927 547.57 +github-june-2days-2019.json zstd 6 6273951764 642756859 22996 260.18 +github-june-2days-2019.json gzstd 1 6273951764 1164400847 29948 199.79 +github-june-2days-2019.json gzkp 1 6273951764 1128755542 19236 311.03 + +VM Image, Linux mint with a few installed applications: +https://files.klauspost.com/compress/rawstudio-mint14.7z + +file out level insize outsize millis mb/s +rawstudio-mint14.tar zskp 1 8558382592 3667489370 20210 403.84 +rawstudio-mint14.tar zskp 2 8558382592 3364592300 31873 256.07 +rawstudio-mint14.tar zskp 3 8558382592 3224594213 71751 113.75 +rawstudio-mint14.tar zstd 1 8558382592 3609250104 17136 476.27 +rawstudio-mint14.tar zstd 3 8558382592 3341679997 29262 278.92 +rawstudio-mint14.tar zstd 6 8558382592 3235846406 77904 104.77 +rawstudio-mint14.tar gzstd 1 8558382592 3926257486 57722 141.40 +rawstudio-mint14.tar gzkp 1 8558382592 3970463184 41749 195.49 + +CSV data: +https://files.klauspost.com/compress/nyc-taxi-data-10M.csv.zst + +file out level insize outsize millis mb/s +nyc-taxi-data-10M.csv zskp 1 3325605752 641339945 8925 355.35 +nyc-taxi-data-10M.csv zskp 2 3325605752 591748091 11268 281.44 +nyc-taxi-data-10M.csv zskp 3 3325605752 538490114 19880 159.53 +nyc-taxi-data-10M.csv zstd 1 3325605752 687399637 8233 385.18 +nyc-taxi-data-10M.csv zstd 3 3325605752 598514411 10065 315.07 +nyc-taxi-data-10M.csv zstd 6 3325605752 570522953 20038 158.27 +nyc-taxi-data-10M.csv gzstd 1 3325605752 928656485 23876 132.83 +nyc-taxi-data-10M.csv gzkp 1 3325605752 924718719 16388 193.53 +``` + +## Decompressor + +Staus: STABLE - there may still be subtle bugs, but a wide variety of content has been tested. + +This library is being continuously [fuzz-tested](https://github.com/klauspost/compress-fuzz), +kindly supplied by [fuzzit.dev](https://fuzzit.dev/). +The main purpose of the fuzz testing is to ensure that it is not possible to crash the decoder, +or run it past its limits with ANY input provided. + +### Usage + +The package has been designed for two main usages, big streams of data and smaller in-memory buffers. +There are two main usages of the package for these. Both of them are accessed by creating a `Decoder`. + +For streaming use a simple setup could look like this: + +```Go +import "github.com/klauspost/compress/zstd" + +func Decompress(in io.Reader, out io.Writer) error { + d, err := zstd.NewReader(in) + if err != nil { + return err + } + defer d.Close() + + // Copy content... + _, err = io.Copy(out, d) + return err +} +``` + +It is important to use the "Close" function when you no longer need the Reader to stop running goroutines. +See "Allocation-less operation" below. + +For decoding buffers, it could look something like this: + +```Go +import "github.com/klauspost/compress/zstd" + +// Create a reader that caches decompressors. +// For this operation type we supply a nil Reader. +var decoder, _ = zstd.NewReader(nil) + +// Decompress a buffer. We don't supply a destination buffer, +// so it will be allocated by the decoder. +func Decompress(src []byte) ([]byte, error) { + return decoder.DecodeAll(src, nil) +} +``` + +Both of these cases should provide the functionality needed. +The decoder can be used for *concurrent* decompression of multiple buffers. +It will only allow a certain number of concurrent operations to run. +To tweak that yourself use the `WithDecoderConcurrency(n)` option when creating the decoder. + +### Dictionaries + +Data compressed with [dictionaries](https://github.com/facebook/zstd#the-case-for-small-data-compression) can be decompressed. + +Dictionaries are added individually to Decoders. +Dictionaries are generated by the `zstd --train` command and contains an initial state for the decoder. +To add a dictionary use the `WithDecoderDicts(dicts ...[]byte)` option with the dictionary data. +Several dictionaries can be added at once. + +The dictionary will be used automatically for the data that specifies them. +A re-used Decoder will still contain the dictionaries registered. + +When registering multiple dictionaries with the same ID, the last one will be used. + +It is possible to use dictionaries when compressing data. + +To enable a dictionary use `WithEncoderDict(dict []byte)`. Here only one dictionary will be used +and it will likely be used even if it doesn't improve compression. + +The used dictionary must be used to decompress the content. + +For any real gains, the dictionary should be built with similar data. +If an unsuitable dictionary is used the output may be slightly larger than using no dictionary. +Use the [zstd commandline tool](https://github.com/facebook/zstd/releases) to build a dictionary from sample data. +For information see [zstd dictionary information](https://github.com/facebook/zstd#the-case-for-small-data-compression). + +For now there is a fixed startup performance penalty for compressing content with dictionaries. +This will likely be improved over time. Just be aware to test performance when implementing. + +### Allocation-less operation + +The decoder has been designed to operate without allocations after a warmup. + +This means that you should *store* the decoder for best performance. +To re-use a stream decoder, use the `Reset(r io.Reader) error` to switch to another stream. +A decoder can safely be re-used even if the previous stream failed. + +To release the resources, you must call the `Close()` function on a decoder. +After this it can *no longer be reused*, but all running goroutines will be stopped. +So you *must* use this if you will no longer need the Reader. + +For decompressing smaller buffers a single decoder can be used. +When decoding buffers, you can supply a destination slice with length 0 and your expected capacity. +In this case no unneeded allocations should be made. + +### Concurrency + +The buffer decoder does everything on the same goroutine and does nothing concurrently. +It can however decode several buffers concurrently. Use `WithDecoderConcurrency(n)` to limit that. + +The stream decoder operates on + +* One goroutine reads input and splits the input to several block decoders. +* A number of decoders will decode blocks. +* A goroutine coordinates these blocks and sends history from one to the next. + +So effectively this also means the decoder will "read ahead" and prepare data to always be available for output. + +Since "blocks" are quite dependent on the output of the previous block stream decoding will only have limited concurrency. + +In practice this means that concurrency is often limited to utilizing about 2 cores effectively. + + +### Benchmarks + +These are some examples of performance compared to [datadog cgo library](https://github.com/DataDog/zstd). + +The first two are streaming decodes and the last are smaller inputs. + +``` +BenchmarkDecoderSilesia-8 3 385000067 ns/op 550.51 MB/s 5498 B/op 8 allocs/op +BenchmarkDecoderSilesiaCgo-8 6 197666567 ns/op 1072.25 MB/s 270672 B/op 8 allocs/op + +BenchmarkDecoderEnwik9-8 1 2027001600 ns/op 493.34 MB/s 10496 B/op 18 allocs/op +BenchmarkDecoderEnwik9Cgo-8 2 979499200 ns/op 1020.93 MB/s 270672 B/op 8 allocs/op + +Concurrent performance: + +BenchmarkDecoder_DecodeAllParallel/kppkn.gtb.zst-16 28915 42469 ns/op 4340.07 MB/s 114 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/geo.protodata.zst-16 116505 9965 ns/op 11900.16 MB/s 16 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/plrabn12.txt.zst-16 8952 134272 ns/op 3588.70 MB/s 915 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/lcet10.txt.zst-16 11820 102538 ns/op 4161.90 MB/s 594 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/asyoulik.txt.zst-16 34782 34184 ns/op 3661.88 MB/s 60 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/alice29.txt.zst-16 27712 43447 ns/op 3500.58 MB/s 99 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html_x_4.zst-16 62826 18750 ns/op 21845.10 MB/s 104 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/paper-100k.pdf.zst-16 631545 1794 ns/op 57078.74 MB/s 2 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/fireworks.jpeg.zst-16 1690140 712 ns/op 172938.13 MB/s 1 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/urls.10K.zst-16 10432 113593 ns/op 6180.73 MB/s 1143 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/html.zst-16 113206 10671 ns/op 9596.27 MB/s 15 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallel/comp-data.bin.zst-16 1530615 779 ns/op 5229.49 MB/s 0 B/op 0 allocs/op + +BenchmarkDecoder_DecodeAllParallelCgo/kppkn.gtb.zst-16 65217 16192 ns/op 11383.34 MB/s 46 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/geo.protodata.zst-16 292671 4039 ns/op 29363.19 MB/s 6 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/plrabn12.txt.zst-16 26314 46021 ns/op 10470.43 MB/s 293 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/lcet10.txt.zst-16 33897 34900 ns/op 12227.96 MB/s 205 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/asyoulik.txt.zst-16 104348 11433 ns/op 10949.01 MB/s 20 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/alice29.txt.zst-16 75949 15510 ns/op 9805.60 MB/s 32 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/html_x_4.zst-16 173910 6756 ns/op 60624.29 MB/s 37 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/paper-100k.pdf.zst-16 923076 1339 ns/op 76474.87 MB/s 1 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/fireworks.jpeg.zst-16 922920 1351 ns/op 91102.57 MB/s 2 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/urls.10K.zst-16 27649 43618 ns/op 16096.19 MB/s 407 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/html.zst-16 279073 4160 ns/op 24614.18 MB/s 6 B/op 0 allocs/op +BenchmarkDecoder_DecodeAllParallelCgo/comp-data.bin.zst-16 749938 1579 ns/op 2581.71 MB/s 0 B/op 0 allocs/op +``` + +This reflects the performance around May 2020, but this may be out of date. + +# Contributions + +Contributions are always welcome. +For new features/fixes, remember to add tests and for performance enhancements include benchmarks. + +For sending files for reproducing errors use a service like [goobox](https://goobox.io/#/upload) or similar to share your files. + +For general feedback and experience reports, feel free to open an issue or write me on [Twitter](https://twitter.com/sh0dan). + +This package includes the excellent [`github.com/cespare/xxhash`](https://github.com/cespare/xxhash) package Copyright (c) 2016 Caleb Spare. diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitreader.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitreader.go new file mode 100644 index 00000000000..85445853715 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitreader.go @@ -0,0 +1,136 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "errors" + "io" + "math/bits" +) + +// bitReader reads a bitstream in reverse. +// The last set bit indicates the start of the stream and is used +// for aligning the input. +type bitReader struct { + in []byte + off uint // next byte to read is at in[off - 1] + value uint64 // Maybe use [16]byte, but shifting is awkward. + bitsRead uint8 +} + +// init initializes and resets the bit reader. +func (b *bitReader) init(in []byte) error { + if len(in) < 1 { + return errors.New("corrupt stream: too short") + } + b.in = in + b.off = uint(len(in)) + // The highest bit of the last byte indicates where to start + v := in[len(in)-1] + if v == 0 { + return errors.New("corrupt stream, did not find end of stream") + } + b.bitsRead = 64 + b.value = 0 + if len(in) >= 8 { + b.fillFastStart() + } else { + b.fill() + b.fill() + } + b.bitsRead += 8 - uint8(highBits(uint32(v))) + return nil +} + +// getBits will return n bits. n can be 0. +func (b *bitReader) getBits(n uint8) int { + if n == 0 /*|| b.bitsRead >= 64 */ { + return 0 + } + return b.getBitsFast(n) +} + +// getBitsFast requires that at least one bit is requested every time. +// There are no checks if the buffer is filled. +func (b *bitReader) getBitsFast(n uint8) int { + const regMask = 64 - 1 + v := uint32((b.value << (b.bitsRead & regMask)) >> ((regMask + 1 - n) & regMask)) + b.bitsRead += n + return int(v) +} + +// fillFast() will make sure at least 32 bits are available. +// There must be at least 4 bytes available. +func (b *bitReader) fillFast() { + if b.bitsRead < 32 { + return + } + // 2 bounds checks. + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 +} + +// fillFastStart() assumes the bitreader is empty and there is at least 8 bytes to read. +func (b *bitReader) fillFastStart() { + // Do single re-slice to avoid bounds checks. + b.value = binary.LittleEndian.Uint64(b.in[b.off-8:]) + b.bitsRead = 0 + b.off -= 8 +} + +// fill() will make sure at least 32 bits are available. +func (b *bitReader) fill() { + if b.bitsRead < 32 { + return + } + if b.off >= 4 { + v := b.in[b.off-4:] + v = v[:4] + low := (uint32(v[0])) | (uint32(v[1]) << 8) | (uint32(v[2]) << 16) | (uint32(v[3]) << 24) + b.value = (b.value << 32) | uint64(low) + b.bitsRead -= 32 + b.off -= 4 + return + } + for b.off > 0 { + b.value = (b.value << 8) | uint64(b.in[b.off-1]) + b.bitsRead -= 8 + b.off-- + } +} + +// finished returns true if all bits have been read from the bit stream. +func (b *bitReader) finished() bool { + return b.off == 0 && b.bitsRead >= 64 +} + +// overread returns true if more bits have been requested than is on the stream. +func (b *bitReader) overread() bool { + return b.bitsRead > 64 +} + +// remain returns the number of bits remaining. +func (b *bitReader) remain() uint { + return b.off*8 + 64 - uint(b.bitsRead) +} + +// close the bitstream and returns an error if out-of-buffer reads occurred. +func (b *bitReader) close() error { + // Release reference. + b.in = nil + if b.bitsRead > 64 { + return io.ErrUnexpectedEOF + } + return nil +} + +func highBits(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitwriter.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitwriter.go new file mode 100644 index 00000000000..303ae90f944 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bitwriter.go @@ -0,0 +1,169 @@ +// Copyright 2018 Klaus Post. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. +// Based on work Copyright (c) 2013, Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +// bitWriter will write bits. +// First bit will be LSB of the first byte of output. +type bitWriter struct { + bitContainer uint64 + nBits uint8 + out []byte +} + +// bitMask16 is bitmasks. Has extra to avoid bounds check. +var bitMask16 = [32]uint16{ + 0, 1, 3, 7, 0xF, 0x1F, + 0x3F, 0x7F, 0xFF, 0x1FF, 0x3FF, 0x7FF, + 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, + 0xFFFF, 0xFFFF} /* up to 16 bits */ + +var bitMask32 = [32]uint32{ + 0, 1, 3, 7, 0xF, 0x1F, 0x3F, 0x7F, 0xFF, + 0x1FF, 0x3FF, 0x7FF, 0xFFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF, + 0x1ffff, 0x3ffff, 0x7FFFF, 0xfFFFF, 0x1fFFFF, 0x3fFFFF, 0x7fFFFF, 0xffFFFF, + 0x1ffFFFF, 0x3ffFFFF, 0x7ffFFFF, 0xfffFFFF, 0x1fffFFFF, 0x3fffFFFF, 0x7fffFFFF, +} // up to 32 bits + +// addBits16NC will add up to 16 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16NC(value uint16, bits uint8) { + b.bitContainer |= uint64(value&bitMask16[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits32NC will add up to 32 bits. +// It will not check if there is space for them, +// so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits32NC(value uint32, bits uint8) { + b.bitContainer |= uint64(value&bitMask32[bits&31]) << (b.nBits & 63) + b.nBits += bits +} + +// addBits16Clean will add up to 16 bits. value may not contain more set bits than indicated. +// It will not check if there is space for them, so the caller must ensure that it has flushed recently. +func (b *bitWriter) addBits16Clean(value uint16, bits uint8) { + b.bitContainer |= uint64(value) << (b.nBits & 63) + b.nBits += bits +} + +// flush will flush all pending full bytes. +// There will be at least 56 bits available for writing when this has been called. +// Using flush32 is faster, but leaves less space for writing. +func (b *bitWriter) flush() { + v := b.nBits >> 3 + switch v { + case 0: + case 1: + b.out = append(b.out, + byte(b.bitContainer), + ) + case 2: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + ) + case 3: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + ) + case 4: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + ) + case 5: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + ) + case 6: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + ) + case 7: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + ) + case 8: + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24), + byte(b.bitContainer>>32), + byte(b.bitContainer>>40), + byte(b.bitContainer>>48), + byte(b.bitContainer>>56), + ) + default: + panic(fmt.Errorf("bits (%d) > 64", b.nBits)) + } + b.bitContainer >>= v << 3 + b.nBits &= 7 +} + +// flush32 will flush out, so there are at least 32 bits available for writing. +func (b *bitWriter) flush32() { + if b.nBits < 32 { + return + } + b.out = append(b.out, + byte(b.bitContainer), + byte(b.bitContainer>>8), + byte(b.bitContainer>>16), + byte(b.bitContainer>>24)) + b.nBits -= 32 + b.bitContainer >>= 32 +} + +// flushAlign will flush remaining full bytes and align to next byte boundary. +func (b *bitWriter) flushAlign() { + nbBytes := (b.nBits + 7) >> 3 + for i := uint8(0); i < nbBytes; i++ { + b.out = append(b.out, byte(b.bitContainer>>(i*8))) + } + b.nBits = 0 + b.bitContainer = 0 +} + +// close will write the alignment bit and write the final byte(s) +// to the output. +func (b *bitWriter) close() error { + // End mark + b.addBits16Clean(1, 1) + // flush until next byte. + b.flushAlign() + return nil +} + +// reset and continue writing by appending to out. +func (b *bitWriter) reset(out []byte) { + b.bitContainer = 0 + b.nBits = 0 + b.out = out +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockdec.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockdec.go new file mode 100644 index 00000000000..4733ea876a1 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockdec.go @@ -0,0 +1,739 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "io" + "sync" + + "github.com/klauspost/compress/huff0" + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +type blockType uint8 + +//go:generate stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex + +const ( + blockTypeRaw blockType = iota + blockTypeRLE + blockTypeCompressed + blockTypeReserved +) + +type literalsBlockType uint8 + +const ( + literalsBlockRaw literalsBlockType = iota + literalsBlockRLE + literalsBlockCompressed + literalsBlockTreeless +) + +const ( + // maxCompressedBlockSize is the biggest allowed compressed block size (128KB) + maxCompressedBlockSize = 128 << 10 + + // Maximum possible block size (all Raw+Uncompressed). + maxBlockSize = (1 << 21) - 1 + + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#literals_section_header + maxCompressedLiteralSize = 1 << 18 + maxRLELiteralSize = 1 << 20 + maxMatchLen = 131074 + maxSequences = 0x7f00 + 0xffff + + // We support slightly less than the reference decoder to be able to + // use ints on 32 bit archs. + maxOffsetBits = 30 +) + +var ( + huffDecoderPool = sync.Pool{New: func() interface{} { + return &huff0.Scratch{} + }} + + fseDecoderPool = sync.Pool{New: func() interface{} { + return &fseDecoder{} + }} +) + +type blockDec struct { + // Raw source data of the block. + data []byte + dataStorage []byte + + // Destination of the decoded data. + dst []byte + + // Buffer for literals data. + literalBuf []byte + + // Window size of the block. + WindowSize uint64 + + history chan *history + input chan struct{} + result chan decodeOutput + sequenceBuf []seq + err error + decWG sync.WaitGroup + + // Frame to use for singlethreaded decoding. + // Should not be used by the decoder itself since parent may be another frame. + localFrame *frameDec + + // Block is RLE, this is the size. + RLESize uint32 + tmp [4]byte + + Type blockType + + // Is this the last block of a frame? + Last bool + + // Use less memory + lowMem bool +} + +func (b *blockDec) String() string { + if b == nil { + return "" + } + return fmt.Sprintf("Steam Size: %d, Type: %v, Last: %t, Window: %d", len(b.data), b.Type, b.Last, b.WindowSize) +} + +func newBlockDec(lowMem bool) *blockDec { + b := blockDec{ + lowMem: lowMem, + result: make(chan decodeOutput, 1), + input: make(chan struct{}, 1), + history: make(chan *history, 1), + } + b.decWG.Add(1) + go b.startDecoder() + return &b +} + +// reset will reset the block. +// Input must be a start of a block and will be at the end of the block when returned. +func (b *blockDec) reset(br byteBuffer, windowSize uint64) error { + b.WindowSize = windowSize + tmp := br.readSmall(3) + if tmp == nil { + if debug { + println("Reading block header:", io.ErrUnexpectedEOF) + } + return io.ErrUnexpectedEOF + } + bh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16) + b.Last = bh&1 != 0 + b.Type = blockType((bh >> 1) & 3) + // find size. + cSize := int(bh >> 3) + maxSize := maxBlockSize + switch b.Type { + case blockTypeReserved: + return ErrReservedBlockType + case blockTypeRLE: + b.RLESize = uint32(cSize) + if b.lowMem { + maxSize = cSize + } + cSize = 1 + case blockTypeCompressed: + if debug { + println("Data size on stream:", cSize) + } + b.RLESize = 0 + maxSize = maxCompressedBlockSize + if windowSize < maxCompressedBlockSize && b.lowMem { + maxSize = int(windowSize) + } + if cSize > maxCompressedBlockSize || uint64(cSize) > b.WindowSize { + if debug { + printf("compressed block too big: csize:%d block: %+v\n", uint64(cSize), b) + } + return ErrCompressedSizeTooBig + } + case blockTypeRaw: + b.RLESize = 0 + // We do not need a destination for raw blocks. + maxSize = -1 + default: + panic("Invalid block type") + } + + // Read block data. + if cap(b.dataStorage) < cSize { + if b.lowMem { + b.dataStorage = make([]byte, 0, cSize) + } else { + b.dataStorage = make([]byte, 0, maxBlockSize) + } + } + if cap(b.dst) <= maxSize { + b.dst = make([]byte, 0, maxSize+1) + } + var err error + b.data, err = br.readBig(cSize, b.dataStorage) + if err != nil { + if debug { + println("Reading block:", err, "(", cSize, ")", len(b.data)) + printf("%T", br) + } + return err + } + return nil +} + +// sendEOF will make the decoder send EOF on this frame. +func (b *blockDec) sendErr(err error) { + b.Last = true + b.Type = blockTypeReserved + b.err = err + b.input <- struct{}{} +} + +// Close will release resources. +// Closed blockDec cannot be reset. +func (b *blockDec) Close() { + close(b.input) + close(b.history) + close(b.result) + b.decWG.Wait() +} + +// decodeAsync will prepare decoding the block when it receives input. +// This will separate output and history. +func (b *blockDec) startDecoder() { + defer b.decWG.Done() + for range b.input { + //println("blockDec: Got block input") + switch b.Type { + case blockTypeRLE: + if cap(b.dst) < int(b.RLESize) { + if b.lowMem { + b.dst = make([]byte, b.RLESize) + } else { + b.dst = make([]byte, maxBlockSize) + } + } + o := decodeOutput{ + d: b, + b: b.dst[:b.RLESize], + err: nil, + } + v := b.data[0] + for i := range o.b { + o.b[i] = v + } + hist := <-b.history + hist.append(o.b) + b.result <- o + case blockTypeRaw: + o := decodeOutput{ + d: b, + b: b.data, + err: nil, + } + hist := <-b.history + hist.append(o.b) + b.result <- o + case blockTypeCompressed: + b.dst = b.dst[:0] + err := b.decodeCompressed(nil) + o := decodeOutput{ + d: b, + b: b.dst, + err: err, + } + if debug { + println("Decompressed to", len(b.dst), "bytes, error:", err) + } + b.result <- o + case blockTypeReserved: + // Used for returning errors. + <-b.history + b.result <- decodeOutput{ + d: b, + b: nil, + err: b.err, + } + default: + panic("Invalid block type") + } + if debug { + println("blockDec: Finished block") + } + } +} + +// decodeAsync will prepare decoding the block when it receives the history. +// If history is provided, it will not fetch it from the channel. +func (b *blockDec) decodeBuf(hist *history) error { + switch b.Type { + case blockTypeRLE: + if cap(b.dst) < int(b.RLESize) { + if b.lowMem { + b.dst = make([]byte, b.RLESize) + } else { + b.dst = make([]byte, maxBlockSize) + } + } + b.dst = b.dst[:b.RLESize] + v := b.data[0] + for i := range b.dst { + b.dst[i] = v + } + hist.appendKeep(b.dst) + return nil + case blockTypeRaw: + hist.appendKeep(b.data) + return nil + case blockTypeCompressed: + saved := b.dst + b.dst = hist.b + hist.b = nil + err := b.decodeCompressed(hist) + if debug { + println("Decompressed to total", len(b.dst), "bytes, hash:", xxhash.Sum64(b.dst), "error:", err) + } + hist.b = b.dst + b.dst = saved + return err + case blockTypeReserved: + // Used for returning errors. + return b.err + default: + panic("Invalid block type") + } +} + +// decodeCompressed will start decompressing a block. +// If no history is supplied the decoder will decodeAsync as much as possible +// before fetching from blockDec.history +func (b *blockDec) decodeCompressed(hist *history) error { + in := b.data + delayedHistory := hist == nil + + if delayedHistory { + // We must always grab history. + defer func() { + if hist == nil { + <-b.history + } + }() + } + // There must be at least one byte for Literals_Block_Type and one for Sequences_Section_Header + if len(in) < 2 { + return ErrBlockTooSmall + } + litType := literalsBlockType(in[0] & 3) + var litRegenSize int + var litCompSize int + sizeFormat := (in[0] >> 2) & 3 + var fourStreams bool + switch litType { + case literalsBlockRaw, literalsBlockRLE: + switch sizeFormat { + case 0, 2: + // Regenerated_Size uses 5 bits (0-31). Literals_Section_Header uses 1 byte. + litRegenSize = int(in[0] >> 3) + in = in[1:] + case 1: + // Regenerated_Size uses 12 bits (0-4095). Literals_Section_Header uses 2 bytes. + litRegenSize = int(in[0]>>4) + (int(in[1]) << 4) + in = in[2:] + case 3: + // Regenerated_Size uses 20 bits (0-1048575). Literals_Section_Header uses 3 bytes. + if len(in) < 3 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return ErrBlockTooSmall + } + litRegenSize = int(in[0]>>4) + (int(in[1]) << 4) + (int(in[2]) << 12) + in = in[3:] + } + case literalsBlockCompressed, literalsBlockTreeless: + switch sizeFormat { + case 0, 1: + // Both Regenerated_Size and Compressed_Size use 10 bits (0-1023). + if len(in) < 3 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + litRegenSize = int(n & 1023) + litCompSize = int(n >> 10) + fourStreams = sizeFormat == 1 + in = in[3:] + case 2: + fourStreams = true + if len(in) < 4 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20) + litRegenSize = int(n & 16383) + litCompSize = int(n >> 14) + in = in[4:] + case 3: + fourStreams = true + if len(in) < 5 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, len(in)) + return ErrBlockTooSmall + } + n := uint64(in[0]>>4) + (uint64(in[1]) << 4) + (uint64(in[2]) << 12) + (uint64(in[3]) << 20) + (uint64(in[4]) << 28) + litRegenSize = int(n & 262143) + litCompSize = int(n >> 18) + in = in[5:] + } + } + if debug { + println("literals type:", litType, "litRegenSize:", litRegenSize, "litCompSize:", litCompSize, "sizeFormat:", sizeFormat, "4X:", fourStreams) + } + var literals []byte + var huff *huff0.Scratch + switch litType { + case literalsBlockRaw: + if len(in) < litRegenSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litRegenSize) + return ErrBlockTooSmall + } + literals = in[:litRegenSize] + in = in[litRegenSize:] + //printf("Found %d uncompressed literals\n", litRegenSize) + case literalsBlockRLE: + if len(in) < 1 { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", 1) + return ErrBlockTooSmall + } + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, litRegenSize) + } else { + if litRegenSize > maxCompressedLiteralSize { + // Exceptional + b.literalBuf = make([]byte, litRegenSize) + } else { + b.literalBuf = make([]byte, litRegenSize, maxCompressedLiteralSize) + + } + } + } + literals = b.literalBuf[:litRegenSize] + v := in[0] + for i := range literals { + literals[i] = v + } + in = in[1:] + if debug { + printf("Found %d RLE compressed literals\n", litRegenSize) + } + case literalsBlockTreeless: + if len(in) < litCompSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize) + return ErrBlockTooSmall + } + // Store compressed literals, so we defer decoding until we get history. + literals = in[:litCompSize] + in = in[litCompSize:] + if debug { + printf("Found %d compressed literals\n", litCompSize) + } + case literalsBlockCompressed: + if len(in) < litCompSize { + println("too small: litType:", litType, " sizeFormat", sizeFormat, "remain:", len(in), "want:", litCompSize) + return ErrBlockTooSmall + } + literals = in[:litCompSize] + in = in[litCompSize:] + huff = huffDecoderPool.Get().(*huff0.Scratch) + var err error + // Ensure we have space to store it. + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, 0, litRegenSize) + } else { + b.literalBuf = make([]byte, 0, maxCompressedLiteralSize) + } + } + if huff == nil { + huff = &huff0.Scratch{} + } + huff, literals, err = huff0.ReadTable(literals, huff) + if err != nil { + println("reading huffman table:", err) + return err + } + // Use our out buffer. + if fourStreams { + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + } else { + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + } + if err != nil { + println("decoding compressed literals:", err) + return err + } + // Make sure we don't leak our literals buffer + if len(literals) != litRegenSize { + return fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) + } + if debug { + printf("Decompressed %d literals into %d bytes\n", litCompSize, litRegenSize) + } + } + + // Decode Sequences + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#sequences-section + if len(in) < 1 { + return ErrBlockTooSmall + } + seqHeader := in[0] + nSeqs := 0 + switch { + case seqHeader == 0: + in = in[1:] + case seqHeader < 128: + nSeqs = int(seqHeader) + in = in[1:] + case seqHeader < 255: + if len(in) < 2 { + return ErrBlockTooSmall + } + nSeqs = int(seqHeader-128)<<8 | int(in[1]) + in = in[2:] + case seqHeader == 255: + if len(in) < 3 { + return ErrBlockTooSmall + } + nSeqs = 0x7f00 + int(in[1]) + (int(in[2]) << 8) + in = in[3:] + } + // Allocate sequences + if cap(b.sequenceBuf) < nSeqs { + if b.lowMem { + b.sequenceBuf = make([]seq, nSeqs) + } else { + // Allocate max + b.sequenceBuf = make([]seq, nSeqs, maxSequences) + } + } else { + // Reuse buffer + b.sequenceBuf = b.sequenceBuf[:nSeqs] + } + var seqs = &sequenceDecs{} + if nSeqs > 0 { + if len(in) < 1 { + return ErrBlockTooSmall + } + br := byteReader{b: in, off: 0} + compMode := br.Uint8() + br.advance(1) + if debug { + printf("Compression modes: 0b%b", compMode) + } + for i := uint(0); i < 3; i++ { + mode := seqCompMode((compMode >> (6 - i*2)) & 3) + if debug { + println("Table", tableIndex(i), "is", mode) + } + var seq *sequenceDec + switch tableIndex(i) { + case tableLiteralLengths: + seq = &seqs.litLengths + case tableOffsets: + seq = &seqs.offsets + case tableMatchLengths: + seq = &seqs.matchLengths + default: + panic("unknown table") + } + switch mode { + case compModePredefined: + seq.fse = &fsePredef[i] + case compModeRLE: + if br.remain() < 1 { + return ErrBlockTooSmall + } + v := br.Uint8() + br.advance(1) + dec := fseDecoderPool.Get().(*fseDecoder) + symb, err := decSymbolValue(v, symbolTableX[i]) + if err != nil { + printf("RLE Transform table (%v) error: %v", tableIndex(i), err) + return err + } + dec.setRLE(symb) + seq.fse = dec + if debug { + printf("RLE set to %+v, code: %v", symb, v) + } + case compModeFSE: + println("Reading table for", tableIndex(i)) + dec := fseDecoderPool.Get().(*fseDecoder) + err := dec.readNCount(&br, uint16(maxTableSymbol[i])) + if err != nil { + println("Read table error:", err) + return err + } + err = dec.transform(symbolTableX[i]) + if err != nil { + println("Transform table error:", err) + return err + } + if debug { + println("Read table ok", "symbolLen:", dec.symbolLen) + } + seq.fse = dec + case compModeRepeat: + seq.repeat = true + } + if br.overread() { + return io.ErrUnexpectedEOF + } + } + in = br.unread() + } + + // Wait for history. + // All time spent after this is critical since it is strictly sequential. + if hist == nil { + hist = <-b.history + if hist.error { + return ErrDecoderClosed + } + } + + // Decode treeless literal block. + if litType == literalsBlockTreeless { + // TODO: We could send the history early WITHOUT the stream history. + // This would allow decoding treeless literials before the byte history is available. + // Silencia stats: Treeless 4393, with: 32775, total: 37168, 11% treeless. + // So not much obvious gain here. + + if hist.huffTree == nil { + return errors.New("literal block was treeless, but no history was defined") + } + // Ensure we have space to store it. + if cap(b.literalBuf) < litRegenSize { + if b.lowMem { + b.literalBuf = make([]byte, 0, litRegenSize) + } else { + b.literalBuf = make([]byte, 0, maxCompressedLiteralSize) + } + } + var err error + // Use our out buffer. + huff = hist.huffTree + if fourStreams { + literals, err = huff.Decoder().Decompress4X(b.literalBuf[:0:litRegenSize], literals) + } else { + literals, err = huff.Decoder().Decompress1X(b.literalBuf[:0:litRegenSize], literals) + } + // Make sure we don't leak our literals buffer + if err != nil { + println("decompressing literals:", err) + return err + } + if len(literals) != litRegenSize { + return fmt.Errorf("literal output size mismatch want %d, got %d", litRegenSize, len(literals)) + } + } else { + if hist.huffTree != nil && huff != nil { + if hist.dict == nil || hist.dict.litEnc != hist.huffTree { + huffDecoderPool.Put(hist.huffTree) + } + hist.huffTree = nil + } + } + if huff != nil { + hist.huffTree = huff + } + if debug { + println("Final literals:", len(literals), "hash:", xxhash.Sum64(literals), "and", nSeqs, "sequences.") + } + + if nSeqs == 0 { + // Decompressed content is defined entirely as Literals Section content. + b.dst = append(b.dst, literals...) + if delayedHistory { + hist.append(literals) + } + return nil + } + + seqs, err := seqs.mergeHistory(&hist.decoders) + if err != nil { + return err + } + if debug { + println("History merged ok") + } + br := &bitReader{} + if err := br.init(in); err != nil { + return err + } + + // TODO: Investigate if sending history without decoders are faster. + // This would allow the sequences to be decoded async and only have to construct stream history. + // If only recent offsets were not transferred, this would be an obvious win. + // Also, if first 3 sequences don't reference recent offsets, all sequences can be decoded. + + hbytes := hist.b + if len(hbytes) > hist.windowSize { + hbytes = hbytes[len(hbytes)-hist.windowSize:] + // We do not need history any more. + if hist.dict != nil { + hist.dict.content = nil + } + } + + if err := seqs.initialize(br, hist, literals, b.dst); err != nil { + println("initializing sequences:", err) + return err + } + + err = seqs.decode(nSeqs, br, hbytes) + if err != nil { + return err + } + if !br.finished() { + return fmt.Errorf("%d extra bits on block, should be 0", br.remain()) + } + + err = br.close() + if err != nil { + printf("Closing sequences: %v, %+v\n", err, *br) + } + if len(b.data) > maxCompressedBlockSize { + return fmt.Errorf("compressed block size too large (%d)", len(b.data)) + } + // Set output and release references. + b.dst = seqs.out + seqs.out, seqs.literals, seqs.hist = nil, nil, nil + + if !delayedHistory { + // If we don't have delayed history, no need to update. + hist.recentOffsets = seqs.prevOffset + return nil + } + if b.Last { + // if last block we don't care about history. + println("Last block, no history returned") + hist.b = hist.b[:0] + return nil + } + hist.append(b.dst) + hist.recentOffsets = seqs.prevOffset + if debug { + println("Finished block with literals:", len(literals), "and", nSeqs, "sequences.") + } + + return nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockenc.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockenc.go new file mode 100644 index 00000000000..083fbb502f4 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blockenc.go @@ -0,0 +1,854 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "math" + "math/bits" + + "github.com/klauspost/compress/huff0" +) + +type blockEnc struct { + size int + literals []byte + sequences []seq + coders seqCoders + litEnc *huff0.Scratch + dictLitEnc *huff0.Scratch + wr bitWriter + + extraLits int + last bool + + output []byte + recentOffsets [3]uint32 + prevRecentOffsets [3]uint32 +} + +// init should be used once the block has been created. +// If called more than once, the effect is the same as calling reset. +func (b *blockEnc) init() { + if cap(b.literals) < maxCompressedLiteralSize { + b.literals = make([]byte, 0, maxCompressedLiteralSize) + } + const defSeqs = 200 + b.literals = b.literals[:0] + if cap(b.sequences) < defSeqs { + b.sequences = make([]seq, 0, defSeqs) + } + if cap(b.output) < maxCompressedBlockSize { + b.output = make([]byte, 0, maxCompressedBlockSize) + } + if b.coders.mlEnc == nil { + b.coders.mlEnc = &fseEncoder{} + b.coders.mlPrev = &fseEncoder{} + b.coders.ofEnc = &fseEncoder{} + b.coders.ofPrev = &fseEncoder{} + b.coders.llEnc = &fseEncoder{} + b.coders.llPrev = &fseEncoder{} + } + b.litEnc = &huff0.Scratch{WantLogLess: 4} + b.reset(nil) +} + +// initNewEncode can be used to reset offsets and encoders to the initial state. +func (b *blockEnc) initNewEncode() { + b.recentOffsets = [3]uint32{1, 4, 8} + b.litEnc.Reuse = huff0.ReusePolicyNone + b.coders.setPrev(nil, nil, nil) +} + +// reset will reset the block for a new encode, but in the same stream, +// meaning that state will be carried over, but the block content is reset. +// If a previous block is provided, the recent offsets are carried over. +func (b *blockEnc) reset(prev *blockEnc) { + b.extraLits = 0 + b.literals = b.literals[:0] + b.size = 0 + b.sequences = b.sequences[:0] + b.output = b.output[:0] + b.last = false + if prev != nil { + b.recentOffsets = prev.prevRecentOffsets + } +} + +// reset will reset the block for a new encode, but in the same stream, +// meaning that state will be carried over, but the block content is reset. +// If a previous block is provided, the recent offsets are carried over. +func (b *blockEnc) swapEncoders(prev *blockEnc) { + b.coders.swap(&prev.coders) + b.litEnc, prev.litEnc = prev.litEnc, b.litEnc +} + +// blockHeader contains the information for a block header. +type blockHeader uint32 + +// setLast sets the 'last' indicator on a block. +func (h *blockHeader) setLast(b bool) { + if b { + *h = *h | 1 + } else { + const mask = (1 << 24) - 2 + *h = *h & mask + } +} + +// setSize will store the compressed size of a block. +func (h *blockHeader) setSize(v uint32) { + const mask = 7 + *h = (*h)&mask | blockHeader(v<<3) +} + +// setType sets the block type. +func (h *blockHeader) setType(t blockType) { + const mask = 1 | (((1 << 24) - 1) ^ 7) + *h = (*h & mask) | blockHeader(t<<1) +} + +// appendTo will append the block header to a slice. +func (h blockHeader) appendTo(b []byte) []byte { + return append(b, uint8(h), uint8(h>>8), uint8(h>>16)) +} + +// String returns a string representation of the block. +func (h blockHeader) String() string { + return fmt.Sprintf("Type: %d, Size: %d, Last:%t", (h>>1)&3, h>>3, h&1 == 1) +} + +// literalsHeader contains literals header information. +type literalsHeader uint64 + +// setType can be used to set the type of literal block. +func (h *literalsHeader) setType(t literalsBlockType) { + const mask = math.MaxUint64 - 3 + *h = (*h & mask) | literalsHeader(t) +} + +// setSize can be used to set a single size, for uncompressed and RLE content. +func (h *literalsHeader) setSize(regenLen int) { + inBits := bits.Len32(uint32(regenLen)) + // Only retain 2 bits + const mask = 3 + lh := uint64(*h & mask) + switch { + case inBits < 5: + lh |= (uint64(regenLen) << 3) | (1 << 60) + if debug { + got := int(lh>>3) & 0xff + if got != regenLen { + panic(fmt.Sprint("litRegenSize = ", regenLen, "(want) != ", got, "(got)")) + } + } + case inBits < 12: + lh |= (1 << 2) | (uint64(regenLen) << 4) | (2 << 60) + case inBits < 20: + lh |= (3 << 2) | (uint64(regenLen) << 4) | (3 << 60) + default: + panic(fmt.Errorf("internal error: block too big (%d)", regenLen)) + } + *h = literalsHeader(lh) +} + +// setSizes will set the size of a compressed literals section and the input length. +func (h *literalsHeader) setSizes(compLen, inLen int, single bool) { + compBits, inBits := bits.Len32(uint32(compLen)), bits.Len32(uint32(inLen)) + // Only retain 2 bits + const mask = 3 + lh := uint64(*h & mask) + switch { + case compBits <= 10 && inBits <= 10: + if !single { + lh |= 1 << 2 + } + lh |= (uint64(inLen) << 4) | (uint64(compLen) << (10 + 4)) | (3 << 60) + if debug { + const mmask = (1 << 24) - 1 + n := (lh >> 4) & mmask + if int(n&1023) != inLen { + panic(fmt.Sprint("regensize:", int(n&1023), "!=", inLen, inBits)) + } + if int(n>>10) != compLen { + panic(fmt.Sprint("compsize:", int(n>>10), "!=", compLen, compBits)) + } + } + case compBits <= 14 && inBits <= 14: + lh |= (2 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (14 + 4)) | (4 << 60) + if single { + panic("single stream used with more than 10 bits length.") + } + case compBits <= 18 && inBits <= 18: + lh |= (3 << 2) | (uint64(inLen) << 4) | (uint64(compLen) << (18 + 4)) | (5 << 60) + if single { + panic("single stream used with more than 10 bits length.") + } + default: + panic("internal error: block too big") + } + *h = literalsHeader(lh) +} + +// appendTo will append the literals header to a byte slice. +func (h literalsHeader) appendTo(b []byte) []byte { + size := uint8(h >> 60) + switch size { + case 1: + b = append(b, uint8(h)) + case 2: + b = append(b, uint8(h), uint8(h>>8)) + case 3: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16)) + case 4: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24)) + case 5: + b = append(b, uint8(h), uint8(h>>8), uint8(h>>16), uint8(h>>24), uint8(h>>32)) + default: + panic(fmt.Errorf("internal error: literalsHeader has invalid size (%d)", size)) + } + return b +} + +// size returns the output size with currently set values. +func (h literalsHeader) size() int { + return int(h >> 60) +} + +func (h literalsHeader) String() string { + return fmt.Sprintf("Type: %d, SizeFormat: %d, Size: 0x%d, Bytes:%d", literalsBlockType(h&3), (h>>2)&3, h&((1<<60)-1)>>4, h>>60) +} + +// pushOffsets will push the recent offsets to the backup store. +func (b *blockEnc) pushOffsets() { + b.prevRecentOffsets = b.recentOffsets +} + +// pushOffsets will push the recent offsets to the backup store. +func (b *blockEnc) popOffsets() { + b.recentOffsets = b.prevRecentOffsets +} + +// matchOffset will adjust recent offsets and return the adjusted one, +// if it matches a previous offset. +func (b *blockEnc) matchOffset(offset, lits uint32) uint32 { + // Check if offset is one of the recent offsets. + // Adjusts the output offset accordingly. + // Gives a tiny bit of compression, typically around 1%. + if true { + if lits > 0 { + switch offset { + case b.recentOffsets[0]: + offset = 1 + case b.recentOffsets[1]: + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 2 + case b.recentOffsets[2]: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 3 + default: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset += 3 + } + } else { + switch offset { + case b.recentOffsets[1]: + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 1 + case b.recentOffsets[2]: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 2 + case b.recentOffsets[0] - 1: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset = 3 + default: + b.recentOffsets[2] = b.recentOffsets[1] + b.recentOffsets[1] = b.recentOffsets[0] + b.recentOffsets[0] = offset + offset += 3 + } + } + } else { + offset += 3 + } + return offset +} + +// encodeRaw can be used to set the output to a raw representation of supplied bytes. +func (b *blockEnc) encodeRaw(a []byte) { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(a))) + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output[:0]) + b.output = append(b.output, a...) + if debug { + println("Adding RAW block, length", len(a), "last:", b.last) + } +} + +// encodeRaw can be used to set the output to a raw representation of supplied bytes. +func (b *blockEnc) encodeRawTo(dst, src []byte) []byte { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(src))) + bh.setType(blockTypeRaw) + dst = bh.appendTo(dst) + dst = append(dst, src...) + if debug { + println("Adding RAW block, length", len(src), "last:", b.last) + } + return dst +} + +// encodeLits can be used if the block is only litLen. +func (b *blockEnc) encodeLits(lits []byte, raw bool) error { + var bh blockHeader + bh.setLast(b.last) + bh.setSize(uint32(len(lits))) + + // Don't compress extremely small blocks + if len(lits) < 8 || (len(lits) < 32 && b.dictLitEnc == nil) || raw { + if debug { + println("Adding RAW block, length", len(lits), "last:", b.last) + } + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits...) + return nil + } + + var ( + out []byte + reUsed, single bool + err error + ) + if b.dictLitEnc != nil { + b.litEnc.TransferCTable(b.dictLitEnc) + b.litEnc.Reuse = huff0.ReusePolicyAllow + b.dictLitEnc = nil + } + if len(lits) >= 1024 { + // Use 4 Streams. + out, reUsed, err = huff0.Compress4X(lits, b.litEnc) + } else if len(lits) > 32 { + // Use 1 stream + single = true + out, reUsed, err = huff0.Compress1X(lits, b.litEnc) + } else { + err = huff0.ErrIncompressible + } + + switch err { + case huff0.ErrIncompressible: + if debug { + println("Adding RAW block, length", len(lits), "last:", b.last) + } + bh.setType(blockTypeRaw) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits...) + return nil + case huff0.ErrUseRLE: + if debug { + println("Adding RLE block, length", len(lits)) + } + bh.setType(blockTypeRLE) + b.output = bh.appendTo(b.output) + b.output = append(b.output, lits[0]) + return nil + default: + return err + case nil: + } + // Compressed... + // Now, allow reuse + b.litEnc.Reuse = huff0.ReusePolicyAllow + bh.setType(blockTypeCompressed) + var lh literalsHeader + if reUsed { + if debug { + println("Reused tree, compressed to", len(out)) + } + lh.setType(literalsBlockTreeless) + } else { + if debug { + println("New tree, compressed to", len(out), "tree size:", len(b.litEnc.OutTable)) + } + lh.setType(literalsBlockCompressed) + } + // Set sizes + lh.setSizes(len(out), len(lits), single) + bh.setSize(uint32(len(out) + lh.size() + 1)) + + // Write block headers. + b.output = bh.appendTo(b.output) + b.output = lh.appendTo(b.output) + // Add compressed data. + b.output = append(b.output, out...) + // No sequences. + b.output = append(b.output, 0) + return nil +} + +// fuzzFseEncoder can be used to fuzz the FSE encoder. +func fuzzFseEncoder(data []byte) int { + if len(data) > maxSequences || len(data) < 2 { + return 0 + } + enc := fseEncoder{} + hist := enc.Histogram()[:256] + maxSym := uint8(0) + for i, v := range data { + v = v & 63 + data[i] = v + hist[v]++ + if v > maxSym { + maxSym = v + } + } + if maxSym == 0 { + // All 0 + return 0 + } + maxCount := func(a []uint32) int { + var max uint32 + for _, v := range a { + if v > max { + max = v + } + } + return int(max) + } + cnt := maxCount(hist[:maxSym]) + if cnt == len(data) { + // RLE + return 0 + } + enc.HistogramFinished(maxSym, cnt) + err := enc.normalizeCount(len(data)) + if err != nil { + return 0 + } + _, err = enc.writeCount(nil) + if err != nil { + panic(err) + } + return 1 +} + +// encode will encode the block and append the output in b.output. +// Previous offset codes must be pushed if more blocks are expected. +func (b *blockEnc) encode(org []byte, raw, rawAllLits bool) error { + if len(b.sequences) == 0 { + return b.encodeLits(b.literals, rawAllLits) + } + // We want some difference to at least account for the headers. + saved := b.size - len(b.literals) - (b.size >> 5) + if saved < 16 { + if org == nil { + return errIncompressible + } + b.popOffsets() + return b.encodeLits(org, rawAllLits) + } + + var bh blockHeader + var lh literalsHeader + bh.setLast(b.last) + bh.setType(blockTypeCompressed) + // Store offset of the block header. Needed when we know the size. + bhOffset := len(b.output) + b.output = bh.appendTo(b.output) + + var ( + out []byte + reUsed, single bool + err error + ) + if b.dictLitEnc != nil { + b.litEnc.TransferCTable(b.dictLitEnc) + b.litEnc.Reuse = huff0.ReusePolicyAllow + b.dictLitEnc = nil + } + if len(b.literals) >= 1024 && !raw { + // Use 4 Streams. + out, reUsed, err = huff0.Compress4X(b.literals, b.litEnc) + } else if len(b.literals) > 32 && !raw { + // Use 1 stream + single = true + out, reUsed, err = huff0.Compress1X(b.literals, b.litEnc) + } else { + err = huff0.ErrIncompressible + } + + switch err { + case huff0.ErrIncompressible: + lh.setType(literalsBlockRaw) + lh.setSize(len(b.literals)) + b.output = lh.appendTo(b.output) + b.output = append(b.output, b.literals...) + if debug { + println("Adding literals RAW, length", len(b.literals)) + } + case huff0.ErrUseRLE: + lh.setType(literalsBlockRLE) + lh.setSize(len(b.literals)) + b.output = lh.appendTo(b.output) + b.output = append(b.output, b.literals[0]) + if debug { + println("Adding literals RLE") + } + default: + if debug { + println("Adding literals ERROR:", err) + } + return err + case nil: + // Compressed litLen... + if reUsed { + if debug { + println("reused tree") + } + lh.setType(literalsBlockTreeless) + } else { + if debug { + println("new tree, size:", len(b.litEnc.OutTable)) + } + lh.setType(literalsBlockCompressed) + if debug { + _, _, err := huff0.ReadTable(out, nil) + if err != nil { + panic(err) + } + } + } + lh.setSizes(len(out), len(b.literals), single) + if debug { + printf("Compressed %d literals to %d bytes", len(b.literals), len(out)) + println("Adding literal header:", lh) + } + b.output = lh.appendTo(b.output) + b.output = append(b.output, out...) + b.litEnc.Reuse = huff0.ReusePolicyAllow + if debug { + println("Adding literals compressed") + } + } + // Sequence compression + + // Write the number of sequences + switch { + case len(b.sequences) < 128: + b.output = append(b.output, uint8(len(b.sequences))) + case len(b.sequences) < 0x7f00: // TODO: this could be wrong + n := len(b.sequences) + b.output = append(b.output, 128+uint8(n>>8), uint8(n)) + default: + n := len(b.sequences) - 0x7f00 + b.output = append(b.output, 255, uint8(n), uint8(n>>8)) + } + if debug { + println("Encoding", len(b.sequences), "sequences") + } + b.genCodes() + llEnc := b.coders.llEnc + ofEnc := b.coders.ofEnc + mlEnc := b.coders.mlEnc + err = llEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + err = ofEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + err = mlEnc.normalizeCount(len(b.sequences)) + if err != nil { + return err + } + + // Choose the best compression mode for each type. + // Will evaluate the new vs predefined and previous. + chooseComp := func(cur, prev, preDef *fseEncoder) (*fseEncoder, seqCompMode) { + // See if predefined/previous is better + hist := cur.count[:cur.symbolLen] + nSize := cur.approxSize(hist) + cur.maxHeaderSize() + predefSize := preDef.approxSize(hist) + prevSize := prev.approxSize(hist) + + // Add a small penalty for new encoders. + // Don't bother with extremely small (<2 byte gains). + nSize = nSize + (nSize+2*8*16)>>4 + switch { + case predefSize <= prevSize && predefSize <= nSize || forcePreDef: + if debug { + println("Using predefined", predefSize>>3, "<=", nSize>>3) + } + return preDef, compModePredefined + case prevSize <= nSize: + if debug { + println("Using previous", prevSize>>3, "<=", nSize>>3) + } + return prev, compModeRepeat + default: + if debug { + println("Using new, predef", predefSize>>3, ". previous:", prevSize>>3, ">", nSize>>3, "header max:", cur.maxHeaderSize()>>3, "bytes") + println("tl:", cur.actualTableLog, "symbolLen:", cur.symbolLen, "norm:", cur.norm[:cur.symbolLen], "hist", cur.count[:cur.symbolLen]) + } + return cur, compModeFSE + } + } + + // Write compression mode + var mode uint8 + if llEnc.useRLE { + mode |= uint8(compModeRLE) << 6 + llEnc.setRLE(b.sequences[0].llCode) + if debug { + println("llEnc.useRLE") + } + } else { + var m seqCompMode + llEnc, m = chooseComp(llEnc, b.coders.llPrev, &fsePredefEnc[tableLiteralLengths]) + mode |= uint8(m) << 6 + } + if ofEnc.useRLE { + mode |= uint8(compModeRLE) << 4 + ofEnc.setRLE(b.sequences[0].ofCode) + if debug { + println("ofEnc.useRLE") + } + } else { + var m seqCompMode + ofEnc, m = chooseComp(ofEnc, b.coders.ofPrev, &fsePredefEnc[tableOffsets]) + mode |= uint8(m) << 4 + } + + if mlEnc.useRLE { + mode |= uint8(compModeRLE) << 2 + mlEnc.setRLE(b.sequences[0].mlCode) + if debug { + println("mlEnc.useRLE, code: ", b.sequences[0].mlCode, "value", b.sequences[0].matchLen) + } + } else { + var m seqCompMode + mlEnc, m = chooseComp(mlEnc, b.coders.mlPrev, &fsePredefEnc[tableMatchLengths]) + mode |= uint8(m) << 2 + } + b.output = append(b.output, mode) + if debug { + printf("Compression modes: 0b%b", mode) + } + b.output, err = llEnc.writeCount(b.output) + if err != nil { + return err + } + start := len(b.output) + b.output, err = ofEnc.writeCount(b.output) + if err != nil { + return err + } + if false { + println("block:", b.output[start:], "tablelog", ofEnc.actualTableLog, "maxcount:", ofEnc.maxCount) + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", ofEnc.actualTableLog, ofEnc.symbolLen) + for i, v := range ofEnc.norm[:ofEnc.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, ofEnc.count[i], v) + } + } + b.output, err = mlEnc.writeCount(b.output) + if err != nil { + return err + } + + // Maybe in block? + wr := &b.wr + wr.reset(b.output) + + var ll, of, ml cState + + // Current sequence + seq := len(b.sequences) - 1 + s := b.sequences[seq] + llEnc.setBits(llBitsTable[:]) + mlEnc.setBits(mlBitsTable[:]) + ofEnc.setBits(nil) + + llTT, ofTT, mlTT := llEnc.ct.symbolTT[:256], ofEnc.ct.symbolTT[:256], mlEnc.ct.symbolTT[:256] + + // We have 3 bounds checks here (and in the loop). + // Since we are iterating backwards it is kinda hard to avoid. + llB, ofB, mlB := llTT[s.llCode], ofTT[s.ofCode], mlTT[s.mlCode] + ll.init(wr, &llEnc.ct, llB) + of.init(wr, &ofEnc.ct, ofB) + wr.flush32() + ml.init(wr, &mlEnc.ct, mlB) + + // Each of these lookups also generates a bounds check. + wr.addBits32NC(s.litLen, llB.outBits) + wr.addBits32NC(s.matchLen, mlB.outBits) + wr.flush32() + wr.addBits32NC(s.offset, ofB.outBits) + if debugSequences { + println("Encoded seq", seq, s, "codes:", s.llCode, s.mlCode, s.ofCode, "states:", ll.state, ml.state, of.state, "bits:", llB, mlB, ofB) + } + seq-- + if llEnc.maxBits+mlEnc.maxBits+ofEnc.maxBits <= 32 { + // No need to flush (common) + for seq >= 0 { + s = b.sequences[seq] + wr.flush32() + llB, ofB, mlB := llTT[s.llCode], ofTT[s.ofCode], mlTT[s.mlCode] + // tabelog max is 8 for all. + of.encode(ofB) + ml.encode(mlB) + ll.encode(llB) + wr.flush32() + + // We checked that all can stay within 32 bits + wr.addBits32NC(s.litLen, llB.outBits) + wr.addBits32NC(s.matchLen, mlB.outBits) + wr.addBits32NC(s.offset, ofB.outBits) + + if debugSequences { + println("Encoded seq", seq, s) + } + + seq-- + } + } else { + for seq >= 0 { + s = b.sequences[seq] + wr.flush32() + llB, ofB, mlB := llTT[s.llCode], ofTT[s.ofCode], mlTT[s.mlCode] + // tabelog max is below 8 for each. + of.encode(ofB) + ml.encode(mlB) + ll.encode(llB) + wr.flush32() + + // ml+ll = max 32 bits total + wr.addBits32NC(s.litLen, llB.outBits) + wr.addBits32NC(s.matchLen, mlB.outBits) + wr.flush32() + wr.addBits32NC(s.offset, ofB.outBits) + + if debugSequences { + println("Encoded seq", seq, s) + } + + seq-- + } + } + ml.flush(mlEnc.actualTableLog) + of.flush(ofEnc.actualTableLog) + ll.flush(llEnc.actualTableLog) + err = wr.close() + if err != nil { + return err + } + b.output = wr.out + + if len(b.output)-3-bhOffset >= b.size { + // Maybe even add a bigger margin. + b.litEnc.Reuse = huff0.ReusePolicyNone + return errIncompressible + } + + // Size is output minus block header. + bh.setSize(uint32(len(b.output)-bhOffset) - 3) + if debug { + println("Rewriting block header", bh) + } + _ = bh.appendTo(b.output[bhOffset:bhOffset]) + b.coders.setPrev(llEnc, mlEnc, ofEnc) + return nil +} + +var errIncompressible = errors.New("incompressible") + +func (b *blockEnc) genCodes() { + if len(b.sequences) == 0 { + // nothing to do + return + } + + if len(b.sequences) > math.MaxUint16 { + panic("can only encode up to 64K sequences") + } + // No bounds checks after here: + llH := b.coders.llEnc.Histogram()[:256] + ofH := b.coders.ofEnc.Histogram()[:256] + mlH := b.coders.mlEnc.Histogram()[:256] + for i := range llH { + llH[i] = 0 + } + for i := range ofH { + ofH[i] = 0 + } + for i := range mlH { + mlH[i] = 0 + } + + var llMax, ofMax, mlMax uint8 + for i, seq := range b.sequences { + v := llCode(seq.litLen) + seq.llCode = v + llH[v]++ + if v > llMax { + llMax = v + } + + v = ofCode(seq.offset) + seq.ofCode = v + ofH[v]++ + if v > ofMax { + ofMax = v + } + + v = mlCode(seq.matchLen) + seq.mlCode = v + mlH[v]++ + if v > mlMax { + mlMax = v + if debugAsserts && mlMax > maxMatchLengthSymbol { + panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d), matchlen: %d", mlMax, seq.matchLen)) + } + } + b.sequences[i] = seq + } + maxCount := func(a []uint32) int { + var max uint32 + for _, v := range a { + if v > max { + max = v + } + } + return int(max) + } + if debugAsserts && mlMax > maxMatchLengthSymbol { + panic(fmt.Errorf("mlMax > maxMatchLengthSymbol (%d)", mlMax)) + } + if debugAsserts && ofMax > maxOffsetBits { + panic(fmt.Errorf("ofMax > maxOffsetBits (%d)", ofMax)) + } + if debugAsserts && llMax > maxLiteralLengthSymbol { + panic(fmt.Errorf("llMax > maxLiteralLengthSymbol (%d)", llMax)) + } + + b.coders.mlEnc.HistogramFinished(mlMax, maxCount(mlH[:mlMax+1])) + b.coders.ofEnc.HistogramFinished(ofMax, maxCount(ofH[:ofMax+1])) + b.coders.llEnc.HistogramFinished(llMax, maxCount(llH[:llMax+1])) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blocktype_string.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blocktype_string.go new file mode 100644 index 00000000000..01a01e486e1 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/blocktype_string.go @@ -0,0 +1,85 @@ +// Code generated by "stringer -type=blockType,literalsBlockType,seqCompMode,tableIndex"; DO NOT EDIT. + +package zstd + +import "strconv" + +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[blockTypeRaw-0] + _ = x[blockTypeRLE-1] + _ = x[blockTypeCompressed-2] + _ = x[blockTypeReserved-3] +} + +const _blockType_name = "blockTypeRawblockTypeRLEblockTypeCompressedblockTypeReserved" + +var _blockType_index = [...]uint8{0, 12, 24, 43, 60} + +func (i blockType) String() string { + if i >= blockType(len(_blockType_index)-1) { + return "blockType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _blockType_name[_blockType_index[i]:_blockType_index[i+1]] +} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[literalsBlockRaw-0] + _ = x[literalsBlockRLE-1] + _ = x[literalsBlockCompressed-2] + _ = x[literalsBlockTreeless-3] +} + +const _literalsBlockType_name = "literalsBlockRawliteralsBlockRLEliteralsBlockCompressedliteralsBlockTreeless" + +var _literalsBlockType_index = [...]uint8{0, 16, 32, 55, 76} + +func (i literalsBlockType) String() string { + if i >= literalsBlockType(len(_literalsBlockType_index)-1) { + return "literalsBlockType(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _literalsBlockType_name[_literalsBlockType_index[i]:_literalsBlockType_index[i+1]] +} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[compModePredefined-0] + _ = x[compModeRLE-1] + _ = x[compModeFSE-2] + _ = x[compModeRepeat-3] +} + +const _seqCompMode_name = "compModePredefinedcompModeRLEcompModeFSEcompModeRepeat" + +var _seqCompMode_index = [...]uint8{0, 18, 29, 40, 54} + +func (i seqCompMode) String() string { + if i >= seqCompMode(len(_seqCompMode_index)-1) { + return "seqCompMode(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _seqCompMode_name[_seqCompMode_index[i]:_seqCompMode_index[i+1]] +} +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[tableLiteralLengths-0] + _ = x[tableOffsets-1] + _ = x[tableMatchLengths-2] +} + +const _tableIndex_name = "tableLiteralLengthstableOffsetstableMatchLengths" + +var _tableIndex_index = [...]uint8{0, 19, 31, 48} + +func (i tableIndex) String() string { + if i >= tableIndex(len(_tableIndex_index)-1) { + return "tableIndex(" + strconv.FormatInt(int64(i), 10) + ")" + } + return _tableIndex_name[_tableIndex_index[i]:_tableIndex_index[i+1]] +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytebuf.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytebuf.go new file mode 100644 index 00000000000..658ef78380e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytebuf.go @@ -0,0 +1,127 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" + "io" + "io/ioutil" +) + +type byteBuffer interface { + // Read up to 8 bytes. + // Returns nil if no more input is available. + readSmall(n int) []byte + + // Read >8 bytes. + // MAY use the destination slice. + readBig(n int, dst []byte) ([]byte, error) + + // Read a single byte. + readByte() (byte, error) + + // Skip n bytes. + skipN(n int) error +} + +// in-memory buffer +type byteBuf []byte + +func (b *byteBuf) readSmall(n int) []byte { + if debugAsserts && n > 8 { + panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) + } + bb := *b + if len(bb) < n { + return nil + } + r := bb[:n] + *b = bb[n:] + return r +} + +func (b *byteBuf) readBig(n int, dst []byte) ([]byte, error) { + bb := *b + if len(bb) < n { + return nil, io.ErrUnexpectedEOF + } + r := bb[:n] + *b = bb[n:] + return r, nil +} + +func (b *byteBuf) remain() []byte { + return *b +} + +func (b *byteBuf) readByte() (byte, error) { + bb := *b + if len(bb) < 1 { + return 0, nil + } + r := bb[0] + *b = bb[1:] + return r, nil +} + +func (b *byteBuf) skipN(n int) error { + bb := *b + if len(bb) < n { + return io.ErrUnexpectedEOF + } + *b = bb[n:] + return nil +} + +// wrapper around a reader. +type readerWrapper struct { + r io.Reader + tmp [8]byte +} + +func (r *readerWrapper) readSmall(n int) []byte { + if debugAsserts && n > 8 { + panic(fmt.Errorf("small read > 8 (%d). use readBig", n)) + } + n2, err := io.ReadFull(r.r, r.tmp[:n]) + // We only really care about the actual bytes read. + if n2 != n { + if debug { + println("readSmall: got", n2, "want", n, "err", err) + } + return nil + } + return r.tmp[:n] +} + +func (r *readerWrapper) readBig(n int, dst []byte) ([]byte, error) { + if cap(dst) < n { + dst = make([]byte, n) + } + n2, err := io.ReadFull(r.r, dst[:n]) + if err == io.EOF && n > 0 { + err = io.ErrUnexpectedEOF + } + return dst[:n2], err +} + +func (r *readerWrapper) readByte() (byte, error) { + n2, err := r.r.Read(r.tmp[:1]) + if err != nil { + return 0, err + } + if n2 != 1 { + return 0, io.ErrUnexpectedEOF + } + return r.tmp[0], nil +} + +func (r *readerWrapper) skipN(n int) error { + n2, err := io.CopyN(ioutil.Discard, r.r, int64(n)) + if n2 != int64(n) { + err = io.ErrUnexpectedEOF + } + return err +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytereader.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytereader.go new file mode 100644 index 00000000000..2c4fca17fa1 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/bytereader.go @@ -0,0 +1,88 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +// byteReader provides a byte reader that reads +// little endian values from a byte stream. +// The input stream is manually advanced. +// The reader performs no bounds checks. +type byteReader struct { + b []byte + off int +} + +// init will initialize the reader and set the input. +func (b *byteReader) init(in []byte) { + b.b = in + b.off = 0 +} + +// advance the stream b n bytes. +func (b *byteReader) advance(n uint) { + b.off += int(n) +} + +// overread returns whether we have advanced too far. +func (b *byteReader) overread() bool { + return b.off > len(b.b) +} + +// Int32 returns a little endian int32 starting at current offset. +func (b byteReader) Int32() int32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := int32(b2[3]) + v2 := int32(b2[2]) + v1 := int32(b2[1]) + v0 := int32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// Uint8 returns the next byte +func (b *byteReader) Uint8() uint8 { + v := b.b[b.off] + return v +} + +// Uint32 returns a little endian uint32 starting at current offset. +func (b byteReader) Uint32() uint32 { + if r := b.remain(); r < 4 { + // Very rare + v := uint32(0) + for i := 1; i <= r; i++ { + v = (v << 8) | uint32(b.b[len(b.b)-i]) + } + return v + } + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// Uint32NC returns a little endian uint32 starting at current offset. +// The caller must be sure if there are at least 4 bytes left. +func (b byteReader) Uint32NC() uint32 { + b2 := b.b[b.off:] + b2 = b2[:4] + v3 := uint32(b2[3]) + v2 := uint32(b2[2]) + v1 := uint32(b2[1]) + v0 := uint32(b2[0]) + return v0 | (v1 << 8) | (v2 << 16) | (v3 << 24) +} + +// unread returns the unread portion of the input. +func (b byteReader) unread() []byte { + return b.b[b.off:] +} + +// remain will return the number of bytes remaining. +func (b byteReader) remain() int { + return len(b.b) - b.off +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder.go new file mode 100644 index 00000000000..d78be6d4236 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder.go @@ -0,0 +1,546 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "bytes" + "errors" + "io" + "sync" +) + +// Decoder provides decoding of zstandard streams. +// The decoder has been designed to operate without allocations after a warmup. +// This means that you should store the decoder for best performance. +// To re-use a stream decoder, use the Reset(r io.Reader) error to switch to another stream. +// A decoder can safely be re-used even if the previous stream failed. +// To release the resources, you must call the Close() function on a decoder. +type Decoder struct { + o decoderOptions + + // Unreferenced decoders, ready for use. + decoders chan *blockDec + + // Streams ready to be decoded. + stream chan decodeStream + + // Current read position used for Reader functionality. + current decoderState + + // Custom dictionaries. + // Always uses copies. + dicts map[uint32]dict + + // streamWg is the waitgroup for all streams + streamWg sync.WaitGroup +} + +// decoderState is used for maintaining state when the decoder +// is used for streaming. +type decoderState struct { + // current block being written to stream. + decodeOutput + + // output in order to be written to stream. + output chan decodeOutput + + // cancel remaining output. + cancel chan struct{} + + flushed bool +} + +var ( + // Check the interfaces we want to support. + _ = io.WriterTo(&Decoder{}) + _ = io.Reader(&Decoder{}) +) + +// NewReader creates a new decoder. +// A nil Reader can be provided in which case Reset can be used to start a decode. +// +// A Decoder can be used in two modes: +// +// 1) As a stream, or +// 2) For stateless decoding using DecodeAll. +// +// Only a single stream can be decoded concurrently, but the same decoder +// can run multiple concurrent stateless decodes. It is even possible to +// use stateless decodes while a stream is being decoded. +// +// The Reset function can be used to initiate a new stream, which is will considerably +// reduce the allocations normally caused by NewReader. +func NewReader(r io.Reader, opts ...DOption) (*Decoder, error) { + initPredefined() + var d Decoder + d.o.setDefault() + for _, o := range opts { + err := o(&d.o) + if err != nil { + return nil, err + } + } + d.current.output = make(chan decodeOutput, d.o.concurrent) + d.current.flushed = true + + // Transfer option dicts. + d.dicts = make(map[uint32]dict, len(d.o.dicts)) + for _, dc := range d.o.dicts { + d.dicts[dc.id] = dc + } + d.o.dicts = nil + + // Create decoders + d.decoders = make(chan *blockDec, d.o.concurrent) + for i := 0; i < d.o.concurrent; i++ { + dec := newBlockDec(d.o.lowMem) + dec.localFrame = newFrameDec(d.o) + d.decoders <- dec + } + + if r == nil { + return &d, nil + } + return &d, d.Reset(r) +} + +// Read bytes from the decompressed stream into p. +// Returns the number of bytes written and any error that occurred. +// When the stream is done, io.EOF will be returned. +func (d *Decoder) Read(p []byte) (int, error) { + if d.stream == nil { + return 0, errors.New("no input has been initialized") + } + var n int + for { + if len(d.current.b) > 0 { + filled := copy(p, d.current.b) + p = p[filled:] + d.current.b = d.current.b[filled:] + n += filled + } + if len(p) == 0 { + break + } + if len(d.current.b) == 0 { + // We have an error and no more data + if d.current.err != nil { + break + } + if !d.nextBlock(n == 0) { + return n, nil + } + } + } + if len(d.current.b) > 0 { + if debug { + println("returning", n, "still bytes left:", len(d.current.b)) + } + // Only return error at end of block + return n, nil + } + if d.current.err != nil { + d.drainOutput() + } + if debug { + println("returning", n, d.current.err, len(d.decoders)) + } + return n, d.current.err +} + +// Reset will reset the decoder the supplied stream after the current has finished processing. +// Note that this functionality cannot be used after Close has been called. +func (d *Decoder) Reset(r io.Reader) error { + if d.current.err == ErrDecoderClosed { + return d.current.err + } + if r == nil { + return errors.New("nil Reader sent as input") + } + + if d.stream == nil { + d.stream = make(chan decodeStream, 1) + d.streamWg.Add(1) + go d.startStreamDecoder(d.stream) + } + + d.drainOutput() + + // If bytes buffer and < 1MB, do sync decoding anyway. + if bb, ok := r.(*bytes.Buffer); ok && bb.Len() < 1<<20 { + if debug { + println("*bytes.Buffer detected, doing sync decode, len:", bb.Len()) + } + b := bb.Bytes() + var dst []byte + if cap(d.current.b) > 0 { + dst = d.current.b + } + + dst, err := d.DecodeAll(b, dst[:0]) + if err == nil { + err = io.EOF + } + d.current.b = dst + d.current.err = err + d.current.flushed = true + if debug { + println("sync decode to", len(dst), "bytes, err:", err) + } + return nil + } + + // Remove current block. + d.current.decodeOutput = decodeOutput{} + d.current.err = nil + d.current.cancel = make(chan struct{}) + d.current.flushed = false + d.current.d = nil + + d.stream <- decodeStream{ + r: r, + output: d.current.output, + cancel: d.current.cancel, + } + return nil +} + +// drainOutput will drain the output until errEndOfStream is sent. +func (d *Decoder) drainOutput() { + if d.current.cancel != nil { + println("cancelling current") + close(d.current.cancel) + d.current.cancel = nil + } + if d.current.d != nil { + if debug { + printf("re-adding current decoder %p, decoders: %d", d.current.d, len(d.decoders)) + } + d.decoders <- d.current.d + d.current.d = nil + d.current.b = nil + } + if d.current.output == nil || d.current.flushed { + println("current already flushed") + return + } + for { + select { + case v := <-d.current.output: + if v.d != nil { + if debug { + printf("re-adding decoder %p", v.d) + } + d.decoders <- v.d + } + if v.err == errEndOfStream { + println("current flushed") + d.current.flushed = true + return + } + } + } +} + +// WriteTo writes data to w until there's no more data to write or when an error occurs. +// The return value n is the number of bytes written. +// Any error encountered during the write is also returned. +func (d *Decoder) WriteTo(w io.Writer) (int64, error) { + if d.stream == nil { + return 0, errors.New("no input has been initialized") + } + var n int64 + for { + if len(d.current.b) > 0 { + n2, err2 := w.Write(d.current.b) + n += int64(n2) + if err2 != nil && d.current.err == nil { + d.current.err = err2 + break + } + } + if d.current.err != nil { + break + } + d.nextBlock(true) + } + err := d.current.err + if err != nil { + d.drainOutput() + } + if err == io.EOF { + err = nil + } + return n, err +} + +// DecodeAll allows stateless decoding of a blob of bytes. +// Output will be appended to dst, so if the destination size is known +// you can pre-allocate the destination slice to avoid allocations. +// DecodeAll can be used concurrently. +// The Decoder concurrency limits will be respected. +func (d *Decoder) DecodeAll(input, dst []byte) ([]byte, error) { + if d.current.err == ErrDecoderClosed { + return dst, ErrDecoderClosed + } + + // Grab a block decoder and frame decoder. + block := <-d.decoders + frame := block.localFrame + defer func() { + if debug { + printf("re-adding decoder: %p", block) + } + frame.rawInput = nil + frame.bBuf = nil + d.decoders <- block + }() + frame.bBuf = input + + for { + frame.history.reset() + err := frame.reset(&frame.bBuf) + if err == io.EOF { + if debug { + println("frame reset return EOF") + } + return dst, nil + } + if frame.DictionaryID != nil { + dict, ok := d.dicts[*frame.DictionaryID] + if !ok { + return nil, ErrUnknownDictionary + } + frame.history.setDict(&dict) + } + if err != nil { + return dst, err + } + if frame.FrameContentSize > d.o.maxDecodedSize-uint64(len(dst)) { + return dst, ErrDecoderSizeExceeded + } + if frame.FrameContentSize > 0 && frame.FrameContentSize < 1<<30 { + // Never preallocate moe than 1 GB up front. + if uint64(cap(dst)) < frame.FrameContentSize { + dst2 := make([]byte, len(dst), len(dst)+int(frame.FrameContentSize)) + copy(dst2, dst) + dst = dst2 + } + } + if cap(dst) == 0 { + // Allocate window size * 2 by default if nothing is provided and we didn't get frame content size. + size := frame.WindowSize * 2 + // Cap to 1 MB. + if size > 1<<20 { + size = 1 << 20 + } + dst = make([]byte, 0, size) + } + + dst, err = frame.runDecoder(dst, block) + if err != nil { + return dst, err + } + if len(frame.bBuf) == 0 { + if debug { + println("frame dbuf empty") + } + break + } + } + return dst, nil +} + +// nextBlock returns the next block. +// If an error occurs d.err will be set. +// Optionally the function can block for new output. +// If non-blocking mode is used the returned boolean will be false +// if no data was available without blocking. +func (d *Decoder) nextBlock(blocking bool) (ok bool) { + if d.current.d != nil { + if debug { + printf("re-adding current decoder %p", d.current.d) + } + d.decoders <- d.current.d + d.current.d = nil + } + if d.current.err != nil { + // Keep error state. + return blocking + } + + if blocking { + d.current.decodeOutput = <-d.current.output + } else { + select { + case d.current.decodeOutput = <-d.current.output: + default: + return false + } + } + if debug { + println("got", len(d.current.b), "bytes, error:", d.current.err) + } + return true +} + +// Close will release all resources. +// It is NOT possible to reuse the decoder after this. +func (d *Decoder) Close() { + if d.current.err == ErrDecoderClosed { + return + } + d.drainOutput() + if d.stream != nil { + close(d.stream) + d.streamWg.Wait() + d.stream = nil + } + if d.decoders != nil { + close(d.decoders) + for dec := range d.decoders { + dec.Close() + } + d.decoders = nil + } + if d.current.d != nil { + d.current.d.Close() + d.current.d = nil + } + d.current.err = ErrDecoderClosed +} + +// IOReadCloser returns the decoder as an io.ReadCloser for convenience. +// Any changes to the decoder will be reflected, so the returned ReadCloser +// can be reused along with the decoder. +// io.WriterTo is also supported by the returned ReadCloser. +func (d *Decoder) IOReadCloser() io.ReadCloser { + return closeWrapper{d: d} +} + +// closeWrapper wraps a function call as a closer. +type closeWrapper struct { + d *Decoder +} + +// WriteTo forwards WriteTo calls to the decoder. +func (c closeWrapper) WriteTo(w io.Writer) (n int64, err error) { + return c.d.WriteTo(w) +} + +// Read forwards read calls to the decoder. +func (c closeWrapper) Read(p []byte) (n int, err error) { + return c.d.Read(p) +} + +// Close closes the decoder. +func (c closeWrapper) Close() error { + c.d.Close() + return nil +} + +type decodeOutput struct { + d *blockDec + b []byte + err error +} + +type decodeStream struct { + r io.Reader + + // Blocks ready to be written to output. + output chan decodeOutput + + // cancel reading from the input + cancel chan struct{} +} + +// errEndOfStream indicates that everything from the stream was read. +var errEndOfStream = errors.New("end-of-stream") + +// Create Decoder: +// Spawn n block decoders. These accept tasks to decode a block. +// Create goroutine that handles stream processing, this will send history to decoders as they are available. +// Decoders update the history as they decode. +// When a block is returned: +// a) history is sent to the next decoder, +// b) content written to CRC. +// c) return data to WRITER. +// d) wait for next block to return data. +// Once WRITTEN, the decoders reused by the writer frame decoder for re-use. +func (d *Decoder) startStreamDecoder(inStream chan decodeStream) { + defer d.streamWg.Done() + frame := newFrameDec(d.o) + for stream := range inStream { + if debug { + println("got new stream") + } + br := readerWrapper{r: stream.r} + decodeStream: + for { + frame.history.reset() + err := frame.reset(&br) + if debug && err != nil { + println("Frame decoder returned", err) + } + if err == nil && frame.DictionaryID != nil { + dict, ok := d.dicts[*frame.DictionaryID] + if !ok { + err = ErrUnknownDictionary + } else { + frame.history.setDict(&dict) + } + } + if err != nil { + stream.output <- decodeOutput{ + err: err, + } + break + } + if debug { + println("starting frame decoder") + } + + // This goroutine will forward history between frames. + frame.frameDone.Add(1) + frame.initAsync() + + go frame.startDecoder(stream.output) + decodeFrame: + // Go through all blocks of the frame. + for { + dec := <-d.decoders + select { + case <-stream.cancel: + if !frame.sendErr(dec, io.EOF) { + // To not let the decoder dangle, send it back. + stream.output <- decodeOutput{d: dec} + } + break decodeStream + default: + } + err := frame.next(dec) + switch err { + case io.EOF: + // End of current frame, no error + println("EOF on next block") + break decodeFrame + case nil: + continue + default: + println("block decoder returned", err) + break decodeStream + } + } + // All blocks have started decoding, check if there are more frames. + println("waiting for done") + frame.frameDone.Wait() + println("done waiting...") + } + frame.frameDone.Wait() + println("Sending EOS") + stream.output <- decodeOutput{err: errEndOfStream} + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder_options.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder_options.go new file mode 100644 index 00000000000..284d384492b --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/decoder_options.go @@ -0,0 +1,84 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "runtime" +) + +// DOption is an option for creating a decoder. +type DOption func(*decoderOptions) error + +// options retains accumulated state of multiple options. +type decoderOptions struct { + lowMem bool + concurrent int + maxDecodedSize uint64 + dicts []dict +} + +func (o *decoderOptions) setDefault() { + *o = decoderOptions{ + // use less ram: true for now, but may change. + lowMem: true, + concurrent: runtime.GOMAXPROCS(0), + } + o.maxDecodedSize = 1 << 63 +} + +// WithDecoderLowmem will set whether to use a lower amount of memory, +// but possibly have to allocate more while running. +func WithDecoderLowmem(b bool) DOption { + return func(o *decoderOptions) error { o.lowMem = b; return nil } +} + +// WithDecoderConcurrency will set the concurrency, +// meaning the maximum number of decoders to run concurrently. +// The value supplied must be at least 1. +// By default this will be set to GOMAXPROCS. +func WithDecoderConcurrency(n int) DOption { + return func(o *decoderOptions) error { + if n <= 0 { + return fmt.Errorf("Concurrency must be at least 1") + } + o.concurrent = n + return nil + } +} + +// WithDecoderMaxMemory allows to set a maximum decoded size for in-memory +// non-streaming operations or maximum window size for streaming operations. +// This can be used to control memory usage of potentially hostile content. +// For streaming operations, the maximum window size is capped at 1<<30 bytes. +// Maximum and default is 1 << 63 bytes. +func WithDecoderMaxMemory(n uint64) DOption { + return func(o *decoderOptions) error { + if n == 0 { + return errors.New("WithDecoderMaxMemory must be at least 1") + } + if n > 1<<63 { + return fmt.Errorf("WithDecoderMaxmemory must be less than 1 << 63") + } + o.maxDecodedSize = n + return nil + } +} + +// WithDecoderDicts allows to register one or more dictionaries for the decoder. +// If several dictionaries with the same ID is provided the last one will be used. +func WithDecoderDicts(dicts ...[]byte) DOption { + return func(o *decoderOptions) error { + for _, b := range dicts { + d, err := loadDict(b) + if err != nil { + return err + } + o.dicts = append(o.dicts, *d) + } + return nil + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/dict.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/dict.go new file mode 100644 index 00000000000..fa25a18d864 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/dict.go @@ -0,0 +1,122 @@ +package zstd + +import ( + "bytes" + "encoding/binary" + "errors" + "fmt" + "io" + + "github.com/klauspost/compress/huff0" +) + +type dict struct { + id uint32 + + litEnc *huff0.Scratch + llDec, ofDec, mlDec sequenceDec + //llEnc, ofEnc, mlEnc []*fseEncoder + offsets [3]int + content []byte +} + +var dictMagic = [4]byte{0x37, 0xa4, 0x30, 0xec} + +// ID returns the dictionary id or 0 if d is nil. +func (d *dict) ID() uint32 { + if d == nil { + return 0 + } + return d.id +} + +// DictContentSize returns the dictionary content size or 0 if d is nil. +func (d *dict) DictContentSize() int { + if d == nil { + return 0 + } + return len(d.content) +} + +// Load a dictionary as described in +// https://github.com/facebook/zstd/blob/master/doc/zstd_compression_format.md#dictionary-format +func loadDict(b []byte) (*dict, error) { + // Check static field size. + if len(b) <= 8+(3*4) { + return nil, io.ErrUnexpectedEOF + } + d := dict{ + llDec: sequenceDec{fse: &fseDecoder{}}, + ofDec: sequenceDec{fse: &fseDecoder{}}, + mlDec: sequenceDec{fse: &fseDecoder{}}, + } + if !bytes.Equal(b[:4], dictMagic[:]) { + return nil, ErrMagicMismatch + } + d.id = binary.LittleEndian.Uint32(b[4:8]) + if d.id == 0 { + return nil, errors.New("dictionaries cannot have ID 0") + } + + // Read literal table + var err error + d.litEnc, b, err = huff0.ReadTable(b[8:], nil) + if err != nil { + return nil, err + } + d.litEnc.Reuse = huff0.ReusePolicyMust + + br := byteReader{ + b: b, + off: 0, + } + readDec := func(i tableIndex, dec *fseDecoder) error { + if err := dec.readNCount(&br, uint16(maxTableSymbol[i])); err != nil { + return err + } + if br.overread() { + return io.ErrUnexpectedEOF + } + err = dec.transform(symbolTableX[i]) + if err != nil { + println("Transform table error:", err) + return err + } + if debug { + println("Read table ok", "symbolLen:", dec.symbolLen) + } + // Set decoders as predefined so they aren't reused. + dec.preDefined = true + return nil + } + + if err := readDec(tableOffsets, d.ofDec.fse); err != nil { + return nil, err + } + if err := readDec(tableMatchLengths, d.mlDec.fse); err != nil { + return nil, err + } + if err := readDec(tableLiteralLengths, d.llDec.fse); err != nil { + return nil, err + } + if br.remain() < 12 { + return nil, io.ErrUnexpectedEOF + } + + d.offsets[0] = int(br.Uint32()) + br.advance(4) + d.offsets[1] = int(br.Uint32()) + br.advance(4) + d.offsets[2] = int(br.Uint32()) + br.advance(4) + if d.offsets[0] <= 0 || d.offsets[1] <= 0 || d.offsets[2] <= 0 { + return nil, errors.New("invalid offset in dictionary") + } + d.content = make([]byte, br.remain()) + copy(d.content, br.unread()) + if d.offsets[0] > len(d.content) || d.offsets[1] > len(d.content) || d.offsets[2] > len(d.content) { + return nil, fmt.Errorf("initial offset bigger than dictionary content size %d, offsets: %v", len(d.content), d.offsets) + } + + return &d, nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_base.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_base.go new file mode 100644 index 00000000000..b1b7c6e6a72 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_base.go @@ -0,0 +1,155 @@ +package zstd + +import ( + "fmt" + "math/bits" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +type fastBase struct { + // cur is the offset at the start of hist + cur int32 + // maximum offset. Should be at least 2x block size. + maxMatchOff int32 + hist []byte + crc *xxhash.Digest + tmp [8]byte + blk *blockEnc + lastDictID uint32 +} + +// CRC returns the underlying CRC writer. +func (e *fastBase) CRC() *xxhash.Digest { + return e.crc +} + +// AppendCRC will append the CRC to the destination slice and return it. +func (e *fastBase) AppendCRC(dst []byte) []byte { + crc := e.crc.Sum(e.tmp[:0]) + dst = append(dst, crc[7], crc[6], crc[5], crc[4]) + return dst +} + +// WindowSize returns the window size of the encoder, +// or a window size small enough to contain the input size, if > 0. +func (e *fastBase) WindowSize(size int) int32 { + if size > 0 && size < int(e.maxMatchOff) { + b := int32(1) << uint(bits.Len(uint(size))) + // Keep minimum window. + if b < 1024 { + b = 1024 + } + return b + } + return e.maxMatchOff +} + +// Block returns the current block. +func (e *fastBase) Block() *blockEnc { + return e.blk +} + +func (e *fastBase) addBlock(src []byte) int32 { + if debugAsserts && e.cur > bufferReset { + panic(fmt.Sprintf("ecur (%d) > buffer reset (%d)", e.cur, bufferReset)) + } + // check if we have space already + if len(e.hist)+len(src) > cap(e.hist) { + if cap(e.hist) == 0 { + l := e.maxMatchOff * 2 + // Make it at least 1MB. + if l < 1<<20 { + l = 1 << 20 + } + e.hist = make([]byte, 0, l) + } else { + if cap(e.hist) < int(e.maxMatchOff*2) { + panic("unexpected buffer size") + } + // Move down + offset := int32(len(e.hist)) - e.maxMatchOff + copy(e.hist[0:e.maxMatchOff], e.hist[offset:]) + e.cur += offset + e.hist = e.hist[:e.maxMatchOff] + } + } + s := int32(len(e.hist)) + e.hist = append(e.hist, src...) + return s +} + +// useBlock will replace the block with the provided one, +// but transfer recent offsets from the previous. +func (e *fastBase) UseBlock(enc *blockEnc) { + enc.reset(e.blk) + e.blk = enc +} + +func (e *fastBase) matchlenNoHist(s, t int32, src []byte) int32 { + // Extend the match to be as long as possible. + return int32(matchLen(src[s:], src[t:])) +} + +func (e *fastBase) matchlen(s, t int32, src []byte) int32 { + if debugAsserts { + if s < 0 { + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) + } + if t < 0 { + err := fmt.Sprintf("s (%d) < 0", s) + panic(err) + } + if s-t > e.maxMatchOff { + err := fmt.Sprintf("s (%d) - t (%d) > maxMatchOff (%d)", s, t, e.maxMatchOff) + panic(err) + } + if len(src)-int(s) > maxCompressedBlockSize { + panic(fmt.Sprintf("len(src)-s (%d) > maxCompressedBlockSize (%d)", len(src)-int(s), maxCompressedBlockSize)) + } + } + + // Extend the match to be as long as possible. + return int32(matchLen(src[s:], src[t:])) +} + +// Reset the encoding table. +func (e *fastBase) resetBase(d *dict, singleBlock bool) { + if e.blk == nil { + e.blk = &blockEnc{} + e.blk.init() + } else { + e.blk.reset(nil) + } + e.blk.initNewEncode() + if e.crc == nil { + e.crc = xxhash.New() + } else { + e.crc.Reset() + } + if (!singleBlock || d.DictContentSize() > 0) && cap(e.hist) < int(e.maxMatchOff*2)+d.DictContentSize() { + l := e.maxMatchOff*2 + int32(d.DictContentSize()) + // Make it at least 1MB. + if l < 1<<20 { + l = 1 << 20 + } + e.hist = make([]byte, 0, l) + } + // We offset current position so everything will be out of reach. + // If above reset line, history will be purged. + if e.cur < bufferReset { + e.cur += e.maxMatchOff + int32(len(e.hist)) + } + e.hist = e.hist[:0] + if d != nil { + // Set offsets (currently not used) + for i, off := range d.offsets { + e.blk.recentOffsets[i] = uint32(off) + e.blk.prevRecentOffsets[i] = e.blk.recentOffsets[i] + } + // Transfer litenc. + e.blk.dictLitEnc = d.litEnc + e.hist = append(e.hist, d.content...) + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_better.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_better.go new file mode 100644 index 00000000000..94a5343d00e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_better.go @@ -0,0 +1,595 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +const ( + betterLongTableBits = 19 // Bits used in the long match table + betterLongTableSize = 1 << betterLongTableBits // Size of the table + + // Note: Increasing the short table bits or making the hash shorter + // can actually lead to compression degradation since it will 'steal' more from the + // long match table and match offsets are quite big. + // This greatly depends on the type of input. + betterShortTableBits = 13 // Bits used in the short match table + betterShortTableSize = 1 << betterShortTableBits // Size of the table +) + +type prevEntry struct { + offset int32 + prev int32 +} + +// betterFastEncoder uses 2 tables, one for short matches (5 bytes) and one for long matches. +// The long match table contains the previous entry with the same hash, +// effectively making it a "chain" of length 2. +// When we find a long match we choose between the two values and select the longest. +// When we find a short match, after checking the long, we check if we can find a long at n+1 +// and that it is longer (lazy matching). +type betterFastEncoder struct { + fastBase + table [betterShortTableSize]tableEntry + longTable [betterLongTableSize]prevEntry + dictTable []tableEntry + dictLongTable []prevEntry +} + +// Encode improves compression... +func (e *betterFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= bufferReset { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = prevEntry{} + } + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + v2 := e.longTable[i].prev + if v < minOff { + v = 0 + v2 = 0 + } else { + v = v - e.cur + e.maxMatchOff + if v2 < minOff { + v2 = 0 + } else { + v2 = v2 - e.cur + e.maxMatchOff + } + } + e.longTable[i] = prevEntry{ + offset: v, + prev: v2, + } + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 9 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + var matched int32 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashS := hash5(cv, betterShortTableBits) + nextHashL := hash8(cv, betterLongTableBits) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + off := s + e.cur + e.longTable[nextHashL] = prevEntry{offset: off, prev: candidateL.offset} + e.table[nextHashS] = tableEntry{offset: off, val: uint32(cv)} + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Index match start+1 (long) -> s - 1 + index0 := s + repOff + s += lenght + repOff + + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + continue + } + const repOff2 = 1 + + // We deviate from the reference encoder and also check offset 2. + // Still slower and not much better, so disabled. + // repIndex = s - offset2 + repOff2 + if false && repIndex >= 0 && load6432(src, repIndex) == load6432(src, s+repOff) { + // Consider history as well. + var seq seq + lenght := 8 + e.matchlen(s+8+repOff2, repIndex+8, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 2 + seq.offset = 2 + if debugSequences { + println("repeat sequence 2", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + index0 := s + repOff2 + s += lenght + repOff2 + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + + // Index skipped... + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + cv = load6432(src, s) + // Swap offsets + offset1, offset2 = offset2, offset1 + continue + } + } + // Find the offsets of our two matches. + coffsetL := candidateL.offset - e.cur + coffsetLP := candidateL.prev - e.cur + + // Check if we have a long match. + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetL+8, src) + 8 + t = coffsetL + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + prevMatch := e.matchlen(s+8, coffsetLP+8, src) + 8 + if prevMatch > matched { + matched = prevMatch + t = coffsetLP + } + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + } + break + } + + // Check if we have a long match on prev. + if s-coffsetLP < e.maxMatchOff && cv == load6432(src, coffsetLP) { + // Found a long match, at least 8 bytes. + matched = e.matchlen(s+8, coffsetLP+8, src) + 8 + t = coffsetLP + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + coffsetS := candidateS.offset - e.cur + + // Check if we have a short match. + if s-coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + matched = e.matchlen(s+4, coffsetS+4, src) + 4 + + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hash8(cv, betterLongTableBits) + candidateL = e.longTable[nextHashL] + coffsetL = candidateL.offset - e.cur + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = prevEntry{offset: s + checkAt + e.cur, prev: candidateL.offset} + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("long match (after short)") + } + break + } + } + + // Check prev long... + coffsetL = candidateL.prev - e.cur + if s-coffsetL < e.maxMatchOff && cv == load6432(src, coffsetL) { + // Found a long match, at least 8 bytes. + matchedNext := e.matchlen(s+8+checkAt, coffsetL+8, src) + 8 + if matchedNext > matched { + t = coffsetL + s += checkAt + matched = matchedNext + if debugMatches { + println("prev long match (after short)") + } + break + } + } + t = coffsetS + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the n-byte match as long as possible. + l := matched + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) -> s - 1 + index0 := s - l + 1 + for index0 < s-1 { + cv0 := load6432(src, index0) + cv1 := cv0 >> 8 + h0 := hash8(cv0, betterLongTableBits) + off := index0 + e.cur + e.longTable[h0] = prevEntry{offset: off, prev: e.longTable[h0].offset} + e.table[hash5(cv1, betterShortTableBits)] = tableEntry{offset: off + 1, val: uint32(cv1)} + index0 += 2 + } + + cv = load6432(src, s) + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hash5(cv, betterShortTableBits) + nextHashL := hash8(cv, betterLongTableBits) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + e.longTable[nextHashL] = prevEntry{offset: s + e.cur, prev: e.longTable[nextHashL].offset} + e.table[nextHashS] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *betterFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + e.Encode(blk, src) +} + +// ResetDict will reset and set a dictionary if not nil +func (e *betterFastEncoder) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d == nil { + return + } + // Init or copy dict table + if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) { + e.dictTable = make([]tableEntry, len(e.table)) + } + end := int32(len(d.content)) - 8 + e.maxMatchOff + for i := e.maxMatchOff; i < end; i += 4 { + const hashLog = betterShortTableBits + + cv := load6432(d.content, i-e.maxMatchOff) + nextHash := hash5(cv, hashLog) // 0 -> 4 + nextHash1 := hash5(cv>>8, hashLog) // 1 -> 5 + nextHash2 := hash5(cv>>16, hashLog) // 2 -> 6 + nextHash3 := hash5(cv>>24, hashLog) // 3 -> 7 + e.dictTable[nextHash] = tableEntry{ + val: uint32(cv), + offset: i, + } + e.dictTable[nextHash1] = tableEntry{ + val: uint32(cv >> 8), + offset: i + 1, + } + e.dictTable[nextHash2] = tableEntry{ + val: uint32(cv >> 16), + offset: i + 2, + } + e.dictTable[nextHash3] = tableEntry{ + val: uint32(cv >> 24), + offset: i + 3, + } + } + e.lastDictID = d.id + } + + // Init or copy dict table + if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) { + e.dictLongTable = make([]prevEntry, len(e.longTable)) + } + if len(d.content) >= 8 { + cv := load6432(d.content, 0) + h := hash8(cv, betterLongTableBits) + e.dictLongTable[h] = prevEntry{ + offset: e.maxMatchOff, + prev: e.dictLongTable[h].offset, + } + + end := int32(len(d.content)) - 8 + e.maxMatchOff + off := 8 // First to read + for i := e.maxMatchOff + 1; i < end; i++ { + cv = cv>>8 | (uint64(d.content[off]) << 56) + h := hash8(cv, betterLongTableBits) + e.dictLongTable[h] = prevEntry{ + offset: i, + prev: e.dictLongTable[h].offset, + } + off++ + } + } + e.lastDictID = d.id + } + // Reset table to initial state + copy(e.longTable[:], e.dictLongTable) + + e.cur = e.maxMatchOff + // Reset table to initial state + copy(e.table[:], e.dictTable) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_dfast.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_dfast.go new file mode 100644 index 00000000000..19eebf66e50 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_dfast.go @@ -0,0 +1,713 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "fmt" + +const ( + dFastLongTableBits = 17 // Bits used in the long match table + dFastLongTableSize = 1 << dFastLongTableBits // Size of the table + dFastLongTableMask = dFastLongTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. + + dFastShortTableBits = tableBits // Bits used in the short match table + dFastShortTableSize = 1 << dFastShortTableBits // Size of the table + dFastShortTableMask = dFastShortTableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. +) + +type doubleFastEncoder struct { + fastEncoder + longTable [dFastLongTableSize]tableEntry + dictLongTable []tableEntry +} + +// Encode mimmics functionality in zstd_dfast.c +func (e *doubleFastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + for e.cur >= bufferReset { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = tableEntry{} + } + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + for i := range e.longTable[:] { + v := e.longTable[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.longTable[i].offset = v + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + // We allow the encoder to optionally turn off repeat offsets across blocks + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHashS := hash5(cv, dFastShortTableBits) + nextHashL := hash8(cv, dFastLongTableBits) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + + if canRepeat { + if repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + lenght := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + + seq.matchLen = uint32(lenght - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch-1 { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += lenght + repOff + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, lenght) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + } + // Find the offsets of our two matches. + coffsetL := s - (candidateL.offset - e.cur) + coffsetS := s - (candidateS.offset - e.cur) + + // Check if we have a long match. + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + // Check if we have a short match. + if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hash8(cv, dFastLongTableBits) + candidateL = e.longTable[nextHashL] + coffsetL = s - (candidateL.offset - e.cur) + checkAt + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)} + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + s += checkAt + if debugMatches { + println("long match (after short)") + } + break + } + + t = candidateS.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + l := e.matchlen(s+4, t+4, src) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) and start+2 (short) + index0 := s - l + 1 + // Index match end-2 (long) and end-1 (short) + index1 := s - 2 + + cv0 := load6432(src, index0) + cv1 := load6432(src, index1) + te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} + te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} + e.longTable[hash8(cv0, dFastLongTableBits)] = te0 + e.longTable[hash8(cv1, dFastLongTableBits)] = te1 + cv0 >>= 8 + cv1 >>= 8 + te0.offset++ + te1.offset++ + te0.val = uint32(cv0) + te1.val = uint32(cv1) + e.table[hash5(cv0, dFastShortTableBits)] = te0 + e.table[hash5(cv1, dFastShortTableBits)] = te1 + + cv = load6432(src, s) + + if !canRepeat { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hash5(cv, dFastShortTableBits) + nextHashL := hash8(cv, dFastLongTableBits) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + l := 4 + e.matchlen(s+4, o2+4, src) + + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *doubleFastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + const ( + // Input margin is the number of bytes we read (8) + // and the maximum we will read ahead (2) + inputMargin = 8 + 2 + minNonLiteralBlockSize = 16 + ) + + // Protect against e.cur wraparound. + if e.cur >= bufferReset { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + for i := range e.longTable[:] { + e.longTable[i] = tableEntry{} + } + e.cur = e.maxMatchOff + } + + s := int32(0) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 1. + const stepSize = 1 + + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + var t int32 + for { + + nextHashS := hash5(cv, dFastShortTableBits) + nextHashL := hash8(cv, dFastLongTableBits) + candidateL := e.longTable[nextHashL] + candidateS := e.table[nextHashS] + + const repOff = 1 + repIndex := s - offset1 + repOff + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + + if len(blk.sequences) > 2 { + if load3232(src, repIndex) == uint32(cv>>(repOff*8)) { + // Consider history as well. + var seq seq + //length := 4 + e.matchlen(s+4+repOff, repIndex+4, src) + length := 4 + int32(matchLen(src[s+4+repOff:], src[repIndex+4:])) + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + repOff + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for repIndex > tMin && start > startLimit && src[repIndex-1] == src[start-1] { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + repOff + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + } + // Find the offsets of our two matches. + coffsetL := s - (candidateL.offset - e.cur) + coffsetS := s - (candidateS.offset - e.cur) + + // Check if we have a long match. + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d). cur: %d", s, t, e.cur)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugMatches { + println("long match") + } + break + } + + // Check if we have a short match. + if coffsetS < e.maxMatchOff && uint32(cv) == candidateS.val { + // found a regular match + // See if we can find a long match at s+1 + const checkAt = 1 + cv := load6432(src, s+checkAt) + nextHashL = hash8(cv, dFastLongTableBits) + candidateL = e.longTable[nextHashL] + coffsetL = s - (candidateL.offset - e.cur) + checkAt + + // We can store it, since we have at least a 4 byte match. + e.longTable[nextHashL] = tableEntry{offset: s + checkAt + e.cur, val: uint32(cv)} + if coffsetL < e.maxMatchOff && uint32(cv) == candidateL.val { + // Found a long match, likely at least 8 bytes. + // Reference encoder checks all 8 bytes, we only check 4, + // but the likelihood of both the first 4 bytes and the hash matching should be enough. + t = candidateL.offset - e.cur + s += checkAt + if debugMatches { + println("long match (after short)") + } + break + } + + t = candidateS.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + if debugMatches { + println("short match") + } + break + } + + // No match found, move forward in input. + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + + // A 4-byte match has been found. Update recent offsets. + // We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + // Extend the 4-byte match as long as possible. + //l := e.matchlen(s+4, t+4, src) + 4 + l := int32(matchLen(src[s+4:], src[t+4:])) + 4 + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] { + s-- + t-- + l++ + } + + // Write our sequence + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + + // Index match start+1 (long) and start+2 (short) + index0 := s - l + 1 + // Index match end-2 (long) and end-1 (short) + index1 := s - 2 + + cv0 := load6432(src, index0) + cv1 := load6432(src, index1) + te0 := tableEntry{offset: index0 + e.cur, val: uint32(cv0)} + te1 := tableEntry{offset: index1 + e.cur, val: uint32(cv1)} + e.longTable[hash8(cv0, dFastLongTableBits)] = te0 + e.longTable[hash8(cv1, dFastLongTableBits)] = te1 + cv0 >>= 8 + cv1 >>= 8 + te0.offset++ + te1.offset++ + te0.val = uint32(cv0) + te1.val = uint32(cv1) + e.table[hash5(cv0, dFastShortTableBits)] = te0 + e.table[hash5(cv1, dFastShortTableBits)] = te1 + + cv = load6432(src, s) + + if len(blk.sequences) <= 2 { + continue + } + + // Check offset 2 + for { + o2 := s - offset2 + if load3232(src, o2) != uint32(cv) { + // Do regular search + break + } + + // Store this, since we have it. + nextHashS := hash5(cv1>>8, dFastShortTableBits) + nextHashL := hash8(cv, dFastLongTableBits) + + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + //l := 4 + e.matchlen(s+4, o2+4, src) + l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) + + entry := tableEntry{offset: s + e.cur, val: uint32(cv)} + e.longTable[nextHashL] = entry + e.table[nextHashS] = entry + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + // Finished + break encodeLoop + } + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } + + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < bufferReset { + e.cur += int32(len(src)) + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *doubleFastEncoder) Reset(d *dict, singleBlock bool) { + e.fastEncoder.Reset(d, singleBlock) + if d == nil { + return + } + + // Init or copy dict table + if len(e.dictLongTable) != len(e.longTable) || d.id != e.lastDictID { + if len(e.dictLongTable) != len(e.longTable) { + e.dictLongTable = make([]tableEntry, len(e.longTable)) + } + if len(d.content) >= 8 { + cv := load6432(d.content, 0) + e.dictLongTable[hash8(cv, dFastLongTableBits)] = tableEntry{ + val: uint32(cv), + offset: e.maxMatchOff, + } + end := int32(len(d.content)) - 8 + e.maxMatchOff + for i := e.maxMatchOff + 1; i < end; i++ { + cv = cv>>8 | (uint64(d.content[i-e.maxMatchOff+7]) << 56) + e.dictLongTable[hash8(cv, dFastLongTableBits)] = tableEntry{ + val: uint32(cv), + offset: i, + } + } + } + e.lastDictID = d.id + } + // Reset table to initial state + e.cur = e.maxMatchOff + copy(e.longTable[:], e.dictLongTable) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_fast.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_fast.go new file mode 100644 index 00000000000..0b301df4390 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/enc_fast.go @@ -0,0 +1,661 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" + "math" + "math/bits" +) + +const ( + tableBits = 15 // Bits used in the table + tableSize = 1 << tableBits // Size of the table + tableMask = tableSize - 1 // Mask for table indices. Redundant, but can eliminate bounds checks. + maxMatchLength = 131074 +) + +type tableEntry struct { + val uint32 + offset int32 +} + +type fastEncoder struct { + fastBase + table [tableSize]tableEntry + dictTable []tableEntry +} + +// Encode mimmics functionality in zstd_fast.c +func (e *fastEncoder) Encode(blk *blockEnc, src []byte) { + const ( + inputMargin = 8 + minNonLiteralBlockSize = 1 + 1 + inputMargin + ) + + // Protect against e.cur wraparound. + for e.cur >= bufferReset { + if len(e.hist) == 0 { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + e.cur = e.maxMatchOff + break + } + // Shift down everything in the table that isn't already too far away. + minOff := e.cur + int32(len(e.hist)) - e.maxMatchOff + for i := range e.table[:] { + v := e.table[i].offset + if v < minOff { + v = 0 + } else { + v = v - e.cur + e.maxMatchOff + } + e.table[i].offset = v + } + e.cur = e.maxMatchOff + break + } + + s := e.addBlock(src) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + // Override src + src = e.hist + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 2. + const stepSize = 2 + + // TEMPLATE + const hashLog = tableBits + // seems global, but would be nice to tweak. + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // t will contain the match offset when we find one. + // When existing the search loop, we have already checked 4 bytes. + var t int32 + + // We will not use repeat offsets across blocks. + // By not using them for the first 3 matches + canRepeat := len(blk.sequences) > 2 + + for { + if debugAsserts && canRepeat && offset1 == 0 { + panic("offset0 was 0") + } + + nextHash := hash6(cv, hashLog) + nextHash2 := hash6(cv>>8, hashLog) + candidate := e.table[nextHash] + candidate2 := e.table[nextHash2] + repIndex := s - offset1 + 2 + + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)} + + if canRepeat && repIndex >= 0 && load3232(src, repIndex) == uint32(cv>>16) { + // Consider history as well. + var seq seq + var length int32 + // length = 4 + e.matchlen(s+6, repIndex+4, src) + { + a := src[s+6:] + b := src[repIndex+4:] + endI := len(a) & (math.MaxInt32 - 7) + length = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + 2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + sMin := s - e.maxMatchOff + if sMin < 0 { + sMin = 0 + } + for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] && seq.matchLen < maxMatchLength-zstdMinMatch { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + 2 + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + coffset0 := s - (candidate.offset - e.cur) + coffset1 := s - (candidate2.offset - e.cur) + 1 + if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { + // found a regular match + t = candidate.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + break + } + + if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val { + // found a regular match + t = candidate2.offset - e.cur + s++ + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + break + } + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // A 4-byte match has been found. We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && canRepeat && int(offset1) > len(src) { + panic("invalid offset") + } + + // Extend the 4-byte match as long as possible. + //l := e.matchlen(s+4, t+4, src) + 4 + var l int32 + { + a := src[s+4:] + b := src[t+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] && l < maxMatchLength { + s-- + t-- + l++ + } + + // Write our sequence. + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + // Don't use repeat offsets + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + + // Check offset 2 + if o2 := s - offset2; canRepeat && load3232(src, o2) == uint32(cv) { + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + //l := 4 + e.matchlen(s+4, o2+4, src) + var l int32 + { + a := src[s+4:] + b := src[o2+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + // Store this, since we have it. + nextHash := hash6(cv, hashLog) + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + break encodeLoop + } + // Prepare next loop. + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + blk.recentOffsets[0] = uint32(offset1) + blk.recentOffsets[1] = uint32(offset2) + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } +} + +// EncodeNoHist will encode a block with no history and no following blocks. +// Most notable difference is that src will not be copied for history and +// we do not need to check for max match length. +func (e *fastEncoder) EncodeNoHist(blk *blockEnc, src []byte) { + const ( + inputMargin = 8 + minNonLiteralBlockSize = 1 + 1 + inputMargin + ) + if debug { + if len(src) > maxBlockSize { + panic("src too big") + } + } + + // Protect against e.cur wraparound. + if e.cur >= bufferReset { + for i := range e.table[:] { + e.table[i] = tableEntry{} + } + e.cur = e.maxMatchOff + } + + s := int32(0) + blk.size = len(src) + if len(src) < minNonLiteralBlockSize { + blk.extraLits = len(src) + blk.literals = blk.literals[:len(src)] + copy(blk.literals, src) + return + } + + sLimit := int32(len(src)) - inputMargin + // stepSize is the number of bytes to skip on every main loop iteration. + // It should be >= 2. + const stepSize = 2 + + // TEMPLATE + const hashLog = tableBits + // seems global, but would be nice to tweak. + const kSearchStrength = 8 + + // nextEmit is where in src the next emitLiteral should start from. + nextEmit := s + cv := load6432(src, s) + + // Relative offsets + offset1 := int32(blk.recentOffsets[0]) + offset2 := int32(blk.recentOffsets[1]) + + addLiterals := func(s *seq, until int32) { + if until == nextEmit { + return + } + blk.literals = append(blk.literals, src[nextEmit:until]...) + s.litLen = uint32(until - nextEmit) + } + if debug { + println("recent offsets:", blk.recentOffsets) + } + +encodeLoop: + for { + // t will contain the match offset when we find one. + // When existing the search loop, we have already checked 4 bytes. + var t int32 + + // We will not use repeat offsets across blocks. + // By not using them for the first 3 matches + + for { + nextHash := hash6(cv, hashLog) + nextHash2 := hash6(cv>>8, hashLog) + candidate := e.table[nextHash] + candidate2 := e.table[nextHash2] + repIndex := s - offset1 + 2 + + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + e.table[nextHash2] = tableEntry{offset: s + e.cur + 1, val: uint32(cv >> 8)} + + if len(blk.sequences) > 2 && load3232(src, repIndex) == uint32(cv>>16) { + // Consider history as well. + var seq seq + // length := 4 + e.matchlen(s+6, repIndex+4, src) + // length := 4 + int32(matchLen(src[s+6:], src[repIndex+4:])) + var length int32 + { + a := src[s+6:] + b := src[repIndex+4:] + endI := len(a) & (math.MaxInt32 - 7) + length = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + length = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + seq.matchLen = uint32(length - zstdMinMatch) + + // We might be able to match backwards. + // Extend as long as we can. + start := s + 2 + // We end the search early, so we don't risk 0 literals + // and have to do special offset treatment. + startLimit := nextEmit + 1 + + sMin := s - e.maxMatchOff + if sMin < 0 { + sMin = 0 + } + for repIndex > sMin && start > startLimit && src[repIndex-1] == src[start-1] { + repIndex-- + start-- + seq.matchLen++ + } + addLiterals(&seq, start) + + // rep 0 + seq.offset = 1 + if debugSequences { + println("repeat sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + s += length + 2 + nextEmit = s + if s >= sLimit { + if debug { + println("repeat ended", s, length) + + } + break encodeLoop + } + cv = load6432(src, s) + continue + } + coffset0 := s - (candidate.offset - e.cur) + coffset1 := s - (candidate2.offset - e.cur) + 1 + if coffset0 < e.maxMatchOff && uint32(cv) == candidate.val { + // found a regular match + t = candidate.offset - e.cur + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0, candidate.offset: %d, e.cur: %d, coffset0: %d, e.maxMatchOff: %d", t, candidate.offset, e.cur, coffset0, e.maxMatchOff)) + } + break + } + + if coffset1 < e.maxMatchOff && uint32(cv>>8) == candidate2.val { + // found a regular match + t = candidate2.offset - e.cur + s++ + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + if debugAsserts && s-t > e.maxMatchOff { + panic("s - t >e.maxMatchOff") + } + if debugAsserts && t < 0 { + panic("t<0") + } + break + } + s += stepSize + ((s - nextEmit) >> (kSearchStrength - 1)) + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + } + // A 4-byte match has been found. We'll later see if more than 4 bytes. + offset2 = offset1 + offset1 = s - t + + if debugAsserts && s <= t { + panic(fmt.Sprintf("s (%d) <= t (%d)", s, t)) + } + + if debugAsserts && t < 0 { + panic(fmt.Sprintf("t (%d) < 0 ", t)) + } + // Extend the 4-byte match as long as possible. + //l := e.matchlenNoHist(s+4, t+4, src) + 4 + // l := int32(matchLen(src[s+4:], src[t+4:])) + 4 + var l int32 + { + a := src[s+4:] + b := src[t+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + // Extend backwards + tMin := s - e.maxMatchOff + if tMin < 0 { + tMin = 0 + } + for t > tMin && s > nextEmit && src[t-1] == src[s-1] { + s-- + t-- + l++ + } + + // Write our sequence. + var seq seq + seq.litLen = uint32(s - nextEmit) + seq.matchLen = uint32(l - zstdMinMatch) + if seq.litLen > 0 { + blk.literals = append(blk.literals, src[nextEmit:s]...) + } + // Don't use repeat offsets + seq.offset = uint32(s-t) + 3 + s += l + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + nextEmit = s + if s >= sLimit { + break encodeLoop + } + cv = load6432(src, s) + + // Check offset 2 + if o2 := s - offset2; len(blk.sequences) > 2 && load3232(src, o2) == uint32(cv) { + // We have at least 4 byte match. + // No need to check backwards. We come straight from a match + //l := 4 + e.matchlenNoHist(s+4, o2+4, src) + // l := 4 + int32(matchLen(src[s+4:], src[o2+4:])) + var l int32 + { + a := src[s+4:] + b := src[o2+4:] + endI := len(a) & (math.MaxInt32 - 7) + l = int32(endI) + 4 + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + l = int32(i+bits.TrailingZeros64(diff)>>3) + 4 + break + } + } + } + + // Store this, since we have it. + nextHash := hash6(cv, hashLog) + e.table[nextHash] = tableEntry{offset: s + e.cur, val: uint32(cv)} + seq.matchLen = uint32(l) - zstdMinMatch + seq.litLen = 0 + // Since litlen is always 0, this is offset 1. + seq.offset = 1 + s += l + nextEmit = s + if debugSequences { + println("sequence", seq, "next s:", s) + } + blk.sequences = append(blk.sequences, seq) + + // Swap offset 1 and 2. + offset1, offset2 = offset2, offset1 + if s >= sLimit { + break encodeLoop + } + // Prepare next loop. + cv = load6432(src, s) + } + } + + if int(nextEmit) < len(src) { + blk.literals = append(blk.literals, src[nextEmit:]...) + blk.extraLits = len(src) - int(nextEmit) + } + if debug { + println("returning, recent offsets:", blk.recentOffsets, "extra literals:", blk.extraLits) + } + // We do not store history, so we must offset e.cur to avoid false matches for next user. + if e.cur < bufferReset { + e.cur += int32(len(src)) + } +} + +// ResetDict will reset and set a dictionary if not nil +func (e *fastEncoder) Reset(d *dict, singleBlock bool) { + e.resetBase(d, singleBlock) + if d == nil { + return + } + + // Init or copy dict table + if len(e.dictTable) != len(e.table) || d.id != e.lastDictID { + if len(e.dictTable) != len(e.table) { + e.dictTable = make([]tableEntry, len(e.table)) + } + if true { + end := e.maxMatchOff + int32(len(d.content)) - 8 + for i := e.maxMatchOff; i < end; i += 3 { + const hashLog = tableBits + + cv := load6432(d.content, i-e.maxMatchOff) + nextHash := hash6(cv, hashLog) // 0 -> 5 + nextHash1 := hash6(cv>>8, hashLog) // 1 -> 6 + nextHash2 := hash6(cv>>16, hashLog) // 2 -> 7 + e.dictTable[nextHash] = tableEntry{ + val: uint32(cv), + offset: i, + } + e.dictTable[nextHash1] = tableEntry{ + val: uint32(cv >> 8), + offset: i + 1, + } + e.dictTable[nextHash2] = tableEntry{ + val: uint32(cv >> 16), + offset: i + 2, + } + } + } + e.lastDictID = d.id + } + + e.cur = e.maxMatchOff + // Reset table to initial state + copy(e.table[:], e.dictTable) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder.go new file mode 100644 index 00000000000..f5759211dac --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder.go @@ -0,0 +1,570 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "crypto/rand" + "fmt" + "io" + rdebug "runtime/debug" + "sync" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +// Encoder provides encoding to Zstandard. +// An Encoder can be used for either compressing a stream via the +// io.WriteCloser interface supported by the Encoder or as multiple independent +// tasks via the EncodeAll function. +// Smaller encodes are encouraged to use the EncodeAll function. +// Use NewWriter to create a new instance. +type Encoder struct { + o encoderOptions + encoders chan encoder + state encoderState + init sync.Once +} + +type encoder interface { + Encode(blk *blockEnc, src []byte) + EncodeNoHist(blk *blockEnc, src []byte) + Block() *blockEnc + CRC() *xxhash.Digest + AppendCRC([]byte) []byte + WindowSize(size int) int32 + UseBlock(*blockEnc) + Reset(d *dict, singleBlock bool) +} + +type encoderState struct { + w io.Writer + filling []byte + current []byte + previous []byte + encoder encoder + writing *blockEnc + err error + writeErr error + nWritten int64 + headerWritten bool + eofWritten bool + fullFrameWritten bool + + // This waitgroup indicates an encode is running. + wg sync.WaitGroup + // This waitgroup indicates we have a block encoding/writing. + wWg sync.WaitGroup +} + +// NewWriter will create a new Zstandard encoder. +// If the encoder will be used for encoding blocks a nil writer can be used. +func NewWriter(w io.Writer, opts ...EOption) (*Encoder, error) { + initPredefined() + var e Encoder + e.o.setDefault() + for _, o := range opts { + err := o(&e.o) + if err != nil { + return nil, err + } + } + if w != nil { + e.Reset(w) + } + return &e, nil +} + +func (e *Encoder) initialize() { + if e.o.concurrent == 0 { + e.o.setDefault() + } + e.encoders = make(chan encoder, e.o.concurrent) + for i := 0; i < e.o.concurrent; i++ { + enc := e.o.encoder() + e.encoders <- enc + } +} + +// Reset will re-initialize the writer and new writes will encode to the supplied writer +// as a new, independent stream. +func (e *Encoder) Reset(w io.Writer) { + s := &e.state + s.wg.Wait() + s.wWg.Wait() + if cap(s.filling) == 0 { + s.filling = make([]byte, 0, e.o.blockSize) + } + if cap(s.current) == 0 { + s.current = make([]byte, 0, e.o.blockSize) + } + if cap(s.previous) == 0 { + s.previous = make([]byte, 0, e.o.blockSize) + } + if s.encoder == nil { + s.encoder = e.o.encoder() + } + if s.writing == nil { + s.writing = &blockEnc{} + s.writing.init() + } + s.writing.initNewEncode() + s.filling = s.filling[:0] + s.current = s.current[:0] + s.previous = s.previous[:0] + s.encoder.Reset(e.o.dict, false) + s.headerWritten = false + s.eofWritten = false + s.fullFrameWritten = false + s.w = w + s.err = nil + s.nWritten = 0 + s.writeErr = nil +} + +// Write data to the encoder. +// Input data will be buffered and as the buffer fills up +// content will be compressed and written to the output. +// When done writing, use Close to flush the remaining output +// and write CRC if requested. +func (e *Encoder) Write(p []byte) (n int, err error) { + s := &e.state + for len(p) > 0 { + if len(p)+len(s.filling) < e.o.blockSize { + if e.o.crc { + _, _ = s.encoder.CRC().Write(p) + } + s.filling = append(s.filling, p...) + return n + len(p), nil + } + add := p + if len(p)+len(s.filling) > e.o.blockSize { + add = add[:e.o.blockSize-len(s.filling)] + } + if e.o.crc { + _, _ = s.encoder.CRC().Write(add) + } + s.filling = append(s.filling, add...) + p = p[len(add):] + n += len(add) + if len(s.filling) < e.o.blockSize { + return n, nil + } + err := e.nextBlock(false) + if err != nil { + return n, err + } + if debugAsserts && len(s.filling) > 0 { + panic(len(s.filling)) + } + } + return n, nil +} + +// nextBlock will synchronize and start compressing input in e.state.filling. +// If an error has occurred during encoding it will be returned. +func (e *Encoder) nextBlock(final bool) error { + s := &e.state + // Wait for current block. + s.wg.Wait() + if s.err != nil { + return s.err + } + if len(s.filling) > e.o.blockSize { + return fmt.Errorf("block > maxStoreBlockSize") + } + if !s.headerWritten { + // If we have a single block encode, do a sync compression. + if final && len(s.filling) > 0 { + s.current = e.EncodeAll(s.filling, s.current[:0]) + var n2 int + n2, s.err = s.w.Write(s.current) + if s.err != nil { + return s.err + } + s.nWritten += int64(n2) + s.current = s.current[:0] + s.filling = s.filling[:0] + s.headerWritten = true + s.fullFrameWritten = true + s.eofWritten = true + return nil + } + + var tmp [maxHeaderSize]byte + fh := frameHeader{ + ContentSize: 0, + WindowSize: uint32(s.encoder.WindowSize(0)), + SingleSegment: false, + Checksum: e.o.crc, + DictID: e.o.dict.ID(), + } + + dst, err := fh.appendTo(tmp[:0]) + if err != nil { + return err + } + s.headerWritten = true + s.wWg.Wait() + var n2 int + n2, s.err = s.w.Write(dst) + if s.err != nil { + return s.err + } + s.nWritten += int64(n2) + } + if s.eofWritten { + // Ensure we only write it once. + final = false + } + + if len(s.filling) == 0 { + // Final block, but no data. + if final { + enc := s.encoder + blk := enc.Block() + blk.reset(nil) + blk.last = true + blk.encodeRaw(nil) + s.wWg.Wait() + _, s.err = s.w.Write(blk.output) + s.nWritten += int64(len(blk.output)) + s.eofWritten = true + } + return s.err + } + + // Move blocks forward. + s.filling, s.current, s.previous = s.previous[:0], s.filling, s.current + s.wg.Add(1) + go func(src []byte) { + if debug { + println("Adding block,", len(src), "bytes, final:", final) + } + defer func() { + if r := recover(); r != nil { + s.err = fmt.Errorf("panic while encoding: %v", r) + rdebug.PrintStack() + } + s.wg.Done() + }() + enc := s.encoder + blk := enc.Block() + enc.Encode(blk, src) + blk.last = final + if final { + s.eofWritten = true + } + // Wait for pending writes. + s.wWg.Wait() + if s.writeErr != nil { + s.err = s.writeErr + return + } + // Transfer encoders from previous write block. + blk.swapEncoders(s.writing) + // Transfer recent offsets to next. + enc.UseBlock(s.writing) + s.writing = blk + s.wWg.Add(1) + go func() { + defer func() { + if r := recover(); r != nil { + s.writeErr = fmt.Errorf("panic while encoding/writing: %v", r) + rdebug.PrintStack() + } + s.wWg.Done() + }() + err := errIncompressible + // If we got the exact same number of literals as input, + // assume the literals cannot be compressed. + if len(src) != len(blk.literals) || len(src) != e.o.blockSize { + err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + } + switch err { + case errIncompressible: + if debug { + println("Storing incompressible block as raw") + } + blk.encodeRaw(src) + // In fast mode, we do not transfer offsets, so we don't have to deal with changing the. + case nil: + default: + s.writeErr = err + return + } + _, s.writeErr = s.w.Write(blk.output) + s.nWritten += int64(len(blk.output)) + }() + }(s.current) + return nil +} + +// ReadFrom reads data from r until EOF or error. +// The return value n is the number of bytes read. +// Any error except io.EOF encountered during the read is also returned. +// +// The Copy function uses ReaderFrom if available. +func (e *Encoder) ReadFrom(r io.Reader) (n int64, err error) { + if debug { + println("Using ReadFrom") + } + + // Flush any current writes. + if len(e.state.filling) > 0 { + if err := e.nextBlock(false); err != nil { + return 0, err + } + } + e.state.filling = e.state.filling[:e.o.blockSize] + src := e.state.filling + for { + n2, err := r.Read(src) + if e.o.crc { + _, _ = e.state.encoder.CRC().Write(src[:n2]) + } + // src is now the unfilled part... + src = src[n2:] + n += int64(n2) + switch err { + case io.EOF: + e.state.filling = e.state.filling[:len(e.state.filling)-len(src)] + if debug { + println("ReadFrom: got EOF final block:", len(e.state.filling)) + } + return n, nil + default: + if debug { + println("ReadFrom: got error:", err) + } + e.state.err = err + return n, err + case nil: + } + if len(src) > 0 { + if debug { + println("ReadFrom: got space left in source:", len(src)) + } + continue + } + err = e.nextBlock(false) + if err != nil { + return n, err + } + e.state.filling = e.state.filling[:e.o.blockSize] + src = e.state.filling + } +} + +// Flush will send the currently written data to output +// and block until everything has been written. +// This should only be used on rare occasions where pushing the currently queued data is critical. +func (e *Encoder) Flush() error { + s := &e.state + if len(s.filling) > 0 { + err := e.nextBlock(false) + if err != nil { + return err + } + } + s.wg.Wait() + s.wWg.Wait() + if s.err != nil { + return s.err + } + return s.writeErr +} + +// Close will flush the final output and close the stream. +// The function will block until everything has been written. +// The Encoder can still be re-used after calling this. +func (e *Encoder) Close() error { + s := &e.state + if s.encoder == nil { + return nil + } + err := e.nextBlock(true) + if err != nil { + return err + } + if e.state.fullFrameWritten { + return s.err + } + s.wg.Wait() + s.wWg.Wait() + + if s.err != nil { + return s.err + } + if s.writeErr != nil { + return s.writeErr + } + + // Write CRC + if e.o.crc && s.err == nil { + // heap alloc. + var tmp [4]byte + _, s.err = s.w.Write(s.encoder.AppendCRC(tmp[:0])) + s.nWritten += 4 + } + + // Add padding with content from crypto/rand.Reader + if s.err == nil && e.o.pad > 0 { + add := calcSkippableFrame(s.nWritten, int64(e.o.pad)) + frame, err := skippableFrame(s.filling[:0], add, rand.Reader) + if err != nil { + return err + } + _, s.err = s.w.Write(frame) + } + return s.err +} + +// EncodeAll will encode all input in src and append it to dst. +// This function can be called concurrently, but each call will only run on a single goroutine. +// If empty input is given, nothing is returned, unless WithZeroFrames is specified. +// Encoded blocks can be concatenated and the result will be the combined input stream. +// Data compressed with EncodeAll can be decoded with the Decoder, +// using either a stream or DecodeAll. +func (e *Encoder) EncodeAll(src, dst []byte) []byte { + if len(src) == 0 { + if e.o.fullZero { + // Add frame header. + fh := frameHeader{ + ContentSize: 0, + WindowSize: MinWindowSize, + SingleSegment: true, + // Adding a checksum would be a waste of space. + Checksum: false, + DictID: 0, + } + dst, _ = fh.appendTo(dst) + + // Write raw block as last one only. + var blk blockHeader + blk.setSize(0) + blk.setType(blockTypeRaw) + blk.setLast(true) + dst = blk.appendTo(dst) + } + return dst + } + e.init.Do(e.initialize) + enc := <-e.encoders + defer func() { + // Release encoder reference to last block. + // If a non-single block is needed the encoder will reset again. + e.encoders <- enc + }() + // Use single segments when above minimum window and below 1MB. + single := len(src) < 1<<20 && len(src) > MinWindowSize + if e.o.single != nil { + single = *e.o.single + } + fh := frameHeader{ + ContentSize: uint64(len(src)), + WindowSize: uint32(enc.WindowSize(len(src))), + SingleSegment: single, + Checksum: e.o.crc, + DictID: e.o.dict.ID(), + } + + // If less than 1MB, allocate a buffer up front. + if len(dst) == 0 && cap(dst) == 0 && len(src) < 1<<20 { + dst = make([]byte, 0, len(src)) + } + dst, err := fh.appendTo(dst) + if err != nil { + panic(err) + } + + // If we can do everything in one block, prefer that. + if len(src) <= maxCompressedBlockSize { + enc.Reset(e.o.dict, true) + // Slightly faster with no history and everything in one block. + if e.o.crc { + _, _ = enc.CRC().Write(src) + } + blk := enc.Block() + blk.last = true + if e.o.dict == nil { + enc.EncodeNoHist(blk, src) + } else { + enc.Encode(blk, src) + } + + // If we got the exact same number of literals as input, + // assume the literals cannot be compressed. + err := errIncompressible + oldout := blk.output + if len(blk.literals) != len(src) || len(src) != e.o.blockSize { + // Output directly to dst + blk.output = dst + err = blk.encode(src, e.o.noEntropy, !e.o.allLitEntropy) + } + + switch err { + case errIncompressible: + if debug { + println("Storing incompressible block as raw") + } + dst = blk.encodeRawTo(dst, src) + case nil: + dst = blk.output + default: + panic(err) + } + blk.output = oldout + } else { + enc.Reset(e.o.dict, false) + blk := enc.Block() + for len(src) > 0 { + todo := src + if len(todo) > e.o.blockSize { + todo = todo[:e.o.blockSize] + } + src = src[len(todo):] + if e.o.crc { + _, _ = enc.CRC().Write(todo) + } + blk.pushOffsets() + enc.Encode(blk, todo) + if len(src) == 0 { + blk.last = true + } + err := errIncompressible + // If we got the exact same number of literals as input, + // assume the literals cannot be compressed. + if len(blk.literals) != len(todo) || len(todo) != e.o.blockSize { + err = blk.encode(todo, e.o.noEntropy, !e.o.allLitEntropy) + } + + switch err { + case errIncompressible: + if debug { + println("Storing incompressible block as raw") + } + dst = blk.encodeRawTo(dst, todo) + blk.popOffsets() + case nil: + dst = append(dst, blk.output...) + default: + panic(err) + } + blk.reset(nil) + } + } + if e.o.crc { + dst = enc.AppendCRC(dst) + } + // Add padding with content from crypto/rand.Reader + if e.o.pad > 0 { + add := calcSkippableFrame(int64(len(dst)), int64(e.o.pad)) + dst, err = skippableFrame(dst, add, rand.Reader) + if err != nil { + panic(err) + } + } + return dst +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder_options.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder_options.go new file mode 100644 index 00000000000..1209915bcce --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/encoder_options.go @@ -0,0 +1,282 @@ +package zstd + +import ( + "errors" + "fmt" + "runtime" + "strings" +) + +// EOption is an option for creating a encoder. +type EOption func(*encoderOptions) error + +// options retains accumulated state of multiple options. +type encoderOptions struct { + concurrent int + level EncoderLevel + single *bool + pad int + blockSize int + windowSize int + crc bool + fullZero bool + noEntropy bool + allLitEntropy bool + customWindow bool + customALEntropy bool + dict *dict +} + +func (o *encoderOptions) setDefault() { + *o = encoderOptions{ + // use less ram: true for now, but may change. + concurrent: runtime.GOMAXPROCS(0), + crc: true, + single: nil, + blockSize: 1 << 16, + windowSize: 8 << 20, + level: SpeedDefault, + allLitEntropy: true, + } +} + +// encoder returns an encoder with the selected options. +func (o encoderOptions) encoder() encoder { + switch o.level { + case SpeedDefault: + return &doubleFastEncoder{fastEncoder: fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}}} + case SpeedBetterCompression: + return &betterFastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} + case SpeedFastest: + return &fastEncoder{fastBase: fastBase{maxMatchOff: int32(o.windowSize)}} + } + panic("unknown compression level") +} + +// WithEncoderCRC will add CRC value to output. +// Output will be 4 bytes larger. +func WithEncoderCRC(b bool) EOption { + return func(o *encoderOptions) error { o.crc = b; return nil } +} + +// WithEncoderConcurrency will set the concurrency, +// meaning the maximum number of decoders to run concurrently. +// The value supplied must be at least 1. +// By default this will be set to GOMAXPROCS. +func WithEncoderConcurrency(n int) EOption { + return func(o *encoderOptions) error { + if n <= 0 { + return fmt.Errorf("concurrency must be at least 1") + } + o.concurrent = n + return nil + } +} + +// WithWindowSize will set the maximum allowed back-reference distance. +// The value must be a power of two between MinWindowSize and MaxWindowSize. +// A larger value will enable better compression but allocate more memory and, +// for above-default values, take considerably longer. +// The default value is determined by the compression level. +func WithWindowSize(n int) EOption { + return func(o *encoderOptions) error { + switch { + case n < MinWindowSize: + return fmt.Errorf("window size must be at least %d", MinWindowSize) + case n > MaxWindowSize: + return fmt.Errorf("window size must be at most %d", MaxWindowSize) + case (n & (n - 1)) != 0: + return errors.New("window size must be a power of 2") + } + + o.windowSize = n + o.customWindow = true + if o.blockSize > o.windowSize { + o.blockSize = o.windowSize + } + return nil + } +} + +// WithEncoderPadding will add padding to all output so the size will be a multiple of n. +// This can be used to obfuscate the exact output size or make blocks of a certain size. +// The contents will be a skippable frame, so it will be invisible by the decoder. +// n must be > 0 and <= 1GB, 1<<30 bytes. +// The padded area will be filled with data from crypto/rand.Reader. +// If `EncodeAll` is used with data already in the destination, the total size will be multiple of this. +func WithEncoderPadding(n int) EOption { + return func(o *encoderOptions) error { + if n <= 0 { + return fmt.Errorf("padding must be at least 1") + } + // No need to waste our time. + if n == 1 { + o.pad = 0 + } + if n > 1<<30 { + return fmt.Errorf("padding must less than 1GB (1<<30 bytes) ") + } + o.pad = n + return nil + } +} + +// EncoderLevel predefines encoder compression levels. +// Only use the constants made available, since the actual mapping +// of these values are very likely to change and your compression could change +// unpredictably when upgrading the library. +type EncoderLevel int + +const ( + speedNotSet EncoderLevel = iota + + // SpeedFastest will choose the fastest reasonable compression. + // This is roughly equivalent to the fastest Zstandard mode. + SpeedFastest + + // SpeedDefault is the default "pretty fast" compression option. + // This is roughly equivalent to the default Zstandard mode (level 3). + SpeedDefault + + // SpeedBetterCompression will yield better compression than the default. + // Currently it is about zstd level 7-8 with ~ 2x-3x the default CPU usage. + // By using this, notice that CPU usage may go up in the future. + SpeedBetterCompression + + // speedLast should be kept as the last actual compression option. + // The is not for external usage, but is used to keep track of the valid options. + speedLast + + // SpeedBestCompression will choose the best available compression option. + // For now this is not implemented. + SpeedBestCompression = SpeedBetterCompression +) + +// EncoderLevelFromString will convert a string representation of an encoding level back +// to a compression level. The compare is not case sensitive. +// If the string wasn't recognized, (false, SpeedDefault) will be returned. +func EncoderLevelFromString(s string) (bool, EncoderLevel) { + for l := EncoderLevel(speedNotSet + 1); l < speedLast; l++ { + if strings.EqualFold(s, l.String()) { + return true, l + } + } + return false, SpeedDefault +} + +// EncoderLevelFromZstd will return an encoder level that closest matches the compression +// ratio of a specific zstd compression level. +// Many input values will provide the same compression level. +func EncoderLevelFromZstd(level int) EncoderLevel { + switch { + case level < 3: + return SpeedFastest + case level >= 3 && level < 6: + return SpeedDefault + case level > 5: + return SpeedBetterCompression + } + return SpeedDefault +} + +// String provides a string representation of the compression level. +func (e EncoderLevel) String() string { + switch e { + case SpeedFastest: + return "fastest" + case SpeedDefault: + return "default" + case SpeedBetterCompression: + return "better" + default: + return "invalid" + } +} + +// WithEncoderLevel specifies a predefined compression level. +func WithEncoderLevel(l EncoderLevel) EOption { + return func(o *encoderOptions) error { + switch { + case l <= speedNotSet || l >= speedLast: + return fmt.Errorf("unknown encoder level") + } + o.level = l + if !o.customWindow { + switch o.level { + case SpeedFastest: + o.windowSize = 4 << 20 + case SpeedDefault: + o.windowSize = 8 << 20 + case SpeedBetterCompression: + o.windowSize = 16 << 20 + } + } + if !o.customALEntropy { + o.allLitEntropy = l > SpeedFastest + } + + return nil + } +} + +// WithZeroFrames will encode 0 length input as full frames. +// This can be needed for compatibility with zstandard usage, +// but is not needed for this package. +func WithZeroFrames(b bool) EOption { + return func(o *encoderOptions) error { + o.fullZero = b + return nil + } +} + +// WithAllLitEntropyCompression will apply entropy compression if no matches are found. +// Disabling this will skip incompressible data faster, but in cases with no matches but +// skewed character distribution compression is lost. +// Default value depends on the compression level selected. +func WithAllLitEntropyCompression(b bool) EOption { + return func(o *encoderOptions) error { + o.customALEntropy = true + o.allLitEntropy = b + return nil + } +} + +// WithNoEntropyCompression will always skip entropy compression of literals. +// This can be useful if content has matches, but unlikely to benefit from entropy +// compression. Usually the slight speed improvement is not worth enabling this. +func WithNoEntropyCompression(b bool) EOption { + return func(o *encoderOptions) error { + o.noEntropy = b + return nil + } +} + +// WithSingleSegment will set the "single segment" flag when EncodeAll is used. +// If this flag is set, data must be regenerated within a single continuous memory segment. +// In this case, Window_Descriptor byte is skipped, but Frame_Content_Size is necessarily present. +// As a consequence, the decoder must allocate a memory segment of size equal or larger than size of your content. +// In order to preserve the decoder from unreasonable memory requirements, +// a decoder is allowed to reject a compressed frame which requests a memory size beyond decoder's authorized range. +// For broader compatibility, decoders are recommended to support memory sizes of at least 8 MB. +// This is only a recommendation, each decoder is free to support higher or lower limits, depending on local limitations. +// If this is not specified, block encodes will automatically choose this based on the input size. +// This setting has no effect on streamed encodes. +func WithSingleSegment(b bool) EOption { + return func(o *encoderOptions) error { + o.single = &b + return nil + } +} + +// WithEncoderDict allows to register a dictionary that will be used for the encode. +// The encoder *may* choose to use no dictionary instead for certain payloads. +func WithEncoderDict(dict []byte) EOption { + return func(o *encoderOptions) error { + d, err := loadDict(dict) + if err != nil { + return err + } + o.dict = d + return nil + } +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/framedec.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/framedec.go new file mode 100644 index 00000000000..fc4a566d39a --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/framedec.go @@ -0,0 +1,494 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "bytes" + "encoding/hex" + "errors" + "hash" + "io" + "sync" + + "github.com/klauspost/compress/zstd/internal/xxhash" +) + +type frameDec struct { + o decoderOptions + crc hash.Hash64 + offset int64 + + WindowSize uint64 + + // maxWindowSize is the maximum windows size to support. + // should never be bigger than max-int. + maxWindowSize uint64 + + // In order queue of blocks being decoded. + decoding chan *blockDec + + // Frame history passed between blocks + history history + + rawInput byteBuffer + + // Byte buffer that can be reused for small input blocks. + bBuf byteBuf + + FrameContentSize uint64 + frameDone sync.WaitGroup + + DictionaryID *uint32 + HasCheckSum bool + SingleSegment bool + + // asyncRunning indicates whether the async routine processes input on 'decoding'. + asyncRunningMu sync.Mutex + asyncRunning bool +} + +const ( + // The minimum Window_Size is 1 KB. + MinWindowSize = 1 << 10 + MaxWindowSize = 1 << 29 +) + +var ( + frameMagic = []byte{0x28, 0xb5, 0x2f, 0xfd} + skippableFrameMagic = []byte{0x2a, 0x4d, 0x18} +) + +func newFrameDec(o decoderOptions) *frameDec { + d := frameDec{ + o: o, + maxWindowSize: MaxWindowSize, + } + if d.maxWindowSize > o.maxDecodedSize { + d.maxWindowSize = o.maxDecodedSize + } + return &d +} + +// reset will read the frame header and prepare for block decoding. +// If nothing can be read from the input, io.EOF will be returned. +// Any other error indicated that the stream contained data, but +// there was a problem. +func (d *frameDec) reset(br byteBuffer) error { + d.HasCheckSum = false + d.WindowSize = 0 + var b []byte + for { + b = br.readSmall(4) + if b == nil { + return io.EOF + } + if !bytes.Equal(b[1:4], skippableFrameMagic) || b[0]&0xf0 != 0x50 { + if debug { + println("Not skippable", hex.EncodeToString(b), hex.EncodeToString(skippableFrameMagic)) + } + // Break if not skippable frame. + break + } + // Read size to skip + b = br.readSmall(4) + if b == nil { + println("Reading Frame Size EOF") + return io.ErrUnexpectedEOF + } + n := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + println("Skipping frame with", n, "bytes.") + err := br.skipN(int(n)) + if err != nil { + if debug { + println("Reading discarded frame", err) + } + return err + } + } + if !bytes.Equal(b, frameMagic) { + println("Got magic numbers: ", b, "want:", frameMagic) + return ErrMagicMismatch + } + + // Read Frame_Header_Descriptor + fhd, err := br.readByte() + if err != nil { + println("Reading Frame_Header_Descriptor", err) + return err + } + d.SingleSegment = fhd&(1<<5) != 0 + + if fhd&(1<<3) != 0 { + return errors.New("Reserved bit set on frame header") + } + + // Read Window_Descriptor + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor + d.WindowSize = 0 + if !d.SingleSegment { + wd, err := br.readByte() + if err != nil { + println("Reading Window_Descriptor", err) + return err + } + printf("raw: %x, mantissa: %d, exponent: %d\n", wd, wd&7, wd>>3) + windowLog := 10 + (wd >> 3) + windowBase := uint64(1) << windowLog + windowAdd := (windowBase / 8) * uint64(wd&0x7) + d.WindowSize = windowBase + windowAdd + } + + // Read Dictionary_ID + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id + d.DictionaryID = nil + if size := fhd & 3; size != 0 { + if size == 3 { + size = 4 + } + b = br.readSmall(int(size)) + if b == nil { + if debug { + println("Reading Dictionary_ID", io.ErrUnexpectedEOF) + } + return io.ErrUnexpectedEOF + } + var id uint32 + switch size { + case 1: + id = uint32(b[0]) + case 2: + id = uint32(b[0]) | (uint32(b[1]) << 8) + case 4: + id = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + } + if debug { + println("Dict size", size, "ID:", id) + } + if id > 0 { + // ID 0 means "sorry, no dictionary anyway". + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary-format + d.DictionaryID = &id + } + } + + // Read Frame_Content_Size + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size + var fcsSize int + v := fhd >> 6 + switch v { + case 0: + if d.SingleSegment { + fcsSize = 1 + } + default: + fcsSize = 1 << v + } + d.FrameContentSize = 0 + if fcsSize > 0 { + b := br.readSmall(fcsSize) + if b == nil { + println("Reading Frame content", io.ErrUnexpectedEOF) + return io.ErrUnexpectedEOF + } + switch fcsSize { + case 1: + d.FrameContentSize = uint64(b[0]) + case 2: + // When FCS_Field_Size is 2, the offset of 256 is added. + d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256 + case 4: + d.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24) + case 8: + d1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24) + d2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24) + d.FrameContentSize = uint64(d1) | (uint64(d2) << 32) + } + if debug { + println("field size bits:", v, "fcsSize:", fcsSize, "FrameContentSize:", d.FrameContentSize, hex.EncodeToString(b[:fcsSize]), "singleseg:", d.SingleSegment, "window:", d.WindowSize) + } + } + // Move this to shared. + d.HasCheckSum = fhd&(1<<2) != 0 + if d.HasCheckSum { + if d.crc == nil { + d.crc = xxhash.New() + } + d.crc.Reset() + } + + if d.WindowSize == 0 && d.SingleSegment { + // We may not need window in this case. + d.WindowSize = d.FrameContentSize + if d.WindowSize < MinWindowSize { + d.WindowSize = MinWindowSize + } + } + + if d.WindowSize > d.maxWindowSize { + printf("window size %d > max %d\n", d.WindowSize, d.maxWindowSize) + return ErrWindowSizeExceeded + } + // The minimum Window_Size is 1 KB. + if d.WindowSize < MinWindowSize { + println("got window size: ", d.WindowSize) + return ErrWindowSizeTooSmall + } + d.history.windowSize = int(d.WindowSize) + if d.o.lowMem && d.history.windowSize < maxBlockSize { + d.history.maxSize = d.history.windowSize * 2 + } else { + d.history.maxSize = d.history.windowSize + maxBlockSize + } + // history contains input - maybe we do something + d.rawInput = br + return nil +} + +// next will start decoding the next block from stream. +func (d *frameDec) next(block *blockDec) error { + if debug { + printf("decoding new block %p:%p", block, block.data) + } + err := block.reset(d.rawInput, d.WindowSize) + if err != nil { + println("block error:", err) + // Signal the frame decoder we have a problem. + d.sendErr(block, err) + return err + } + block.input <- struct{}{} + if debug { + println("next block:", block) + } + d.asyncRunningMu.Lock() + defer d.asyncRunningMu.Unlock() + if !d.asyncRunning { + return nil + } + if block.Last { + // We indicate the frame is done by sending io.EOF + d.decoding <- block + return io.EOF + } + d.decoding <- block + return nil +} + +// sendEOF will queue an error block on the frame. +// This will cause the frame decoder to return when it encounters the block. +// Returns true if the decoder was added. +func (d *frameDec) sendErr(block *blockDec, err error) bool { + d.asyncRunningMu.Lock() + defer d.asyncRunningMu.Unlock() + if !d.asyncRunning { + return false + } + + println("sending error", err.Error()) + block.sendErr(err) + d.decoding <- block + return true +} + +// checkCRC will check the checksum if the frame has one. +// Will return ErrCRCMismatch if crc check failed, otherwise nil. +func (d *frameDec) checkCRC() error { + if !d.HasCheckSum { + return nil + } + var tmp [4]byte + got := d.crc.Sum64() + // Flip to match file order. + tmp[0] = byte(got >> 0) + tmp[1] = byte(got >> 8) + tmp[2] = byte(got >> 16) + tmp[3] = byte(got >> 24) + + // We can overwrite upper tmp now + want := d.rawInput.readSmall(4) + if want == nil { + println("CRC missing?") + return io.ErrUnexpectedEOF + } + + if !bytes.Equal(tmp[:], want) { + if debug { + println("CRC Check Failed:", tmp[:], "!=", want) + } + return ErrCRCMismatch + } + if debug { + println("CRC ok", tmp[:]) + } + return nil +} + +func (d *frameDec) initAsync() { + if !d.o.lowMem && !d.SingleSegment { + // set max extra size history to 10MB. + d.history.maxSize = d.history.windowSize + maxBlockSize*5 + } + // re-alloc if more than one extra block size. + if d.o.lowMem && cap(d.history.b) > d.history.maxSize+maxBlockSize { + d.history.b = make([]byte, 0, d.history.maxSize) + } + if cap(d.history.b) < d.history.maxSize { + d.history.b = make([]byte, 0, d.history.maxSize) + } + if cap(d.decoding) < d.o.concurrent { + d.decoding = make(chan *blockDec, d.o.concurrent) + } + if debug { + h := d.history + printf("history init. len: %d, cap: %d", len(h.b), cap(h.b)) + } + d.asyncRunningMu.Lock() + d.asyncRunning = true + d.asyncRunningMu.Unlock() +} + +// startDecoder will start decoding blocks and write them to the writer. +// The decoder will stop as soon as an error occurs or at end of frame. +// When the frame has finished decoding the *bufio.Reader +// containing the remaining input will be sent on frameDec.frameDone. +func (d *frameDec) startDecoder(output chan decodeOutput) { + written := int64(0) + + defer func() { + d.asyncRunningMu.Lock() + d.asyncRunning = false + d.asyncRunningMu.Unlock() + + // Drain the currently decoding. + d.history.error = true + flushdone: + for { + select { + case b := <-d.decoding: + b.history <- &d.history + output <- <-b.result + default: + break flushdone + } + } + println("frame decoder done, signalling done") + d.frameDone.Done() + }() + // Get decoder for first block. + block := <-d.decoding + block.history <- &d.history + for { + var next *blockDec + // Get result + r := <-block.result + if r.err != nil { + println("Result contained error", r.err) + output <- r + return + } + if debug { + println("got result, from ", d.offset, "to", d.offset+int64(len(r.b))) + d.offset += int64(len(r.b)) + } + if !block.Last { + // Send history to next block + select { + case next = <-d.decoding: + if debug { + println("Sending ", len(d.history.b), "bytes as history") + } + next.history <- &d.history + default: + // Wait until we have sent the block, so + // other decoders can potentially get the decoder. + next = nil + } + } + + // Add checksum, async to decoding. + if d.HasCheckSum { + n, err := d.crc.Write(r.b) + if err != nil { + r.err = err + if n != len(r.b) { + r.err = io.ErrShortWrite + } + output <- r + return + } + } + written += int64(len(r.b)) + if d.SingleSegment && uint64(written) > d.FrameContentSize { + println("runDecoder: single segment and", uint64(written), ">", d.FrameContentSize) + r.err = ErrFrameSizeExceeded + output <- r + return + } + if block.Last { + r.err = d.checkCRC() + output <- r + return + } + output <- r + if next == nil { + // There was no decoder available, we wait for one now that we have sent to the writer. + if debug { + println("Sending ", len(d.history.b), " bytes as history") + } + next = <-d.decoding + next.history <- &d.history + } + block = next + } +} + +// runDecoder will create a sync decoder that will decode a block of data. +func (d *frameDec) runDecoder(dst []byte, dec *blockDec) ([]byte, error) { + saved := d.history.b + + // We use the history for output to avoid copying it. + d.history.b = dst + // Store input length, so we only check new data. + crcStart := len(dst) + var err error + for { + err = dec.reset(d.rawInput, d.WindowSize) + if err != nil { + break + } + if debug { + println("next block:", dec) + } + err = dec.decodeBuf(&d.history) + if err != nil || dec.Last { + break + } + if uint64(len(d.history.b)) > d.o.maxDecodedSize { + err = ErrDecoderSizeExceeded + break + } + if d.SingleSegment && uint64(len(d.history.b)) > d.o.maxDecodedSize { + println("runDecoder: single segment and", uint64(len(d.history.b)), ">", d.o.maxDecodedSize) + err = ErrFrameSizeExceeded + break + } + } + dst = d.history.b + if err == nil { + if d.HasCheckSum { + var n int + n, err = d.crc.Write(dst[crcStart:]) + if err == nil { + if n != len(dst)-crcStart { + err = io.ErrShortWrite + } else { + err = d.checkCRC() + } + } + } + } + d.history.b = saved + return dst, err +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/frameenc.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/frameenc.go new file mode 100644 index 00000000000..4ef7f5a3e3d --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/frameenc.go @@ -0,0 +1,137 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "fmt" + "io" + "math" + "math/bits" +) + +type frameHeader struct { + ContentSize uint64 + WindowSize uint32 + SingleSegment bool + Checksum bool + DictID uint32 +} + +const maxHeaderSize = 14 + +func (f frameHeader) appendTo(dst []byte) ([]byte, error) { + dst = append(dst, frameMagic...) + var fhd uint8 + if f.Checksum { + fhd |= 1 << 2 + } + if f.SingleSegment { + fhd |= 1 << 5 + } + + var dictIDContent []byte + if f.DictID > 0 { + var tmp [4]byte + if f.DictID < 256 { + fhd |= 1 + tmp[0] = uint8(f.DictID) + dictIDContent = tmp[:1] + } else if f.DictID < 1<<16 { + fhd |= 2 + binary.LittleEndian.PutUint16(tmp[:2], uint16(f.DictID)) + dictIDContent = tmp[:2] + } else { + fhd |= 3 + binary.LittleEndian.PutUint32(tmp[:4], f.DictID) + dictIDContent = tmp[:4] + } + } + var fcs uint8 + if f.ContentSize >= 256 { + fcs++ + } + if f.ContentSize >= 65536+256 { + fcs++ + } + if f.ContentSize >= 0xffffffff { + fcs++ + } + + fhd |= fcs << 6 + + dst = append(dst, fhd) + if !f.SingleSegment { + const winLogMin = 10 + windowLog := (bits.Len32(f.WindowSize-1) - winLogMin) << 3 + dst = append(dst, uint8(windowLog)) + } + if f.DictID > 0 { + dst = append(dst, dictIDContent...) + } + switch fcs { + case 0: + if f.SingleSegment { + dst = append(dst, uint8(f.ContentSize)) + } + // Unless SingleSegment is set, framessizes < 256 are nto stored. + case 1: + f.ContentSize -= 256 + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8)) + case 2: + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24)) + case 3: + dst = append(dst, uint8(f.ContentSize), uint8(f.ContentSize>>8), uint8(f.ContentSize>>16), uint8(f.ContentSize>>24), + uint8(f.ContentSize>>32), uint8(f.ContentSize>>40), uint8(f.ContentSize>>48), uint8(f.ContentSize>>56)) + default: + panic("invalid fcs") + } + return dst, nil +} + +const skippableFrameHeader = 4 + 4 + +// calcSkippableFrame will return a total size to be added for written +// to be divisible by multiple. +// The value will always be > skippableFrameHeader. +// The function will panic if written < 0 or wantMultiple <= 0. +func calcSkippableFrame(written, wantMultiple int64) int { + if wantMultiple <= 0 { + panic("wantMultiple <= 0") + } + if written < 0 { + panic("written < 0") + } + leftOver := written % wantMultiple + if leftOver == 0 { + return 0 + } + toAdd := wantMultiple - leftOver + for toAdd < skippableFrameHeader { + toAdd += wantMultiple + } + return int(toAdd) +} + +// skippableFrame will add a skippable frame with a total size of bytes. +// total should be >= skippableFrameHeader and < math.MaxUint32. +func skippableFrame(dst []byte, total int, r io.Reader) ([]byte, error) { + if total == 0 { + return dst, nil + } + if total < skippableFrameHeader { + return dst, fmt.Errorf("requested skippable frame (%d) < 8", total) + } + if int64(total) > math.MaxUint32 { + return dst, fmt.Errorf("requested skippable frame (%d) > max uint32", total) + } + dst = append(dst, 0x50, 0x2a, 0x4d, 0x18) + f := uint32(total - skippableFrameHeader) + dst = append(dst, uint8(f), uint8(f>>8), uint8(f>>16), uint8(f>>24)) + start := len(dst) + dst = append(dst, make([]byte, f)...) + _, err := io.ReadFull(r, dst[start:]) + return dst, err +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_decoder.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_decoder.go new file mode 100644 index 00000000000..e6d3d49b39c --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_decoder.go @@ -0,0 +1,385 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" +) + +const ( + tablelogAbsoluteMax = 9 +) + +const ( + /*!MEMORY_USAGE : + * Memory usage formula : N->2^N Bytes (examples : 10 -> 1KB; 12 -> 4KB ; 16 -> 64KB; 20 -> 1MB; etc.) + * Increasing memory usage improves compression ratio + * Reduced memory usage can improve speed, due to cache effect + * Recommended max value is 14, for 16KB, which nicely fits into Intel x86 L1 cache */ + maxMemoryUsage = tablelogAbsoluteMax + 2 + + maxTableLog = maxMemoryUsage - 2 + maxTablesize = 1 << maxTableLog + maxTableMask = (1 << maxTableLog) - 1 + minTablelog = 5 + maxSymbolValue = 255 +) + +// fseDecoder provides temporary storage for compression and decompression. +type fseDecoder struct { + dt [maxTablesize]decSymbol // Decompression table. + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + maxBits uint8 // Maximum number of additional bits + + // used for table creation to avoid allocations. + stateTable [256]uint16 + norm [maxSymbolValue + 1]int16 + preDefined bool +} + +// tableStep returns the next table index. +func tableStep(tableSize uint32) uint32 { + return (tableSize >> 1) + (tableSize >> 3) + 3 +} + +// readNCount will read the symbol distribution so decoding tables can be constructed. +func (s *fseDecoder) readNCount(b *byteReader, maxSymbol uint16) error { + var ( + charnum uint16 + previous0 bool + ) + if b.remain() < 4 { + return errors.New("input too small") + } + bitStream := b.Uint32NC() + nbBits := uint((bitStream & 0xF) + minTablelog) // extract tableLog + if nbBits > tablelogAbsoluteMax { + println("Invalid tablelog:", nbBits) + return errors.New("tableLog too large") + } + bitStream >>= 4 + bitCount := uint(4) + + s.actualTableLog = uint8(nbBits) + remaining := int32((1 << nbBits) + 1) + threshold := int32(1 << nbBits) + gotTotal := int32(0) + nbBits++ + + for remaining > 1 && charnum <= maxSymbol { + if previous0 { + //println("prev0") + n0 := charnum + for (bitStream & 0xFFFF) == 0xFFFF { + //println("24 x 0") + n0 += 24 + if r := b.remain(); r > 5 { + b.advance(2) + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount + } else { + // end of bit stream + bitStream >>= 16 + bitCount += 16 + } + } + //printf("bitstream: %d, 0b%b", bitStream&3, bitStream) + for (bitStream & 3) == 3 { + n0 += 3 + bitStream >>= 2 + bitCount += 2 + } + n0 += uint16(bitStream & 3) + bitCount += 2 + + if n0 > maxSymbolValue { + return errors.New("maxSymbolValue too small") + } + //println("inserting ", n0-charnum, "zeroes from idx", charnum, "ending before", n0) + for charnum < n0 { + s.norm[uint8(charnum)] = 0 + charnum++ + } + + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + b.advance(bitCount >> 3) + bitCount &= 7 + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> bitCount + } else { + bitStream >>= 2 + } + } + + max := (2*threshold - 1) - remaining + var count int32 + + if int32(bitStream)&(threshold-1) < max { + count = int32(bitStream) & (threshold - 1) + if debugAsserts && nbBits < 1 { + panic("nbBits underflow") + } + bitCount += nbBits - 1 + } else { + count = int32(bitStream) & (2*threshold - 1) + if count >= threshold { + count -= max + } + bitCount += nbBits + } + + // extra accuracy + count-- + if count < 0 { + // -1 means +1 + remaining += count + gotTotal -= count + } else { + remaining -= count + gotTotal += count + } + s.norm[charnum&0xff] = int16(count) + charnum++ + previous0 = count == 0 + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if r := b.remain(); r >= 7 || r-int(bitCount>>3) >= 4 { + b.advance(bitCount >> 3) + bitCount &= 7 + // The check above should make sure we can read 32 bits + bitStream = b.Uint32NC() >> (bitCount & 31) + } else { + bitCount -= (uint)(8 * (len(b.b) - 4 - b.off)) + b.off = len(b.b) - 4 + bitStream = b.Uint32() >> (bitCount & 31) + } + } + s.symbolLen = charnum + if s.symbolLen <= 1 { + return fmt.Errorf("symbolLen (%d) too small", s.symbolLen) + } + if s.symbolLen > maxSymbolValue+1 { + return fmt.Errorf("symbolLen (%d) too big", s.symbolLen) + } + if remaining != 1 { + return fmt.Errorf("corruption detected (remaining %d != 1)", remaining) + } + if bitCount > 32 { + return fmt.Errorf("corruption detected (bitCount %d > 32)", bitCount) + } + if gotTotal != 1<> 3) + // println(s.norm[:s.symbolLen], s.symbolLen) + return s.buildDtable() +} + +// decSymbol contains information about a state entry, +// Including the state offset base, the output symbol and +// the number of bits to read for the low part of the destination state. +// Using a composite uint64 is faster than a struct with separate members. +type decSymbol uint64 + +func newDecSymbol(nbits, addBits uint8, newState uint16, baseline uint32) decSymbol { + return decSymbol(nbits) | (decSymbol(addBits) << 8) | (decSymbol(newState) << 16) | (decSymbol(baseline) << 32) +} + +func (d decSymbol) nbBits() uint8 { + return uint8(d) +} + +func (d decSymbol) addBits() uint8 { + return uint8(d >> 8) +} + +func (d decSymbol) newState() uint16 { + return uint16(d >> 16) +} + +func (d decSymbol) baseline() uint32 { + return uint32(d >> 32) +} + +func (d decSymbol) baselineInt() int { + return int(d >> 32) +} + +func (d *decSymbol) set(nbits, addBits uint8, newState uint16, baseline uint32) { + *d = decSymbol(nbits) | (decSymbol(addBits) << 8) | (decSymbol(newState) << 16) | (decSymbol(baseline) << 32) +} + +func (d *decSymbol) setNBits(nBits uint8) { + const mask = 0xffffffffffffff00 + *d = (*d & mask) | decSymbol(nBits) +} + +func (d *decSymbol) setAddBits(addBits uint8) { + const mask = 0xffffffffffff00ff + *d = (*d & mask) | (decSymbol(addBits) << 8) +} + +func (d *decSymbol) setNewState(state uint16) { + const mask = 0xffffffff0000ffff + *d = (*d & mask) | decSymbol(state)<<16 +} + +func (d *decSymbol) setBaseline(baseline uint32) { + const mask = 0xffffffff + *d = (*d & mask) | decSymbol(baseline)<<32 +} + +func (d *decSymbol) setExt(addBits uint8, baseline uint32) { + const mask = 0xffff00ff + *d = (*d & mask) | (decSymbol(addBits) << 8) | (decSymbol(baseline) << 32) +} + +// decSymbolValue returns the transformed decSymbol for the given symbol. +func decSymbolValue(symb uint8, t []baseOffset) (decSymbol, error) { + if int(symb) >= len(t) { + return 0, fmt.Errorf("rle symbol %d >= max %d", symb, len(t)) + } + lu := t[symb] + return newDecSymbol(0, lu.addBits, 0, lu.baseLine), nil +} + +// setRLE will set the decoder til RLE mode. +func (s *fseDecoder) setRLE(symbol decSymbol) { + s.actualTableLog = 0 + s.maxBits = symbol.addBits() + s.dt[0] = symbol +} + +// buildDtable will build the decoding table. +func (s *fseDecoder) buildDtable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + symbolNext := s.stateTable[:256] + + // Init, lay down lowprob symbols + { + for i, v := range s.norm[:s.symbolLen] { + if v == -1 { + s.dt[highThreshold].setAddBits(uint8(i)) + highThreshold-- + symbolNext[i] = 1 + } else { + symbolNext[i] = uint16(v) + } + } + } + // Spread symbols + { + tableMask := tableSize - 1 + step := tableStep(tableSize) + position := uint32(0) + for ss, v := range s.norm[:s.symbolLen] { + for i := 0; i < int(v); i++ { + s.dt[position].setAddBits(uint8(ss)) + position = (position + step) & tableMask + for position > highThreshold { + // lowprob area + position = (position + step) & tableMask + } + } + } + if position != 0 { + // position must reach all cells once, otherwise normalizedCounter is incorrect + return errors.New("corrupted input (position != 0)") + } + } + + // Build Decoding table + { + tableSize := uint16(1 << s.actualTableLog) + for u, v := range s.dt[:tableSize] { + symbol := v.addBits() + nextState := symbolNext[symbol] + symbolNext[symbol] = nextState + 1 + nBits := s.actualTableLog - byte(highBits(uint32(nextState))) + s.dt[u&maxTableMask].setNBits(nBits) + newState := (nextState << nBits) - tableSize + if newState > tableSize { + return fmt.Errorf("newState (%d) outside table size (%d)", newState, tableSize) + } + if newState == uint16(u) && nBits == 0 { + // Seems weird that this is possible with nbits > 0. + return fmt.Errorf("newState (%d) == oldState (%d) and no bits", newState, u) + } + s.dt[u&maxTableMask].setNewState(newState) + } + } + return nil +} + +// transform will transform the decoder table into a table usable for +// decoding without having to apply the transformation while decoding. +// The state will contain the base value and the number of bits to read. +func (s *fseDecoder) transform(t []baseOffset) error { + tableSize := uint16(1 << s.actualTableLog) + s.maxBits = 0 + for i, v := range s.dt[:tableSize] { + add := v.addBits() + if int(add) >= len(t) { + return fmt.Errorf("invalid decoding table entry %d, symbol %d >= max (%d)", i, v.addBits(), len(t)) + } + lu := t[add] + if lu.addBits > s.maxBits { + s.maxBits = lu.addBits + } + v.setExt(lu.addBits, lu.baseLine) + s.dt[i] = v + } + return nil +} + +type fseState struct { + dt []decSymbol + state decSymbol +} + +// Initialize and decodeAsync first state and symbol. +func (s *fseState) init(br *bitReader, tableLog uint8, dt []decSymbol) { + s.dt = dt + br.fill() + s.state = dt[br.getBits(tableLog)] +} + +// next returns the current symbol and sets the next state. +// At least tablelog bits must be available in the bit reader. +func (s *fseState) next(br *bitReader) { + lowBits := uint16(br.getBits(s.state.nbBits())) + s.state = s.dt[s.state.newState()+lowBits] +} + +// finished returns true if all bits have been read from the bitstream +// and the next state would require reading bits from the input. +func (s *fseState) finished(br *bitReader) bool { + return br.finished() && s.state.nbBits() > 0 +} + +// final returns the current state symbol without decoding the next. +func (s *fseState) final() (int, uint8) { + return s.state.baselineInt(), s.state.addBits() +} + +// final returns the current state symbol without decoding the next. +func (s decSymbol) final() (int, uint8) { + return s.baselineInt(), s.addBits() +} + +// nextFast returns the next symbol and sets the next state. +// This can only be used if no symbols are 0 bits. +// At least tablelog bits must be available in the bit reader. +func (s *fseState) nextFast(br *bitReader) (uint32, uint8) { + lowBits := uint16(br.getBitsFast(s.state.nbBits())) + s.state = s.dt[s.state.newState()+lowBits] + return s.state.baseline(), s.state.addBits() +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_encoder.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_encoder.go new file mode 100644 index 00000000000..aa9eba88b80 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_encoder.go @@ -0,0 +1,726 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "math" +) + +const ( + // For encoding we only support up to + maxEncTableLog = 8 + maxEncTablesize = 1 << maxTableLog + maxEncTableMask = (1 << maxTableLog) - 1 + minEncTablelog = 5 + maxEncSymbolValue = maxMatchLengthSymbol +) + +// Scratch provides temporary storage for compression and decompression. +type fseEncoder struct { + symbolLen uint16 // Length of active part of the symbol table. + actualTableLog uint8 // Selected tablelog. + ct cTable // Compression tables. + maxCount int // count of the most probable symbol + zeroBits bool // no bits has prob > 50%. + clearCount bool // clear count + useRLE bool // This encoder is for RLE + preDefined bool // This encoder is predefined. + reUsed bool // Set to know when the encoder has been reused. + rleVal uint8 // RLE Symbol + maxBits uint8 // Maximum output bits after transform. + + // TODO: Technically zstd should be fine with 64 bytes. + count [256]uint32 + norm [256]int16 +} + +// cTable contains tables used for compression. +type cTable struct { + tableSymbol []byte + stateTable []uint16 + symbolTT []symbolTransform +} + +// symbolTransform contains the state transform for a symbol. +type symbolTransform struct { + deltaNbBits uint32 + deltaFindState int16 + outBits uint8 +} + +// String prints values as a human readable string. +func (s symbolTransform) String() string { + return fmt.Sprintf("{deltabits: %08x, findstate:%d outbits:%d}", s.deltaNbBits, s.deltaFindState, s.outBits) +} + +// Histogram allows to populate the histogram and skip that step in the compression, +// It otherwise allows to inspect the histogram when compression is done. +// To indicate that you have populated the histogram call HistogramFinished +// with the value of the highest populated symbol, as well as the number of entries +// in the most populated entry. These are accepted at face value. +// The returned slice will always be length 256. +func (s *fseEncoder) Histogram() []uint32 { + return s.count[:] +} + +// HistogramFinished can be called to indicate that the histogram has been populated. +// maxSymbol is the index of the highest set symbol of the next data segment. +// maxCount is the number of entries in the most populated entry. +// These are accepted at face value. +func (s *fseEncoder) HistogramFinished(maxSymbol uint8, maxCount int) { + s.maxCount = maxCount + s.symbolLen = uint16(maxSymbol) + 1 + s.clearCount = maxCount != 0 +} + +// prepare will prepare and allocate scratch tables used for both compression and decompression. +func (s *fseEncoder) prepare() (*fseEncoder, error) { + if s == nil { + s = &fseEncoder{} + } + s.useRLE = false + if s.clearCount && s.maxCount == 0 { + for i := range s.count { + s.count[i] = 0 + } + s.clearCount = false + } + return s, nil +} + +// allocCtable will allocate tables needed for compression. +// If existing tables a re big enough, they are simply re-used. +func (s *fseEncoder) allocCtable() { + tableSize := 1 << s.actualTableLog + // get tableSymbol that is big enough. + if cap(s.ct.tableSymbol) < int(tableSize) { + s.ct.tableSymbol = make([]byte, tableSize) + } + s.ct.tableSymbol = s.ct.tableSymbol[:tableSize] + + ctSize := tableSize + if cap(s.ct.stateTable) < ctSize { + s.ct.stateTable = make([]uint16, ctSize) + } + s.ct.stateTable = s.ct.stateTable[:ctSize] + + if cap(s.ct.symbolTT) < 256 { + s.ct.symbolTT = make([]symbolTransform, 256) + } + s.ct.symbolTT = s.ct.symbolTT[:256] +} + +// buildCTable will populate the compression table so it is ready to be used. +func (s *fseEncoder) buildCTable() error { + tableSize := uint32(1 << s.actualTableLog) + highThreshold := tableSize - 1 + var cumul [256]int16 + + s.allocCtable() + tableSymbol := s.ct.tableSymbol[:tableSize] + // symbol start positions + { + cumul[0] = 0 + for ui, v := range s.norm[:s.symbolLen-1] { + u := byte(ui) // one less than reference + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = u + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + } + // Encode last symbol separately to avoid overflowing u + u := int(s.symbolLen - 1) + v := s.norm[s.symbolLen-1] + if v == -1 { + // Low proba symbol + cumul[u+1] = cumul[u] + 1 + tableSymbol[highThreshold] = byte(u) + highThreshold-- + } else { + cumul[u+1] = cumul[u] + v + } + if uint32(cumul[s.symbolLen]) != tableSize { + return fmt.Errorf("internal error: expected cumul[s.symbolLen] (%d) == tableSize (%d)", cumul[s.symbolLen], tableSize) + } + cumul[s.symbolLen] = int16(tableSize) + 1 + } + // Spread symbols + s.zeroBits = false + { + step := tableStep(tableSize) + tableMask := tableSize - 1 + var position uint32 + // if any symbol > largeLimit, we may have 0 bits output. + largeLimit := int16(1 << (s.actualTableLog - 1)) + for ui, v := range s.norm[:s.symbolLen] { + symbol := byte(ui) + if v > largeLimit { + s.zeroBits = true + } + for nbOccurrences := int16(0); nbOccurrences < v; nbOccurrences++ { + tableSymbol[position] = symbol + position = (position + step) & tableMask + for position > highThreshold { + position = (position + step) & tableMask + } /* Low proba area */ + } + } + + // Check if we have gone through all positions + if position != 0 { + return errors.New("position!=0") + } + } + + // Build table + table := s.ct.stateTable + { + tsi := int(tableSize) + for u, v := range tableSymbol { + // TableU16 : sorted by symbol order; gives next state value + table[cumul[v]] = uint16(tsi + u) + cumul[v]++ + } + } + + // Build Symbol Transformation Table + { + total := int16(0) + symbolTT := s.ct.symbolTT[:s.symbolLen] + tableLog := s.actualTableLog + tl := (uint32(tableLog) << 16) - (1 << tableLog) + for i, v := range s.norm[:s.symbolLen] { + switch v { + case 0: + case -1, 1: + symbolTT[i].deltaNbBits = tl + symbolTT[i].deltaFindState = int16(total - 1) + total++ + default: + maxBitsOut := uint32(tableLog) - highBit(uint32(v-1)) + minStatePlus := uint32(v) << maxBitsOut + symbolTT[i].deltaNbBits = (maxBitsOut << 16) - minStatePlus + symbolTT[i].deltaFindState = int16(total - v) + total += v + } + } + if total != int16(tableSize) { + return fmt.Errorf("total mismatch %d (got) != %d (want)", total, tableSize) + } + } + return nil +} + +var rtbTable = [...]uint32{0, 473195, 504333, 520860, 550000, 700000, 750000, 830000} + +func (s *fseEncoder) setRLE(val byte) { + s.allocCtable() + s.actualTableLog = 0 + s.ct.stateTable = s.ct.stateTable[:1] + s.ct.symbolTT[val] = symbolTransform{ + deltaFindState: 0, + deltaNbBits: 0, + } + if debug { + println("setRLE: val", val, "symbolTT", s.ct.symbolTT[val]) + } + s.rleVal = val + s.useRLE = true +} + +// setBits will set output bits for the transform. +// if nil is provided, the number of bits is equal to the index. +func (s *fseEncoder) setBits(transform []byte) { + if s.reUsed || s.preDefined { + return + } + if s.useRLE { + if transform == nil { + s.ct.symbolTT[s.rleVal].outBits = s.rleVal + s.maxBits = s.rleVal + return + } + s.maxBits = transform[s.rleVal] + s.ct.symbolTT[s.rleVal].outBits = s.maxBits + return + } + if transform == nil { + for i := range s.ct.symbolTT[:s.symbolLen] { + s.ct.symbolTT[i].outBits = uint8(i) + } + s.maxBits = uint8(s.symbolLen - 1) + return + } + s.maxBits = 0 + for i, v := range transform[:s.symbolLen] { + s.ct.symbolTT[i].outBits = v + if v > s.maxBits { + // We could assume bits always going up, but we play safe. + s.maxBits = v + } + } +} + +// normalizeCount will normalize the count of the symbols so +// the total is equal to the table size. +// If successful, compression tables will also be made ready. +func (s *fseEncoder) normalizeCount(length int) error { + if s.reUsed { + return nil + } + s.optimalTableLog(length) + var ( + tableLog = s.actualTableLog + scale = 62 - uint64(tableLog) + step = (1 << 62) / uint64(length) + vStep = uint64(1) << (scale - 20) + stillToDistribute = int16(1 << tableLog) + largest int + largestP int16 + lowThreshold = (uint32)(length >> tableLog) + ) + if s.maxCount == length { + s.useRLE = true + return nil + } + s.useRLE = false + for i, cnt := range s.count[:s.symbolLen] { + // already handled + // if (count[s] == s.length) return 0; /* rle special case */ + + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + stillToDistribute-- + } else { + proba := (int16)((uint64(cnt) * step) >> scale) + if proba < 8 { + restToBeat := vStep * uint64(rtbTable[proba]) + v := uint64(cnt)*step - (uint64(proba) << scale) + if v > restToBeat { + proba++ + } + } + if proba > largestP { + largestP = proba + largest = i + } + s.norm[i] = proba + stillToDistribute -= proba + } + } + + if -stillToDistribute >= (s.norm[largest] >> 1) { + // corner case, need another normalization method + err := s.normalizeCount2(length) + if err != nil { + return err + } + if debugAsserts { + err = s.validateNorm() + if err != nil { + return err + } + } + return s.buildCTable() + } + s.norm[largest] += stillToDistribute + if debugAsserts { + err := s.validateNorm() + if err != nil { + return err + } + } + return s.buildCTable() +} + +// Secondary normalization method. +// To be used when primary method fails. +func (s *fseEncoder) normalizeCount2(length int) error { + const notYetAssigned = -2 + var ( + distributed uint32 + total = uint32(length) + tableLog = s.actualTableLog + lowThreshold = uint32(total >> tableLog) + lowOne = uint32((total * 3) >> (tableLog + 1)) + ) + for i, cnt := range s.count[:s.symbolLen] { + if cnt == 0 { + s.norm[i] = 0 + continue + } + if cnt <= lowThreshold { + s.norm[i] = -1 + distributed++ + total -= cnt + continue + } + if cnt <= lowOne { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + s.norm[i] = notYetAssigned + } + toDistribute := (1 << tableLog) - distributed + + if (total / toDistribute) > lowOne { + // risk of rounding to zero + lowOne = uint32((total * 3) / (toDistribute * 2)) + for i, cnt := range s.count[:s.symbolLen] { + if (s.norm[i] == notYetAssigned) && (cnt <= lowOne) { + s.norm[i] = 1 + distributed++ + total -= cnt + continue + } + } + toDistribute = (1 << tableLog) - distributed + } + if distributed == uint32(s.symbolLen)+1 { + // all values are pretty poor; + // probably incompressible data (should have already been detected); + // find max, then give all remaining points to max + var maxV int + var maxC uint32 + for i, cnt := range s.count[:s.symbolLen] { + if cnt > maxC { + maxV = i + maxC = cnt + } + } + s.norm[maxV] += int16(toDistribute) + return nil + } + + if total == 0 { + // all of the symbols were low enough for the lowOne or lowThreshold + for i := uint32(0); toDistribute > 0; i = (i + 1) % (uint32(s.symbolLen)) { + if s.norm[i] > 0 { + toDistribute-- + s.norm[i]++ + } + } + return nil + } + + var ( + vStepLog = 62 - uint64(tableLog) + mid = uint64((1 << (vStepLog - 1)) - 1) + rStep = (((1 << vStepLog) * uint64(toDistribute)) + mid) / uint64(total) // scale on remaining + tmpTotal = mid + ) + for i, cnt := range s.count[:s.symbolLen] { + if s.norm[i] == notYetAssigned { + var ( + end = tmpTotal + uint64(cnt)*rStep + sStart = uint32(tmpTotal >> vStepLog) + sEnd = uint32(end >> vStepLog) + weight = sEnd - sStart + ) + if weight < 1 { + return errors.New("weight < 1") + } + s.norm[i] = int16(weight) + tmpTotal = end + } + } + return nil +} + +// optimalTableLog calculates and sets the optimal tableLog in s.actualTableLog +func (s *fseEncoder) optimalTableLog(length int) { + tableLog := uint8(maxEncTableLog) + minBitsSrc := highBit(uint32(length)) + 1 + minBitsSymbols := highBit(uint32(s.symbolLen-1)) + 2 + minBits := uint8(minBitsSymbols) + if minBitsSrc < minBitsSymbols { + minBits = uint8(minBitsSrc) + } + + maxBitsSrc := uint8(highBit(uint32(length-1))) - 2 + if maxBitsSrc < tableLog { + // Accuracy can be reduced + tableLog = maxBitsSrc + } + if minBits > tableLog { + tableLog = minBits + } + // Need a minimum to safely represent all symbol values + if tableLog < minEncTablelog { + tableLog = minEncTablelog + } + if tableLog > maxEncTableLog { + tableLog = maxEncTableLog + } + s.actualTableLog = tableLog +} + +// validateNorm validates the normalized histogram table. +func (s *fseEncoder) validateNorm() (err error) { + var total int + for _, v := range s.norm[:s.symbolLen] { + if v >= 0 { + total += int(v) + } else { + total -= int(v) + } + } + defer func() { + if err == nil { + return + } + fmt.Printf("selected TableLog: %d, Symbol length: %d\n", s.actualTableLog, s.symbolLen) + for i, v := range s.norm[:s.symbolLen] { + fmt.Printf("%3d: %5d -> %4d \n", i, s.count[i], v) + } + }() + if total != (1 << s.actualTableLog) { + return fmt.Errorf("warning: Total == %d != %d", total, 1<> 3) + 3 + 2 + + // Write Table Size + bitStream = uint32(tableLog - minEncTablelog) + bitCount = uint(4) + remaining = int16(tableSize + 1) /* +1 for extra accuracy */ + threshold = int16(tableSize) + nbBits = uint(tableLog + 1) + outP = len(out) + ) + if cap(out) < outP+maxHeaderSize { + out = append(out, make([]byte, maxHeaderSize*3)...) + out = out[:len(out)-maxHeaderSize*3] + } + out = out[:outP+maxHeaderSize] + + // stops at 1 + for remaining > 1 { + if previous0 { + start := charnum + for s.norm[charnum] == 0 { + charnum++ + } + for charnum >= start+24 { + start += 24 + bitStream += uint32(0xFFFF) << bitCount + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + } + for charnum >= start+3 { + start += 3 + bitStream += 3 << bitCount + bitCount += 2 + } + bitStream += uint32(charnum-start) << bitCount + bitCount += 2 + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + count := s.norm[charnum] + charnum++ + max := (2*threshold - 1) - remaining + if count < 0 { + remaining += count + } else { + remaining -= count + } + count++ // +1 for extra accuracy + if count >= threshold { + count += max // [0..max[ [max..threshold[ (...) [threshold+max 2*threshold[ + } + bitStream += uint32(count) << bitCount + bitCount += nbBits + if count < max { + bitCount-- + } + + previous0 = count == 1 + if remaining < 1 { + return nil, errors.New("internal error: remaining < 1") + } + for remaining < threshold { + nbBits-- + threshold >>= 1 + } + + if bitCount > 16 { + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += 2 + bitStream >>= 16 + bitCount -= 16 + } + } + + if outP+2 > len(out) { + return nil, fmt.Errorf("internal error: %d > %d, maxheader: %d, sl: %d, tl: %d, normcount: %v", outP+2, len(out), maxHeaderSize, s.symbolLen, int(tableLog), s.norm[:s.symbolLen]) + } + out[outP] = byte(bitStream) + out[outP+1] = byte(bitStream >> 8) + outP += int((bitCount + 7) / 8) + + if charnum > s.symbolLen { + return nil, errors.New("internal error: charnum > s.symbolLen") + } + return out[:outP], nil +} + +// Approximate symbol cost, as fractional value, using fixed-point format (accuracyLog fractional bits) +// note 1 : assume symbolValue is valid (<= maxSymbolValue) +// note 2 : if freq[symbolValue]==0, @return a fake cost of tableLog+1 bits * +func (s *fseEncoder) bitCost(symbolValue uint8, accuracyLog uint32) uint32 { + minNbBits := s.ct.symbolTT[symbolValue].deltaNbBits >> 16 + threshold := (minNbBits + 1) << 16 + if debugAsserts { + if !(s.actualTableLog < 16) { + panic("!s.actualTableLog < 16") + } + // ensure enough room for renormalization double shift + if !(uint8(accuracyLog) < 31-s.actualTableLog) { + panic("!uint8(accuracyLog) < 31-s.actualTableLog") + } + } + tableSize := uint32(1) << s.actualTableLog + deltaFromThreshold := threshold - (s.ct.symbolTT[symbolValue].deltaNbBits + tableSize) + // linear interpolation (very approximate) + normalizedDeltaFromThreshold := (deltaFromThreshold << accuracyLog) >> s.actualTableLog + bitMultiplier := uint32(1) << accuracyLog + if debugAsserts { + if s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold { + panic("s.ct.symbolTT[symbolValue].deltaNbBits+tableSize > threshold") + } + if normalizedDeltaFromThreshold > bitMultiplier { + panic("normalizedDeltaFromThreshold > bitMultiplier") + } + } + return (minNbBits+1)*bitMultiplier - normalizedDeltaFromThreshold +} + +// Returns the cost in bits of encoding the distribution in count using ctable. +// Histogram should only be up to the last non-zero symbol. +// Returns an -1 if ctable cannot represent all the symbols in count. +func (s *fseEncoder) approxSize(hist []uint32) uint32 { + if int(s.symbolLen) < len(hist) { + // More symbols than we have. + return math.MaxUint32 + } + if s.useRLE { + // We will never reuse RLE encoders. + return math.MaxUint32 + } + const kAccuracyLog = 8 + badCost := (uint32(s.actualTableLog) + 1) << kAccuracyLog + var cost uint32 + for i, v := range hist { + if v == 0 { + continue + } + if s.norm[i] == 0 { + return math.MaxUint32 + } + bitCost := s.bitCost(uint8(i), kAccuracyLog) + if bitCost > badCost { + return math.MaxUint32 + } + cost += v * bitCost + } + return cost >> kAccuracyLog +} + +// maxHeaderSize returns the maximum header size in bits. +// This is not exact size, but we want a penalty for new tables anyway. +func (s *fseEncoder) maxHeaderSize() uint32 { + if s.preDefined { + return 0 + } + if s.useRLE { + return 8 + } + return (((uint32(s.symbolLen) * uint32(s.actualTableLog)) >> 3) + 3) * 8 +} + +// cState contains the compression state of a stream. +type cState struct { + bw *bitWriter + stateTable []uint16 + state uint16 +} + +// init will initialize the compression state to the first symbol of the stream. +func (c *cState) init(bw *bitWriter, ct *cTable, first symbolTransform) { + c.bw = bw + c.stateTable = ct.stateTable + if len(c.stateTable) == 1 { + // RLE + c.stateTable[0] = uint16(0) + c.state = 0 + return + } + nbBitsOut := (first.deltaNbBits + (1 << 15)) >> 16 + im := int32((nbBitsOut << 16) - first.deltaNbBits) + lu := (im >> nbBitsOut) + int32(first.deltaFindState) + c.state = c.stateTable[lu] + return +} + +// encode the output symbol provided and write it to the bitstream. +func (c *cState) encode(symbolTT symbolTransform) { + nbBitsOut := (uint32(c.state) + symbolTT.deltaNbBits) >> 16 + dstState := int32(c.state>>(nbBitsOut&15)) + int32(symbolTT.deltaFindState) + c.bw.addBits16NC(c.state, uint8(nbBitsOut)) + c.state = c.stateTable[dstState] +} + +// flush will write the tablelog to the output and flush the remaining full bytes. +func (c *cState) flush(tableLog uint8) { + c.bw.flush32() + c.bw.addBits16NC(c.state, tableLog) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_predefined.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_predefined.go new file mode 100644 index 00000000000..6c17dc17f4f --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/fse_predefined.go @@ -0,0 +1,158 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "fmt" + "math" + "sync" +) + +var ( + // fsePredef are the predefined fse tables as defined here: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + // These values are already transformed. + fsePredef [3]fseDecoder + + // fsePredefEnc are the predefined encoder based on fse tables as defined here: + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + // These values are already transformed. + fsePredefEnc [3]fseEncoder + + // symbolTableX contain the transformations needed for each type as defined in + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets + symbolTableX [3][]baseOffset + + // maxTableSymbol is the biggest supported symbol for each table type + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#the-codes-for-literals-lengths-match-lengths-and-offsets + maxTableSymbol = [3]uint8{tableLiteralLengths: maxLiteralLengthSymbol, tableOffsets: maxOffsetLengthSymbol, tableMatchLengths: maxMatchLengthSymbol} + + // bitTables is the bits table for each table. + bitTables = [3][]byte{tableLiteralLengths: llBitsTable[:], tableOffsets: nil, tableMatchLengths: mlBitsTable[:]} +) + +type tableIndex uint8 + +const ( + // indexes for fsePredef and symbolTableX + tableLiteralLengths tableIndex = 0 + tableOffsets tableIndex = 1 + tableMatchLengths tableIndex = 2 + + maxLiteralLengthSymbol = 35 + maxOffsetLengthSymbol = 30 + maxMatchLengthSymbol = 52 +) + +// baseOffset is used for calculating transformations. +type baseOffset struct { + baseLine uint32 + addBits uint8 +} + +// fillBase will precalculate base offsets with the given bit distributions. +func fillBase(dst []baseOffset, base uint32, bits ...uint8) { + if len(bits) != len(dst) { + panic(fmt.Sprintf("len(dst) (%d) != len(bits) (%d)", len(dst), len(bits))) + } + for i, bit := range bits { + if base > math.MaxInt32 { + panic(fmt.Sprintf("invalid decoding table, base overflows int32")) + } + + dst[i] = baseOffset{ + baseLine: base, + addBits: bit, + } + base += 1 << bit + } +} + +var predef sync.Once + +func initPredefined() { + predef.Do(func() { + // Literals length codes + tmp := make([]baseOffset, 36) + for i := range tmp[:16] { + tmp[i] = baseOffset{ + baseLine: uint32(i), + addBits: 0, + } + } + fillBase(tmp[16:], 16, 1, 1, 1, 1, 2, 2, 3, 3, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + symbolTableX[tableLiteralLengths] = tmp + + // Match length codes + tmp = make([]baseOffset, 53) + for i := range tmp[:32] { + tmp[i] = baseOffset{ + // The transformation adds the 3 length. + baseLine: uint32(i) + 3, + addBits: 0, + } + } + fillBase(tmp[32:], 35, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16) + symbolTableX[tableMatchLengths] = tmp + + // Offset codes + tmp = make([]baseOffset, maxOffsetBits+1) + tmp[1] = baseOffset{ + baseLine: 1, + addBits: 1, + } + fillBase(tmp[2:], 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30) + symbolTableX[tableOffsets] = tmp + + // Fill predefined tables and transform them. + // https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#default-distributions + for i := range fsePredef[:] { + f := &fsePredef[i] + switch tableIndex(i) { + case tableLiteralLengths: + // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L243 + f.actualTableLog = 6 + copy(f.norm[:], []int16{4, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 1, 1, 1, 1, 1, + -1, -1, -1, -1}) + f.symbolLen = 36 + case tableOffsets: + // https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L281 + f.actualTableLog = 5 + copy(f.norm[:], []int16{ + 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1, -1}) + f.symbolLen = 29 + case tableMatchLengths: + //https://github.com/facebook/zstd/blob/ededcfca57366461021c922720878c81a5854a0a/lib/decompress/zstd_decompress_block.c#L304 + f.actualTableLog = 6 + copy(f.norm[:], []int16{ + 1, 4, 3, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, -1, -1, + -1, -1, -1, -1, -1}) + f.symbolLen = 53 + } + if err := f.buildDtable(); err != nil { + panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) + } + if err := f.transform(symbolTableX[i]); err != nil { + panic(fmt.Errorf("building table %v: %v", tableIndex(i), err)) + } + f.preDefined = true + + // Create encoder as well + enc := &fsePredefEnc[i] + copy(enc.norm[:], f.norm[:]) + enc.symbolLen = f.symbolLen + enc.actualTableLog = f.actualTableLog + if err := enc.buildCTable(); err != nil { + panic(fmt.Errorf("building encoding table %v: %v", tableIndex(i), err)) + } + enc.setBits(bitTables[i]) + enc.preDefined = true + } + }) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/hash.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/hash.go new file mode 100644 index 00000000000..4a752067fc9 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/hash.go @@ -0,0 +1,77 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +const ( + prime3bytes = 506832829 + prime4bytes = 2654435761 + prime5bytes = 889523592379 + prime6bytes = 227718039650203 + prime7bytes = 58295818150454627 + prime8bytes = 0xcf1bbcdcb7a56463 +) + +// hashLen returns a hash of the lowest l bytes of u for a size size of h bytes. +// l must be >=4 and <=8. Any other value will return hash for 4 bytes. +// h should always be <32. +// Preferably h and l should be a constant. +// FIXME: This does NOT get resolved, if 'mls' is constant, +// so this cannot be used. +func hashLen(u uint64, hashLog, mls uint8) uint32 { + switch mls { + case 5: + return hash5(u, hashLog) + case 6: + return hash6(u, hashLog) + case 7: + return hash7(u, hashLog) + case 8: + return hash8(u, hashLog) + default: + return hash4x64(u, hashLog) + } +} + +// hash3 returns the hash of the lower 3 bytes of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <32. +func hash3(u uint32, h uint8) uint32 { + return ((u << (32 - 24)) * prime3bytes) >> ((32 - h) & 31) +} + +// hash4 returns the hash of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <32. +func hash4(u uint32, h uint8) uint32 { + return (u * prime4bytes) >> ((32 - h) & 31) +} + +// hash4x64 returns the hash of the lowest 4 bytes of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <32. +func hash4x64(u uint64, h uint8) uint32 { + return (uint32(u) * prime4bytes) >> ((32 - h) & 31) +} + +// hash5 returns the hash of the lowest 5 bytes of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <64. +func hash5(u uint64, h uint8) uint32 { + return uint32(((u << (64 - 40)) * prime5bytes) >> ((64 - h) & 63)) +} + +// hash6 returns the hash of the lowest 6 bytes of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <64. +func hash6(u uint64, h uint8) uint32 { + return uint32(((u << (64 - 48)) * prime6bytes) >> ((64 - h) & 63)) +} + +// hash7 returns the hash of the lowest 7 bytes of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <64. +func hash7(u uint64, h uint8) uint32 { + return uint32(((u << (64 - 56)) * prime7bytes) >> ((64 - h) & 63)) +} + +// hash8 returns the hash of u to fit in a hash table with h bits. +// Preferably h should be a constant and should always be <64. +func hash8(u uint64, h uint8) uint32 { + return uint32((u * prime8bytes) >> ((64 - h) & 63)) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/history.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/history.go new file mode 100644 index 00000000000..f783e32d251 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/history.go @@ -0,0 +1,89 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "github.com/klauspost/compress/huff0" +) + +// history contains the information transferred between blocks. +type history struct { + b []byte + huffTree *huff0.Scratch + recentOffsets [3]int + decoders sequenceDecs + windowSize int + maxSize int + error bool + dict *dict +} + +// reset will reset the history to initial state of a frame. +// The history must already have been initialized to the desired size. +func (h *history) reset() { + h.b = h.b[:0] + h.error = false + h.recentOffsets = [3]int{1, 4, 8} + if f := h.decoders.litLengths.fse; f != nil && !f.preDefined { + fseDecoderPool.Put(f) + } + if f := h.decoders.offsets.fse; f != nil && !f.preDefined { + fseDecoderPool.Put(f) + } + if f := h.decoders.matchLengths.fse; f != nil && !f.preDefined { + fseDecoderPool.Put(f) + } + h.decoders = sequenceDecs{} + if h.huffTree != nil { + if h.dict == nil || h.dict.litEnc != h.huffTree { + huffDecoderPool.Put(h.huffTree) + } + } + h.huffTree = nil + h.dict = nil + //printf("history created: %+v (l: %d, c: %d)", *h, len(h.b), cap(h.b)) +} + +func (h *history) setDict(dict *dict) { + if dict == nil { + return + } + h.dict = dict + h.decoders.litLengths = dict.llDec + h.decoders.offsets = dict.ofDec + h.decoders.matchLengths = dict.mlDec + h.recentOffsets = dict.offsets + h.huffTree = dict.litEnc +} + +// append bytes to history. +// This function will make sure there is space for it, +// if the buffer has been allocated with enough extra space. +func (h *history) append(b []byte) { + if len(b) >= h.windowSize { + // Discard all history by simply overwriting + h.b = h.b[:h.windowSize] + copy(h.b, b[len(b)-h.windowSize:]) + return + } + + // If there is space, append it. + if len(b) < cap(h.b)-len(h.b) { + h.b = append(h.b, b...) + return + } + + // Move data down so we only have window size left. + // We know we have less than window size in b at this point. + discard := len(b) + len(h.b) - h.windowSize + copy(h.b, h.b[discard:]) + h.b = h.b[:h.windowSize] + copy(h.b[h.windowSize-len(b):], b) +} + +// append bytes to history without ever discarding anything. +func (h *history) appendKeep(b []byte) { + h.b = append(h.b, b...) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt new file mode 100644 index 00000000000..24b53065f40 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/LICENSE.txt @@ -0,0 +1,22 @@ +Copyright (c) 2016 Caleb Spare + +MIT License + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md new file mode 100644 index 00000000000..69aa3bb587c --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/README.md @@ -0,0 +1,58 @@ +# xxhash + +VENDORED: Go to [github.com/cespare/xxhash](https://github.com/cespare/xxhash) for original package. + + +[![GoDoc](https://godoc.org/github.com/cespare/xxhash?status.svg)](https://godoc.org/github.com/cespare/xxhash) +[![Build Status](https://travis-ci.org/cespare/xxhash.svg?branch=master)](https://travis-ci.org/cespare/xxhash) + +xxhash is a Go implementation of the 64-bit +[xxHash](http://cyan4973.github.io/xxHash/) algorithm, XXH64. This is a +high-quality hashing algorithm that is much faster than anything in the Go +standard library. + +This package provides a straightforward API: + +``` +func Sum64(b []byte) uint64 +func Sum64String(s string) uint64 +type Digest struct{ ... } + func New() *Digest +``` + +The `Digest` type implements hash.Hash64. Its key methods are: + +``` +func (*Digest) Write([]byte) (int, error) +func (*Digest) WriteString(string) (int, error) +func (*Digest) Sum64() uint64 +``` + +This implementation provides a fast pure-Go implementation and an even faster +assembly implementation for amd64. + +## Benchmarks + +Here are some quick benchmarks comparing the pure-Go and assembly +implementations of Sum64. + +| input size | purego | asm | +| --- | --- | --- | +| 5 B | 979.66 MB/s | 1291.17 MB/s | +| 100 B | 7475.26 MB/s | 7973.40 MB/s | +| 4 KB | 17573.46 MB/s | 17602.65 MB/s | +| 10 MB | 17131.46 MB/s | 17142.16 MB/s | + +These numbers were generated on Ubuntu 18.04 with an Intel i7-8700K CPU using +the following commands under Go 1.11.2: + +``` +$ go test -tags purego -benchtime 10s -bench '/xxhash,direct,bytes' +$ go test -benchtime 10s -bench '/xxhash,direct,bytes' +``` + +## Projects using this package + +- [InfluxDB](https://github.com/influxdata/influxdb) +- [Prometheus](https://github.com/prometheus/prometheus) +- [FreeCache](https://github.com/coocood/freecache) diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go new file mode 100644 index 00000000000..426b9cac786 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash.go @@ -0,0 +1,238 @@ +// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described +// at http://cyan4973.github.io/xxHash/. +// THIS IS VENDORED: Go to github.com/cespare/xxhash for original package. + +package xxhash + +import ( + "encoding/binary" + "errors" + "math/bits" +) + +const ( + prime1 uint64 = 11400714785074694791 + prime2 uint64 = 14029467366897019727 + prime3 uint64 = 1609587929392839161 + prime4 uint64 = 9650029242287828579 + prime5 uint64 = 2870177450012600261 +) + +// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where +// possible in the Go code is worth a small (but measurable) performance boost +// by avoiding some MOVQs. Vars are needed for the asm and also are useful for +// convenience in the Go code in a few places where we need to intentionally +// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the +// result overflows a uint64). +var ( + prime1v = prime1 + prime2v = prime2 + prime3v = prime3 + prime4v = prime4 + prime5v = prime5 +) + +// Digest implements hash.Hash64. +type Digest struct { + v1 uint64 + v2 uint64 + v3 uint64 + v4 uint64 + total uint64 + mem [32]byte + n int // how much of mem is used +} + +// New creates a new Digest that computes the 64-bit xxHash algorithm. +func New() *Digest { + var d Digest + d.Reset() + return &d +} + +// Reset clears the Digest's state so that it can be reused. +func (d *Digest) Reset() { + d.v1 = prime1v + prime2 + d.v2 = prime2 + d.v3 = 0 + d.v4 = -prime1v + d.total = 0 + d.n = 0 +} + +// Size always returns 8 bytes. +func (d *Digest) Size() int { return 8 } + +// BlockSize always returns 32 bytes. +func (d *Digest) BlockSize() int { return 32 } + +// Write adds more data to d. It always returns len(b), nil. +func (d *Digest) Write(b []byte) (n int, err error) { + n = len(b) + d.total += uint64(n) + + if d.n+n < 32 { + // This new data doesn't even fill the current block. + copy(d.mem[d.n:], b) + d.n += n + return + } + + if d.n > 0 { + // Finish off the partial block. + copy(d.mem[d.n:], b) + d.v1 = round(d.v1, u64(d.mem[0:8])) + d.v2 = round(d.v2, u64(d.mem[8:16])) + d.v3 = round(d.v3, u64(d.mem[16:24])) + d.v4 = round(d.v4, u64(d.mem[24:32])) + b = b[32-d.n:] + d.n = 0 + } + + if len(b) >= 32 { + // One or more full blocks left. + nw := writeBlocks(d, b) + b = b[nw:] + } + + // Store any remaining partial block. + copy(d.mem[:], b) + d.n = len(b) + + return +} + +// Sum appends the current hash to b and returns the resulting slice. +func (d *Digest) Sum(b []byte) []byte { + s := d.Sum64() + return append( + b, + byte(s>>56), + byte(s>>48), + byte(s>>40), + byte(s>>32), + byte(s>>24), + byte(s>>16), + byte(s>>8), + byte(s), + ) +} + +// Sum64 returns the current hash. +func (d *Digest) Sum64() uint64 { + var h uint64 + + if d.total >= 32 { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = d.v3 + prime5 + } + + h += d.total + + i, end := 0, d.n + for ; i+8 <= end; i += 8 { + k1 := round(0, u64(d.mem[i:i+8])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if i+4 <= end { + h ^= uint64(u32(d.mem[i:i+4])) * prime1 + h = rol23(h)*prime2 + prime3 + i += 4 + } + for i < end { + h ^= uint64(d.mem[i]) * prime5 + h = rol11(h) * prime1 + i++ + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +const ( + magic = "xxh\x06" + marshaledSize = len(magic) + 8*5 + 32 +) + +// MarshalBinary implements the encoding.BinaryMarshaler interface. +func (d *Digest) MarshalBinary() ([]byte, error) { + b := make([]byte, 0, marshaledSize) + b = append(b, magic...) + b = appendUint64(b, d.v1) + b = appendUint64(b, d.v2) + b = appendUint64(b, d.v3) + b = appendUint64(b, d.v4) + b = appendUint64(b, d.total) + b = append(b, d.mem[:d.n]...) + b = b[:len(b)+len(d.mem)-d.n] + return b, nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface. +func (d *Digest) UnmarshalBinary(b []byte) error { + if len(b) < len(magic) || string(b[:len(magic)]) != magic { + return errors.New("xxhash: invalid hash state identifier") + } + if len(b) != marshaledSize { + return errors.New("xxhash: invalid hash state size") + } + b = b[len(magic):] + b, d.v1 = consumeUint64(b) + b, d.v2 = consumeUint64(b) + b, d.v3 = consumeUint64(b) + b, d.v4 = consumeUint64(b) + b, d.total = consumeUint64(b) + copy(d.mem[:], b) + b = b[len(d.mem):] + d.n = int(d.total % uint64(len(d.mem))) + return nil +} + +func appendUint64(b []byte, x uint64) []byte { + var a [8]byte + binary.LittleEndian.PutUint64(a[:], x) + return append(b, a[:]...) +} + +func consumeUint64(b []byte) ([]byte, uint64) { + x := u64(b) + return b[8:], x +} + +func u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) } +func u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) } + +func round(acc, input uint64) uint64 { + acc += input * prime2 + acc = rol31(acc) + acc *= prime1 + return acc +} + +func mergeRound(acc, val uint64) uint64 { + val = round(0, val) + acc ^= val + acc = acc*prime1 + prime4 + return acc +} + +func rol1(x uint64) uint64 { return bits.RotateLeft64(x, 1) } +func rol7(x uint64) uint64 { return bits.RotateLeft64(x, 7) } +func rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) } +func rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) } +func rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) } +func rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) } +func rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) } +func rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) } diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.go new file mode 100644 index 00000000000..35318d7c46c --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.go @@ -0,0 +1,13 @@ +// +build !appengine +// +build gc +// +build !purego + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +// +//go:noescape +func Sum64(b []byte) uint64 + +//go:noescape +func writeBlocks(*Digest, []byte) int diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s new file mode 100644 index 00000000000..2c9c5357a14 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_amd64.s @@ -0,0 +1,215 @@ +// +build !appengine +// +build gc +// +build !purego + +#include "textflag.h" + +// Register allocation: +// AX h +// CX pointer to advance through b +// DX n +// BX loop end +// R8 v1, k1 +// R9 v2 +// R10 v3 +// R11 v4 +// R12 tmp +// R13 prime1v +// R14 prime2v +// R15 prime4v + +// round reads from and advances the buffer pointer in CX. +// It assumes that R13 has prime1v and R14 has prime2v. +#define round(r) \ + MOVQ (CX), R12 \ + ADDQ $8, CX \ + IMULQ R14, R12 \ + ADDQ R12, r \ + ROLQ $31, r \ + IMULQ R13, r + +// mergeRound applies a merge round on the two registers acc and val. +// It assumes that R13 has prime1v, R14 has prime2v, and R15 has prime4v. +#define mergeRound(acc, val) \ + IMULQ R14, val \ + ROLQ $31, val \ + IMULQ R13, val \ + XORQ val, acc \ + IMULQ R13, acc \ + ADDQ R15, acc + +// func Sum64(b []byte) uint64 +TEXT ·Sum64(SB), NOSPLIT, $0-32 + // Load fixed primes. + MOVQ ·prime1v(SB), R13 + MOVQ ·prime2v(SB), R14 + MOVQ ·prime4v(SB), R15 + + // Load slice. + MOVQ b_base+0(FP), CX + MOVQ b_len+8(FP), DX + LEAQ (CX)(DX*1), BX + + // The first loop limit will be len(b)-32. + SUBQ $32, BX + + // Check whether we have at least one block. + CMPQ DX, $32 + JLT noBlocks + + // Set up initial state (v1, v2, v3, v4). + MOVQ R13, R8 + ADDQ R14, R8 + MOVQ R14, R9 + XORQ R10, R10 + XORQ R11, R11 + SUBQ R13, R11 + + // Loop until CX > BX. +blockLoop: + round(R8) + round(R9) + round(R10) + round(R11) + + CMPQ CX, BX + JLE blockLoop + + MOVQ R8, AX + ROLQ $1, AX + MOVQ R9, R12 + ROLQ $7, R12 + ADDQ R12, AX + MOVQ R10, R12 + ROLQ $12, R12 + ADDQ R12, AX + MOVQ R11, R12 + ROLQ $18, R12 + ADDQ R12, AX + + mergeRound(AX, R8) + mergeRound(AX, R9) + mergeRound(AX, R10) + mergeRound(AX, R11) + + JMP afterBlocks + +noBlocks: + MOVQ ·prime5v(SB), AX + +afterBlocks: + ADDQ DX, AX + + // Right now BX has len(b)-32, and we want to loop until CX > len(b)-8. + ADDQ $24, BX + + CMPQ CX, BX + JG fourByte + +wordLoop: + // Calculate k1. + MOVQ (CX), R8 + ADDQ $8, CX + IMULQ R14, R8 + ROLQ $31, R8 + IMULQ R13, R8 + + XORQ R8, AX + ROLQ $27, AX + IMULQ R13, AX + ADDQ R15, AX + + CMPQ CX, BX + JLE wordLoop + +fourByte: + ADDQ $4, BX + CMPQ CX, BX + JG singles + + MOVL (CX), R8 + ADDQ $4, CX + IMULQ R13, R8 + XORQ R8, AX + + ROLQ $23, AX + IMULQ R14, AX + ADDQ ·prime3v(SB), AX + +singles: + ADDQ $4, BX + CMPQ CX, BX + JGE finalize + +singlesLoop: + MOVBQZX (CX), R12 + ADDQ $1, CX + IMULQ ·prime5v(SB), R12 + XORQ R12, AX + + ROLQ $11, AX + IMULQ R13, AX + + CMPQ CX, BX + JL singlesLoop + +finalize: + MOVQ AX, R12 + SHRQ $33, R12 + XORQ R12, AX + IMULQ R14, AX + MOVQ AX, R12 + SHRQ $29, R12 + XORQ R12, AX + IMULQ ·prime3v(SB), AX + MOVQ AX, R12 + SHRQ $32, R12 + XORQ R12, AX + + MOVQ AX, ret+24(FP) + RET + +// writeBlocks uses the same registers as above except that it uses AX to store +// the d pointer. + +// func writeBlocks(d *Digest, b []byte) int +TEXT ·writeBlocks(SB), NOSPLIT, $0-40 + // Load fixed primes needed for round. + MOVQ ·prime1v(SB), R13 + MOVQ ·prime2v(SB), R14 + + // Load slice. + MOVQ arg1_base+8(FP), CX + MOVQ arg1_len+16(FP), DX + LEAQ (CX)(DX*1), BX + SUBQ $32, BX + + // Load vN from d. + MOVQ arg+0(FP), AX + MOVQ 0(AX), R8 // v1 + MOVQ 8(AX), R9 // v2 + MOVQ 16(AX), R10 // v3 + MOVQ 24(AX), R11 // v4 + + // We don't need to check the loop condition here; this function is + // always called with at least one block of data to process. +blockLoop: + round(R8) + round(R9) + round(R10) + round(R11) + + CMPQ CX, BX + JLE blockLoop + + // Copy vN back to d. + MOVQ R8, 0(AX) + MOVQ R9, 8(AX) + MOVQ R10, 16(AX) + MOVQ R11, 24(AX) + + // The number of bytes written is CX minus the old base pointer. + SUBQ arg1_base+8(FP), CX + MOVQ CX, ret+32(FP) + + RET diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go new file mode 100644 index 00000000000..4a5a821603e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_other.go @@ -0,0 +1,76 @@ +// +build !amd64 appengine !gc purego + +package xxhash + +// Sum64 computes the 64-bit xxHash digest of b. +func Sum64(b []byte) uint64 { + // A simpler version would be + // d := New() + // d.Write(b) + // return d.Sum64() + // but this is faster, particularly for small inputs. + + n := len(b) + var h uint64 + + if n >= 32 { + v1 := prime1v + prime2 + v2 := prime2 + v3 := uint64(0) + v4 := -prime1v + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + h = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4) + h = mergeRound(h, v1) + h = mergeRound(h, v2) + h = mergeRound(h, v3) + h = mergeRound(h, v4) + } else { + h = prime5 + } + + h += uint64(n) + + i, end := 0, len(b) + for ; i+8 <= end; i += 8 { + k1 := round(0, u64(b[i:i+8:len(b)])) + h ^= k1 + h = rol27(h)*prime1 + prime4 + } + if i+4 <= end { + h ^= uint64(u32(b[i:i+4:len(b)])) * prime1 + h = rol23(h)*prime2 + prime3 + i += 4 + } + for ; i < end; i++ { + h ^= uint64(b[i]) * prime5 + h = rol11(h) * prime1 + } + + h ^= h >> 33 + h *= prime2 + h ^= h >> 29 + h *= prime3 + h ^= h >> 32 + + return h +} + +func writeBlocks(d *Digest, b []byte) int { + v1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4 + n := len(b) + for len(b) >= 32 { + v1 = round(v1, u64(b[0:8:len(b)])) + v2 = round(v2, u64(b[8:16:len(b)])) + v3 = round(v3, u64(b[16:24:len(b)])) + v4 = round(v4, u64(b[24:32:len(b)])) + b = b[32:len(b):len(b)] + } + d.v1, d.v2, d.v3, d.v4 = v1, v2, v3, v4 + return n - len(b) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go new file mode 100644 index 00000000000..6f3b0cb1026 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/internal/xxhash/xxhash_safe.go @@ -0,0 +1,11 @@ +package xxhash + +// Sum64String computes the 64-bit xxHash digest of s. +func Sum64String(s string) uint64 { + return Sum64([]byte(s)) +} + +// WriteString adds more data to d. It always returns len(s), nil. +func (d *Digest) WriteString(s string) (n int, err error) { + return d.Write([]byte(s)) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqdec.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqdec.go new file mode 100644 index 00000000000..b5c8ef13329 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqdec.go @@ -0,0 +1,485 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "errors" + "fmt" + "io" +) + +type seq struct { + litLen uint32 + matchLen uint32 + offset uint32 + + // Codes are stored here for the encoder + // so they only have to be looked up once. + llCode, mlCode, ofCode uint8 +} + +func (s seq) String() string { + if s.offset <= 3 { + if s.offset == 0 { + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset: INVALID (0)") + } + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset, " (repeat)") + } + return fmt.Sprint("litLen:", s.litLen, ", matchLen:", s.matchLen+zstdMinMatch, ", offset:", s.offset-3, " (new)") +} + +type seqCompMode uint8 + +const ( + compModePredefined seqCompMode = iota + compModeRLE + compModeFSE + compModeRepeat +) + +type sequenceDec struct { + // decoder keeps track of the current state and updates it from the bitstream. + fse *fseDecoder + state fseState + repeat bool +} + +// init the state of the decoder with input from stream. +func (s *sequenceDec) init(br *bitReader) error { + if s.fse == nil { + return errors.New("sequence decoder not defined") + } + s.state.init(br, s.fse.actualTableLog, s.fse.dt[:1<= 0; i-- { + if br.overread() { + printf("reading sequence %d, exceeded available data\n", seqs-i) + return io.ErrUnexpectedEOF + } + var ll, mo, ml int + if br.off > 4+((maxOffsetBits+16+16)>>3) { + // inlined function: + // ll, mo, ml = s.nextFast(br, llState, mlState, ofState) + + // Final will not read from stream. + var llB, mlB, moB uint8 + ll, llB = llState.final() + ml, mlB = mlState.final() + mo, moB = ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + } else { + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + } else { + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + } + } + br.fillFast() + } else { + ll, mo, ml = s.next(br, llState, mlState, ofState) + br.fill() + } + + if debugSequences { + println("Seq", seqs-i-1, "Litlen:", ll, "mo:", mo, "(abs) ml:", ml) + } + + if ll > len(s.literals) { + return fmt.Errorf("unexpected literal count, want %d bytes, but only %d is available", ll, len(s.literals)) + } + size := ll + ml + len(s.out) + if size-startSize > maxBlockSize { + return fmt.Errorf("output (%d) bigger than max block size", size) + } + if size > cap(s.out) { + // Not enough size, will be extremely rarely triggered, + // but could be if destination slice is too small for sync operations. + // We add maxBlockSize to the capacity. + s.out = append(s.out, make([]byte, maxBlockSize)...) + s.out = s.out[:len(s.out)-maxBlockSize] + } + if ml > maxMatchLen { + return fmt.Errorf("match len (%d) bigger than max allowed length", ml) + } + + // Add literals + s.out = append(s.out, s.literals[:ll]...) + s.literals = s.literals[ll:] + out := s.out + + if mo == 0 && ml > 0 { + return fmt.Errorf("zero matchoff and matchlen (%d) > 0", ml) + } + + if mo > len(s.out)+len(hist) || mo > s.windowSize { + if len(s.dict) == 0 { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) + } + + // we may be in dictionary. + dictO := len(s.dict) - (mo - (len(s.out) + len(hist))) + if dictO < 0 || dictO >= len(s.dict) { + return fmt.Errorf("match offset (%d) bigger than current history (%d)", mo, len(s.out)+len(hist)) + } + end := dictO + ml + if end > len(s.dict) { + out = append(out, s.dict[dictO:]...) + mo -= len(s.dict) - dictO + ml -= len(s.dict) - dictO + } else { + out = append(out, s.dict[dictO:end]...) + mo = 0 + ml = 0 + } + } + + // Copy from history. + // TODO: Blocks without history could be made to ignore this completely. + if v := mo - len(s.out); v > 0 { + // v is the start position in history from end. + start := len(s.hist) - v + if ml > v { + // Some goes into current block. + // Copy remainder of history + out = append(out, s.hist[start:]...) + mo -= v + ml -= v + } else { + out = append(out, s.hist[start:start+ml]...) + ml = 0 + } + } + // We must be in current buffer now + if ml > 0 { + start := len(s.out) - mo + if ml <= len(s.out)-start { + // No overlap + out = append(out, s.out[start:start+ml]...) + } else { + // Overlapping copy + // Extend destination slice and copy one byte at the time. + out = out[:len(out)+ml] + src := out[start : start+ml] + // Destination is the space we just added. + dst := out[len(out)-ml:] + dst = dst[:len(src)] + for i := range src { + dst[i] = src[i] + } + } + } + s.out = out + if i == 0 { + // This is the last sequence, so we shouldn't update state. + break + } + + // Manually inlined, ~ 5-20% faster + // Update all 3 states at once. Approx 20% faster. + nBits := llState.nbBits() + mlState.nbBits() + ofState.nbBits() + if nBits == 0 { + llState = llTable[llState.newState()&maxTableMask] + mlState = mlTable[mlState.newState()&maxTableMask] + ofState = ofTable[ofState.newState()&maxTableMask] + } else { + bits := br.getBitsFast(nBits) + lowBits := uint16(bits >> ((ofState.nbBits() + mlState.nbBits()) & 31)) + llState = llTable[(llState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits >> (ofState.nbBits() & 31)) + lowBits &= bitMask[mlState.nbBits()&15] + mlState = mlTable[(mlState.newState()+lowBits)&maxTableMask] + + lowBits = uint16(bits) & bitMask[ofState.nbBits()&15] + ofState = ofTable[(ofState.newState()+lowBits)&maxTableMask] + } + } + + // Add final literals + s.out = append(s.out, s.literals...) + return nil +} + +// update states, at least 27 bits must be available. +func (s *sequenceDecs) update(br *bitReader) { + // Max 8 bits + s.litLengths.state.next(br) + // Max 9 bits + s.matchLengths.state.next(br) + // Max 8 bits + s.offsets.state.next(br) +} + +var bitMask [16]uint16 + +func init() { + for i := range bitMask[:] { + bitMask[i] = uint16((1 << uint(i)) - 1) + } +} + +// update states, at least 27 bits must be available. +func (s *sequenceDecs) updateAlt(br *bitReader) { + // Update all 3 states at once. Approx 20% faster. + a, b, c := s.litLengths.state.state, s.matchLengths.state.state, s.offsets.state.state + + nBits := a.nbBits() + b.nbBits() + c.nbBits() + if nBits == 0 { + s.litLengths.state.state = s.litLengths.state.dt[a.newState()] + s.matchLengths.state.state = s.matchLengths.state.dt[b.newState()] + s.offsets.state.state = s.offsets.state.dt[c.newState()] + return + } + bits := br.getBitsFast(nBits) + lowBits := uint16(bits >> ((c.nbBits() + b.nbBits()) & 31)) + s.litLengths.state.state = s.litLengths.state.dt[a.newState()+lowBits] + + lowBits = uint16(bits >> (c.nbBits() & 31)) + lowBits &= bitMask[b.nbBits()&15] + s.matchLengths.state.state = s.matchLengths.state.dt[b.newState()+lowBits] + + lowBits = uint16(bits) & bitMask[c.nbBits()&15] + s.offsets.state.state = s.offsets.state.dt[c.newState()+lowBits] +} + +// nextFast will return new states when there are at least 4 unused bytes left on the stream when done. +func (s *sequenceDecs) nextFast(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) { + // Final will not read from stream. + ll, llB := llState.final() + ml, mlB := mlState.final() + mo, moB := ofState.final() + + // extra bits are stored in reverse order. + br.fillFast() + mo += br.getBits(moB) + if s.maxBits > 32 { + br.fillFast() + } + ml += br.getBits(mlB) + ll += br.getBits(llB) + + if moB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = mo + return + } + // mo = s.adjustOffset(mo, ll, moB) + // Inlined for rather big speedup + if ll == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + mo++ + } + + if mo == 0 { + mo = s.prevOffset[0] + return + } + var temp int + if mo == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[mo] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("temp was 0") + temp = 1 + } + + if mo != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + mo = temp + return +} + +func (s *sequenceDecs) next(br *bitReader, llState, mlState, ofState decSymbol) (ll, mo, ml int) { + // Final will not read from stream. + ll, llB := llState.final() + ml, mlB := mlState.final() + mo, moB := ofState.final() + + // extra bits are stored in reverse order. + br.fill() + if s.maxBits <= 32 { + mo += br.getBits(moB) + ml += br.getBits(mlB) + ll += br.getBits(llB) + } else { + mo += br.getBits(moB) + br.fill() + // matchlength+literal length, max 32 bits + ml += br.getBits(mlB) + ll += br.getBits(llB) + + } + mo = s.adjustOffset(mo, ll, moB) + return +} + +func (s *sequenceDecs) adjustOffset(offset, litLen int, offsetB uint8) int { + if offsetB > 1 { + s.prevOffset[2] = s.prevOffset[1] + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = offset + return offset + } + + if litLen == 0 { + // There is an exception though, when current sequence's literals_length = 0. + // In this case, repeated offsets are shifted by one, so an offset_value of 1 means Repeated_Offset2, + // an offset_value of 2 means Repeated_Offset3, and an offset_value of 3 means Repeated_Offset1 - 1_byte. + offset++ + } + + if offset == 0 { + return s.prevOffset[0] + } + var temp int + if offset == 3 { + temp = s.prevOffset[0] - 1 + } else { + temp = s.prevOffset[offset] + } + + if temp == 0 { + // 0 is not valid; input is corrupted; force offset to 1 + println("temp was 0") + temp = 1 + } + + if offset != 1 { + s.prevOffset[2] = s.prevOffset[1] + } + s.prevOffset[1] = s.prevOffset[0] + s.prevOffset[0] = temp + return temp +} + +// mergeHistory will merge history. +func (s *sequenceDecs) mergeHistory(hist *sequenceDecs) (*sequenceDecs, error) { + for i := uint(0); i < 3; i++ { + var sNew, sHist *sequenceDec + switch i { + default: + // same as "case 0": + sNew = &s.litLengths + sHist = &hist.litLengths + case 1: + sNew = &s.offsets + sHist = &hist.offsets + case 2: + sNew = &s.matchLengths + sHist = &hist.matchLengths + } + if sNew.repeat { + if sHist.fse == nil { + return nil, fmt.Errorf("sequence stream %d, repeat requested, but no history", i) + } + continue + } + if sNew.fse == nil { + return nil, fmt.Errorf("sequence stream %d, no fse found", i) + } + if sHist.fse != nil && !sHist.fse.preDefined { + fseDecoderPool.Put(sHist.fse) + } + sHist.fse = sNew.fse + } + return hist, nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqenc.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqenc.go new file mode 100644 index 00000000000..36bcc3cc02e --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/seqenc.go @@ -0,0 +1,115 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import "math/bits" + +type seqCoders struct { + llEnc, ofEnc, mlEnc *fseEncoder + llPrev, ofPrev, mlPrev *fseEncoder +} + +// swap coders with another (block). +func (s *seqCoders) swap(other *seqCoders) { + *s, *other = *other, *s +} + +// setPrev will update the previous encoders to the actually used ones +// and make sure a fresh one is in the main slot. +func (s *seqCoders) setPrev(ll, ml, of *fseEncoder) { + compareSwap := func(used *fseEncoder, current, prev **fseEncoder) { + // We used the new one, more current to history and reuse the previous history + if *current == used { + *prev, *current = *current, *prev + c := *current + p := *prev + c.reUsed = false + p.reUsed = true + return + } + if used == *prev { + return + } + // Ensure we cannot reuse by accident + prevEnc := *prev + prevEnc.symbolLen = 0 + return + } + compareSwap(ll, &s.llEnc, &s.llPrev) + compareSwap(ml, &s.mlEnc, &s.mlPrev) + compareSwap(of, &s.ofEnc, &s.ofPrev) +} + +func highBit(val uint32) (n uint32) { + return uint32(bits.Len32(val) - 1) +} + +var llCodeTable = [64]byte{0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 16, 17, 17, 18, 18, 19, 19, + 20, 20, 20, 20, 21, 21, 21, 21, + 22, 22, 22, 22, 22, 22, 22, 22, + 23, 23, 23, 23, 23, 23, 23, 23, + 24, 24, 24, 24, 24, 24, 24, 24, + 24, 24, 24, 24, 24, 24, 24, 24} + +// Up to 6 bits +const maxLLCode = 35 + +// llBitsTable translates from ll code to number of bits. +var llBitsTable = [maxLLCode + 1]byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16} + +// llCode returns the code that represents the literal length requested. +func llCode(litLength uint32) uint8 { + const llDeltaCode = 19 + if litLength <= 63 { + // Compiler insists on bounds check (Go 1.12) + return llCodeTable[litLength&63] + } + return uint8(highBit(litLength)) + llDeltaCode +} + +var mlCodeTable = [128]byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 36, 36, 37, 37, 37, 37, + 38, 38, 38, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 39, 39, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, + 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, 41, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, + 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42} + +// Up to 6 bits +const maxMLCode = 52 + +// mlBitsTable translates from ml code to number of bits. +var mlBitsTable = [maxMLCode + 1]byte{ + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 2, 2, 3, 3, + 4, 4, 5, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16} + +// note : mlBase = matchLength - MINMATCH; +// because it's the format it's stored in seqStore->sequences +func mlCode(mlBase uint32) uint8 { + const mlDeltaCode = 36 + if mlBase <= 127 { + // Compiler insists on bounds check (Go 1.12) + return mlCodeTable[mlBase&127] + } + return uint8(highBit(mlBase)) + mlDeltaCode +} + +func ofCode(offset uint32) uint8 { + // A valid offset will always be > 0. + return uint8(bits.Len32(offset) - 1) +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/snappy.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/snappy.go new file mode 100644 index 00000000000..841fd95acce --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/snappy.go @@ -0,0 +1,436 @@ +// Copyright 2019+ Klaus Post. All rights reserved. +// License information can be found in the LICENSE file. +// Based on work by Yann Collet, released under BSD License. + +package zstd + +import ( + "encoding/binary" + "errors" + "hash/crc32" + "io" + + "github.com/klauspost/compress/huff0" + "github.com/klauspost/compress/snappy" +) + +const ( + snappyTagLiteral = 0x00 + snappyTagCopy1 = 0x01 + snappyTagCopy2 = 0x02 + snappyTagCopy4 = 0x03 +) + +const ( + snappyChecksumSize = 4 + snappyMagicBody = "sNaPpY" + + // snappyMaxBlockSize is the maximum size of the input to encodeBlock. It is not + // part of the wire format per se, but some parts of the encoder assume + // that an offset fits into a uint16. + // + // Also, for the framing format (Writer type instead of Encode function), + // https://github.com/google/snappy/blob/master/framing_format.txt says + // that "the uncompressed data in a chunk must be no longer than 65536 + // bytes". + snappyMaxBlockSize = 65536 + + // snappyMaxEncodedLenOfMaxBlockSize equals MaxEncodedLen(snappyMaxBlockSize), but is + // hard coded to be a const instead of a variable, so that obufLen can also + // be a const. Their equivalence is confirmed by + // TestMaxEncodedLenOfMaxBlockSize. + snappyMaxEncodedLenOfMaxBlockSize = 76490 +) + +const ( + chunkTypeCompressedData = 0x00 + chunkTypeUncompressedData = 0x01 + chunkTypePadding = 0xfe + chunkTypeStreamIdentifier = 0xff +) + +var ( + // ErrSnappyCorrupt reports that the input is invalid. + ErrSnappyCorrupt = errors.New("snappy: corrupt input") + // ErrSnappyTooLarge reports that the uncompressed length is too large. + ErrSnappyTooLarge = errors.New("snappy: decoded block is too large") + // ErrSnappyUnsupported reports that the input isn't supported. + ErrSnappyUnsupported = errors.New("snappy: unsupported input") + + errUnsupportedLiteralLength = errors.New("snappy: unsupported literal length") +) + +// SnappyConverter can read SnappyConverter-compressed streams and convert them to zstd. +// Conversion is done by converting the stream directly from Snappy without intermediate +// full decoding. +// Therefore the compression ratio is much less than what can be done by a full decompression +// and compression, and a faulty Snappy stream may lead to a faulty Zstandard stream without +// any errors being generated. +// No CRC value is being generated and not all CRC values of the Snappy stream are checked. +// However, it provides really fast recompression of Snappy streams. +// The converter can be reused to avoid allocations, even after errors. +type SnappyConverter struct { + r io.Reader + err error + buf []byte + block *blockEnc +} + +// Convert the Snappy stream supplied in 'in' and write the zStandard stream to 'w'. +// If any error is detected on the Snappy stream it is returned. +// The number of bytes written is returned. +func (r *SnappyConverter) Convert(in io.Reader, w io.Writer) (int64, error) { + initPredefined() + r.err = nil + r.r = in + if r.block == nil { + r.block = &blockEnc{} + r.block.init() + } + r.block.initNewEncode() + if len(r.buf) != snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize { + r.buf = make([]byte, snappyMaxEncodedLenOfMaxBlockSize+snappyChecksumSize) + } + r.block.litEnc.Reuse = huff0.ReusePolicyNone + var written int64 + var readHeader bool + { + var header []byte + var n int + header, r.err = frameHeader{WindowSize: snappyMaxBlockSize}.appendTo(r.buf[:0]) + + n, r.err = w.Write(header) + if r.err != nil { + return written, r.err + } + written += int64(n) + } + + for { + if !r.readFull(r.buf[:4], true) { + // Add empty last block + r.block.reset(nil) + r.block.last = true + err := r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + n, err := w.Write(r.block.output) + if err != nil { + return written, err + } + written += int64(n) + + return written, r.err + } + chunkType := r.buf[0] + if !readHeader { + if chunkType != chunkTypeStreamIdentifier { + println("chunkType != chunkTypeStreamIdentifier", chunkType) + r.err = ErrSnappyCorrupt + return written, r.err + } + readHeader = true + } + chunkLen := int(r.buf[1]) | int(r.buf[2])<<8 | int(r.buf[3])<<16 + if chunkLen > len(r.buf) { + println("chunkLen > len(r.buf)", chunkType) + r.err = ErrSnappyUnsupported + return written, r.err + } + + // The chunk types are specified at + // https://github.com/google/snappy/blob/master/framing_format.txt + switch chunkType { + case chunkTypeCompressedData: + // Section 4.2. Compressed data (chunk type 0x00). + if chunkLen < snappyChecksumSize { + println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + buf := r.buf[:chunkLen] + if !r.readFull(buf, false) { + return written, r.err + } + //checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + buf = buf[snappyChecksumSize:] + + n, hdr, err := snappyDecodedLen(buf) + if err != nil { + r.err = err + return written, r.err + } + buf = buf[hdr:] + if n > snappyMaxBlockSize { + println("n > snappyMaxBlockSize", n, snappyMaxBlockSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.reset(nil) + r.block.pushOffsets() + if err := decodeSnappy(r.block, buf); err != nil { + r.err = err + return written, r.err + } + if r.block.size+r.block.extraLits != n { + printf("invalid size, want %d, got %d\n", n, r.block.size+r.block.extraLits) + r.err = ErrSnappyCorrupt + return written, r.err + } + err = r.block.encode(nil, false, false) + switch err { + case errIncompressible: + r.block.popOffsets() + r.block.reset(nil) + r.block.literals, err = snappy.Decode(r.block.literals[:n], r.buf[snappyChecksumSize:chunkLen]) + if err != nil { + println("snappy.Decode:", err) + return written, err + } + err = r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + case nil: + default: + return written, err + } + + n, r.err = w.Write(r.block.output) + if r.err != nil { + return written, err + } + written += int64(n) + continue + case chunkTypeUncompressedData: + if debug { + println("Uncompressed, chunklen", chunkLen) + } + // Section 4.3. Uncompressed data (chunk type 0x01). + if chunkLen < snappyChecksumSize { + println("chunkLen < snappyChecksumSize", chunkLen, snappyChecksumSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.reset(nil) + buf := r.buf[:snappyChecksumSize] + if !r.readFull(buf, false) { + return written, r.err + } + checksum := uint32(buf[0]) | uint32(buf[1])<<8 | uint32(buf[2])<<16 | uint32(buf[3])<<24 + // Read directly into r.decoded instead of via r.buf. + n := chunkLen - snappyChecksumSize + if n > snappyMaxBlockSize { + println("n > snappyMaxBlockSize", n, snappyMaxBlockSize) + r.err = ErrSnappyCorrupt + return written, r.err + } + r.block.literals = r.block.literals[:n] + if !r.readFull(r.block.literals, false) { + return written, r.err + } + if snappyCRC(r.block.literals) != checksum { + println("literals crc mismatch") + r.err = ErrSnappyCorrupt + return written, r.err + } + err := r.block.encodeLits(r.block.literals, false) + if err != nil { + return written, err + } + n, r.err = w.Write(r.block.output) + if r.err != nil { + return written, err + } + written += int64(n) + continue + + case chunkTypeStreamIdentifier: + if debug { + println("stream id", chunkLen, len(snappyMagicBody)) + } + // Section 4.1. Stream identifier (chunk type 0xff). + if chunkLen != len(snappyMagicBody) { + println("chunkLen != len(snappyMagicBody)", chunkLen, len(snappyMagicBody)) + r.err = ErrSnappyCorrupt + return written, r.err + } + if !r.readFull(r.buf[:len(snappyMagicBody)], false) { + return written, r.err + } + for i := 0; i < len(snappyMagicBody); i++ { + if r.buf[i] != snappyMagicBody[i] { + println("r.buf[i] != snappyMagicBody[i]", r.buf[i], snappyMagicBody[i], i) + r.err = ErrSnappyCorrupt + return written, r.err + } + } + continue + } + + if chunkType <= 0x7f { + // Section 4.5. Reserved unskippable chunks (chunk types 0x02-0x7f). + println("chunkType <= 0x7f") + r.err = ErrSnappyUnsupported + return written, r.err + } + // Section 4.4 Padding (chunk type 0xfe). + // Section 4.6. Reserved skippable chunks (chunk types 0x80-0xfd). + if !r.readFull(r.buf[:chunkLen], false) { + return written, r.err + } + } +} + +// decodeSnappy writes the decoding of src to dst. It assumes that the varint-encoded +// length of the decompressed bytes has already been read. +func decodeSnappy(blk *blockEnc, src []byte) error { + //decodeRef(make([]byte, snappyMaxBlockSize), src) + var s, length int + lits := blk.extraLits + var offset uint32 + for s < len(src) { + switch src[s] & 0x03 { + case snappyTagLiteral: + x := uint32(src[s] >> 2) + switch { + case x < 60: + s++ + case x == 60: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-1]) + case x == 61: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-2]) | uint32(src[s-1])<<8 + case x == 62: + s += 4 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-3]) | uint32(src[s-2])<<8 | uint32(src[s-1])<<16 + case x == 63: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, src) + return ErrSnappyCorrupt + } + x = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + if x > snappyMaxBlockSize { + println("x > snappyMaxBlockSize", x, snappyMaxBlockSize) + return ErrSnappyCorrupt + } + length = int(x) + 1 + if length <= 0 { + println("length <= 0 ", length) + + return errUnsupportedLiteralLength + } + //if length > snappyMaxBlockSize-d || uint32(length) > len(src)-s { + // return ErrSnappyCorrupt + //} + + blk.literals = append(blk.literals, src[s:s+length]...) + //println(length, "litLen") + lits += length + s += length + continue + + case snappyTagCopy1: + s += 2 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 4 + int(src[s-2])>>2&0x7 + offset = uint32(src[s-2])&0xe0<<3 | uint32(src[s-1]) + + case snappyTagCopy2: + s += 3 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 1 + int(src[s-3])>>2 + offset = uint32(src[s-2]) | uint32(src[s-1])<<8 + + case snappyTagCopy4: + s += 5 + if uint(s) > uint(len(src)) { // The uint conversions catch overflow from the previous line. + println("uint(s) > uint(len(src)", s, len(src)) + return ErrSnappyCorrupt + } + length = 1 + int(src[s-5])>>2 + offset = uint32(src[s-4]) | uint32(src[s-3])<<8 | uint32(src[s-2])<<16 | uint32(src[s-1])<<24 + } + + if offset <= 0 || blk.size+lits < int(offset) /*|| length > len(blk)-d */ { + println("offset <= 0 || blk.size+lits < int(offset)", offset, blk.size+lits, int(offset), blk.size, lits) + + return ErrSnappyCorrupt + } + + // Check if offset is one of the recent offsets. + // Adjusts the output offset accordingly. + // Gives a tiny bit of compression, typically around 1%. + if false { + offset = blk.matchOffset(offset, uint32(lits)) + } else { + offset += 3 + } + + blk.sequences = append(blk.sequences, seq{ + litLen: uint32(lits), + offset: offset, + matchLen: uint32(length) - zstdMinMatch, + }) + blk.size += length + lits + lits = 0 + } + blk.extraLits = lits + return nil +} + +func (r *SnappyConverter) readFull(p []byte, allowEOF bool) (ok bool) { + if _, r.err = io.ReadFull(r.r, p); r.err != nil { + if r.err == io.ErrUnexpectedEOF || (r.err == io.EOF && !allowEOF) { + r.err = ErrSnappyCorrupt + } + return false + } + return true +} + +var crcTable = crc32.MakeTable(crc32.Castagnoli) + +// crc implements the checksum specified in section 3 of +// https://github.com/google/snappy/blob/master/framing_format.txt +func snappyCRC(b []byte) uint32 { + c := crc32.Update(0, crcTable, b) + return uint32(c>>15|c<<17) + 0xa282ead8 +} + +// snappyDecodedLen returns the length of the decoded block and the number of bytes +// that the length header occupied. +func snappyDecodedLen(src []byte) (blockLen, headerLen int, err error) { + v, n := binary.Uvarint(src) + if n <= 0 || v > 0xffffffff { + return 0, 0, ErrSnappyCorrupt + } + + const wordSize = 32 << (^uint(0) >> 32 & 1) + if wordSize == 32 && v > 0x7fffffff { + return 0, 0, ErrSnappyTooLarge + } + return int(v), n, nil +} diff --git a/awsproviderlint/vendor/github.com/klauspost/compress/zstd/zstd.go b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/zstd.go new file mode 100644 index 00000000000..0807719c8b9 --- /dev/null +++ b/awsproviderlint/vendor/github.com/klauspost/compress/zstd/zstd.go @@ -0,0 +1,144 @@ +// Package zstd provides decompression of zstandard files. +// +// For advanced usage and examples, go to the README: https://github.com/klauspost/compress/tree/master/zstd#zstd +package zstd + +import ( + "errors" + "log" + "math" + "math/bits" +) + +// enable debug printing +const debug = false + +// Enable extra assertions. +const debugAsserts = debug || false + +// print sequence details +const debugSequences = false + +// print detailed matching information +const debugMatches = false + +// force encoder to use predefined tables. +const forcePreDef = false + +// zstdMinMatch is the minimum zstd match length. +const zstdMinMatch = 3 + +// Reset the buffer offset when reaching this. +const bufferReset = math.MaxInt32 - MaxWindowSize + +var ( + // ErrReservedBlockType is returned when a reserved block type is found. + // Typically this indicates wrong or corrupted input. + ErrReservedBlockType = errors.New("invalid input: reserved block type encountered") + + // ErrCompressedSizeTooBig is returned when a block is bigger than allowed. + // Typically this indicates wrong or corrupted input. + ErrCompressedSizeTooBig = errors.New("invalid input: compressed size too big") + + // ErrBlockTooSmall is returned when a block is too small to be decoded. + // Typically returned on invalid input. + ErrBlockTooSmall = errors.New("block too small") + + // ErrMagicMismatch is returned when a "magic" number isn't what is expected. + // Typically this indicates wrong or corrupted input. + ErrMagicMismatch = errors.New("invalid input: magic number mismatch") + + // ErrWindowSizeExceeded is returned when a reference exceeds the valid window size. + // Typically this indicates wrong or corrupted input. + ErrWindowSizeExceeded = errors.New("window size exceeded") + + // ErrWindowSizeTooSmall is returned when no window size is specified. + // Typically this indicates wrong or corrupted input. + ErrWindowSizeTooSmall = errors.New("invalid input: window size was too small") + + // ErrDecoderSizeExceeded is returned if decompressed size exceeds the configured limit. + ErrDecoderSizeExceeded = errors.New("decompressed size exceeds configured limit") + + // ErrUnknownDictionary is returned if the dictionary ID is unknown. + // For the time being dictionaries are not supported. + ErrUnknownDictionary = errors.New("unknown dictionary") + + // ErrFrameSizeExceeded is returned if the stated frame size is exceeded. + // This is only returned if SingleSegment is specified on the frame. + ErrFrameSizeExceeded = errors.New("frame size exceeded") + + // ErrCRCMismatch is returned if CRC mismatches. + ErrCRCMismatch = errors.New("CRC check failed") + + // ErrDecoderClosed will be returned if the Decoder was used after + // Close has been called. + ErrDecoderClosed = errors.New("decoder used after Close") +) + +func println(a ...interface{}) { + if debug { + log.Println(a...) + } +} + +func printf(format string, a ...interface{}) { + if debug { + log.Printf(format, a...) + } +} + +// matchLenFast does matching, but will not match the last up to 7 bytes. +func matchLenFast(a, b []byte) int { + endI := len(a) & (math.MaxInt32 - 7) + for i := 0; i < endI; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + return i + bits.TrailingZeros64(diff)>>3 + } + } + return endI +} + +// matchLen returns the maximum length. +// a must be the shortest of the two. +// The function also returns whether all bytes matched. +func matchLen(a, b []byte) int { + b = b[:len(a)] + for i := 0; i < len(a)-7; i += 8 { + if diff := load64(a, i) ^ load64(b, i); diff != 0 { + return i + (bits.TrailingZeros64(diff) >> 3) + } + } + + checked := (len(a) >> 3) << 3 + a = a[checked:] + b = b[checked:] + for i := range a { + if a[i] != b[i] { + return i + checked + } + } + return len(a) + checked +} + +func load3232(b []byte, i int32) uint32 { + // Help the compiler eliminate bounds checks on the read so it can be done in a single read. + b = b[i:] + b = b[:4] + return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24 +} + +func load6432(b []byte, i int32) uint64 { + // Help the compiler eliminate bounds checks on the read so it can be done in a single read. + b = b[i:] + b = b[:8] + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} + +func load64(b []byte, i int) uint64 { + // Help the compiler eliminate bounds checks on the read so it can be done in a single read. + b = b[i:] + b = b[:8] + return uint64(b[0]) | uint64(b[1])<<8 | uint64(b[2])<<16 | uint64(b[3])<<24 | + uint64(b[4])<<32 | uint64(b[5])<<40 | uint64(b[6])<<48 | uint64(b[7])<<56 +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go index ee35e9de7cb..8d177f151c4 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion.go @@ -138,6 +138,15 @@ func getConversionKnown(in cty.Type, out cty.Type, unsafe bool) conversion { outEty := out.ElementType() return conversionObjectToMap(in, outEty, unsafe) + case out.IsObjectType() && in.IsMapType(): + if !unsafe { + // Converting a map to an object is an "unsafe" conversion, + // because we don't know if all the map keys will correspond to + // object attributes. + return nil + } + return conversionMapToObject(in, out, unsafe) + case in.IsCapsuleType() || out.IsCapsuleType(): if !unsafe { // Capsule types can only participate in "unsafe" conversions, diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_collection.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_collection.go index 3039ba22e54..2207df9e46c 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_collection.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_collection.go @@ -13,20 +13,28 @@ import ( // if we're converting from a set into a list of the same element type.) func conversionCollectionToList(ety cty.Type, conv conversion) conversion { return func(val cty.Value, path cty.Path) (cty.Value, error) { + if !val.Length().IsKnown() { + // If the input collection has an unknown length (which is true + // for a set containing unknown values) then our result must be + // an unknown list, because we can't predict how many elements + // the resulting list should have. + return cty.UnknownVal(cty.List(val.Type().ElementType())), nil + } + elems := make([]cty.Value, 0, val.LengthInt()) i := int64(0) - path = append(path, nil) + elemPath := append(path.Copy(), nil) it := val.ElementIterator() for it.Next() { _, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: cty.NumberIntVal(i), } if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } @@ -37,6 +45,9 @@ func conversionCollectionToList(ety cty.Type, conv conversion) conversion { } if len(elems) == 0 { + if ety == cty.DynamicPseudoType { + ety = val.Type().ElementType() + } return cty.ListValEmpty(ety), nil } @@ -55,18 +66,18 @@ func conversionCollectionToSet(ety cty.Type, conv conversion) conversion { return func(val cty.Value, path cty.Path) (cty.Value, error) { elems := make([]cty.Value, 0, val.LengthInt()) i := int64(0) - path = append(path, nil) + elemPath := append(path.Copy(), nil) it := val.ElementIterator() for it.Next() { _, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: cty.NumberIntVal(i), } if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } @@ -77,6 +88,11 @@ func conversionCollectionToSet(ety cty.Type, conv conversion) conversion { } if len(elems) == 0 { + // Prefer a concrete type over a dynamic type when returning an + // empty set + if ety == cty.DynamicPseudoType { + ety = val.Type().ElementType() + } return cty.SetValEmpty(ety), nil } @@ -93,13 +109,13 @@ func conversionCollectionToSet(ety cty.Type, conv conversion) conversion { func conversionCollectionToMap(ety cty.Type, conv conversion) conversion { return func(val cty.Value, path cty.Path) (cty.Value, error) { elems := make(map[string]cty.Value, 0) - path = append(path, nil) + elemPath := append(path.Copy(), nil) it := val.ElementIterator() for it.Next() { key, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: key, } @@ -107,11 +123,11 @@ func conversionCollectionToMap(ety cty.Type, conv conversion) conversion { if err != nil { // Should never happen, because keys can only be numbers or // strings and both can convert to string. - return cty.DynamicVal, path.NewErrorf("cannot convert key type %s to string for map", key.Type().FriendlyName()) + return cty.DynamicVal, elemPath.NewErrorf("cannot convert key type %s to string for map", key.Type().FriendlyName()) } if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } @@ -121,9 +137,25 @@ func conversionCollectionToMap(ety cty.Type, conv conversion) conversion { } if len(elems) == 0 { + // Prefer a concrete type over a dynamic type when returning an + // empty map + if ety == cty.DynamicPseudoType { + ety = val.Type().ElementType() + } return cty.MapValEmpty(ety), nil } + if ety.IsCollectionType() || ety.IsObjectType() { + var err error + if elems, err = conversionUnifyCollectionElements(elems, path, false); err != nil { + return cty.NilVal, err + } + } + + if err := conversionCheckMapElementTypes(elems, path); err != nil { + return cty.NilVal, err + } + return cty.MapVal(elems), nil } } @@ -132,34 +164,45 @@ func conversionCollectionToMap(ety cty.Type, conv conversion) conversion { // given tuple type and return a set of the given element type. // // Will panic if the given tupleType isn't actually a tuple type. -func conversionTupleToSet(tupleType cty.Type, listEty cty.Type, unsafe bool) conversion { +func conversionTupleToSet(tupleType cty.Type, setEty cty.Type, unsafe bool) conversion { tupleEtys := tupleType.TupleElementTypes() if len(tupleEtys) == 0 { // Empty tuple short-circuit return func(val cty.Value, path cty.Path) (cty.Value, error) { - return cty.SetValEmpty(listEty), nil + return cty.SetValEmpty(setEty), nil } } - if listEty == cty.DynamicPseudoType { + if setEty == cty.DynamicPseudoType { // This is a special case where the caller wants us to find // a suitable single type that all elements can convert to, if // possible. - listEty, _ = unify(tupleEtys, unsafe) - if listEty == cty.NilType { + setEty, _ = unify(tupleEtys, unsafe) + if setEty == cty.NilType { return nil } + + // If the set element type after unification is still the dynamic + // type, the only way this can result in a valid set is if all values + // are of dynamic type + if setEty == cty.DynamicPseudoType { + for _, tupleEty := range tupleEtys { + if !tupleEty.Equals(cty.DynamicPseudoType) { + return nil + } + } + } } elemConvs := make([]conversion, len(tupleEtys)) for i, tupleEty := range tupleEtys { - if tupleEty.Equals(listEty) { + if tupleEty.Equals(setEty) { // no conversion required continue } - elemConvs[i] = getConversion(tupleEty, listEty, unsafe) + elemConvs[i] = getConversion(tupleEty, setEty, unsafe) if elemConvs[i] == nil { // If any of our element conversions are impossible, then the our // whole conversion is impossible. @@ -171,20 +214,20 @@ func conversionTupleToSet(tupleType cty.Type, listEty cty.Type, unsafe bool) con // element conversions in elemConvs return func(val cty.Value, path cty.Path) (cty.Value, error) { elems := make([]cty.Value, 0, len(elemConvs)) - path = append(path, nil) + elemPath := append(path.Copy(), nil) i := int64(0) it := val.ElementIterator() for it.Next() { _, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: cty.NumberIntVal(i), } conv := elemConvs[i] if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } @@ -220,6 +263,17 @@ func conversionTupleToList(tupleType cty.Type, listEty cty.Type, unsafe bool) co if listEty == cty.NilType { return nil } + + // If the list element type after unification is still the dynamic + // type, the only way this can result in a valid list is if all values + // are of dynamic type + if listEty == cty.DynamicPseudoType { + for _, tupleEty := range tupleEtys { + if !tupleEty.Equals(cty.DynamicPseudoType) { + return nil + } + } + } } elemConvs := make([]conversion, len(tupleEtys)) @@ -241,29 +295,35 @@ func conversionTupleToList(tupleType cty.Type, listEty cty.Type, unsafe bool) co // element conversions in elemConvs return func(val cty.Value, path cty.Path) (cty.Value, error) { elems := make([]cty.Value, 0, len(elemConvs)) - path = append(path, nil) + elemTys := make([]cty.Type, 0, len(elems)) + elemPath := append(path.Copy(), nil) i := int64(0) it := val.ElementIterator() for it.Next() { _, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: cty.NumberIntVal(i), } conv := elemConvs[i] if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } } elems = append(elems, val) + elemTys = append(elemTys, val.Type()) i++ } + elems, err := conversionUnifyListElements(elems, elemPath, unsafe) + if err != nil { + return cty.NilVal, err + } return cty.ListVal(elems), nil } } @@ -315,19 +375,19 @@ func conversionObjectToMap(objectType cty.Type, mapEty cty.Type, unsafe bool) co // element conversions in elemConvs return func(val cty.Value, path cty.Path) (cty.Value, error) { elems := make(map[string]cty.Value, len(elemConvs)) - path = append(path, nil) + elemPath := append(path.Copy(), nil) it := val.ElementIterator() for it.Next() { name, val := it.Element() var err error - path[len(path)-1] = cty.IndexStep{ + elemPath[len(elemPath)-1] = cty.IndexStep{ Key: name, } conv := elemConvs[name.AsString()] if conv != nil { - val, err = conv(val, path) + val, err = conv(val, elemPath) if err != nil { return cty.NilVal, err } @@ -335,6 +395,175 @@ func conversionObjectToMap(objectType cty.Type, mapEty cty.Type, unsafe bool) co elems[name.AsString()] = val } + if mapEty.IsCollectionType() || mapEty.IsObjectType() { + var err error + if elems, err = conversionUnifyCollectionElements(elems, path, unsafe); err != nil { + return cty.NilVal, err + } + } + + if err := conversionCheckMapElementTypes(elems, path); err != nil { + return cty.NilVal, err + } + return cty.MapVal(elems), nil } } + +// conversionMapToObject returns a conversion that will take a value of the +// given map type and return an object of the given type. The object attribute +// types must all be compatible with the map element type. +// +// Will panic if the given mapType and objType are not maps and objects +// respectively. +func conversionMapToObject(mapType cty.Type, objType cty.Type, unsafe bool) conversion { + objectAtys := objType.AttributeTypes() + mapEty := mapType.ElementType() + + elemConvs := make(map[string]conversion, len(objectAtys)) + for name, objectAty := range objectAtys { + if objectAty.Equals(mapEty) { + // no conversion required + continue + } + + elemConvs[name] = getConversion(mapEty, objectAty, unsafe) + if elemConvs[name] == nil { + // If any of our element conversions are impossible, then the our + // whole conversion is impossible. + return nil + } + } + + // If we fall out here then a conversion is possible, using the + // element conversions in elemConvs + return func(val cty.Value, path cty.Path) (cty.Value, error) { + elems := make(map[string]cty.Value, len(elemConvs)) + elemPath := append(path.Copy(), nil) + it := val.ElementIterator() + for it.Next() { + name, val := it.Element() + + // if there is no corresponding attribute, we skip this key + if _, ok := objectAtys[name.AsString()]; !ok { + continue + } + + var err error + + elemPath[len(elemPath)-1] = cty.IndexStep{ + Key: name, + } + + conv := elemConvs[name.AsString()] + if conv != nil { + val, err = conv(val, elemPath) + if err != nil { + return cty.NilVal, err + } + } + + elems[name.AsString()] = val + } + + for name, aty := range objectAtys { + if _, exists := elems[name]; !exists { + if optional := objType.AttributeOptional(name); optional { + elems[name] = cty.NullVal(aty) + } else { + return cty.NilVal, path.NewErrorf("map has no element for required attribute %q", name) + } + } + } + + return cty.ObjectVal(elems), nil + } +} + +func conversionUnifyCollectionElements(elems map[string]cty.Value, path cty.Path, unsafe bool) (map[string]cty.Value, error) { + elemTypes := make([]cty.Type, 0, len(elems)) + for _, elem := range elems { + elemTypes = append(elemTypes, elem.Type()) + } + unifiedType, _ := unify(elemTypes, unsafe) + if unifiedType == cty.NilType { + return nil, path.NewErrorf("collection elements cannot be unified") + } + + unifiedElems := make(map[string]cty.Value) + elemPath := append(path.Copy(), nil) + + for name, elem := range elems { + if elem.Type().Equals(unifiedType) { + unifiedElems[name] = elem + continue + } + conv := getConversion(elem.Type(), unifiedType, unsafe) + if conv == nil { + } + elemPath[len(elemPath)-1] = cty.IndexStep{ + Key: cty.StringVal(name), + } + val, err := conv(elem, elemPath) + if err != nil { + return nil, err + } + unifiedElems[name] = val + } + + return unifiedElems, nil +} + +func conversionCheckMapElementTypes(elems map[string]cty.Value, path cty.Path) error { + elementType := cty.NilType + elemPath := append(path.Copy(), nil) + + for name, elem := range elems { + if elementType == cty.NilType { + elementType = elem.Type() + continue + } + if !elementType.Equals(elem.Type()) { + elemPath[len(elemPath)-1] = cty.IndexStep{ + Key: cty.StringVal(name), + } + return elemPath.NewErrorf("%s is required", elementType.FriendlyName()) + } + } + + return nil +} + +func conversionUnifyListElements(elems []cty.Value, path cty.Path, unsafe bool) ([]cty.Value, error) { + elemTypes := make([]cty.Type, len(elems)) + for i, elem := range elems { + elemTypes[i] = elem.Type() + } + unifiedType, _ := unify(elemTypes, unsafe) + if unifiedType == cty.NilType { + return nil, path.NewErrorf("collection elements cannot be unified") + } + + ret := make([]cty.Value, len(elems)) + elemPath := append(path.Copy(), nil) + + for i, elem := range elems { + if elem.Type().Equals(unifiedType) { + ret[i] = elem + continue + } + conv := getConversion(elem.Type(), unifiedType, unsafe) + if conv == nil { + } + elemPath[len(elemPath)-1] = cty.IndexStep{ + Key: cty.NumberIntVal(int64(i)), + } + val, err := conv(elem, elemPath) + if err != nil { + return nil, err + } + ret[i] = val + } + + return ret, nil +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_object.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_object.go index 62dabb8d1bb..098c109bdba 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_object.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/conversion_object.go @@ -11,17 +11,29 @@ import ( // type, meaning that each attribute of the output type has a corresponding // attribute in the input type where a recursive conversion is available. // +// If the "out" type has any optional attributes, those attributes may be +// absent in the "in" type, in which case null values will be used in their +// place in the result. +// // Shallow object conversions work the same for both safe and unsafe modes, // but the safety flag is passed on to recursive conversions and may thus // limit the above definition of "subset". func conversionObjectToObject(in, out cty.Type, unsafe bool) conversion { inAtys := in.AttributeTypes() outAtys := out.AttributeTypes() + outOptionals := out.OptionalAttributes() attrConvs := make(map[string]conversion) for name, outAty := range outAtys { inAty, exists := inAtys[name] if !exists { + if _, optional := outOptionals[name]; optional { + // If it's optional then we'll skip inserting an + // attribute conversion and then deal with inserting + // the default value in our overall conversion logic + // later. + continue + } // No conversion is available, then. return nil } @@ -71,6 +83,13 @@ func conversionObjectToObject(in, out cty.Type, unsafe bool) conversion { attrVals[name] = val } + for name := range outOptionals { + if _, exists := attrVals[name]; !exists { + wantTy := outAtys[name] + attrVals[name] = cty.NullVal(wantTy) + } + } + return cty.ObjectVal(attrVals), nil } } diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/mismatch_msg.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/mismatch_msg.go index 581304ecd5b..5c1e114d9f5 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/mismatch_msg.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/mismatch_msg.go @@ -78,10 +78,16 @@ func mismatchMessageObjects(got, want cty.Type) string { for name, wantAty := range wantAtys { gotAty, exists := gotAtys[name] if !exists { - missingAttrs = append(missingAttrs, name) + if !want.AttributeOptional(name) { + missingAttrs = append(missingAttrs, name) + } continue } + if gotAty.Equals(wantAty) { + continue // exact match, so no problem + } + // We'll now try to convert these attributes in isolation and // see if we have a nested conversion error to report. // We'll try an unsafe conversion first, and then fall back on diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/unify.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/unify.go index 53ebbfe08a1..ee171d1ed4b 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/unify.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/convert/unify.go @@ -28,11 +28,14 @@ func unify(types []cty.Type, unsafe bool) (cty.Type, []Conversion) { // a subset of that type, which would be a much less useful conversion for // unification purposes. { + mapCt := 0 objectCt := 0 tupleCt := 0 dynamicCt := 0 for _, ty := range types { switch { + case ty.IsMapType(): + mapCt++ case ty.IsObjectType(): objectCt++ case ty.IsTupleType(): @@ -44,6 +47,8 @@ func unify(types []cty.Type, unsafe bool) (cty.Type, []Conversion) { } } switch { + case mapCt > 0 && (mapCt+dynamicCt) == len(types): + return unifyMapTypes(types, unsafe, dynamicCt > 0) case objectCt > 0 && (objectCt+dynamicCt) == len(types): return unifyObjectTypes(types, unsafe, dynamicCt > 0) case tupleCt > 0 && (tupleCt+dynamicCt) == len(types): @@ -95,6 +100,44 @@ Preferences: return cty.NilType, nil } +func unifyMapTypes(types []cty.Type, unsafe bool, hasDynamic bool) (cty.Type, []Conversion) { + // If we had any dynamic types in the input here then we can't predict + // what path we'll take through here once these become known types, so + // we'll conservatively produce DynamicVal for these. + if hasDynamic { + return unifyAllAsDynamic(types) + } + + elemTypes := make([]cty.Type, 0, len(types)) + for _, ty := range types { + elemTypes = append(elemTypes, ty.ElementType()) + } + retElemType, _ := unify(elemTypes, unsafe) + if retElemType == cty.NilType { + return cty.NilType, nil + } + + retTy := cty.Map(retElemType) + + conversions := make([]Conversion, len(types)) + for i, ty := range types { + if ty.Equals(retTy) { + continue + } + if unsafe { + conversions[i] = GetConversionUnsafe(ty, retTy) + } else { + conversions[i] = GetConversion(ty, retTy) + } + if conversions[i] == nil { + // Shouldn't be reachable, since we were able to unify + return cty.NilType, nil + } + } + + return retTy, conversions +} + func unifyObjectTypes(types []cty.Type, unsafe bool, hasDynamic bool) (cty.Type, []Conversion) { // If we had any dynamic types in the input here then we can't predict // what path we'll take through here once these become known types, so diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/function.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/function.go index efd882725fd..efc83ad7699 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/function.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/function.go @@ -244,19 +244,21 @@ func (f Function) Call(args []cty.Value) (val cty.Value, err error) { return cty.UnknownVal(expectedType), nil } - if val.IsMarked() && !spec.AllowMarked { - unwrappedVal, marks := val.Unmark() - // In order to avoid additional overhead on applications that - // are not using marked values, we copy the given args only - // if we encounter a marked value we need to unmark. However, - // as a consequence we end up doing redundant copying if multiple - // marked values need to be unwrapped. That seems okay because - // argument lists are generally small. - newArgs := make([]cty.Value, len(args)) - copy(newArgs, args) - newArgs[i] = unwrappedVal - resultMarks = append(resultMarks, marks) - args = newArgs + if !spec.AllowMarked { + unwrappedVal, marks := val.UnmarkDeep() + if len(marks) > 0 { + // In order to avoid additional overhead on applications that + // are not using marked values, we copy the given args only + // if we encounter a marked value we need to unmark. However, + // as a consequence we end up doing redundant copying if multiple + // marked values need to be unwrapped. That seems okay because + // argument lists are generally small. + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[i] = unwrappedVal + resultMarks = append(resultMarks, marks) + args = newArgs + } } } @@ -266,13 +268,15 @@ func (f Function) Call(args []cty.Value) (val cty.Value, err error) { if !val.IsKnown() && !spec.AllowUnknown { return cty.UnknownVal(expectedType), nil } - if val.IsMarked() && !spec.AllowMarked { - unwrappedVal, marks := val.Unmark() - newArgs := make([]cty.Value, len(args)) - copy(newArgs, args) - newArgs[len(posArgs)+i] = unwrappedVal - resultMarks = append(resultMarks, marks) - args = newArgs + if !spec.AllowMarked { + unwrappedVal, marks := val.UnmarkDeep() + if len(marks) > 0 { + newArgs := make([]cty.Value, len(args)) + copy(newArgs, args) + newArgs[len(posArgs)+i] = unwrappedVal + resultMarks = append(resultMarks, marks) + args = newArgs + } } } } diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go index 967ba03c8b2..230b03af5fa 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/collection.go @@ -1,9 +1,12 @@ package stdlib import ( + "errors" "fmt" + "sort" "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" ) @@ -122,6 +125,1114 @@ var LengthFunc = function.New(&function.Spec{ }, }) +var ElementFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.DynamicPseudoType, + }, + { + Name: "index", + Type: cty.Number, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + list := args[0] + index := args[1] + if index.IsKnown() { + if index.LessThan(cty.NumberIntVal(0)).True() { + return cty.DynamicPseudoType, fmt.Errorf("cannot use element function with a negative index") + } + } + + listTy := list.Type() + switch { + case listTy.IsListType(): + return listTy.ElementType(), nil + case listTy.IsTupleType(): + if !args[1].IsKnown() { + // If the index isn't known yet then we can't predict the + // result type since each tuple element can have its own type. + return cty.DynamicPseudoType, nil + } + + etys := listTy.TupleElementTypes() + var index int + err := gocty.FromCtyValue(args[1], &index) + if err != nil { + // e.g. fractional number where whole number is required + return cty.DynamicPseudoType, fmt.Errorf("invalid index: %s", err) + } + if len(etys) == 0 { + return cty.DynamicPseudoType, errors.New("cannot use element function with an empty list") + } + index = index % len(etys) + return etys[index], nil + default: + return cty.DynamicPseudoType, fmt.Errorf("cannot read elements from %s", listTy.FriendlyName()) + } + }, + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + var index int + err := gocty.FromCtyValue(args[1], &index) + if err != nil { + // can't happen because we checked this in the Type function above + return cty.DynamicVal, fmt.Errorf("invalid index: %s", err) + } + + if args[1].LessThan(cty.NumberIntVal(0)).True() { + return cty.DynamicVal, fmt.Errorf("cannot use element function with a negative index") + } + + if !args[0].IsKnown() { + return cty.UnknownVal(retType), nil + } + + l := args[0].LengthInt() + if l == 0 { + return cty.DynamicVal, errors.New("cannot use element function with an empty list") + } + index = index % l + + // We did all the necessary type checks in the type function above, + // so this is guaranteed not to fail. + return args[0].Index(cty.NumberIntVal(int64(index))), nil + }, +}) + +// CoalesceListFunc is a function that takes any number of list arguments +// and returns the first one that isn't empty. +var CoalesceListFunc = function.New(&function.Spec{ + Params: []function.Parameter{}, + VarParam: &function.Parameter{ + Name: "vals", + Type: cty.DynamicPseudoType, + AllowUnknown: true, + AllowDynamicType: true, + AllowNull: true, + }, + Type: func(args []cty.Value) (ret cty.Type, err error) { + if len(args) == 0 { + return cty.NilType, errors.New("at least one argument is required") + } + + argTypes := make([]cty.Type, len(args)) + + for i, arg := range args { + // if any argument is unknown, we can't be certain know which type we will return + if !arg.IsKnown() { + return cty.DynamicPseudoType, nil + } + ty := arg.Type() + + if !ty.IsListType() && !ty.IsTupleType() { + return cty.NilType, errors.New("coalescelist arguments must be lists or tuples") + } + + argTypes[i] = arg.Type() + } + + last := argTypes[0] + // If there are mixed types, we have to return a dynamic type. + for _, next := range argTypes[1:] { + if !next.Equals(last) { + return cty.DynamicPseudoType, nil + } + } + + return last, nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + for _, arg := range args { + if !arg.IsKnown() { + // If we run into an unknown list at some point, we can't + // predict the final result yet. (If there's a known, non-empty + // arg before this then we won't get here.) + return cty.UnknownVal(retType), nil + } + + if arg.IsNull() { + continue + } + + if arg.LengthInt() > 0 { + return arg, nil + } + } + + return cty.NilVal, errors.New("no non-null arguments") + }, +}) + +// CompactFunc is a function that takes a list of strings and returns a new list +// with any empty string elements removed. +var CompactFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.List(cty.String), + }, + }, + Type: function.StaticReturnType(cty.List(cty.String)), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + listVal := args[0] + if !listVal.IsWhollyKnown() { + // If some of the element values aren't known yet then we + // can't yet return a compacted list + return cty.UnknownVal(retType), nil + } + + var outputList []cty.Value + + for it := listVal.ElementIterator(); it.Next(); { + _, v := it.Element() + if v.IsNull() || v.AsString() == "" { + continue + } + outputList = append(outputList, v) + } + + if len(outputList) == 0 { + return cty.ListValEmpty(cty.String), nil + } + + return cty.ListVal(outputList), nil + }, +}) + +// ContainsFunc is a function that determines whether a given list or +// set contains a given single value as one of its elements. +var ContainsFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.DynamicPseudoType, + }, + { + Name: "value", + Type: cty.DynamicPseudoType, + }, + }, + Type: function.StaticReturnType(cty.Bool), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + arg := args[0] + ty := arg.Type() + + if !ty.IsListType() && !ty.IsTupleType() && !ty.IsSetType() { + return cty.NilVal, errors.New("argument must be list, tuple, or set") + } + + if args[0].IsNull() { + return cty.NilVal, errors.New("cannot search a nil list or set") + } + + if args[0].LengthInt() == 0 { + return cty.False, nil + } + + if !args[0].IsKnown() || !args[1].IsKnown() { + return cty.UnknownVal(cty.Bool), nil + } + + containsUnknown := false + for it := args[0].ElementIterator(); it.Next(); { + _, v := it.Element() + eq := args[1].Equals(v) + if !eq.IsKnown() { + // We may have an unknown value which could match later, but we + // first need to continue checking all values for an exact + // match. + containsUnknown = true + continue + } + if eq.True() { + return cty.True, nil + } + } + + if containsUnknown { + return cty.UnknownVal(cty.Bool), nil + } + + return cty.False, nil + }, +}) + +// DistinctFunc is a function that takes a list and returns a new list +// with any duplicate elements removed. +var DistinctFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.List(cty.DynamicPseudoType), + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + return args[0].Type(), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + listVal := args[0] + + if !listVal.IsWhollyKnown() { + return cty.UnknownVal(retType), nil + } + var list []cty.Value + + for it := listVal.ElementIterator(); it.Next(); { + _, v := it.Element() + list, err = appendIfMissing(list, v) + if err != nil { + return cty.NilVal, err + } + } + + if len(list) == 0 { + return cty.ListValEmpty(retType.ElementType()), nil + } + return cty.ListVal(list), nil + }, +}) + +// ChunklistFunc is a function that splits a single list into fixed-size chunks, +// returning a list of lists. +var ChunklistFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.List(cty.DynamicPseudoType), + }, + { + Name: "size", + Type: cty.Number, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + return cty.List(args[0].Type()), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + listVal := args[0] + if !listVal.IsKnown() { + return cty.UnknownVal(retType), nil + } + + if listVal.LengthInt() == 0 { + return cty.ListValEmpty(listVal.Type()), nil + } + + var size int + err = gocty.FromCtyValue(args[1], &size) + if err != nil { + return cty.NilVal, fmt.Errorf("invalid index: %s", err) + } + + if size < 0 { + return cty.NilVal, errors.New("the size argument must be positive") + } + + output := make([]cty.Value, 0) + + // if size is 0, returns a list made of the initial list + if size == 0 { + output = append(output, listVal) + return cty.ListVal(output), nil + } + + chunk := make([]cty.Value, 0) + + l := args[0].LengthInt() + i := 0 + + for it := listVal.ElementIterator(); it.Next(); { + _, v := it.Element() + chunk = append(chunk, v) + + // Chunk when index isn't 0, or when reaching the values's length + if (i+1)%size == 0 || (i+1) == l { + output = append(output, cty.ListVal(chunk)) + chunk = make([]cty.Value, 0) + } + i++ + } + + return cty.ListVal(output), nil + }, +}) + +// FlattenFunc is a function that takes a list and replaces any elements +// that are lists with a flattened sequence of the list contents. +var FlattenFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.DynamicPseudoType, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + if !args[0].IsWhollyKnown() { + return cty.DynamicPseudoType, nil + } + + argTy := args[0].Type() + if !argTy.IsListType() && !argTy.IsSetType() && !argTy.IsTupleType() { + return cty.NilType, errors.New("can only flatten lists, sets and tuples") + } + + retVal, known := flattener(args[0]) + if !known { + return cty.DynamicPseudoType, nil + } + + tys := make([]cty.Type, len(retVal)) + for i, ty := range retVal { + tys[i] = ty.Type() + } + return cty.Tuple(tys), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + inputList := args[0] + if inputList.LengthInt() == 0 { + return cty.EmptyTupleVal, nil + } + + out, known := flattener(inputList) + if !known { + return cty.UnknownVal(retType), nil + } + + return cty.TupleVal(out), nil + }, +}) + +// Flatten until it's not a cty.List, and return whether the value is known. +// We can flatten lists with unknown values, as long as they are not +// lists themselves. +func flattener(flattenList cty.Value) ([]cty.Value, bool) { + if !flattenList.Length().IsKnown() { + // If we don't know the length of what we're flattening then we can't + // predict the length of our result yet either. + return nil, false + } + out := make([]cty.Value, 0) + for it := flattenList.ElementIterator(); it.Next(); { + _, val := it.Element() + if val.Type().IsListType() || val.Type().IsSetType() || val.Type().IsTupleType() { + if !val.IsKnown() { + return out, false + } + + res, known := flattener(val) + if !known { + return res, known + } + out = append(out, res...) + } else { + out = append(out, val) + } + } + return out, true +} + +// KeysFunc is a function that takes a map and returns a sorted list of the map keys. +var KeysFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "inputMap", + Type: cty.DynamicPseudoType, + AllowUnknown: true, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + ty := args[0].Type() + switch { + case ty.IsMapType(): + return cty.List(cty.String), nil + case ty.IsObjectType(): + atys := ty.AttributeTypes() + if len(atys) == 0 { + return cty.EmptyTuple, nil + } + // All of our result elements will be strings, and atys just + // decides how many there are. + etys := make([]cty.Type, len(atys)) + for i := range etys { + etys[i] = cty.String + } + return cty.Tuple(etys), nil + default: + return cty.DynamicPseudoType, function.NewArgErrorf(0, "must have map or object type") + } + }, + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + m := args[0] + var keys []cty.Value + + switch { + case m.Type().IsObjectType(): + // In this case we allow unknown values so we must work only with + // the attribute _types_, not with the value itself. + var names []string + for name := range m.Type().AttributeTypes() { + names = append(names, name) + } + sort.Strings(names) // same ordering guaranteed by cty's ElementIterator + if len(names) == 0 { + return cty.EmptyTupleVal, nil + } + keys = make([]cty.Value, len(names)) + for i, name := range names { + keys[i] = cty.StringVal(name) + } + return cty.TupleVal(keys), nil + default: + if !m.IsKnown() { + return cty.UnknownVal(retType), nil + } + + // cty guarantees that ElementIterator will iterate in lexicographical + // order by key. + for it := args[0].ElementIterator(); it.Next(); { + k, _ := it.Element() + keys = append(keys, k) + } + if len(keys) == 0 { + return cty.ListValEmpty(cty.String), nil + } + return cty.ListVal(keys), nil + } + }, +}) + +// LookupFunc is a function that performs dynamic lookups of map types. +var LookupFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "inputMap", + Type: cty.DynamicPseudoType, + }, + { + Name: "key", + Type: cty.String, + }, + { + Name: "default", + Type: cty.DynamicPseudoType, + }, + }, + Type: func(args []cty.Value) (ret cty.Type, err error) { + ty := args[0].Type() + + switch { + case ty.IsObjectType(): + if !args[1].IsKnown() { + return cty.DynamicPseudoType, nil + } + + key := args[1].AsString() + if ty.HasAttribute(key) { + return args[0].GetAttr(key).Type(), nil + } else if len(args) == 3 { + // if the key isn't found but a default is provided, + // return the default type + return args[2].Type(), nil + } + return cty.DynamicPseudoType, function.NewArgErrorf(0, "the given object has no attribute %q", key) + case ty.IsMapType(): + if len(args) == 3 { + _, err = convert.Convert(args[2], ty.ElementType()) + if err != nil { + return cty.NilType, function.NewArgErrorf(2, "the default value must have the same type as the map elements") + } + } + return ty.ElementType(), nil + default: + return cty.NilType, function.NewArgErrorf(0, "lookup() requires a map as the first argument") + } + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + defaultVal := args[2] + + mapVar := args[0] + lookupKey := args[1].AsString() + + if !mapVar.IsWhollyKnown() { + return cty.UnknownVal(retType), nil + } + + if mapVar.Type().IsObjectType() { + if mapVar.Type().HasAttribute(lookupKey) { + return mapVar.GetAttr(lookupKey), nil + } + } else if mapVar.HasIndex(cty.StringVal(lookupKey)) == cty.True { + return mapVar.Index(cty.StringVal(lookupKey)), nil + } + + defaultVal, err = convert.Convert(defaultVal, retType) + if err != nil { + return cty.NilVal, err + } + return defaultVal, nil + }, +}) + +// MergeFunc constructs a function that takes an arbitrary number of maps or +// objects, and returns a single value that contains a merged set of keys and +// values from all of the inputs. +// +// If more than one given map or object defines the same key then the one that +// is later in the argument sequence takes precedence. +var MergeFunc = function.New(&function.Spec{ + Params: []function.Parameter{}, + VarParam: &function.Parameter{ + Name: "maps", + Type: cty.DynamicPseudoType, + AllowDynamicType: true, + AllowNull: true, + }, + Type: func(args []cty.Value) (cty.Type, error) { + // empty args is accepted, so assume an empty object since we have no + // key-value types. + if len(args) == 0 { + return cty.EmptyObject, nil + } + + // collect the possible object attrs + attrs := map[string]cty.Type{} + + first := cty.NilType + matching := true + attrsKnown := true + for i, arg := range args { + ty := arg.Type() + // any dynamic args mean we can't compute a type + if ty.Equals(cty.DynamicPseudoType) { + return cty.DynamicPseudoType, nil + } + + // check for invalid arguments + if !ty.IsMapType() && !ty.IsObjectType() { + return cty.NilType, fmt.Errorf("arguments must be maps or objects, got %#v", ty.FriendlyName()) + } + + switch { + case ty.IsObjectType() && !arg.IsNull(): + for attr, aty := range ty.AttributeTypes() { + attrs[attr] = aty + } + case ty.IsMapType(): + switch { + case arg.IsNull(): + // pass, nothing to add + case arg.IsKnown(): + ety := arg.Type().ElementType() + for it := arg.ElementIterator(); it.Next(); { + attr, _ := it.Element() + attrs[attr.AsString()] = ety + } + default: + // any unknown maps means we don't know all possible attrs + // for the return type + attrsKnown = false + } + } + + // record the first argument type for comparison + if i == 0 { + first = arg.Type() + continue + } + + if !ty.Equals(first) && matching { + matching = false + } + } + + // the types all match, so use the first argument type + if matching { + return first, nil + } + + // We had a mix of unknown maps and objects, so we can't predict the + // attributes + if !attrsKnown { + return cty.DynamicPseudoType, nil + } + + return cty.Object(attrs), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + outputMap := make(map[string]cty.Value) + + for _, arg := range args { + if arg.IsNull() { + continue + } + for it := arg.ElementIterator(); it.Next(); { + k, v := it.Element() + outputMap[k.AsString()] = v + } + } + + switch { + case retType.IsMapType(): + if len(outputMap) == 0 { + return cty.MapValEmpty(retType.ElementType()), nil + } + return cty.MapVal(outputMap), nil + case retType.IsObjectType(), retType.Equals(cty.DynamicPseudoType): + return cty.ObjectVal(outputMap), nil + default: + panic(fmt.Sprintf("unexpected return type: %#v", retType)) + } + }, +}) + +// ReverseListFunc takes a sequence and produces a new sequence of the same length +// with all of the same elements as the given sequence but in reverse order. +var ReverseListFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.DynamicPseudoType, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + argTy := args[0].Type() + switch { + case argTy.IsTupleType(): + argTys := argTy.TupleElementTypes() + retTys := make([]cty.Type, len(argTys)) + for i, ty := range argTys { + retTys[len(retTys)-i-1] = ty + } + return cty.Tuple(retTys), nil + case argTy.IsListType(), argTy.IsSetType(): // We accept sets here to mimic the usual behavior of auto-converting to list + return cty.List(argTy.ElementType()), nil + default: + return cty.NilType, function.NewArgErrorf(0, "can only reverse list or tuple values, not %s", argTy.FriendlyName()) + } + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + in := args[0].AsValueSlice() + outVals := make([]cty.Value, len(in)) + for i, v := range in { + outVals[len(outVals)-i-1] = v + } + switch { + case retType.IsTupleType(): + return cty.TupleVal(outVals), nil + default: + if len(outVals) == 0 { + return cty.ListValEmpty(retType.ElementType()), nil + } + return cty.ListVal(outVals), nil + } + }, +}) + +// SetProductFunc calculates the Cartesian product of two or more sets or +// sequences. If the arguments are all lists then the result is a list of tuples, +// preserving the ordering of all of the input lists. Otherwise the result is a +// set of tuples. +var SetProductFunc = function.New(&function.Spec{ + Params: []function.Parameter{}, + VarParam: &function.Parameter{ + Name: "sets", + Type: cty.DynamicPseudoType, + }, + Type: func(args []cty.Value) (retType cty.Type, err error) { + if len(args) < 2 { + return cty.NilType, errors.New("at least two arguments are required") + } + + listCount := 0 + elemTys := make([]cty.Type, len(args)) + for i, arg := range args { + aty := arg.Type() + switch { + case aty.IsSetType(): + elemTys[i] = aty.ElementType() + case aty.IsListType(): + elemTys[i] = aty.ElementType() + listCount++ + case aty.IsTupleType(): + // We can accept a tuple type only if there's some common type + // that all of its elements can be converted to. + allEtys := aty.TupleElementTypes() + if len(allEtys) == 0 { + elemTys[i] = cty.DynamicPseudoType + listCount++ + break + } + ety, _ := convert.UnifyUnsafe(allEtys) + if ety == cty.NilType { + return cty.NilType, function.NewArgErrorf(i, "all elements must be of the same type") + } + elemTys[i] = ety + listCount++ + default: + return cty.NilType, function.NewArgErrorf(i, "a set or a list is required") + } + } + + if listCount == len(args) { + return cty.List(cty.Tuple(elemTys)), nil + } + return cty.Set(cty.Tuple(elemTys)), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + ety := retType.ElementType() + + total := 1 + for _, arg := range args { + if !arg.Length().IsKnown() { + return cty.UnknownVal(retType), nil + } + + // Because of our type checking function, we are guaranteed that + // all of the arguments are known, non-null values of types that + // support LengthInt. + total *= arg.LengthInt() + } + + if total == 0 { + // If any of the arguments was an empty collection then our result + // is also an empty collection, which we'll short-circuit here. + if retType.IsListType() { + return cty.ListValEmpty(ety), nil + } + return cty.SetValEmpty(ety), nil + } + + subEtys := ety.TupleElementTypes() + product := make([][]cty.Value, total) + + b := make([]cty.Value, total*len(args)) + n := make([]int, len(args)) + s := 0 + argVals := make([][]cty.Value, len(args)) + for i, arg := range args { + argVals[i] = arg.AsValueSlice() + } + + for i := range product { + e := s + len(args) + pi := b[s:e] + product[i] = pi + s = e + + for j, n := range n { + val := argVals[j][n] + ty := subEtys[j] + if !val.Type().Equals(ty) { + var err error + val, err = convert.Convert(val, ty) + if err != nil { + // Should never happen since we checked this in our + // type-checking function. + return cty.NilVal, fmt.Errorf("failed to convert argVals[%d][%d] to %s; this is a bug in cty", j, n, ty.FriendlyName()) + } + } + pi[j] = val + } + + for j := len(n) - 1; j >= 0; j-- { + n[j]++ + if n[j] < len(argVals[j]) { + break + } + n[j] = 0 + } + } + + productVals := make([]cty.Value, total) + for i, vals := range product { + productVals[i] = cty.TupleVal(vals) + } + + if retType.IsListType() { + return cty.ListVal(productVals), nil + } + return cty.SetVal(productVals), nil + }, +}) + +// SliceFunc is a function that extracts some consecutive elements +// from within a list. +var SliceFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.DynamicPseudoType, + }, + { + Name: "start_index", + Type: cty.Number, + }, + { + Name: "end_index", + Type: cty.Number, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + arg := args[0] + argTy := arg.Type() + + if argTy.IsSetType() { + return cty.NilType, function.NewArgErrorf(0, "cannot slice a set, because its elements do not have indices; explicitly convert to a list if the ordering of the result is not important") + } + if !argTy.IsListType() && !argTy.IsTupleType() { + return cty.NilType, function.NewArgErrorf(0, "must be a list or tuple value") + } + + startIndex, endIndex, idxsKnown, err := sliceIndexes(args) + if err != nil { + return cty.NilType, err + } + + if argTy.IsListType() { + return argTy, nil + } + + if !idxsKnown { + // If we don't know our start/end indices then we can't predict + // the result type if we're planning to return a tuple. + return cty.DynamicPseudoType, nil + } + return cty.Tuple(argTy.TupleElementTypes()[startIndex:endIndex]), nil + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + inputList := args[0] + + if retType == cty.DynamicPseudoType { + return cty.DynamicVal, nil + } + + // we ignore idxsKnown return value here because the indices are always + // known here, or else the call would've short-circuited. + startIndex, endIndex, _, err := sliceIndexes(args) + if err != nil { + return cty.NilVal, err + } + + if endIndex-startIndex == 0 { + if retType.IsTupleType() { + return cty.EmptyTupleVal, nil + } + return cty.ListValEmpty(retType.ElementType()), nil + } + + outputList := inputList.AsValueSlice()[startIndex:endIndex] + + if retType.IsTupleType() { + return cty.TupleVal(outputList), nil + } + + return cty.ListVal(outputList), nil + }, +}) + +func sliceIndexes(args []cty.Value) (int, int, bool, error) { + var startIndex, endIndex, length int + var startKnown, endKnown, lengthKnown bool + + // If it's a tuple then we always know the length by the type, but collections might be unknown or have unknown length + if args[0].Type().IsTupleType() || args[0].Length().IsKnown() { + length = args[0].LengthInt() + lengthKnown = true + } + + if args[1].IsKnown() { + if err := gocty.FromCtyValue(args[1], &startIndex); err != nil { + return 0, 0, false, function.NewArgErrorf(1, "invalid start index: %s", err) + } + if startIndex < 0 { + return 0, 0, false, function.NewArgErrorf(1, "start index must not be less than zero") + } + if lengthKnown && startIndex > length { + return 0, 0, false, function.NewArgErrorf(1, "start index must not be greater than the length of the list") + } + startKnown = true + } + if args[2].IsKnown() { + if err := gocty.FromCtyValue(args[2], &endIndex); err != nil { + return 0, 0, false, function.NewArgErrorf(2, "invalid end index: %s", err) + } + if endIndex < 0 { + return 0, 0, false, function.NewArgErrorf(2, "end index must not be less than zero") + } + if lengthKnown && endIndex > length { + return 0, 0, false, function.NewArgErrorf(2, "end index must not be greater than the length of the list") + } + endKnown = true + } + if startKnown && endKnown { + if startIndex > endIndex { + return 0, 0, false, function.NewArgErrorf(1, "start index must not be greater than end index") + } + } + return startIndex, endIndex, startKnown && endKnown, nil +} + +// ValuesFunc is a function that returns a list of the map values, +// in the order of the sorted keys. +var ValuesFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "values", + Type: cty.DynamicPseudoType, + }, + }, + Type: func(args []cty.Value) (ret cty.Type, err error) { + ty := args[0].Type() + if ty.IsMapType() { + return cty.List(ty.ElementType()), nil + } else if ty.IsObjectType() { + // The result is a tuple type with all of the same types as our + // object type's attributes, sorted in lexicographical order by the + // keys. (This matches the sort order guaranteed by ElementIterator + // on a cty object value.) + atys := ty.AttributeTypes() + if len(atys) == 0 { + return cty.EmptyTuple, nil + } + attrNames := make([]string, 0, len(atys)) + for name := range atys { + attrNames = append(attrNames, name) + } + sort.Strings(attrNames) + + tys := make([]cty.Type, len(attrNames)) + for i, name := range attrNames { + tys[i] = atys[name] + } + return cty.Tuple(tys), nil + } + return cty.NilType, errors.New("values() requires a map as the first argument") + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + mapVar := args[0] + + // We can just iterate the map/object value here because cty guarantees + // that these types always iterate in key lexicographical order. + var values []cty.Value + for it := mapVar.ElementIterator(); it.Next(); { + _, val := it.Element() + values = append(values, val) + } + + if retType.IsTupleType() { + return cty.TupleVal(values), nil + } + if len(values) == 0 { + return cty.ListValEmpty(retType.ElementType()), nil + } + return cty.ListVal(values), nil + }, +}) + +// ZipmapFunc is a function that constructs a map from a list of keys +// and a corresponding list of values. +var ZipmapFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "keys", + Type: cty.List(cty.String), + }, + { + Name: "values", + Type: cty.DynamicPseudoType, + }, + }, + Type: func(args []cty.Value) (ret cty.Type, err error) { + keys := args[0] + values := args[1] + valuesTy := values.Type() + + switch { + case valuesTy.IsListType(): + return cty.Map(values.Type().ElementType()), nil + case valuesTy.IsTupleType(): + if !keys.IsWhollyKnown() { + // Since zipmap with a tuple produces an object, we need to know + // all of the key names before we can predict our result type. + return cty.DynamicPseudoType, nil + } + + keysRaw := keys.AsValueSlice() + valueTypesRaw := valuesTy.TupleElementTypes() + if len(keysRaw) != len(valueTypesRaw) { + return cty.NilType, fmt.Errorf("number of keys (%d) does not match number of values (%d)", len(keysRaw), len(valueTypesRaw)) + } + atys := make(map[string]cty.Type, len(valueTypesRaw)) + for i, keyVal := range keysRaw { + if keyVal.IsNull() { + return cty.NilType, fmt.Errorf("keys list has null value at index %d", i) + } + key := keyVal.AsString() + atys[key] = valueTypesRaw[i] + } + return cty.Object(atys), nil + + default: + return cty.NilType, errors.New("values argument must be a list or tuple value") + } + }, + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + keys := args[0] + values := args[1] + + if !keys.IsWhollyKnown() { + // Unknown map keys and object attributes are not supported, so + // our entire result must be unknown in this case. + return cty.UnknownVal(retType), nil + } + + // both keys and values are guaranteed to be shallowly-known here, + // because our declared params above don't allow unknown or null values. + if keys.LengthInt() != values.LengthInt() { + return cty.NilVal, fmt.Errorf("number of keys (%d) does not match number of values (%d)", keys.LengthInt(), values.LengthInt()) + } + + output := make(map[string]cty.Value) + + i := 0 + for it := keys.ElementIterator(); it.Next(); { + _, v := it.Element() + val := values.Index(cty.NumberIntVal(int64(i))) + output[v.AsString()] = val + i++ + } + + switch { + case retType.IsMapType(): + if len(output) == 0 { + return cty.MapValEmpty(retType.ElementType()), nil + } + return cty.MapVal(output), nil + case retType.IsObjectType(): + return cty.ObjectVal(output), nil + default: + // Should never happen because the type-check function should've + // caught any other case. + return cty.NilVal, fmt.Errorf("internally selected incorrect result type %s (this is a bug)", retType.FriendlyName()) + } + }, +}) + +// helper function to add an element to a list, if it does not already exist +func appendIfMissing(slice []cty.Value, element cty.Value) ([]cty.Value, error) { + for _, ele := range slice { + eq, err := Equal(ele, element) + if err != nil { + return slice, err + } + if eq.True() { + return slice, nil + } + } + return append(slice, element), nil +} + // HasIndex determines whether the given collection can be indexed with the // given key. func HasIndex(collection cty.Value, key cty.Value) (cty.Value, error) { @@ -138,3 +1249,91 @@ func Index(collection cty.Value, key cty.Value) (cty.Value, error) { func Length(collection cty.Value) (cty.Value, error) { return LengthFunc.Call([]cty.Value{collection}) } + +// Element returns a single element from a given list at the given index. If +// index is greater than the length of the list then it is wrapped modulo +// the list length. +func Element(list, index cty.Value) (cty.Value, error) { + return ElementFunc.Call([]cty.Value{list, index}) +} + +// CoalesceList takes any number of list arguments and returns the first one that isn't empty. +func CoalesceList(args ...cty.Value) (cty.Value, error) { + return CoalesceListFunc.Call(args) +} + +// Compact takes a list of strings and returns a new list +// with any empty string elements removed. +func Compact(list cty.Value) (cty.Value, error) { + return CompactFunc.Call([]cty.Value{list}) +} + +// Contains determines whether a given list contains a given single value +// as one of its elements. +func Contains(list, value cty.Value) (cty.Value, error) { + return ContainsFunc.Call([]cty.Value{list, value}) +} + +// Distinct takes a list and returns a new list with any duplicate elements removed. +func Distinct(list cty.Value) (cty.Value, error) { + return DistinctFunc.Call([]cty.Value{list}) +} + +// Chunklist splits a single list into fixed-size chunks, returning a list of lists. +func Chunklist(list, size cty.Value) (cty.Value, error) { + return ChunklistFunc.Call([]cty.Value{list, size}) +} + +// Flatten takes a list and replaces any elements that are lists with a flattened +// sequence of the list contents. +func Flatten(list cty.Value) (cty.Value, error) { + return FlattenFunc.Call([]cty.Value{list}) +} + +// Keys takes a map and returns a sorted list of the map keys. +func Keys(inputMap cty.Value) (cty.Value, error) { + return KeysFunc.Call([]cty.Value{inputMap}) +} + +// Lookup performs a dynamic lookup into a map. +// There are two required arguments, map and key, plus an optional default, +// which is a value to return if no key is found in map. +func Lookup(inputMap, key, defaultValue cty.Value) (cty.Value, error) { + return LookupFunc.Call([]cty.Value{inputMap, key, defaultValue}) +} + +// Merge takes an arbitrary number of maps and returns a single map that contains +// a merged set of elements from all of the maps. +// +// If more than one given map defines the same key then the one that is later in +// the argument sequence takes precedence. +func Merge(maps ...cty.Value) (cty.Value, error) { + return MergeFunc.Call(maps) +} + +// ReverseList takes a sequence and produces a new sequence of the same length +// with all of the same elements as the given sequence but in reverse order. +func ReverseList(list cty.Value) (cty.Value, error) { + return ReverseListFunc.Call([]cty.Value{list}) +} + +// SetProduct computes the Cartesian product of sets or sequences. +func SetProduct(sets ...cty.Value) (cty.Value, error) { + return SetProductFunc.Call(sets) +} + +// Slice extracts some consecutive elements from within a list. +func Slice(list, start, end cty.Value) (cty.Value, error) { + return SliceFunc.Call([]cty.Value{list, start, end}) +} + +// Values returns a list of the map values, in the order of the sorted keys. +// This function only works on flat maps. +func Values(values cty.Value) (cty.Value, error) { + return ValuesFunc.Call([]cty.Value{values}) +} + +// Zipmap constructs a map from a list of keys and a corresponding list of values. +func Zipmap(keys, values cty.Value) (cty.Value, error) { + return ZipmapFunc.Call([]cty.Value{keys, values}) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/conversion.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/conversion.go new file mode 100644 index 00000000000..66eb97e2512 --- /dev/null +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/conversion.go @@ -0,0 +1,87 @@ +package stdlib + +import ( + "strconv" + + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/convert" + "github.com/zclconf/go-cty/cty/function" +) + +// MakeToFunc constructs a "to..." function, like "tostring", which converts +// its argument to a specific type or type kind. +// +// The given type wantTy can be any type constraint that cty's "convert" package +// would accept. In particular, this means that you can pass +// cty.List(cty.DynamicPseudoType) to mean "list of any single type", which +// will then cause cty to attempt to unify all of the element types when given +// a tuple. +func MakeToFunc(wantTy cty.Type) function.Function { + return function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "v", + // We use DynamicPseudoType rather than wantTy here so that + // all values will pass through the function API verbatim and + // we can handle the conversion logic within the Type and + // Impl functions. This allows us to customize the error + // messages to be more appropriate for an explicit type + // conversion, whereas the cty function system produces + // messages aimed at _implicit_ type conversions. + Type: cty.DynamicPseudoType, + AllowNull: true, + }, + }, + Type: func(args []cty.Value) (cty.Type, error) { + gotTy := args[0].Type() + if gotTy.Equals(wantTy) { + return wantTy, nil + } + conv := convert.GetConversionUnsafe(args[0].Type(), wantTy) + if conv == nil { + // We'll use some specialized errors for some trickier cases, + // but most we can handle in a simple way. + switch { + case gotTy.IsTupleType() && wantTy.IsTupleType(): + return cty.NilType, function.NewArgErrorf(0, "incompatible tuple type for conversion: %s", convert.MismatchMessage(gotTy, wantTy)) + case gotTy.IsObjectType() && wantTy.IsObjectType(): + return cty.NilType, function.NewArgErrorf(0, "incompatible object type for conversion: %s", convert.MismatchMessage(gotTy, wantTy)) + default: + return cty.NilType, function.NewArgErrorf(0, "cannot convert %s to %s", gotTy.FriendlyName(), wantTy.FriendlyNameForConstraint()) + } + } + // If a conversion is available then everything is fine. + return wantTy, nil + }, + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + // We didn't set "AllowUnknown" on our argument, so it is guaranteed + // to be known here but may still be null. + ret, err := convert.Convert(args[0], retType) + if err != nil { + // Because we used GetConversionUnsafe above, conversion can + // still potentially fail in here. For example, if the user + // asks to convert the string "a" to bool then we'll + // optimistically permit it during type checking but fail here + // once we note that the value isn't either "true" or "false". + gotTy := args[0].Type() + switch { + case gotTy == cty.String && wantTy == cty.Bool: + what := "string" + if !args[0].IsNull() { + what = strconv.Quote(args[0].AsString()) + } + return cty.NilVal, function.NewArgErrorf(0, `cannot convert %s to bool; only the strings "true" or "false" are allowed`, what) + case gotTy == cty.String && wantTy == cty.Number: + what := "string" + if !args[0].IsNull() { + what = strconv.Quote(args[0].AsString()) + } + return cty.NilVal, function.NewArgErrorf(0, `cannot convert %s to number; given string must be a decimal representation of a number`, what) + default: + return cty.NilVal, function.NewArgErrorf(0, "cannot convert %s to %s", gotTy.FriendlyName(), wantTy.FriendlyNameForConstraint()) + } + } + return ret, nil + }, + }) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/datetime.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/datetime.go index aa15b7bde96..1ceffcf63cf 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/datetime.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/datetime.go @@ -203,6 +203,33 @@ var FormatDateFunc = function.New(&function.Spec{ }, }) +// TimeAddFunc is a function that adds a duration to a timestamp, returning a new timestamp. +var TimeAddFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "timestamp", + Type: cty.String, + }, + { + Name: "duration", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + ts, err := parseTimestamp(args[0].AsString()) + if err != nil { + return cty.UnknownVal(cty.String), err + } + duration, err := time.ParseDuration(args[1].AsString()) + if err != nil { + return cty.UnknownVal(cty.String), err + } + + return cty.StringVal(ts.Add(duration).Format(time.RFC3339)), nil + }, +}) + // FormatDate reformats a timestamp given in RFC3339 syntax into another time // syntax defined by a given format string. // @@ -335,9 +362,14 @@ func splitDateFormat(data []byte, atEOF bool) (advance int, token []byte, err er for i := 1; i < len(data); i++ { if data[i] == esc { if (i + 1) == len(data) { - // We need at least one more byte to decide if this is an - // escape or a terminator. - return 0, nil, nil + if atEOF { + // We have a closing quote and are at the end of our input + return len(data), data, nil + } else { + // We need at least one more byte to decide if this is an + // escape or a terminator. + return 0, nil, nil + } } if data[i+1] == esc { i++ // doubled-up quotes are an escape sequence @@ -383,3 +415,20 @@ func splitDateFormat(data []byte, atEOF bool) (advance int, token []byte, err er func startsDateFormatVerb(b byte) bool { return (b >= 'a' && b <= 'z') || (b >= 'A' && b <= 'Z') } + +// TimeAdd adds a duration to a timestamp, returning a new timestamp. +// +// In the HCL language, timestamps are conventionally represented as +// strings using RFC 3339 "Date and Time format" syntax. Timeadd requires +// the timestamp argument to be a string conforming to this syntax. +// +// `duration` is a string representation of a time difference, consisting of +// sequences of number and unit pairs, like `"1.5h"` or `1h30m`. The accepted +// units are `ns`, `us` (or `µs`), `"ms"`, `"s"`, `"m"`, and `"h"`. The first +// number may be negative to indicate a negative duration, like `"-2h5m"`. +// +// The result is a string, also in RFC 3339 format, representing the result +// of adding the given direction to the given timestamp. +func TimeAdd(timestamp cty.Value, duration cty.Value) (cty.Value, error) { + return TimeAddFunc.Call([]cty.Value{timestamp, duration}) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go index 834e9b6fcc1..b95c347f575 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/format.go @@ -6,7 +6,7 @@ import ( "math/big" "strings" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" @@ -85,7 +85,7 @@ var FormatListFunc = function.New(&function.Spec{ argTy := arg.Type() switch { case (argTy.IsListType() || argTy.IsSetType() || argTy.IsTupleType()) && !arg.IsNull(): - if !argTy.IsTupleType() && !arg.IsKnown() { + if !argTy.IsTupleType() && !(arg.IsKnown() && arg.Length().IsKnown()) { // We can't iterate this one at all yet then, so we can't // yet produce a result. unknowns[i] = true diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/json.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/json.go index 07901c65d37..02770a65287 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/json.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/json.go @@ -12,6 +12,7 @@ var JSONEncodeFunc = function.New(&function.Spec{ Name: "val", Type: cty.DynamicPseudoType, AllowDynamicType: true, + AllowNull: true, }, }, Type: function.StaticReturnType(cty.String), @@ -24,6 +25,10 @@ var JSONEncodeFunc = function.New(&function.Spec{ return cty.UnknownVal(retType), nil } + if val.IsNull() { + return cty.StringVal("null"), nil + } + buf, err := json.Marshal(val, val.Type()) if err != nil { return cty.NilVal, err diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go index 480305e831d..7bbe584b0a1 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/number.go @@ -2,10 +2,12 @@ package stdlib import ( "fmt" + "math" "math/big" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" + "github.com/zclconf/go-cty/cty/gocty" ) var AbsoluteFunc = function.New(&function.Spec{ @@ -358,6 +360,188 @@ var IntFunc = function.New(&function.Spec{ }, }) +// CeilFunc is a function that returns the closest whole number greater +// than or equal to the given value. +var CeilFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "num", + Type: cty.Number, + }, + }, + Type: function.StaticReturnType(cty.Number), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var val float64 + if err := gocty.FromCtyValue(args[0], &val); err != nil { + return cty.UnknownVal(cty.String), err + } + if math.IsInf(val, 0) { + return cty.NumberFloatVal(val), nil + } + return cty.NumberIntVal(int64(math.Ceil(val))), nil + }, +}) + +// FloorFunc is a function that returns the closest whole number lesser +// than or equal to the given value. +var FloorFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "num", + Type: cty.Number, + }, + }, + Type: function.StaticReturnType(cty.Number), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var val float64 + if err := gocty.FromCtyValue(args[0], &val); err != nil { + return cty.UnknownVal(cty.String), err + } + if math.IsInf(val, 0) { + return cty.NumberFloatVal(val), nil + } + return cty.NumberIntVal(int64(math.Floor(val))), nil + }, +}) + +// LogFunc is a function that returns the logarithm of a given number in a given base. +var LogFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "num", + Type: cty.Number, + }, + { + Name: "base", + Type: cty.Number, + }, + }, + Type: function.StaticReturnType(cty.Number), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var num float64 + if err := gocty.FromCtyValue(args[0], &num); err != nil { + return cty.UnknownVal(cty.String), err + } + + var base float64 + if err := gocty.FromCtyValue(args[1], &base); err != nil { + return cty.UnknownVal(cty.String), err + } + + return cty.NumberFloatVal(math.Log(num) / math.Log(base)), nil + }, +}) + +// PowFunc is a function that returns the logarithm of a given number in a given base. +var PowFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "num", + Type: cty.Number, + }, + { + Name: "power", + Type: cty.Number, + }, + }, + Type: function.StaticReturnType(cty.Number), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var num float64 + if err := gocty.FromCtyValue(args[0], &num); err != nil { + return cty.UnknownVal(cty.String), err + } + + var power float64 + if err := gocty.FromCtyValue(args[1], &power); err != nil { + return cty.UnknownVal(cty.String), err + } + + return cty.NumberFloatVal(math.Pow(num, power)), nil + }, +}) + +// SignumFunc is a function that determines the sign of a number, returning a +// number between -1 and 1 to represent the sign.. +var SignumFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "num", + Type: cty.Number, + }, + }, + Type: function.StaticReturnType(cty.Number), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var num int + if err := gocty.FromCtyValue(args[0], &num); err != nil { + return cty.UnknownVal(cty.String), err + } + switch { + case num < 0: + return cty.NumberIntVal(-1), nil + case num > 0: + return cty.NumberIntVal(+1), nil + default: + return cty.NumberIntVal(0), nil + } + }, +}) + +// ParseIntFunc is a function that parses a string argument and returns an integer of the specified base. +var ParseIntFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "number", + Type: cty.DynamicPseudoType, + }, + { + Name: "base", + Type: cty.Number, + }, + }, + + Type: func(args []cty.Value) (cty.Type, error) { + if !args[0].Type().Equals(cty.String) { + return cty.Number, function.NewArgErrorf(0, "first argument must be a string, not %s", args[0].Type().FriendlyName()) + } + return cty.Number, nil + }, + + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + var numstr string + var base int + var err error + + if err = gocty.FromCtyValue(args[0], &numstr); err != nil { + return cty.UnknownVal(cty.String), function.NewArgError(0, err) + } + + if err = gocty.FromCtyValue(args[1], &base); err != nil { + return cty.UnknownVal(cty.Number), function.NewArgError(1, err) + } + + if base < 2 || base > 62 { + return cty.UnknownVal(cty.Number), function.NewArgErrorf( + 1, + "base must be a whole number between 2 and 62 inclusive", + ) + } + + num, ok := (&big.Int{}).SetString(numstr, base) + if !ok { + return cty.UnknownVal(cty.Number), function.NewArgErrorf( + 0, + "cannot parse %q as a base %d integer", + numstr, + base, + ) + } + + parsedNum := cty.NumberVal((&big.Float{}).SetInt(num)) + + return parsedNum, nil + }, +}) + // Absolute returns the magnitude of the given number, without its sign. // That is, it turns negative values into positive values. func Absolute(num cty.Value) (cty.Value, error) { @@ -436,3 +620,34 @@ func Int(num cty.Value) (cty.Value, error) { } return IntFunc.Call([]cty.Value{num}) } + +// Ceil returns the closest whole number greater than or equal to the given value. +func Ceil(num cty.Value) (cty.Value, error) { + return CeilFunc.Call([]cty.Value{num}) +} + +// Floor returns the closest whole number lesser than or equal to the given value. +func Floor(num cty.Value) (cty.Value, error) { + return FloorFunc.Call([]cty.Value{num}) +} + +// Log returns returns the logarithm of a given number in a given base. +func Log(num, base cty.Value) (cty.Value, error) { + return LogFunc.Call([]cty.Value{num, base}) +} + +// Pow returns the logarithm of a given number in a given base. +func Pow(num, power cty.Value) (cty.Value, error) { + return PowFunc.Call([]cty.Value{num, power}) +} + +// Signum determines the sign of a number, returning a number between -1 and +// 1 to represent the sign. +func Signum(num cty.Value) (cty.Value, error) { + return SignumFunc.Call([]cty.Value{num}) +} + +// ParseInt parses a string argument and returns an integer of the specified base. +func ParseInt(num cty.Value, base cty.Value) (cty.Value, error) { + return ParseIntFunc.Call([]cty.Value{num, base}) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/set.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/set.go index 100078fdc43..29c425eaf29 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/set.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/set.go @@ -44,7 +44,7 @@ var SetUnionFunc = function.New(&function.Spec{ Type: setOperationReturnType, Impl: setOperationImpl(func(s1, s2 cty.ValueSet) cty.ValueSet { return s1.Union(s2) - }), + }, true), }) var SetIntersectionFunc = function.New(&function.Spec{ @@ -63,7 +63,7 @@ var SetIntersectionFunc = function.New(&function.Spec{ Type: setOperationReturnType, Impl: setOperationImpl(func(s1, s2 cty.ValueSet) cty.ValueSet { return s1.Intersection(s2) - }), + }, false), }) var SetSubtractFunc = function.New(&function.Spec{ @@ -82,7 +82,7 @@ var SetSubtractFunc = function.New(&function.Spec{ Type: setOperationReturnType, Impl: setOperationImpl(func(s1, s2 cty.ValueSet) cty.ValueSet { return s1.Subtract(s2) - }), + }, false), }) var SetSymmetricDifferenceFunc = function.New(&function.Spec{ @@ -100,8 +100,8 @@ var SetSymmetricDifferenceFunc = function.New(&function.Spec{ }, Type: setOperationReturnType, Impl: setOperationImpl(func(s1, s2 cty.ValueSet) cty.ValueSet { - return s1.Subtract(s2) - }), + return s1.SymmetricDifference(s2) + }, false), }) // SetHasElement determines whether the given set contains the given value as an @@ -163,8 +163,23 @@ func SetSymmetricDifference(sets ...cty.Value) (cty.Value, error) { func setOperationReturnType(args []cty.Value) (ret cty.Type, err error) { var etys []cty.Type for _, arg := range args { - etys = append(etys, arg.Type().ElementType()) + ty := arg.Type().ElementType() + + // Do not unify types for empty dynamic pseudo typed collections. These + // will always convert to any other concrete type. + if arg.IsKnown() && arg.LengthInt() == 0 && ty.Equals(cty.DynamicPseudoType) { + continue + } + + etys = append(etys, ty) } + + // If all element types were skipped (due to being empty dynamic collections), + // the return type should also be a set of dynamic pseudo type. + if len(etys) == 0 { + return cty.Set(cty.DynamicPseudoType), nil + } + newEty, _ := convert.UnifyUnsafe(etys) if newEty == cty.NilType { return cty.NilType, fmt.Errorf("given sets must all have compatible element types") @@ -172,13 +187,21 @@ func setOperationReturnType(args []cty.Value) (ret cty.Type, err error) { return cty.Set(newEty), nil } -func setOperationImpl(f func(s1, s2 cty.ValueSet) cty.ValueSet) function.ImplFunc { +func setOperationImpl(f func(s1, s2 cty.ValueSet) cty.ValueSet, allowUnknowns bool) function.ImplFunc { return func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { first := args[0] first, err = convert.Convert(first, retType) if err != nil { return cty.NilVal, function.NewArgError(0, err) } + if !allowUnknowns && !first.IsWhollyKnown() { + // This set function can produce a correct result only when all + // elements are known, because eventually knowing the unknown + // values may cause the result to have fewer known elements, or + // might cause a result with no unknown elements at all to become + // one with a different length. + return cty.UnknownVal(retType), nil + } set := first.AsValueSet() for i, arg := range args[1:] { @@ -186,6 +209,10 @@ func setOperationImpl(f func(s1, s2 cty.ValueSet) cty.ValueSet) function.ImplFun if err != nil { return cty.NilVal, function.NewArgError(i+1, err) } + if !allowUnknowns && !arg.IsWhollyKnown() { + // (For the same reason as we did this check for "first" above.) + return cty.UnknownVal(retType), nil + } argSet := arg.AsValueSet() set = f(set, argSet) diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go index 12e9dbc3ddf..01ebc47fd5d 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string.go @@ -1,9 +1,13 @@ package stdlib import ( + "fmt" + "regexp" + "sort" "strings" - "github.com/apparentlymart/go-textseg/textseg" + "github.com/apparentlymart/go-textseg/v12/textseg" + "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/function" "github.com/zclconf/go-cty/cty/gocty" @@ -140,8 +144,14 @@ var SubstrFunc = function.New(&function.Spec{ } offset += totalLen + } else if length == 0 { + // Short circuit here, after error checks, because if a + // string of length 0 has been requested it will always + // be the empty string + return cty.StringVal(""), nil } + sub := in pos := 0 var i int @@ -187,6 +197,252 @@ var SubstrFunc = function.New(&function.Spec{ }, }) +var JoinFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "separator", + Type: cty.String, + }, + }, + VarParam: &function.Parameter{ + Name: "lists", + Type: cty.List(cty.String), + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + sep := args[0].AsString() + listVals := args[1:] + if len(listVals) < 1 { + return cty.UnknownVal(cty.String), fmt.Errorf("at least one list is required") + } + + l := 0 + for _, list := range listVals { + if !list.IsWhollyKnown() { + return cty.UnknownVal(cty.String), nil + } + l += list.LengthInt() + } + + items := make([]string, 0, l) + for ai, list := range listVals { + ei := 0 + for it := list.ElementIterator(); it.Next(); { + _, val := it.Element() + if val.IsNull() { + if len(listVals) > 1 { + return cty.UnknownVal(cty.String), function.NewArgErrorf(ai+1, "element %d of list %d is null; cannot concatenate null values", ei, ai+1) + } + return cty.UnknownVal(cty.String), function.NewArgErrorf(ai+1, "element %d is null; cannot concatenate null values", ei) + } + items = append(items, val.AsString()) + ei++ + } + } + + return cty.StringVal(strings.Join(items, sep)), nil + }, +}) + +var SortFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "list", + Type: cty.List(cty.String), + }, + }, + Type: function.StaticReturnType(cty.List(cty.String)), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + listVal := args[0] + + if !listVal.IsWhollyKnown() { + // If some of the element values aren't known yet then we + // can't yet predict the order of the result. + return cty.UnknownVal(retType), nil + } + if listVal.LengthInt() == 0 { // Easy path + return listVal, nil + } + + list := make([]string, 0, listVal.LengthInt()) + for it := listVal.ElementIterator(); it.Next(); { + iv, v := it.Element() + if v.IsNull() { + return cty.UnknownVal(retType), fmt.Errorf("given list element %s is null; a null string cannot be sorted", iv.AsBigFloat().String()) + } + list = append(list, v.AsString()) + } + + sort.Strings(list) + retVals := make([]cty.Value, len(list)) + for i, s := range list { + retVals[i] = cty.StringVal(s) + } + return cty.ListVal(retVals), nil + }, +}) + +var SplitFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "separator", + Type: cty.String, + }, + { + Name: "str", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.List(cty.String)), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + sep := args[0].AsString() + str := args[1].AsString() + elems := strings.Split(str, sep) + elemVals := make([]cty.Value, len(elems)) + for i, s := range elems { + elemVals[i] = cty.StringVal(s) + } + if len(elemVals) == 0 { + return cty.ListValEmpty(cty.String), nil + } + return cty.ListVal(elemVals), nil + }, +}) + +// ChompFunc is a function that removes newline characters at the end of a +// string. +var ChompFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + newlines := regexp.MustCompile(`(?:\r\n?|\n)*\z`) + return cty.StringVal(newlines.ReplaceAllString(args[0].AsString(), "")), nil + }, +}) + +// IndentFunc is a function that adds a given number of spaces to the +// beginnings of all but the first line in a given multi-line string. +var IndentFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "spaces", + Type: cty.Number, + }, + { + Name: "str", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + var spaces int + if err := gocty.FromCtyValue(args[0], &spaces); err != nil { + return cty.UnknownVal(cty.String), err + } + data := args[1].AsString() + pad := strings.Repeat(" ", spaces) + return cty.StringVal(strings.Replace(data, "\n", "\n"+pad, -1)), nil + }, +}) + +// TitleFunc is a function that converts the first letter of each word in the +// given string to uppercase. +var TitleFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + return cty.StringVal(strings.Title(args[0].AsString())), nil + }, +}) + +// TrimSpaceFunc is a function that removes any space characters from the start +// and end of the given string. +var TrimSpaceFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + return cty.StringVal(strings.TrimSpace(args[0].AsString())), nil + }, +}) + +// TrimFunc is a function that removes the specified characters from the start +// and end of the given string. +var TrimFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + { + Name: "cutset", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + str := args[0].AsString() + cutset := args[1].AsString() + return cty.StringVal(strings.Trim(str, cutset)), nil + }, +}) + +// TrimPrefixFunc is a function that removes the specified characters from the +// start the given string. +var TrimPrefixFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + { + Name: "prefix", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + str := args[0].AsString() + prefix := args[1].AsString() + return cty.StringVal(strings.TrimPrefix(str, prefix)), nil + }, +}) + +// TrimSuffixFunc is a function that removes the specified characters from the +// end of the given string. +var TrimSuffixFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + { + Name: "suffix", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + str := args[0].AsString() + cutset := args[1].AsString() + return cty.StringVal(strings.TrimSuffix(str, cutset)), nil + }, +}) + // Upper is a Function that converts a given string to uppercase. func Upper(str cty.Value) (cty.Value, error) { return UpperFunc.Call([]cty.Value{str}) @@ -232,3 +488,60 @@ func Strlen(str cty.Value) (cty.Value, error) { func Substr(str cty.Value, offset cty.Value, length cty.Value) (cty.Value, error) { return SubstrFunc.Call([]cty.Value{str, offset, length}) } + +// Join concatenates together the string elements of one or more lists with a +// given separator. +func Join(sep cty.Value, lists ...cty.Value) (cty.Value, error) { + args := make([]cty.Value, len(lists)+1) + args[0] = sep + copy(args[1:], lists) + return JoinFunc.Call(args) +} + +// Sort re-orders the elements of a given list of strings so that they are +// in ascending lexicographical order. +func Sort(list cty.Value) (cty.Value, error) { + return SortFunc.Call([]cty.Value{list}) +} + +// Split divides a given string by a given separator, returning a list of +// strings containing the characters between the separator sequences. +func Split(sep, str cty.Value) (cty.Value, error) { + return SplitFunc.Call([]cty.Value{sep, str}) +} + +// Chomp removes newline characters at the end of a string. +func Chomp(str cty.Value) (cty.Value, error) { + return ChompFunc.Call([]cty.Value{str}) +} + +// Indent adds a given number of spaces to the beginnings of all but the first +// line in a given multi-line string. +func Indent(spaces, str cty.Value) (cty.Value, error) { + return IndentFunc.Call([]cty.Value{spaces, str}) +} + +// Title converts the first letter of each word in the given string to uppercase. +func Title(str cty.Value) (cty.Value, error) { + return TitleFunc.Call([]cty.Value{str}) +} + +// TrimSpace removes any space characters from the start and end of the given string. +func TrimSpace(str cty.Value) (cty.Value, error) { + return TrimSpaceFunc.Call([]cty.Value{str}) +} + +// Trim removes the specified characters from the start and end of the given string. +func Trim(str, cutset cty.Value) (cty.Value, error) { + return TrimFunc.Call([]cty.Value{str, cutset}) +} + +// TrimPrefix removes the specified prefix from the start of the given string. +func TrimPrefix(str, prefix cty.Value) (cty.Value, error) { + return TrimPrefixFunc.Call([]cty.Value{str, prefix}) +} + +// TrimSuffix removes the specified suffix from the end of the given string. +func TrimSuffix(str, suffix cty.Value) (cty.Value, error) { + return TrimSuffixFunc.Call([]cty.Value{str, suffix}) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string_replace.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string_replace.go new file mode 100644 index 00000000000..f777ce5c3e9 --- /dev/null +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/function/stdlib/string_replace.go @@ -0,0 +1,80 @@ +package stdlib + +import ( + "regexp" + "strings" + + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/function" +) + +// ReplaceFunc is a function that searches a given string for another given +// substring, and replaces each occurence with a given replacement string. +// The substr argument is a simple string. +var ReplaceFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + { + Name: "substr", + Type: cty.String, + }, + { + Name: "replace", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (cty.Value, error) { + str := args[0].AsString() + substr := args[1].AsString() + replace := args[2].AsString() + + return cty.StringVal(strings.Replace(str, substr, replace, -1)), nil + }, +}) + +// RegexReplaceFunc is a function that searches a given string for another +// given substring, and replaces each occurence with a given replacement +// string. The substr argument must be a valid regular expression. +var RegexReplaceFunc = function.New(&function.Spec{ + Params: []function.Parameter{ + { + Name: "str", + Type: cty.String, + }, + { + Name: "substr", + Type: cty.String, + }, + { + Name: "replace", + Type: cty.String, + }, + }, + Type: function.StaticReturnType(cty.String), + Impl: func(args []cty.Value, retType cty.Type) (ret cty.Value, err error) { + str := args[0].AsString() + substr := args[1].AsString() + replace := args[2].AsString() + + re, err := regexp.Compile(substr) + if err != nil { + return cty.UnknownVal(cty.String), err + } + + return cty.StringVal(re.ReplaceAllString(str, replace)), nil + }, +}) + +// Replace searches a given string for another given substring, +// and replaces all occurrences with a given replacement string. +func Replace(str, substr, replace cty.Value) (cty.Value, error) { + return ReplaceFunc.Call([]cty.Value{str, substr, replace}) +} + +func RegexReplace(str, substr, replace cty.Value) (cty.Value, error) { + return RegexReplaceFunc.Call([]cty.Value{str, substr, replace}) +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json.go index c421a62ed94..2222e0f80bb 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "sort" ) // MarshalJSON is an implementation of json.Marshaler that allows Type @@ -52,6 +53,19 @@ func (t Type) MarshalJSON() ([]byte, error) { } buf.WriteString(`["object",`) buf.Write(atysJSON) + if optionals := t.OptionalAttributes(); len(optionals) > 0 { + buf.WriteByte(',') + optionalNames := make([]string, 0, len(optionals)) + for k := range optionals { + optionalNames = append(optionalNames, k) + } + sort.Strings(optionalNames) + optionalsJSON, err := json.Marshal(optionalNames) + if err != nil { + return nil, err + } + buf.Write(optionalsJSON) + } buf.WriteRune(']') return buf.Bytes(), nil case typeTuple: @@ -148,7 +162,16 @@ func (t *Type) UnmarshalJSON(buf []byte) error { if err != nil { return err } - *t = Object(atys) + if dec.More() { + var optionals []string + err = dec.Decode(&optionals) + if err != nil { + return err + } + *t = ObjectWithOptionalAttrs(atys, optionals) + } else { + *t = Object(atys) + } case "tuple": var etys []Type err = dec.Decode(&etys) diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json/marshal.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json/marshal.go index 75e02577b1e..7a14ce81a42 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json/marshal.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/json/marshal.go @@ -10,7 +10,7 @@ import ( func marshal(val cty.Value, t cty.Type, path cty.Path, b *bytes.Buffer) error { if val.IsMarked() { - return path.NewErrorf("value has marks, so it cannot be seralized") + return path.NewErrorf("value has marks, so it cannot be serialized as JSON") } // If we're going to decode as DynamicPseudoType then we need to save diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/marks.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/marks.go index 3898e455335..4e1d3b129f3 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/marks.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/marks.go @@ -67,6 +67,23 @@ func (m ValueMarks) GoString() string { return s.String() } +// PathValueMarks is a structure that enables tracking marks +// and the paths where they are located in one type +type PathValueMarks struct { + Path Path + Marks ValueMarks +} + +func (p PathValueMarks) Equal(o PathValueMarks) bool { + if !p.Path.Equals(o.Path) { + return false + } + if !p.Marks.Equal(o.Marks) { + return false + } + return true +} + // IsMarked returns true if and only if the receiving value carries at least // one mark. A marked value cannot be used directly with integration methods // without explicitly unmarking it (and retrieving the markings) first. @@ -174,6 +191,31 @@ func (val Value) Mark(mark interface{}) Value { } } +type applyPathValueMarksTransformer struct { + pvm []PathValueMarks +} + +func (t *applyPathValueMarksTransformer) Enter(p Path, v Value) (Value, error) { + return v, nil +} + +func (t *applyPathValueMarksTransformer) Exit(p Path, v Value) (Value, error) { + for _, path := range t.pvm { + if p.Equals(path.Path) { + return v.WithMarks(path.Marks), nil + } + } + return v, nil +} + +// MarkWithPaths accepts a slice of PathValueMarks to apply +// markers to particular paths and returns the marked +// Value. +func (val Value) MarkWithPaths(pvm []PathValueMarks) Value { + ret, _ := TransformWithTransformer(val, &applyPathValueMarksTransformer{pvm}) + return ret +} + // Unmark separates the marks of the receiving value from the value itself, // removing a new unmarked value and a map (representing a set) of the marks. // @@ -191,6 +233,24 @@ func (val Value) Unmark() (Value, ValueMarks) { }, marks } +type unmarkTransformer struct { + pvm []PathValueMarks +} + +func (t *unmarkTransformer) Enter(p Path, v Value) (Value, error) { + unmarkedVal, marks := v.Unmark() + if len(marks) > 0 { + path := make(Path, len(p), len(p)+1) + copy(path, p) + t.pvm = append(t.pvm, PathValueMarks{path, marks}) + } + return unmarkedVal, nil +} + +func (t *unmarkTransformer) Exit(p Path, v Value) (Value, error) { + return v, nil +} + // UnmarkDeep is similar to Unmark, but it works with an entire nested structure // rather than just the given value directly. // @@ -198,17 +258,29 @@ func (val Value) Unmark() (Value, ValueMarks) { // the returned marks set includes the superset of all of the marks encountered // during the operation. func (val Value) UnmarkDeep() (Value, ValueMarks) { + t := unmarkTransformer{} + ret, _ := TransformWithTransformer(val, &t) + marks := make(ValueMarks) - ret, _ := Transform(val, func(_ Path, v Value) (Value, error) { - unmarkedV, valueMarks := v.Unmark() - for m, s := range valueMarks { + for _, pvm := range t.pvm { + for m, s := range pvm.Marks { marks[m] = s } - return unmarkedV, nil - }) + } + return ret, marks } +// UnmarkDeepWithPaths is like UnmarkDeep, except it returns a slice +// of PathValueMarks rather than a superset of all marks. This allows +// a caller to know which marks are associated with which paths +// in the Value. +func (val Value) UnmarkDeepWithPaths() (Value, []PathValueMarks) { + t := unmarkTransformer{} + ret, _ := TransformWithTransformer(val, &t) + return ret, t.pvm +} + func (val Value) unmarkForce() Value { unw, _ := val.Unmark() return unw diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/object_type.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/object_type.go index 187d38751b8..0c67d4ecd41 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/object_type.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/object_type.go @@ -2,11 +2,13 @@ package cty import ( "fmt" + "sort" ) type typeObject struct { typeImplSigil - AttrTypes map[string]Type + AttrTypes map[string]Type + AttrOptional map[string]struct{} } // Object creates an object type with the given attribute types. @@ -14,14 +16,52 @@ type typeObject struct { // After a map is passed to this function the caller must no longer access it, // since ownership is transferred to this library. func Object(attrTypes map[string]Type) Type { + return ObjectWithOptionalAttrs(attrTypes, nil) +} + +// ObjectWithOptionalAttrs creates an object type where some of its attributes +// are optional. +// +// This function is EXPERIMENTAL. The behavior of the function or of any other +// functions working either directly or indirectly with a type created by +// this function is not currently considered as a compatibility constraint, and +// is subject to change even in minor-version releases of this module. Other +// modules that work with cty types and values may or may not support object +// types with optional attributes; if they do not, their behavior when +// receiving one may be non-ideal. +// +// Optional attributes are significant only when an object type is being used +// as a target type for conversion in the "convert" package. A value of an +// object type always has a value for each of the attributes in the attribute +// types table, with optional values replaced with null during conversion. +// +// All keys in the optional slice must also exist in the attrTypes map. If not, +// this function will panic. +// +// After a map or array is passed to this function the caller must no longer +// access it, since ownership is transferred to this library. +func ObjectWithOptionalAttrs(attrTypes map[string]Type, optional []string) Type { attrTypesNorm := make(map[string]Type, len(attrTypes)) for k, v := range attrTypes { attrTypesNorm[NormalizeString(k)] = v } + var optionalSet map[string]struct{} + if len(optional) > 0 { + optionalSet = make(map[string]struct{}, len(optional)) + for _, k := range optional { + k = NormalizeString(k) + if _, exists := attrTypesNorm[k]; !exists { + panic(fmt.Sprintf("optional contains undeclared attribute %q", k)) + } + optionalSet[k] = struct{}{} + } + } + return Type{ typeObject{ - AttrTypes: attrTypesNorm, + AttrTypes: attrTypesNorm, + AttrOptional: optionalSet, }, } } @@ -44,6 +84,11 @@ func (t typeObject) Equals(other Type) bool { if !oty.Equals(ty) { return false } + _, opt := t.AttrOptional[attr] + _, oopt := ot.AttrOptional[attr] + if opt != oopt { + return false + } } return true @@ -66,6 +111,14 @@ func (t typeObject) GoString() string { if len(t.AttrTypes) == 0 { return "cty.EmptyObject" } + if len(t.AttrOptional) > 0 { + opt := make([]string, len(t.AttrOptional)) + for k := range t.AttrOptional { + opt = append(opt, k) + } + sort.Strings(opt) + return fmt.Sprintf("cty.ObjectWithOptionalAttrs(%#v, %#v)", t.AttrTypes, opt) + } return fmt.Sprintf("cty.Object(%#v)", t.AttrTypes) } @@ -133,3 +186,35 @@ func (t Type) AttributeTypes() map[string]Type { } panic("AttributeTypes on non-object Type") } + +// OptionalAttributes returns a map representing the set of attributes +// that are optional. Will panic if the receiver is not an object type +// (use IsObjectType to confirm). +// +// The returned map is part of the internal state of the type, and is provided +// for read access only. It is forbidden for any caller to modify the returned +// map. +func (t Type) OptionalAttributes() map[string]struct{} { + if ot, ok := t.typeImpl.(typeObject); ok { + return ot.AttrOptional + } + panic("OptionalAttributes on non-object Type") +} + +// AttributeOptional returns true if the attribute of the given name is +// optional. +// +// Will panic if the receiver is not an object type (use IsObjectType to +// confirm) or if the object type has no such attribute (use HasAttribute to +// confirm). +func (t Type) AttributeOptional(name string) bool { + name = NormalizeString(name) + if ot, ok := t.typeImpl.(typeObject); ok { + if _, hasAttr := ot.AttrTypes[name]; !hasAttr { + panic("no such attribute") + } + _, exists := ot.AttrOptional[name] + return exists + } + panic("AttributeDefaultValue on non-object Type") +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path.go index b31444954d3..636e68c63dd 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path.go @@ -51,11 +51,31 @@ func (p Path) Index(v Value) Path { return ret } +// IndexInt is a typed convenience method for Index. +func (p Path) IndexInt(v int) Path { + return p.Index(NumberIntVal(int64(v))) +} + +// IndexString is a typed convenience method for Index. +func (p Path) IndexString(v string) Path { + return p.Index(StringVal(v)) +} + // IndexPath is a convenience method to start a new Path with an IndexStep. func IndexPath(v Value) Path { return Path{}.Index(v) } +// IndexIntPath is a typed convenience method for IndexPath. +func IndexIntPath(v int) Path { + return IndexPath(NumberIntVal(int64(v))) +} + +// IndexStringPath is a typed convenience method for IndexPath. +func IndexStringPath(v string) Path { + return IndexPath(StringVal(v)) +} + // GetAttr returns a new Path that is the reciever with a GetAttrStep appended // to the end. // diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path_set.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path_set.go index f1c892b9d9d..1960c01e974 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path_set.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/path_set.go @@ -196,3 +196,9 @@ func (r pathSetRules) Equivalent(a, b interface{}) bool { return true } + +// SameRules is true if both Rules instances are pathSetRules structs. +func (r pathSetRules) SameRules(other set.Rules) bool { + _, ok := other.(pathSetRules) + return ok +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/rules.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/rules.go index 51f744b5e9a..03ecd25b97c 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/rules.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/rules.go @@ -22,6 +22,10 @@ type Rules interface { // though it is *not* required that two values with the same hash value // be equivalent. Equivalent(interface{}, interface{}) bool + + // SameRules returns true if the instance is equivalent to another Rules + // instance. + SameRules(Rules) bool } // OrderedRules is an extension of Rules that can apply a partial order to diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/set.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/set.go index b4fb316f1cc..15a76638f56 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/set.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set/set.go @@ -41,7 +41,7 @@ func NewSetFromSlice(rules Rules, vals []interface{}) Set { } func sameRules(s1 Set, s2 Set) bool { - return s1.rules == s2.rules + return s1.rules.SameRules(s2.rules) } func mustHaveSameRules(s1 Set, s2 Set) { @@ -53,7 +53,7 @@ func mustHaveSameRules(s1 Set, s2 Set) { // HasRules returns true if and only if the receiving set has the given rules // instance as its rules. func (s Set) HasRules(rules Rules) bool { - return s.rules == rules + return s.rules.SameRules(rules) } // Rules returns the receiving set's rules instance. diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set_internals.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set_internals.go index e7e1d3337e3..2b8af1e2170 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set_internals.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/set_internals.go @@ -65,6 +65,17 @@ func (r setRules) Equivalent(v1 interface{}, v2 interface{}) bool { return eqv.v == true } +// SameRules is only true if the other Rules instance is also a setRules struct, +// and the types are considered equal. +func (r setRules) SameRules(other set.Rules) bool { + rules, ok := other.(setRules) + if !ok { + return false + } + + return r.Type.Equals(rules.Type) +} + // Less is an implementation of set.OrderedRules so that we can iterate over // set elements in a consistent order, where such an order is possible. func (r setRules) Less(v1, v2 interface{}) bool { diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/type.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/type.go index 730cb9862ef..5c44575338c 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/type.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/type.go @@ -36,6 +36,9 @@ func (t typeImplSigil) isTypeImpl() typeImplSigil { // Equals returns true if the other given Type exactly equals the receiver // type. func (t Type) Equals(other Type) bool { + if t == NilType || other == NilType { + return t == other + } return t.typeImpl.Equals(other) } @@ -87,7 +90,7 @@ func (t Type) HasDynamicTypes() bool { case t.IsPrimitiveType(): return false case t.IsCollectionType(): - return false + return t.ElementType().HasDynamicTypes() case t.IsObjectType(): attrTypes := t.AttributeTypes() for _, at := range attrTypes { diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/unknown.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/unknown.go index e54179eb144..83893c0237d 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/unknown.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/unknown.go @@ -5,7 +5,8 @@ package cty type unknownType struct { } -// Unknown is a special value that can be +// unknown is a special value that can be used as the internal value of a +// Value to create a placeholder for a value that isn't yet known. var unknown interface{} = &unknownType{} // UnknownVal returns an Value that represents an unknown value of the given diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value.go index 1025ba82eba..f6a25ddef9f 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value.go @@ -106,3 +106,37 @@ func (val Value) IsWhollyKnown() bool { return true } } + +// HasWhollyKnownType checks if the value is dynamic, or contains any nested +// DynamicVal. This implies that both the value is not known, and the final +// type may change. +func (val Value) HasWhollyKnownType() bool { + // a null dynamic type is known + if val.IsNull() { + return true + } + + // an unknown DynamicPseudoType is a DynamicVal, but we don't want to + // check that value for equality here, since this method is used within the + // equality check. + if !val.IsKnown() && val.ty == DynamicPseudoType { + return false + } + + if val.CanIterateElements() { + // if the value is not known, then we can look directly at the internal + // types + if !val.IsKnown() { + return !val.ty.HasDynamicTypes() + } + + for it := val.ElementIterator(); it.Next(); { + _, ev := it.Element() + if !ev.HasWhollyKnownType() { + return false + } + } + } + + return true +} diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_init.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_init.go index 2dafe17ae34..fc2d7b6fb39 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_init.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_init.go @@ -247,11 +247,6 @@ func SetVal(vals []Value) Value { val = unmarkedVal markSets = append(markSets, marks) } - if val.ContainsMarked() { - // FIXME: Allow this, but unmark the values and apply the - // marking to the set itself instead. - panic("set cannot contain marked values") - } if elementType == DynamicPseudoType { elementType = val.ty } else if val.ty != DynamicPseudoType && !elementType.Equals(val.ty) { diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_ops.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_ops.go index 35a644be45f..b33cc4f4711 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_ops.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/value_ops.go @@ -3,7 +3,6 @@ package cty import ( "fmt" "math/big" - "reflect" "github.com/zclconf/go-cty/cty/set" ) @@ -133,9 +132,9 @@ func (val Value) Equals(other Value) Value { case val.IsKnown() && !other.IsKnown(): switch { case val.IsNull(), other.ty.HasDynamicTypes(): - // If known is Null, we need to wait for the unkown value since + // If known is Null, we need to wait for the unknown value since // nulls of any type are equal. - // An unkown with a dynamic type compares as unknown, which we need + // An unknown with a dynamic type compares as unknown, which we need // to check before the type comparison below. return UnknownVal(Bool) case !val.ty.Equals(other.ty): @@ -148,9 +147,9 @@ func (val Value) Equals(other Value) Value { case other.IsKnown() && !val.IsKnown(): switch { case other.IsNull(), val.ty.HasDynamicTypes(): - // If known is Null, we need to wait for the unkown value since + // If known is Null, we need to wait for the unknown value since // nulls of any type are equal. - // An unkown with a dynamic type compares as unknown, which we need + // An unknown with a dynamic type compares as unknown, which we need // to check before the type comparison below. return UnknownVal(Bool) case !other.ty.Equals(val.ty): @@ -171,7 +170,15 @@ func (val Value) Equals(other Value) Value { return BoolVal(false) } - if val.ty.HasDynamicTypes() || other.ty.HasDynamicTypes() { + // Check if there are any nested dynamic values making this comparison + // unknown. + if !val.HasWhollyKnownType() || !other.HasWhollyKnownType() { + // Even if we have dynamic values, we can still determine inequality if + // there is no way the types could later conform. + if val.ty.TestConformance(other.ty) != nil && other.ty.TestConformance(val.ty) != nil { + return BoolVal(false) + } + return UnknownVal(Bool) } @@ -262,24 +269,26 @@ func (val Value) Equals(other Value) Value { s2 := other.v.(set.Set) equal := true - // Note that by our definition of sets it's never possible for two - // sets that contain unknown values (directly or indicrectly) to - // ever be equal, even if they are otherwise identical. - - // FIXME: iterating both lists and checking each item is not the - // ideal implementation here, but it works with the primitives we - // have in the set implementation. Perhaps the set implementation - // can provide its own equality test later. - s1.EachValue(func(v interface{}) { - if !s2.Has(v) { + // Two sets are equal if all of their values are known and all values + // in one are also in the other. + for it := s1.Iterator(); it.Next(); { + rv := it.Value() + if rv == unknown { // "unknown" is the internal representation of unknown-ness + return UnknownVal(Bool) + } + if !s2.Has(rv) { equal = false } - }) - s2.EachValue(func(v interface{}) { - if !s1.Has(v) { + } + for it := s2.Iterator(); it.Next(); { + rv := it.Value() + if rv == unknown { // "unknown" is the internal representation of unknown-ness + return UnknownVal(Bool) + } + if !s1.Has(rv) { equal = false } - }) + } result = equal case ty.IsMapType(): @@ -454,17 +463,32 @@ func (val Value) RawEquals(other Value) bool { return true } return false + case ty.IsSetType(): - s1 := val.v.(set.Set) - s2 := other.v.(set.Set) + // Convert the set values into a slice so that we can compare each + // value. This is safe because the underlying sets are ordered (see + // setRules in set_internals.go), and so the results are guaranteed to + // be in a consistent order for two equal sets + setList1 := val.AsValueSlice() + setList2 := other.AsValueSlice() + + // If both physical sets have the same length and they have all of their + // _known_ values in common, we know that both sets also have the same + // number of unknown values. + if len(setList1) != len(setList2) { + return false + } + + for i := range setList1 { + eq := setList1[i].RawEquals(setList2[i]) + if !eq { + return false + } + } - // Since we're intentionally ignoring our rule that two unknowns - // are never equal, we can cheat here. - // (This isn't 100% right since e.g. it will fail if the set contains - // numbers that are infinite, which DeepEqual can't compare properly. - // We're accepting that limitation for simplicity here, since this - // function is here primarily for testing.) - return reflect.DeepEqual(s1, s2) + // If we got here without returning false already then our sets are + // equal enough for RawEquals purposes. + return true case ty.IsMapType(): ety := ty.typeImpl.(typeMap).ElementTypeT @@ -572,8 +596,25 @@ func (val Value) Multiply(other Value) Value { return *shortCircuit } - ret := new(big.Float) + // find the larger precision of the arguments + resPrec := val.v.(*big.Float).Prec() + otherPrec := other.v.(*big.Float).Prec() + if otherPrec > resPrec { + resPrec = otherPrec + } + + // make sure we have enough precision for the product + ret := new(big.Float).SetPrec(512) ret.Mul(val.v.(*big.Float), other.v.(*big.Float)) + + // now reduce the precision back to the greater argument, or the minimum + // required by the product. + minPrec := ret.MinPrec() + if minPrec > resPrec { + resPrec = minPrec + } + ret.SetPrec(resPrec) + return NumberVal(ret) } @@ -645,11 +686,14 @@ func (val Value) Modulo(other Value) Value { // FIXME: This is a bit clumsy. Should come back later and see if there's a // more straightforward way to do this. rat := val.Divide(other) - ratFloorInt := &big.Int{} - rat.v.(*big.Float).Int(ratFloorInt) - work := (&big.Float{}).SetInt(ratFloorInt) + ratFloorInt, _ := rat.v.(*big.Float).Int(nil) + + // start with a copy of the original larger value so that we do not lose + // precision. + v := val.v.(*big.Float) + work := new(big.Float).Copy(v).SetInt(ratFloorInt) work.Mul(other.v.(*big.Float), work) - work.Sub(val.v.(*big.Float), work) + work.Sub(v, work) return NumberVal(work) } @@ -947,8 +991,7 @@ func (val Value) HasElement(elem Value) Value { // If the receiver is null then this function will panic. // // Note that Length is not supported for strings. To determine the length -// of a string, call AsString and take the length of the native Go string -// that is returned. +// of a string, use the Length function in funcs/stdlib. func (val Value) Length() Value { if val.IsMarked() { val, valMarks := val.Unmark() @@ -963,6 +1006,25 @@ func (val Value) Length() Value { if !val.IsKnown() { return UnknownVal(Number) } + if val.Type().IsSetType() { + // The Length rules are a little different for sets because if any + // unknown values are present then the values they are standing in for + // may or may not be equal to other elements in the set, and thus they + // may or may not coalesce with other elements and produce fewer + // items in the resulting set. + storeLength := int64(val.v.(set.Set).Length()) + if storeLength == 1 || val.IsWhollyKnown() { + // If our set is wholly known then we know its length. + // + // We also know the length if the physical store has only one + // element, even if that element is unknown, because there's + // nothing else in the set for it to coalesce with and a single + // unknown value cannot represent more than one known value. + return NumberIntVal(storeLength) + } + // Otherwise, we cannot predict the length. + return UnknownVal(Number) + } return NumberIntVal(int64(val.LengthInt())) } @@ -972,6 +1034,13 @@ func (val Value) Length() Value { // // This is an integration method provided for the convenience of code bridging // into Go's type system. +// +// For backward compatibility with an earlier implementation error, LengthInt's +// result can disagree with Length's result for any set containing unknown +// values. Length can potentially indicate the set's length is unknown in that +// case, whereas LengthInt will return the maximum possible length as if the +// unknown values were each a placeholder for a value not equal to any other +// value in the set. func (val Value) LengthInt() int { val.assertUnmarked() if val.Type().IsTupleType() { @@ -995,6 +1064,15 @@ func (val Value) LengthInt() int { return len(val.v.([]interface{})) case val.ty.IsSetType(): + // NOTE: This is technically not correct in cases where the set + // contains unknown values, because in that case we can't know how + // many known values those unknown values are standing in for -- they + // might coalesce with other values once known. + // + // However, this incorrect behavior is preserved for backward + // compatibility with callers that were relying on LengthInt rather + // than calling Length. Instead of panicking when a set contains an + // unknown value, LengthInt returns the largest possible length. return val.v.(set.Set).Length() case val.ty.IsMapType(): diff --git a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/walk.go b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/walk.go index a6943babef8..d17f48ccd1e 100644 --- a/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/walk.go +++ b/awsproviderlint/vendor/github.com/zclconf/go-cty/cty/walk.go @@ -61,6 +61,34 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { return nil } +// Transformer is the interface used to optionally transform values in a +// possibly-complex structure. The Enter method is called before traversing +// through a given path, and the Exit method is called when traversal of a +// path is complete. +// +// Use Enter when you want to transform a complex value before traversal +// (preorder), and Exit when you want to transform a value after traversal +// (postorder). +// +// The path passed to the given function may not be used after that function +// returns, since its backing array is re-used for other calls. +type Transformer interface { + Enter(Path, Value) (Value, error) + Exit(Path, Value) (Value, error) +} + +type postorderTransformer struct { + callback func(Path, Value) (Value, error) +} + +func (t *postorderTransformer) Enter(p Path, v Value) (Value, error) { + return v, nil +} + +func (t *postorderTransformer) Exit(p Path, v Value) (Value, error) { + return t.callback(p, v) +} + // Transform visits all of the values in a possibly-complex structure, // calling a given function for each value which has an opportunity to // replace that value. @@ -77,7 +105,7 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { // value constructor functions. An easy way to preserve invariants is to // ensure that the transform function never changes the value type. // -// The callback function my halt the walk altogether by +// The callback function may halt the walk altogether by // returning a non-nil error. If the returned error is about the element // currently being visited, it is recommended to use the provided path // value to produce a PathError describing that context. @@ -86,10 +114,23 @@ func walk(path Path, val Value, cb func(Path, Value) (bool, error)) error { // returns, since its backing array is re-used for other calls. func Transform(val Value, cb func(Path, Value) (Value, error)) (Value, error) { var path Path - return transform(path, val, cb) + return transform(path, val, &postorderTransformer{cb}) +} + +// TransformWithTransformer allows the caller to more closely control the +// traversal used for transformation. See the documentation for Transformer for +// more details. +func TransformWithTransformer(val Value, t Transformer) (Value, error) { + var path Path + return transform(path, val, t) } -func transform(path Path, val Value, cb func(Path, Value) (Value, error)) (Value, error) { +func transform(path Path, val Value, t Transformer) (Value, error) { + val, err := t.Enter(path, val) + if err != nil { + return DynamicVal, err + } + ty := val.Type() var newVal Value @@ -112,7 +153,7 @@ func transform(path Path, val Value, cb func(Path, Value) (Value, error)) (Value path := append(path, IndexStep{ Key: kv, }) - newEv, err := transform(path, ev, cb) + newEv, err := transform(path, ev, t) if err != nil { return DynamicVal, err } @@ -143,7 +184,7 @@ func transform(path Path, val Value, cb func(Path, Value) (Value, error)) (Value path := append(path, IndexStep{ Key: kv, }) - newEv, err := transform(path, ev, cb) + newEv, err := transform(path, ev, t) if err != nil { return DynamicVal, err } @@ -165,7 +206,7 @@ func transform(path Path, val Value, cb func(Path, Value) (Value, error)) (Value path := append(path, GetAttrStep{ Name: name, }) - newAV, err := transform(path, av, cb) + newAV, err := transform(path, av, t) if err != nil { return DynamicVal, err } @@ -178,5 +219,9 @@ func transform(path Path, val Value, cb func(Path, Value) (Value, error)) (Value newVal = val } - return cb(path, newVal) + newVal, err = t.Exit(path, newVal) + if err != nil { + return DynamicVal, err + } + return newVal, err } diff --git a/awsproviderlint/vendor/golang.org/x/oauth2/go.mod b/awsproviderlint/vendor/golang.org/x/oauth2/go.mod index b3457815528..2b13f0b34cb 100644 --- a/awsproviderlint/vendor/golang.org/x/oauth2/go.mod +++ b/awsproviderlint/vendor/golang.org/x/oauth2/go.mod @@ -3,8 +3,7 @@ module golang.org/x/oauth2 go 1.11 require ( - cloud.google.com/go v0.34.0 - golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e - golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 // indirect - google.golang.org/appengine v1.4.0 + cloud.google.com/go v0.65.0 + golang.org/x/net v0.0.0-20200822124328-c89045814202 + google.golang.org/appengine v1.6.6 ) diff --git a/awsproviderlint/vendor/golang.org/x/oauth2/go.sum b/awsproviderlint/vendor/golang.org/x/oauth2/go.sum index 6f0079b0d7f..eab5833c421 100644 --- a/awsproviderlint/vendor/golang.org/x/oauth2/go.sum +++ b/awsproviderlint/vendor/golang.org/x/oauth2/go.sum @@ -1,12 +1,361 @@ -cloud.google.com/go v0.34.0 h1:eOI3/cP2VTU6uZLDYAoic+eyzzB9YyGmJ7eIjl8rOPg= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0 h1:Dg9iHVQfrhq82rUNu9ZxUDrJLaxFUe/HlCVaLyRruq8= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/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-20181108010431-42b317875d0f/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-20190227155943-e225da77a7e6/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-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/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= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6 h1:lMO5rYAqUxkmaj76jAkRUvt5JZgFymx/+Q5Mzfivuhc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysis.go b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysis.go index 8c9977355c9..8c3c2e7ab95 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysis.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysis.go @@ -95,12 +95,13 @@ type Pass struct { Analyzer *Analyzer // the identity of the current analyzer // syntax and type information - Fset *token.FileSet // file position information - Files []*ast.File // the abstract syntax tree of each file - OtherFiles []string // names of non-Go files of this package - Pkg *types.Package // type information about the package - TypesInfo *types.Info // type information about the syntax trees - TypesSizes types.Sizes // function for computing sizes of types + Fset *token.FileSet // file position information + Files []*ast.File // the abstract syntax tree of each file + OtherFiles []string // names of non-Go files of this package + IgnoredFiles []string // names of ignored source files in this package + Pkg *types.Package // type information about the package + TypesInfo *types.Info // type information about the syntax trees + TypesSizes types.Sizes // function for computing sizes of types // Report reports a Diagnostic, a finding about a specific location // in the analyzed source code such as a potential mistake. diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysistest/analysistest.go b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysistest/analysistest.go index 5b22053d00d..ae5630239cb 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysistest/analysistest.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/analysistest/analysistest.go @@ -97,12 +97,22 @@ type Testing interface { func RunWithSuggestedFixes(t Testing, dir string, a *analysis.Analyzer, patterns ...string) []*Result { r := Run(t, dir, a, patterns...) - // file -> message -> edits - fileEdits := make(map[*token.File]map[string][]diff.TextEdit) - fileContents := make(map[*token.File][]byte) - - // Validate edits, prepare the fileEdits map and read the file contents. + // Process each result (package) separately, matching up the suggested + // fixes into a diff, which we will compare to the .golden file. We have + // to do this per-result in case a file appears in two packages, such as in + // packages with tests, where mypkg/a.go will appear in both mypkg and + // mypkg.test. In that case, the analyzer may suggest the same set of + // changes to a.go for each package. If we merge all the results, those + // changes get doubly applied, which will cause conflicts or mismatches. + // Validating the results separately means as long as the two analyses + // don't produce conflicting suggestions for a single file, everything + // should match up. for _, act := range r { + // file -> message -> edits + fileEdits := make(map[*token.File]map[string][]diff.TextEdit) + fileContents := make(map[*token.File][]byte) + + // Validate edits, prepare the fileEdits map and read the file contents. for _, diag := range act.Diagnostics { for _, sf := range diag.SuggestedFixes { for _, edit := range sf.TextEdits { @@ -142,78 +152,78 @@ func RunWithSuggestedFixes(t Testing, dir string, a *analysis.Analyzer, patterns } } } - } - for file, fixes := range fileEdits { - // Get the original file contents. - orig, ok := fileContents[file] - if !ok { - t.Errorf("could not find file contents for %s", file.Name()) - continue - } - - // Get the golden file and read the contents. - ar, err := txtar.ParseFile(file.Name() + ".golden") - if err != nil { - t.Errorf("error reading %s.golden: %v", file.Name(), err) - continue - } - - if len(ar.Files) > 0 { - // one virtual file per kind of suggested fix + for file, fixes := range fileEdits { + // Get the original file contents. + orig, ok := fileContents[file] + if !ok { + t.Errorf("could not find file contents for %s", file.Name()) + continue + } - if len(ar.Comment) != 0 { - // we allow either just the comment, or just virtual - // files, not both. it is not clear how "both" should - // behave. - t.Errorf("%s.golden has leading comment; we don't know what to do with it", file.Name()) + // Get the golden file and read the contents. + ar, err := txtar.ParseFile(file.Name() + ".golden") + if err != nil { + t.Errorf("error reading %s.golden: %v", file.Name(), err) continue } - for sf, edits := range fixes { - found := false - for _, vf := range ar.Files { - if vf.Name == sf { - found = true - out := diff.ApplyEdits(string(orig), edits) - // the file may contain multiple trailing - // newlines if the user places empty lines - // between files in the archive. normalize - // this to a single newline. - want := string(bytes.TrimRight(vf.Data, "\n")) + "\n" - formatted, err := format.Source([]byte(out)) - if err != nil { - continue - } - if want != string(formatted) { - d := myers.ComputeEdits("", want, string(formatted)) - t.Errorf("suggested fixes failed for %s:\n%s", file.Name(), diff.ToUnified(fmt.Sprintf("%s.golden [%s]", file.Name(), sf), "actual", want, d)) + if len(ar.Files) > 0 { + // one virtual file per kind of suggested fix + + if len(ar.Comment) != 0 { + // we allow either just the comment, or just virtual + // files, not both. it is not clear how "both" should + // behave. + t.Errorf("%s.golden has leading comment; we don't know what to do with it", file.Name()) + continue + } + + for sf, edits := range fixes { + found := false + for _, vf := range ar.Files { + if vf.Name == sf { + found = true + out := diff.ApplyEdits(string(orig), edits) + // the file may contain multiple trailing + // newlines if the user places empty lines + // between files in the archive. normalize + // this to a single newline. + want := string(bytes.TrimRight(vf.Data, "\n")) + "\n" + formatted, err := format.Source([]byte(out)) + if err != nil { + continue + } + if want != string(formatted) { + d := myers.ComputeEdits("", want, string(formatted)) + t.Errorf("suggested fixes failed for %s:\n%s", file.Name(), diff.ToUnified(fmt.Sprintf("%s.golden [%s]", file.Name(), sf), "actual", want, d)) + } + break } - break + } + if !found { + t.Errorf("no section for suggested fix %q in %s.golden", sf, file.Name()) } } - if !found { - t.Errorf("no section for suggested fix %q in %s.golden", sf, file.Name()) - } - } - } else { - // all suggested fixes are represented by a single file + } else { + // all suggested fixes are represented by a single file - var catchallEdits []diff.TextEdit - for _, edits := range fixes { - catchallEdits = append(catchallEdits, edits...) - } + var catchallEdits []diff.TextEdit + for _, edits := range fixes { + catchallEdits = append(catchallEdits, edits...) + } - out := diff.ApplyEdits(string(orig), catchallEdits) - want := string(ar.Comment) + out := diff.ApplyEdits(string(orig), catchallEdits) + want := string(ar.Comment) - formatted, err := format.Source([]byte(out)) - if err != nil { - continue - } - if want != string(formatted) { - d := myers.ComputeEdits("", want, string(formatted)) - t.Errorf("suggested fixes failed for %s:\n%s", file.Name(), diff.ToUnified(file.Name()+".golden", "actual", want, d)) + formatted, err := format.Source([]byte(out)) + if err != nil { + continue + } + if want != string(formatted) { + d := myers.ComputeEdits("", want, string(formatted)) + t.Errorf("suggested fixes failed for %s:\n%s", file.Name(), diff.ToUnified(file.Name()+".golden", "actual", want, d)) + } } } } @@ -320,7 +330,6 @@ func loadPackages(dir string, patterns ...string) ([]*packages.Package, error) { // specified by the contents of "// want ..." comments in the package's // source files, which must have been parsed with comments enabled. func check(t Testing, gopath string, pass *analysis.Pass, diagnostics []analysis.Diagnostic, facts map[types.Object][]analysis.Fact) { - type key struct { file string line int @@ -346,7 +355,7 @@ func check(t Testing, gopath string, pass *analysis.Pass, diagnostics []analysis } } - // Extract 'want' comments from Go files. + // Extract 'want' comments from parsed Go files. for _, f := range pass.Files { for _, cgroup := range f.Comments { for _, c := range cgroup.List { @@ -389,6 +398,16 @@ func check(t Testing, gopath string, pass *analysis.Pass, diagnostics []analysis linenum := 0 for _, line := range strings.Split(string(data), "\n") { linenum++ + + // Hack: treat a comment of the form "//...// want..." + // or "/*...// want... */ + // as if it starts at 'want'. + // This allows us to add comments on comments, + // as required when testing the buildtag analyzer. + if i := strings.Index(line, "// want"); i >= 0 { + line = line[i:] + } + if i := strings.Index(line, "//"); i >= 0 { line = line[i+len("//"):] processComment(filename, linenum, line) diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/doc.go b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/doc.go index fb17a0e4154..9fa3302dfbe 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/doc.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/doc.go @@ -121,13 +121,14 @@ package being analyzed, and provides operations to the Run function for reporting diagnostics and other information back to the driver. type Pass struct { - Fset *token.FileSet - Files []*ast.File - OtherFiles []string - Pkg *types.Package - TypesInfo *types.Info - ResultOf map[*Analyzer]interface{} - Report func(Diagnostic) + Fset *token.FileSet + Files []*ast.File + OtherFiles []string + IgnoredFiles []string + Pkg *types.Package + TypesInfo *types.Info + ResultOf map[*Analyzer]interface{} + Report func(Diagnostic) ... } @@ -139,6 +140,12 @@ files such as assembly that are part of this package. See the "asmdecl" or "buildtags" analyzers for examples of loading non-Go files and reporting diagnostics against them. +The IgnoredFiles field provides the names, but not the contents, +of ignored Go and non-Go source files that are not part of this package +with the current build configuration but may be part of other build +configurations. See the "buildtags" analyzer for an example of loading +and checking IgnoredFiles. + The ResultOf field provides the results computed by the analyzers required by this one, as expressed in its Analyzer.Requires field. The driver runs the required analyzers first and makes their results diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/internal/checker/checker.go b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/internal/checker/checker.go index 5ccfb163748..34f5b47d4cb 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/internal/checker/checker.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/internal/checker/checker.go @@ -639,6 +639,7 @@ func (act *action) execOnce() { Fset: act.pkg.Fset, Files: act.pkg.Syntax, OtherFiles: act.pkg.OtherFiles, + IgnoredFiles: act.pkg.IgnoredFiles, Pkg: act.pkg.Types, TypesInfo: act.pkg.TypesInfo, TypesSizes: act.pkg.TypesSizes, diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go index 2ed274949bd..713e1380ef1 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/analysis/unitchecker/unitchecker.go @@ -63,6 +63,7 @@ type Config struct { ImportPath string GoFiles []string NonGoFiles []string + IgnoredFiles []string ImportMap map[string]string PackageFile map[string]string Standard map[string]bool @@ -333,6 +334,7 @@ func run(fset *token.FileSet, cfg *Config, analyzers []*analysis.Analyzer) ([]re Fset: fset, Files: files, OtherFiles: cfg.NonGoFiles, + IgnoredFiles: cfg.IgnoredFiles, Pkg: pkg, TypesInfo: info, TypesSizes: tc.Sizes, diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go b/awsproviderlint/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go index dc6177c122d..35bc6a4127a 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/internal/packagesdriver/sizes.go @@ -39,7 +39,12 @@ func GetSizes(ctx context.Context, buildFlags, env []string, gocmdRunner *gocomm } if tool == "off" { - return GetSizesGolist(ctx, buildFlags, env, gocmdRunner, dir) + inv := gocommand.Invocation{ + BuildFlags: buildFlags, + Env: env, + WorkingDir: dir, + } + return GetSizesGolist(ctx, inv, gocmdRunner) } req, err := json.Marshal(struct { @@ -75,26 +80,17 @@ func GetSizes(ctx context.Context, buildFlags, env []string, gocmdRunner *gocomm return response.Sizes, nil } -func GetSizesGolist(ctx context.Context, buildFlags, env []string, gocmdRunner *gocommand.Runner, dir string) (types.Sizes, error) { - inv := gocommand.Invocation{ - Verb: "list", - Args: []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"}, - Env: env, - BuildFlags: buildFlags, - WorkingDir: dir, - } +func GetSizesGolist(ctx context.Context, inv gocommand.Invocation, gocmdRunner *gocommand.Runner) (types.Sizes, error) { + inv.Verb = "list" + inv.Args = []string{"-f", "{{context.GOARCH}} {{context.Compiler}}", "--", "unsafe"} stdout, stderr, friendlyErr, rawErr := gocmdRunner.RunRaw(ctx, inv) var goarch, compiler string if rawErr != nil { if strings.Contains(rawErr.Error(), "cannot find main module") { // User's running outside of a module. All bets are off. Get GOARCH and guess compiler is gc. // TODO(matloob): Is this a problem in practice? - inv := gocommand.Invocation{ - Verb: "env", - Args: []string{"GOARCH"}, - Env: env, - WorkingDir: dir, - } + inv.Verb = "env" + inv.Args = []string{"GOARCH"} envout, enverr := gocmdRunner.Run(ctx, inv) if enverr != nil { return nil, enverr diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist.go b/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist.go index bc04503c10a..81381fa1cce 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist.go @@ -10,6 +10,7 @@ import ( "encoding/json" "fmt" "go/types" + "io/ioutil" "log" "os" "os/exec" @@ -91,7 +92,7 @@ type golistState struct { goVersionOnce sync.Once goVersionError error - goVersion string // third field of 'go version' + goVersion int // The X in Go 1.X. // vendorDirs caches the (non)existence of vendor directories. vendorDirs map[string]bool @@ -139,6 +140,12 @@ func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { response := newDeduper() + state := &golistState{ + cfg: cfg, + ctx: ctx, + vendorDirs: map[string]bool{}, + } + // Fill in response.Sizes asynchronously if necessary. var sizeserr error var sizeswg sync.WaitGroup @@ -146,19 +153,13 @@ func goListDriver(cfg *Config, patterns ...string) (*driverResponse, error) { sizeswg.Add(1) go func() { var sizes types.Sizes - sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, cfg.BuildFlags, cfg.Env, cfg.gocmdRunner, cfg.Dir) + sizes, sizeserr = packagesdriver.GetSizesGolist(ctx, state.cfgInvocation(), cfg.gocmdRunner) // types.SizesFor always returns nil or a *types.StdSizes. response.dr.Sizes, _ = sizes.(*types.StdSizes) sizeswg.Done() }() } - state := &golistState{ - cfg: cfg, - ctx: ctx, - vendorDirs: map[string]bool{}, - } - // Determine files requested in contains patterns var containFiles []string restPatterns := make([]string, 0, len(patterns)) @@ -208,56 +209,58 @@ extractQueries: } } - modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) - if err != nil { - return nil, err - } + // Only use go/packages' overlay processing if we're using a Go version + // below 1.16. Otherwise, go list handles it. + if goVersion, err := state.getGoVersion(); err == nil && goVersion < 16 { + modifiedPkgs, needPkgs, err := state.processGolistOverlay(response) + if err != nil { + return nil, err + } - var containsCandidates []string - if len(containFiles) > 0 { - containsCandidates = append(containsCandidates, modifiedPkgs...) - containsCandidates = append(containsCandidates, needPkgs...) - } - if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { - return nil, err - } - // Check candidate packages for containFiles. - if len(containFiles) > 0 { - for _, id := range containsCandidates { - pkg, ok := response.seenPackages[id] - if !ok { - response.addPackage(&Package{ - ID: id, - Errors: []Error{ - { + var containsCandidates []string + if len(containFiles) > 0 { + containsCandidates = append(containsCandidates, modifiedPkgs...) + containsCandidates = append(containsCandidates, needPkgs...) + } + if err := state.addNeededOverlayPackages(response, needPkgs); err != nil { + return nil, err + } + // Check candidate packages for containFiles. + if len(containFiles) > 0 { + for _, id := range containsCandidates { + pkg, ok := response.seenPackages[id] + if !ok { + response.addPackage(&Package{ + ID: id, + Errors: []Error{{ Kind: ListError, Msg: fmt.Sprintf("package %s expected but not seen", id), - }, - }, - }) - continue - } - for _, f := range containFiles { - for _, g := range pkg.GoFiles { - if sameFile(f, g) { - response.addRoot(id) + }}, + }) + continue + } + for _, f := range containFiles { + for _, g := range pkg.GoFiles { + if sameFile(f, g) { + response.addRoot(id) + } } } } } - } - // Add root for any package that matches a pattern. This applies only to - // packages that are modified by overlays, since they are not added as - // roots automatically. - for _, pattern := range restPatterns { - match := matchPattern(pattern) - for _, pkgID := range modifiedPkgs { - pkg, ok := response.seenPackages[pkgID] - if !ok { - continue - } - if match(pkg.PkgPath) { - response.addRoot(pkg.ID) + // Add root for any package that matches a pattern. This applies only to + // packages that are modified by overlays, since they are not added as + // roots automatically. + for _, pattern := range restPatterns { + match := matchPattern(pattern) + for _, pkgID := range modifiedPkgs { + pkg, ok := response.seenPackages[pkgID] + if !ok { + continue + } + if match(pkg.PkgPath) { + response.addRoot(pkg.ID) + } } } } @@ -381,32 +384,34 @@ func (state *golistState) adhocPackage(pattern, query string) (*driverResponse, // Fields must match go list; // see $GOROOT/src/cmd/go/internal/load/pkg.go. type jsonPackage struct { - ImportPath string - Dir string - Name string - Export string - GoFiles []string - CompiledGoFiles []string - CFiles []string - CgoFiles []string - CXXFiles []string - MFiles []string - HFiles []string - FFiles []string - SFiles []string - SwigFiles []string - SwigCXXFiles []string - SysoFiles []string - Imports []string - ImportMap map[string]string - Deps []string - Module *Module - TestGoFiles []string - TestImports []string - XTestGoFiles []string - XTestImports []string - ForTest string // q in a "p [q.test]" package, else "" - DepOnly bool + ImportPath string + Dir string + Name string + Export string + GoFiles []string + CompiledGoFiles []string + IgnoredGoFiles []string + IgnoredOtherFiles []string + CFiles []string + CgoFiles []string + CXXFiles []string + MFiles []string + HFiles []string + FFiles []string + SFiles []string + SwigFiles []string + SwigCXXFiles []string + SysoFiles []string + Imports []string + ImportMap map[string]string + Deps []string + Module *Module + TestGoFiles []string + TestImports []string + XTestGoFiles []string + XTestImports []string + ForTest string // q in a "p [q.test]" package, else "" + DepOnly bool Error *jsonPackageError } @@ -558,6 +563,7 @@ func (state *golistState) createDriverResponse(words ...string) (*driverResponse GoFiles: absJoin(p.Dir, p.GoFiles, p.CgoFiles), CompiledGoFiles: absJoin(p.Dir, p.CompiledGoFiles), OtherFiles: absJoin(p.Dir, otherFiles(p)...), + IgnoredFiles: absJoin(p.Dir, p.IgnoredGoFiles, p.IgnoredOtherFiles), forTest: p.ForTest, Module: p.Module, } @@ -728,7 +734,7 @@ func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { // On Go 1.14 and earlier, only add filenames from errors if the import stack is empty. // The import stack behaves differently for these versions than newer Go versions. - if strings.HasPrefix(goV, "go1.13") || strings.HasPrefix(goV, "go1.14") { + if goV < 15 { return len(p.Error.ImportStack) == 0 } @@ -739,31 +745,9 @@ func (state *golistState) shouldAddFilenameFromError(p *jsonPackage) bool { return len(p.Error.ImportStack) == 0 || p.Error.ImportStack[len(p.Error.ImportStack)-1] == p.ImportPath } -func (state *golistState) getGoVersion() (string, error) { +func (state *golistState) getGoVersion() (int, error) { state.goVersionOnce.Do(func() { - var b *bytes.Buffer - // Invoke go version. Don't use invokeGo because it will supply build flags, and - // go version doesn't expect build flags. - inv := gocommand.Invocation{ - Verb: "version", - Env: state.cfg.Env, - Logf: state.cfg.Logf, - } - gocmdRunner := state.cfg.gocmdRunner - if gocmdRunner == nil { - gocmdRunner = &gocommand.Runner{} - } - b, _, _, state.goVersionError = gocmdRunner.RunRaw(state.cfg.Context, inv) - if state.goVersionError != nil { - return - } - - sp := strings.Split(b.String(), " ") - if len(sp) < 3 { - state.goVersionError = fmt.Errorf("go version output: expected 'go version ', got '%s'", b.String()) - return - } - state.goVersion = sp[2] + state.goVersion, state.goVersionError = gocommand.GoVersion(state.ctx, state.cfgInvocation(), state.cfg.gocmdRunner) }) return state.goVersion, state.goVersionError } @@ -836,18 +820,46 @@ func golistargs(cfg *Config, words []string) []string { return fullargs } -// invokeGo returns the stdout of a go command invocation. -func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { +// cfgInvocation returns an Invocation that reflects cfg's settings. +func (state *golistState) cfgInvocation() gocommand.Invocation { cfg := state.cfg - - inv := gocommand.Invocation{ - Verb: verb, - Args: args, + return gocommand.Invocation{ BuildFlags: cfg.BuildFlags, + ModFile: cfg.modFile, + ModFlag: cfg.modFlag, Env: cfg.Env, Logf: cfg.Logf, WorkingDir: cfg.Dir, } +} + +// invokeGo returns the stdout of a go command invocation. +func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, error) { + cfg := state.cfg + + inv := state.cfgInvocation() + + // For Go versions 1.16 and above, `go list` accepts overlays directly via + // the -overlay flag. Set it, if it's available. + // + // The check for "list" is not necessarily required, but we should avoid + // getting the go version if possible. + if verb == "list" { + goVersion, err := state.getGoVersion() + if err != nil { + return nil, err + } + if goVersion >= 16 { + filename, cleanup, err := state.writeOverlays() + if err != nil { + return nil, err + } + defer cleanup() + inv.Overlay = filename + } + } + inv.Verb = verb + inv.Args = args gocmdRunner := cfg.gocmdRunner if gocmdRunner == nil { gocmdRunner = &gocommand.Runner{} @@ -987,6 +999,67 @@ func (state *golistState) invokeGo(verb string, args ...string) (*bytes.Buffer, return stdout, nil } +// OverlayJSON is the format overlay files are expected to be in. +// The Replace map maps from overlaid paths to replacement paths: +// the Go command will forward all reads trying to open +// each overlaid path to its replacement path, or consider the overlaid +// path not to exist if the replacement path is empty. +// +// From golang/go#39958. +type OverlayJSON struct { + Replace map[string]string `json:"replace,omitempty"` +} + +// writeOverlays writes out files for go list's -overlay flag, as described +// above. +func (state *golistState) writeOverlays() (filename string, cleanup func(), err error) { + // Do nothing if there are no overlays in the config. + if len(state.cfg.Overlay) == 0 { + return "", func() {}, nil + } + dir, err := ioutil.TempDir("", "gopackages-*") + if err != nil { + return "", nil, err + } + // The caller must clean up this directory, unless this function returns an + // error. + cleanup = func() { + os.RemoveAll(dir) + } + defer func() { + if err != nil { + cleanup() + } + }() + overlays := map[string]string{} + for k, v := range state.cfg.Overlay { + // Create a unique filename for the overlaid files, to avoid + // creating nested directories. + noSeparator := strings.Join(strings.Split(filepath.ToSlash(k), "/"), "") + f, err := ioutil.TempFile(dir, fmt.Sprintf("*-%s", noSeparator)) + if err != nil { + return "", func() {}, err + } + if _, err := f.Write(v); err != nil { + return "", func() {}, err + } + if err := f.Close(); err != nil { + return "", func() {}, err + } + overlays[k] = f.Name() + } + b, err := json.Marshal(OverlayJSON{Replace: overlays}) + if err != nil { + return "", func() {}, err + } + // Write out the overlay file that contains the filepath mappings. + filename = filepath.Join(dir, "overlay.json") + if err := ioutil.WriteFile(filename, b, 0665); err != nil { + return "", func() {}, err + } + return filename, cleanup, nil +} + func containsGoFile(s []string) bool { for _, f := range s { if strings.HasSuffix(f, ".go") { diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist_overlay.go b/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist_overlay.go index 885aec3ec31..de2c1dc5793 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist_overlay.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/packages/golist_overlay.go @@ -1,3 +1,7 @@ +// Copyright 2018 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + package packages import ( diff --git a/awsproviderlint/vendor/golang.org/x/tools/go/packages/packages.go b/awsproviderlint/vendor/golang.org/x/tools/go/packages/packages.go index 04053f1e7d4..38475e8712a 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/go/packages/packages.go +++ b/awsproviderlint/vendor/golang.org/x/tools/go/packages/packages.go @@ -144,6 +144,12 @@ type Config struct { // the build system's query tool. BuildFlags []string + // modFile will be used for -modfile in go command invocations. + modFile string + + // modFlag will be used for -modfile in go command invocations. + modFlag string + // Fset provides source position information for syntax trees and types. // If Fset is nil, Load will use a new fileset, but preserve Fset's value. Fset *token.FileSet @@ -289,6 +295,11 @@ type Package struct { // including assembly, C, C++, Fortran, Objective-C, SWIG, and so on. OtherFiles []string + // IgnoredFiles lists source files that are not part of the package + // using the current build configuration but that might be part of + // the package using other build configurations. + IgnoredFiles []string + // ExportFile is the absolute path to a file containing type // information for the package as provided by the build system. ExportFile string @@ -361,6 +372,12 @@ func init() { packagesinternal.SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) { config.(*Config).gocmdRunner = runner } + packagesinternal.SetModFile = func(config interface{}, value string) { + config.(*Config).modFile = value + } + packagesinternal.SetModFlag = func(config interface{}, value string) { + config.(*Config).modFlag = value + } packagesinternal.TypecheckCgo = int(typecheckCgo) } @@ -404,6 +421,7 @@ type flatPackage struct { GoFiles []string `json:",omitempty"` CompiledGoFiles []string `json:",omitempty"` OtherFiles []string `json:",omitempty"` + IgnoredFiles []string `json:",omitempty"` ExportFile string `json:",omitempty"` Imports map[string]string `json:",omitempty"` } @@ -426,6 +444,7 @@ func (p *Package) MarshalJSON() ([]byte, error) { GoFiles: p.GoFiles, CompiledGoFiles: p.CompiledGoFiles, OtherFiles: p.OtherFiles, + IgnoredFiles: p.IgnoredFiles, ExportFile: p.ExportFile, } if len(p.Imports) > 0 { @@ -712,7 +731,8 @@ func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) { result[i] = lpkg.Package } for i := range ld.pkgs { - // Clear all unrequested fields, for extra de-Hyrum-ization. + // Clear all unrequested fields, + // to catch programs that use more than they request. if ld.requestedMode&NeedName == 0 { ld.pkgs[i].Name = "" ld.pkgs[i].PkgPath = "" @@ -720,6 +740,7 @@ func (ld *loader) refine(roots []string, list ...*Package) ([]*Package, error) { if ld.requestedMode&NeedFiles == 0 { ld.pkgs[i].GoFiles = nil ld.pkgs[i].OtherFiles = nil + ld.pkgs[i].IgnoredFiles = nil } if ld.requestedMode&NeedCompiledGoFiles == 0 { ld.pkgs[i].CompiledGoFiles = nil diff --git a/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/invoke.go b/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/invoke.go index f516e17623d..8ba2253838c 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/invoke.go +++ b/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/invoke.go @@ -130,6 +130,9 @@ type Invocation struct { Verb string Args []string BuildFlags []string + ModFlag string + ModFile string + Overlay string Env []string WorkingDir string Logf func(format string, args ...interface{}) @@ -158,17 +161,41 @@ func (i *Invocation) run(ctx context.Context, stdout, stderr io.Writer) error { } goArgs := []string{i.Verb} + + appendModFile := func() { + if i.ModFile != "" { + goArgs = append(goArgs, "-modfile="+i.ModFile) + } + } + appendModFlag := func() { + if i.ModFlag != "" { + goArgs = append(goArgs, "-mod="+i.ModFlag) + } + } + appendOverlayFlag := func() { + if i.Overlay != "" { + goArgs = append(goArgs, "-overlay="+i.Overlay) + } + } + switch i.Verb { + case "env", "version": + goArgs = append(goArgs, i.Args...) case "mod": - // mod needs the sub-verb before build flags. + // mod needs the sub-verb before flags. goArgs = append(goArgs, i.Args[0]) - goArgs = append(goArgs, i.BuildFlags...) + appendModFile() goArgs = append(goArgs, i.Args[1:]...) - case "env": - // env doesn't take build flags. + case "get": + goArgs = append(goArgs, i.BuildFlags...) + appendModFile() goArgs = append(goArgs, i.Args...) - default: + + default: // notably list and build. goArgs = append(goArgs, i.BuildFlags...) + appendModFile() + appendModFlag() + appendOverlayFlag() goArgs = append(goArgs, i.Args...) } cmd := exec.Command("go", goArgs...) diff --git a/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/version.go b/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/version.go new file mode 100644 index 00000000000..60d45ac0e64 --- /dev/null +++ b/awsproviderlint/vendor/golang.org/x/tools/internal/gocommand/version.go @@ -0,0 +1,40 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package gocommand + +import ( + "context" + "fmt" + "strings" +) + +// GoVersion checks the go version by running "go list" with modules off. +// It returns the X in Go 1.X. +func GoVersion(ctx context.Context, inv Invocation, r *Runner) (int, error) { + inv.Verb = "list" + inv.Args = []string{"-e", "-f", `{{context.ReleaseTags}}`} + inv.Env = append(append([]string{}, inv.Env...), "GO111MODULE=off") + // Unset any unneeded flags. + inv.ModFile = "" + inv.ModFlag = "" + stdoutBytes, err := r.Run(ctx, inv) + if err != nil { + return 0, err + } + stdout := stdoutBytes.String() + if len(stdout) < 3 { + return 0, fmt.Errorf("bad ReleaseTags output: %q", stdout) + } + // Split up "[go1.1 go1.15]" + tags := strings.Fields(stdout[1 : len(stdout)-2]) + for i := len(tags) - 1; i >= 0; i-- { + var version int + if _, err := fmt.Sscanf(tags[i], "go1.%d", &version); err != nil { + continue + } + return version, nil + } + return 0, fmt.Errorf("no parseable ReleaseTags in %v", tags) +} diff --git a/awsproviderlint/vendor/golang.org/x/tools/internal/imports/fix.go b/awsproviderlint/vendor/golang.org/x/tools/internal/imports/fix.go index 675d16c873b..d859617b774 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/internal/imports/fix.go +++ b/awsproviderlint/vendor/golang.org/x/tools/internal/imports/fix.go @@ -83,7 +83,7 @@ type ImportFix struct { IdentName string // FixType is the type of fix this is (AddImport, DeleteImport, SetImportName). FixType ImportFixType - Relevance int // see pkg + Relevance float64 // see pkg } // An ImportInfo represents a single import statement. @@ -592,9 +592,9 @@ func getFixes(fset *token.FileSet, f *ast.File, filename string, env *ProcessEnv return fixes, nil } -// Highest relevance, used for the standard library. Chosen arbitrarily to -// match pre-existing gopls code. -const MaxRelevance = 7 +// MaxRelevance is the highest relevance, used for the standard library. +// Chosen arbitrarily to match pre-existing gopls code. +const MaxRelevance = 7.0 // getCandidatePkgs works with the passed callback to find all acceptable packages. // It deduplicates by import path, and uses a cached stdlib rather than reading @@ -607,6 +607,10 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena if err != nil { return err } + + var mu sync.Mutex // to guard asynchronous access to dupCheck + dupCheck := map[string]struct{}{} + // Start off with the standard library. for importPath, exports := range stdlib { p := &pkg{ @@ -615,14 +619,12 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena packageName: path.Base(importPath), relevance: MaxRelevance, } + dupCheck[importPath] = struct{}{} if notSelf(p) && wrappedCallback.dirFound(p) && wrappedCallback.packageNameLoaded(p) { wrappedCallback.exportsLoaded(p, exports) } } - var mu sync.Mutex - dupCheck := map[string]struct{}{} - scanFilter := &scanCallback{ rootFound: func(root gopathwalk.Root) bool { // Exclude goroot results -- getting them is relatively expensive, not cached, @@ -658,8 +660,8 @@ func getCandidatePkgs(ctx context.Context, wrappedCallback *scanCallback, filena return resolver.scan(ctx, scanFilter) } -func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map[string]int, error) { - result := make(map[string]int) +func ScoreImportPaths(ctx context.Context, env *ProcessEnv, paths []string) (map[string]float64, error) { + result := make(map[string]float64) resolver, err := env.GetResolver() if err != nil { return nil, err @@ -802,6 +804,8 @@ type ProcessEnv struct { GocmdRunner *gocommand.Runner BuildFlags []string + ModFlag string + ModFile string // Env overrides the OS environment, and can be used to specify // GOPROXY, GO111MODULE, etc. PATH cannot be set here, because @@ -995,7 +999,7 @@ type Resolver interface { // loadExports may be called concurrently. loadExports(ctx context.Context, pkg *pkg, includeTest bool) (string, []string, error) // scoreImportPath returns the relevance for an import path. - scoreImportPath(ctx context.Context, path string) int + scoreImportPath(ctx context.Context, path string) float64 ClearForNewScan() } @@ -1260,10 +1264,10 @@ func packageDirToName(dir string) (packageName string, err error) { } type pkg struct { - dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") - importPathShort string // vendorless import path ("net/http", "a/b") - packageName string // package name loaded from source if requested - relevance int // a weakly-defined score of how relevant a package is. 0 is most relevant. + dir string // absolute file path to pkg directory ("/usr/lib/go/src/net/http") + importPathShort string // vendorless import path ("net/http", "a/b") + packageName string // package name loaded from source if requested + relevance float64 // a weakly-defined score of how relevant a package is. 0 is most relevant. } type pkgDistance struct { @@ -1389,7 +1393,7 @@ func (r *gopathResolver) scan(ctx context.Context, callback *scanCallback) error return nil } -func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) int { +func (r *gopathResolver) scoreImportPath(ctx context.Context, path string) float64 { if _, ok := stdlib[path]; ok { return MaxRelevance } diff --git a/awsproviderlint/vendor/golang.org/x/tools/internal/imports/mod.go b/awsproviderlint/vendor/golang.org/x/tools/internal/imports/mod.go index 94880d61604..8a83613c572 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/internal/imports/mod.go +++ b/awsproviderlint/vendor/golang.org/x/tools/internal/imports/mod.go @@ -59,6 +59,8 @@ func (r *ModuleResolver) init() error { } inv := gocommand.Invocation{ BuildFlags: r.env.BuildFlags, + ModFlag: r.env.ModFlag, + ModFile: r.env.ModFile, Env: r.env.env(), Logf: r.env.Logf, WorkingDir: r.env.WorkingDir, @@ -487,7 +489,7 @@ func (r *ModuleResolver) scan(ctx context.Context, callback *scanCallback) error return nil } -func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) int { +func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) float64 { if _, ok := stdlib[path]; ok { return MaxRelevance } @@ -495,17 +497,31 @@ func (r *ModuleResolver) scoreImportPath(ctx context.Context, path string) int { return modRelevance(mod) } -func modRelevance(mod *gocommand.ModuleJSON) int { +func modRelevance(mod *gocommand.ModuleJSON) float64 { + var relevance float64 switch { case mod == nil: // out of scope return MaxRelevance - 4 case mod.Indirect: - return MaxRelevance - 3 + relevance = MaxRelevance - 3 case !mod.Main: - return MaxRelevance - 2 + relevance = MaxRelevance - 2 default: - return MaxRelevance - 1 // main module ties with stdlib + relevance = MaxRelevance - 1 // main module ties with stdlib } + + _, versionString, ok := module.SplitPathVersion(mod.Path) + if ok { + index := strings.Index(versionString, "v") + if index == -1 { + return relevance + } + if versionNumber, err := strconv.ParseFloat(versionString[index+1:], 64); err == nil { + relevance += versionNumber / 1000 + } + } + + return relevance } // canonicalize gets the result of canonicalizing the packages using the results diff --git a/awsproviderlint/vendor/golang.org/x/tools/internal/packagesinternal/packages.go b/awsproviderlint/vendor/golang.org/x/tools/internal/packagesinternal/packages.go index 2c4527f2436..1335a5eed8a 100644 --- a/awsproviderlint/vendor/golang.org/x/tools/internal/packagesinternal/packages.go +++ b/awsproviderlint/vendor/golang.org/x/tools/internal/packagesinternal/packages.go @@ -12,3 +12,6 @@ var GetGoCmdRunner = func(config interface{}) *gocommand.Runner { return nil } var SetGoCmdRunner = func(config interface{}, runner *gocommand.Runner) {} var TypecheckCgo int + +var SetModFlag = func(config interface{}, value string) {} +var SetModFile = func(config interface{}, value string) {} diff --git a/awsproviderlint/vendor/google.golang.org/api/internal/creds.go b/awsproviderlint/vendor/google.golang.org/api/internal/creds.go index 75e9445e1b3..dc6d50e96aa 100644 --- a/awsproviderlint/vendor/google.golang.org/api/internal/creds.go +++ b/awsproviderlint/vendor/google.golang.org/api/internal/creds.go @@ -11,6 +11,7 @@ import ( "io/ioutil" "golang.org/x/oauth2" + "google.golang.org/api/internal/impersonate" "golang.org/x/oauth2/google" ) @@ -18,6 +19,17 @@ import ( // Creds returns credential information obtained from DialSettings, or if none, then // it returns default credential information. func Creds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { + creds, err := baseCreds(ctx, ds) + if err != nil { + return nil, err + } + if ds.ImpersonationConfig != nil { + return impersonateCredentials(ctx, creds, ds) + } + return creds, nil +} + +func baseCreds(ctx context.Context, ds *DialSettings) (*google.Credentials, error) { if ds.Credentials != nil { return ds.Credentials, nil } @@ -103,3 +115,17 @@ func QuotaProjectFromCreds(cred *google.Credentials) string { } return v.QuotaProject } + +func impersonateCredentials(ctx context.Context, creds *google.Credentials, ds *DialSettings) (*google.Credentials, error) { + if len(ds.ImpersonationConfig.Scopes) == 0 { + ds.ImpersonationConfig.Scopes = ds.Scopes + } + ts, err := impersonate.TokenSource(ctx, creds.TokenSource, ds.ImpersonationConfig) + if err != nil { + return nil, err + } + return &google.Credentials{ + TokenSource: ts, + ProjectID: creds.ProjectID, + }, nil +} diff --git a/awsproviderlint/vendor/google.golang.org/api/internal/gensupport/media.go b/awsproviderlint/vendor/google.golang.org/api/internal/gensupport/media.go index 0288cc30427..0460ab59406 100644 --- a/awsproviderlint/vendor/google.golang.org/api/internal/gensupport/media.go +++ b/awsproviderlint/vendor/google.golang.org/api/internal/gensupport/media.go @@ -55,7 +55,7 @@ func (cs *contentSniffer) Read(p []byte) (n int, err error) { return cs.r.Read(p) } -// ContentType returns the sniffed content type, and whether the content type was succesfully sniffed. +// ContentType returns the sniffed content type, and whether the content type was successfully sniffed. func (cs *contentSniffer) ContentType() (string, bool) { if cs.sniffed { return cs.ctype, cs.ctype != "" @@ -88,7 +88,7 @@ func DetermineContentType(media io.Reader, ctype string) (io.Reader, string) { return media, ctype } - // For backwards compatability, allow clients to set content + // For backwards compatibility, allow clients to set content // type by providing a ContentTyper for media. if typer, ok := media.(googleapi.ContentTyper); ok { return media, typer.ContentType() diff --git a/awsproviderlint/vendor/google.golang.org/api/internal/impersonate/impersonate.go b/awsproviderlint/vendor/google.golang.org/api/internal/impersonate/impersonate.go new file mode 100644 index 00000000000..b465bbcd12e --- /dev/null +++ b/awsproviderlint/vendor/google.golang.org/api/internal/impersonate/impersonate.go @@ -0,0 +1,128 @@ +// Copyright 2020 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package impersonate is used to impersonate Google Credentials. +package impersonate + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "io/ioutil" + "net/http" + "time" + + "golang.org/x/oauth2" +) + +// Config for generating impersonated credentials. +type Config struct { + // Target is the service account to impersonate. Required. + Target string + // Scopes the impersonated credential should have. Required. + Scopes []string + // Delegates are the service accounts in a delegation chain. Each service + // account must be granted roles/iam.serviceAccountTokenCreator on the next + // service account in the chain. Optional. + Delegates []string +} + +// TokenSource returns an impersonated TokenSource configured with the provided +// config using ts as the base credential provider for making requests. +func TokenSource(ctx context.Context, ts oauth2.TokenSource, config *Config) (oauth2.TokenSource, error) { + if len(config.Scopes) == 0 { + return nil, fmt.Errorf("impersonate: scopes must be provided") + } + its := impersonatedTokenSource{ + ctx: ctx, + ts: ts, + name: formatIAMServiceAccountName(config.Target), + // Default to the longest acceptable value of one hour as the token will + // be refreshed automatically. + lifetime: "3600s", + } + + its.delegates = make([]string, len(config.Delegates)) + for i, v := range config.Delegates { + its.delegates[i] = formatIAMServiceAccountName(v) + } + its.scopes = make([]string, len(config.Scopes)) + copy(its.scopes, config.Scopes) + + return oauth2.ReuseTokenSource(nil, its), nil +} + +func formatIAMServiceAccountName(name string) string { + return fmt.Sprintf("projects/-/serviceAccounts/%s", name) +} + +type generateAccessTokenReq struct { + Delegates []string `json:"delegates,omitempty"` + Lifetime string `json:"lifetime,omitempty"` + Scope []string `json:"scope,omitempty"` +} + +type generateAccessTokenResp struct { + AccessToken string `json:"accessToken"` + ExpireTime string `json:"expireTime"` +} + +type impersonatedTokenSource struct { + ctx context.Context + ts oauth2.TokenSource + + name string + lifetime string + scopes []string + delegates []string +} + +// Token returns an impersonated Token. +func (i impersonatedTokenSource) Token() (*oauth2.Token, error) { + hc := oauth2.NewClient(i.ctx, i.ts) + reqBody := generateAccessTokenReq{ + Delegates: i.delegates, + Lifetime: i.lifetime, + Scope: i.scopes, + } + b, err := json.Marshal(reqBody) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to marshal request: %v", err) + } + url := fmt.Sprintf("https://iamcredentials.googleapis.com/v1/%s:generateAccessToken", i.name) + req, err := http.NewRequest("POST", url, bytes.NewReader(b)) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to create request: %v", err) + } + req = req.WithContext(i.ctx) + req.Header.Set("Content-Type", "application/json") + + resp, err := hc.Do(req) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to generate access token: %v", err) + } + defer resp.Body.Close() + body, err := ioutil.ReadAll(io.LimitReader(resp.Body, 1<<20)) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to read body: %v", err) + } + if c := resp.StatusCode; c < 200 || c > 299 { + return nil, fmt.Errorf("impersonate: status code %d: %s", c, body) + } + + var accessTokenResp generateAccessTokenResp + if err := json.Unmarshal(body, &accessTokenResp); err != nil { + return nil, fmt.Errorf("impersonate: unable to parse response: %v", err) + } + expiry, err := time.Parse(time.RFC3339, accessTokenResp.ExpireTime) + if err != nil { + return nil, fmt.Errorf("impersonate: unable to parse expiry: %v", err) + } + return &oauth2.Token{ + AccessToken: accessTokenResp.AccessToken, + Expiry: expiry, + }, nil +} diff --git a/awsproviderlint/vendor/google.golang.org/api/internal/service-account.json b/awsproviderlint/vendor/google.golang.org/api/internal/service-account.json deleted file mode 100644 index 6b36a92961e..00000000000 --- a/awsproviderlint/vendor/google.golang.org/api/internal/service-account.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "type": "service_account", - "project_id": "project_id", - "private_key_id": "private_key_id", - "private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzd9ZdbPLAR4/g\nj+Rodu15kEasMpxf/Mz+gKRb2fmgR2Y18Y/iRBYZ4SkmF2pBSfzvwE/aTCzSPBGl\njHhPzohXnSN029eWoItmxVONlqCbR29pD07aLzv08LGeIGdHIEdhVjhvRwTkYZIF\ndXmlHNDRUU/EbJN9D+3ahw22BNnC4PaDgfIWTs3xIlTCSf2rL39I4DSNLTS/LzxK\n/XrQfBMtfwMWwyQaemXbc7gRgzOy8L56wa1W1zyXx99th97j1bLnoAXBGplhB4Co\n25ohyDAuhxRm+XGMEaO0Mzo7u97kvhj48a569RH1QRhOf7EBf60jO4h5eOmfi5P5\nPV3l7041AgMBAAECggEAEZ0RTNoEeRqM5F067YW+iM/AH+ZXspP9Cn1VpC4gcbqQ\nLXsnw+0qvh97CmIB66Z3TJBzRdl0DK4YjUbcB/kdKHwjnrR01DOtesijCqJd4N+B\n762w73jzSXbV9872U+S3HLZ5k3JE6KUqz55X8fyCAgkY6w4862lEzs2yasrPFHEV\nRoQp3PM0Miif8R3hGDhOWcHxcobullthG6JHAQFfc1ctwEjZI4TK0iWqlzfWGyKN\nT9UgvjUDud5cGvS9el0AiLN6keAf77tcPn1zetUVhxN1KN4bVAm1Q+6O8esl63Rj\n7JXpHzxaRnit9S6/aH/twHsGGtLg5Puw6jey6xs4AQKBgQD2JNy1wzewCRkD+jug\n8CHbJ+LIJVRNIaWa/RK1QD8/UjmFPkIzRQSF3AKC5mRAWSa2FL3yVK3N/DD7hazW\n85XSBB7IDcnoJnA9SkUeWwqQGkDx3EntlU3gX8Kn/+ofF8O9jLXxAa901MAVXVuf\n5YDzrl4PNE3bFnPCdiNmSdRfhQKBgQC6p4DsCpwqbeTu9f5ak9VW/fQP47Fgt+Mf\nwGjBnKP5PbbNJpHCfamF7jqSRH83Xy0KNssH7jD/NZ2oT594sMmiQPUC5ni9VYY6\nsuYB0JbD5Mq+EjKIVhYtxaQJ76LzHreEI+G4z6k3H7/hRpr3/C48n9G/uVkT9DbJ\noplxxEx68QKBgQCdJ23vcwO0Firtmi/GEmtbVHz70rGfSXNFoHz4UlvPXv0wsE5u\nE4vOt2i3EMhDOWh46odYGG6bzH+tp2xyFTW70Dui+QLHgPs6dpfoyLHWzZxXj5F3\n6lK9hgZvYvqk/XRRKmzjwnK2wjsdqOyeC1covlR5mqh20D/6kZkKbur0TQKBgAwy\nCZBimRWEnKKoW/gbFKNccGfhXqONID/g2Hdd/rC4QYth68AjacIgcJ9B7nX1uAGk\n1tsryvPB0w0+NpMyKdp6GAgaeuUUA3MuYSzZLiCagEyu77JMvaI7+Z3UlHcCGMd/\neK4Uk1/QqT7U2Cc/yN2ZK6E1QQa2vCWshA4U31JhAoGAbtbSSSsul1c+PsJ13Cfk\n6qVnqYzPqt23QTyOZmGAvUHH/M4xRiQpOE0cDF4t/r5PwenAQPQzTvMmWRzj6uAY\n3eaU0eAK7ZfoweCoOIAPnpFbbRLrXfoY46H7MYh7euWGXOKEpxz5yzuEkd9ByNUE\n86vSEidqbMIiXVgEgnu/k08=\n-----END PRIVATE KEY-----\n", - "client_email": "xyz@developer.gserviceaccount.com", - "client_id": "123", - "auth_uri": "https://accounts.google.com/o/oauth2/auth", - "token_uri": "https://accounts.google.com/o/oauth2/token", - "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", - "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/xyz%40developer.gserviceaccount.com" -} diff --git a/awsproviderlint/vendor/google.golang.org/api/internal/settings.go b/awsproviderlint/vendor/google.golang.org/api/internal/settings.go index f435519decf..26259b82abb 100644 --- a/awsproviderlint/vendor/google.golang.org/api/internal/settings.go +++ b/awsproviderlint/vendor/google.golang.org/api/internal/settings.go @@ -12,6 +12,7 @@ import ( "golang.org/x/oauth2" "golang.org/x/oauth2/google" + "google.golang.org/api/internal/impersonate" "google.golang.org/grpc" ) @@ -38,6 +39,8 @@ type DialSettings struct { TelemetryDisabled bool ClientCertSource func(*tls.CertificateRequestInfo) (*tls.Certificate, error) CustomClaims map[string]interface{} + SkipValidation bool + ImpersonationConfig *impersonate.Config // Google API system parameters. For more information please read: // https://cloud.google.com/apis/docs/system-parameters @@ -47,6 +50,9 @@ type DialSettings struct { // Validate reports an error if ds is invalid. func (ds *DialSettings) Validate() error { + if ds.SkipValidation { + return nil + } hasCreds := ds.APIKey != "" || ds.TokenSource != nil || ds.CredentialsFile != "" || ds.Credentials != nil if ds.NoAuth && hasCreds { return errors.New("options.WithoutAuthentication is incompatible with any option that provides credentials") @@ -101,6 +107,8 @@ func (ds *DialSettings) Validate() error { if ds.ClientCertSource != nil && (ds.GRPCConn != nil || ds.GRPCConnPool != nil || ds.GRPCConnPoolSize != 0 || ds.GRPCDialOpts != nil) { return errors.New("WithClientCertSource is currently only supported for HTTP. gRPC settings are incompatible") } - + if ds.ImpersonationConfig != nil && len(ds.ImpersonationConfig.Scopes) == 0 && len(ds.Scopes) == 0 { + return errors.New("WithImpersonatedCredentials requires scopes being provided") + } return nil } diff --git a/awsproviderlint/vendor/google.golang.org/api/option/internaloption/internaloption.go b/awsproviderlint/vendor/google.golang.org/api/option/internaloption/internaloption.go index ff5b530cfe0..b4d78a830ae 100644 --- a/awsproviderlint/vendor/google.golang.org/api/option/internaloption/internaloption.go +++ b/awsproviderlint/vendor/google.golang.org/api/option/internaloption/internaloption.go @@ -20,7 +20,7 @@ func (o defaultEndpointOption) Apply(settings *internal.DialSettings) { // // It should only be used internally by generated clients. // -// This is similar to WithEndpoint, but allows us to determine whether the user has overriden the default endpoint. +// This is similar to WithEndpoint, but allows us to determine whether the user has overridden the default endpoint. func WithDefaultEndpoint(url string) option.ClientOption { return defaultEndpointOption(url) } @@ -34,7 +34,19 @@ func (o defaultMTLSEndpointOption) Apply(settings *internal.DialSettings) { // WithDefaultMTLSEndpoint is an option that indicates the default mTLS endpoint. // // It should only be used internally by generated clients. -// func WithDefaultMTLSEndpoint(url string) option.ClientOption { return defaultMTLSEndpointOption(url) } + +// SkipDialSettingsValidation bypasses validation on ClientOptions. +// +// It should only be used internally. +func SkipDialSettingsValidation() option.ClientOption { + return skipDialSettingsValidation{} +} + +type skipDialSettingsValidation struct{} + +func (s skipDialSettingsValidation) Apply(settings *internal.DialSettings) { + settings.SkipValidation = true +} diff --git a/awsproviderlint/vendor/google.golang.org/api/option/option.go b/awsproviderlint/vendor/google.golang.org/api/option/option.go index b7c40d60a45..686476f9cbb 100644 --- a/awsproviderlint/vendor/google.golang.org/api/option/option.go +++ b/awsproviderlint/vendor/google.golang.org/api/option/option.go @@ -11,6 +11,7 @@ import ( "golang.org/x/oauth2" "google.golang.org/api/internal" + "google.golang.org/api/internal/impersonate" "google.golang.org/grpc" ) @@ -269,3 +270,57 @@ type withClientCertSource struct{ s ClientCertSource } func (w withClientCertSource) Apply(o *internal.DialSettings) { o.ClientCertSource = w.s } + +// ImpersonateCredentials returns a ClientOption that will impersonate the +// target service account. +// +// In order to impersonate the target service account +// the base service account must have the Service Account Token Creator role, +// roles/iam.serviceAccountTokenCreator, on the target service account. +// See https://cloud.google.com/iam/docs/understanding-service-accounts. +// +// Optionally, delegates can be used during impersonation if the base service +// account lacks the token creator role on the target. When using delegates, +// each service account must be granted roles/iam.serviceAccountTokenCreator +// on the next service account in the chain. +// +// For example, if a base service account of SA1 is trying to impersonate target +// service account SA2 while using delegate service accounts DSA1 and DSA2, +// the following must be true: +// +// 1. Base service account SA1 has roles/iam.serviceAccountTokenCreator on +// DSA1. +// 2. DSA1 has roles/iam.serviceAccountTokenCreator on DSA2. +// 3. DSA2 has roles/iam.serviceAccountTokenCreator on target SA2. +// +// The resulting impersonated credential will either have the default scopes of +// the client being instantiating or the scopes from WithScopes if provided. +// Scopes are required for creating impersonated credentials, so if this option +// is used while not using a NewClient/NewService function, WithScopes must also +// be explicitly passed in as well. +// +// If the base credential is an authorized user and not a service account, or if +// the option WithQuotaProject is set, the target service account must have a +// role that grants the serviceusage.services.use permission such as +// roles/serviceusage.serviceUsageConsumer. +// +// This is an EXPERIMENTAL API and may be changed or removed in the future. +func ImpersonateCredentials(target string, delegates ...string) ClientOption { + return impersonateServiceAccount{ + target: target, + delegates: delegates, + } +} + +type impersonateServiceAccount struct { + target string + delegates []string +} + +func (i impersonateServiceAccount) Apply(o *internal.DialSettings) { + o.ImpersonationConfig = &impersonate.Config{ + Target: i.target, + } + o.ImpersonationConfig.Delegates = make([]string, len(i.delegates)) + copy(o.ImpersonationConfig.Delegates, i.delegates) +} diff --git a/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-api.json b/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-api.json index e78776b2be8..1e076ab66d4 100644 --- a/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-api.json +++ b/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-api.json @@ -26,7 +26,7 @@ "description": "Stores and retrieves potentially large, immutable data objects.", "discoveryVersion": "v1", "documentationLink": "https://developers.google.com/storage/docs/json_api/", - "etag": "\"u9GIe6H63LSGq-9_t39K2Zx_EAc/5Ir-e9ddNPcr5skzvRsSnJlvTYg\"", + "etag": "\"3133373531323239383338313531333236393038\"", "icons": { "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" @@ -1781,7 +1781,7 @@ "type": "string" }, "kmsKeyName": { - "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", "location": "query", "type": "string" }, @@ -3229,7 +3229,7 @@ } } }, - "revision": "20200611", + "revision": "20200927", "rootUrl": "https://storage.googleapis.com/", "schemas": { "Bucket": { @@ -3406,8 +3406,8 @@ "type": "string" }, "customTimeBefore": { - "description": "A timestamp in RFC 3339 format. This condition is satisfied when the custom time on an object is before this timestamp.", - "format": "date-time", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", + "format": "date", "type": "string" }, "daysSinceCustomTime": { @@ -3436,8 +3436,8 @@ "type": "array" }, "noncurrentTimeBefore": { - "description": "A timestamp in RFC 3339 format. This condition is satisfied when the noncurrent time on an object is before this timestamp. This condition is relevant only for versioned objects.", - "format": "date-time", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", + "format": "date", "type": "string" }, "numNewerVersions": { @@ -3579,10 +3579,6 @@ "type": "string" }, "type": "array" - }, - "zoneSeparation": { - "description": "If set, objects placed in this bucket are required to be separated by disaster domain.", - "type": "boolean" } }, "type": "object" @@ -4096,7 +4092,7 @@ "type": "string" }, "kmsKeyName": { - "description": "Cloud KMS Key used to encrypt this object, if the object is encrypted by such a key.", + "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.", "type": "string" }, "md5Hash": { diff --git a/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-gen.go b/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-gen.go index dc51a22ede6..6c80946b217 100644 --- a/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-gen.go +++ b/awsproviderlint/vendor/google.golang.org/api/storage/v1/storage-gen.go @@ -400,10 +400,6 @@ type Bucket struct { // requests will fail with a 400 Bad Request response. ZoneAffinity []string `json:"zoneAffinity,omitempty"` - // ZoneSeparation: If set, objects placed in this bucket are required to - // be separated by disaster domain. - ZoneSeparation bool `json:"zoneSeparation,omitempty"` - // ServerResponse contains the HTTP response code and headers from the // server. googleapi.ServerResponse `json:"-"` @@ -756,8 +752,9 @@ type BucketLifecycleRuleCondition struct { // is created before midnight of the specified date in UTC. CreatedBefore string `json:"createdBefore,omitempty"` - // CustomTimeBefore: A timestamp in RFC 3339 format. This condition is - // satisfied when the custom time on an object is before this timestamp. + // CustomTimeBefore: A date in RFC 3339 format with only the date part + // (for instance, "2013-01-15"). This condition is satisfied when the + // custom time on an object is before this date in UTC. CustomTimeBefore string `json:"customTimeBefore,omitempty"` // DaysSinceCustomTime: Number of days elapsed since the user-specified @@ -793,9 +790,10 @@ type BucketLifecycleRuleCondition struct { // DURABLE_REDUCED_AVAILABILITY. MatchesStorageClass []string `json:"matchesStorageClass,omitempty"` - // NoncurrentTimeBefore: A timestamp in RFC 3339 format. This condition - // is satisfied when the noncurrent time on an object is before this - // timestamp. This condition is relevant only for versioned objects. + // NoncurrentTimeBefore: A date in RFC 3339 format with only the date + // part (for instance, "2013-01-15"). This condition is satisfied when + // the noncurrent time on an object is before this date in UTC. This + // condition is relevant only for versioned objects. NoncurrentTimeBefore string `json:"noncurrentTimeBefore,omitempty"` // NumNewerVersions: Relevant only for versioned objects. If the value @@ -1734,8 +1732,8 @@ type Object struct { // storage#object. Kind string `json:"kind,omitempty"` - // KmsKeyName: Cloud KMS Key used to encrypt this object, if the object - // is encrypted by such a key. + // KmsKeyName: Not currently supported. Specifying the parameter causes + // the request to fail with status code 400 - Bad Request. KmsKeyName string `json:"kmsKeyName,omitempty"` // Md5Hash: MD5 hash of the data; encoded using base64. For more @@ -2442,7 +2440,7 @@ func (c *BucketAccessControlsDeleteCall) Header() http.Header { func (c *BucketAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2590,7 +2588,7 @@ func (c *BucketAccessControlsGetCall) Header() http.Header { func (c *BucketAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2757,7 +2755,7 @@ func (c *BucketAccessControlsInsertCall) Header() http.Header { func (c *BucketAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -2930,7 +2928,7 @@ func (c *BucketAccessControlsListCall) Header() http.Header { func (c *BucketAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3091,7 +3089,7 @@ func (c *BucketAccessControlsPatchCall) Header() http.Header { func (c *BucketAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3265,7 +3263,7 @@ func (c *BucketAccessControlsUpdateCall) Header() http.Header { func (c *BucketAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3451,7 +3449,7 @@ func (c *BucketsDeleteCall) Header() http.Header { func (c *BucketsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3630,7 +3628,7 @@ func (c *BucketsGetCall) Header() http.Header { func (c *BucketsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -3836,7 +3834,7 @@ func (c *BucketsGetIamPolicyCall) Header() http.Header { func (c *BucketsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4053,7 +4051,7 @@ func (c *BucketsInsertCall) Header() http.Header { func (c *BucketsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4310,7 +4308,7 @@ func (c *BucketsListCall) Header() http.Header { func (c *BucketsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4520,7 +4518,7 @@ func (c *BucketsLockRetentionPolicyCall) Header() http.Header { func (c *BucketsLockRetentionPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4755,7 +4753,7 @@ func (c *BucketsPatchCall) Header() http.Header { func (c *BucketsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -4984,7 +4982,7 @@ func (c *BucketsSetIamPolicyCall) Header() http.Header { func (c *BucketsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5159,7 +5157,7 @@ func (c *BucketsTestIamPermissionsCall) Header() http.Header { func (c *BucketsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5399,7 +5397,7 @@ func (c *BucketsUpdateCall) Header() http.Header { func (c *BucketsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5611,7 +5609,7 @@ func (c *ChannelsStopCall) Header() http.Header { func (c *ChannelsStopCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5728,7 +5726,7 @@ func (c *DefaultObjectAccessControlsDeleteCall) Header() http.Header { func (c *DefaultObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -5876,7 +5874,7 @@ func (c *DefaultObjectAccessControlsGetCall) Header() http.Header { func (c *DefaultObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6044,7 +6042,7 @@ func (c *DefaultObjectAccessControlsInsertCall) Header() http.Header { func (c *DefaultObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6234,7 +6232,7 @@ func (c *DefaultObjectAccessControlsListCall) Header() http.Header { func (c *DefaultObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6407,7 +6405,7 @@ func (c *DefaultObjectAccessControlsPatchCall) Header() http.Header { func (c *DefaultObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6581,7 +6579,7 @@ func (c *DefaultObjectAccessControlsUpdateCall) Header() http.Header { func (c *DefaultObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6753,7 +6751,7 @@ func (c *NotificationsDeleteCall) Header() http.Header { func (c *NotificationsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -6901,7 +6899,7 @@ func (c *NotificationsGetCall) Header() http.Header { func (c *NotificationsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7071,7 +7069,7 @@ func (c *NotificationsInsertCall) Header() http.Header { func (c *NotificationsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7246,7 +7244,7 @@ func (c *NotificationsListCall) Header() http.Header { func (c *NotificationsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7419,7 +7417,7 @@ func (c *ObjectAccessControlsDeleteCall) Header() http.Header { func (c *ObjectAccessControlsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7591,7 +7589,7 @@ func (c *ObjectAccessControlsGetCall) Header() http.Header { func (c *ObjectAccessControlsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7782,7 +7780,7 @@ func (c *ObjectAccessControlsInsertCall) Header() http.Header { func (c *ObjectAccessControlsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -7979,7 +7977,7 @@ func (c *ObjectAccessControlsListCall) Header() http.Header { func (c *ObjectAccessControlsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8164,7 +8162,7 @@ func (c *ObjectAccessControlsPatchCall) Header() http.Header { func (c *ObjectAccessControlsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8362,7 +8360,7 @@ func (c *ObjectAccessControlsUpdateCall) Header() http.Header { func (c *ObjectAccessControlsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8547,9 +8545,11 @@ func (c *ObjectsComposeCall) IfMetagenerationMatch(ifMetagenerationMatch int64) return c } -// KmsKeyName sets the optional parameter "kmsKeyName": Not currently -// supported. Specifying the parameter causes the request to fail with -// status code 400 - Bad Request. +// KmsKeyName sets the optional parameter "kmsKeyName": Resource name of +// the Cloud KMS key, of the form +// projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, +// that will be used to encrypt the object. Overrides the object +// metadata's kms_key_name value, if any. func (c *ObjectsComposeCall) KmsKeyName(kmsKeyName string) *ObjectsComposeCall { c.urlParams_.Set("kmsKeyName", kmsKeyName) return c @@ -8597,7 +8597,7 @@ func (c *ObjectsComposeCall) Header() http.Header { func (c *ObjectsComposeCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -8716,7 +8716,7 @@ func (c *ObjectsComposeCall) Do(opts ...googleapi.CallOption) (*Object, error) { // "type": "string" // }, // "kmsKeyName": { - // "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request.", + // "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", // "location": "query", // "type": "string" // }, @@ -8940,7 +8940,7 @@ func (c *ObjectsCopyCall) Header() http.Header { func (c *ObjectsCopyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9268,7 +9268,7 @@ func (c *ObjectsDeleteCall) Header() http.Header { func (c *ObjectsDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9501,7 +9501,7 @@ func (c *ObjectsGetCall) Header() http.Header { func (c *ObjectsGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -9751,7 +9751,7 @@ func (c *ObjectsGetIamPolicyCall) Header() http.Header { func (c *ObjectsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10068,7 +10068,7 @@ func (c *ObjectsInsertCall) Header() http.Header { func (c *ObjectsInsertCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10441,7 +10441,7 @@ func (c *ObjectsListCall) Header() http.Header { func (c *ObjectsListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -10758,7 +10758,7 @@ func (c *ObjectsPatchCall) Header() http.Header { func (c *ObjectsPatchCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11150,7 +11150,7 @@ func (c *ObjectsRewriteCall) Header() http.Header { func (c *ObjectsRewriteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11453,7 +11453,7 @@ func (c *ObjectsSetIamPolicyCall) Header() http.Header { func (c *ObjectsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11653,7 +11653,7 @@ func (c *ObjectsTestIamPermissionsCall) Header() http.Header { func (c *ObjectsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -11914,7 +11914,7 @@ func (c *ObjectsUpdateCall) Header() http.Header { func (c *ObjectsUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12232,7 +12232,7 @@ func (c *ObjectsWatchAllCall) Header() http.Header { func (c *ObjectsWatchAllCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12448,7 +12448,7 @@ func (c *ProjectsHmacKeysCreateCall) Header() http.Header { func (c *ProjectsHmacKeysCreateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12598,7 +12598,7 @@ func (c *ProjectsHmacKeysDeleteCall) Header() http.Header { func (c *ProjectsHmacKeysDeleteCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12733,7 +12733,7 @@ func (c *ProjectsHmacKeysGetCall) Header() http.Header { func (c *ProjectsHmacKeysGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -12933,7 +12933,7 @@ func (c *ProjectsHmacKeysListCall) Header() http.Header { func (c *ProjectsHmacKeysListCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -13128,7 +13128,7 @@ func (c *ProjectsHmacKeysUpdateCall) Header() http.Header { func (c *ProjectsHmacKeysUpdateCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } @@ -13305,7 +13305,7 @@ func (c *ProjectsServiceAccountGetCall) Header() http.Header { func (c *ProjectsServiceAccountGetCall) doRequest(alt string) (*http.Response, error) { reqHeaders := make(http.Header) - reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20200707") + reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20201023") for k, v := range c.header_ { reqHeaders[k] = v } diff --git a/awsproviderlint/vendor/google.golang.org/api/transport/http/dial.go b/awsproviderlint/vendor/google.golang.org/api/transport/http/dial.go index 44503014172..8578cac9ef2 100644 --- a/awsproviderlint/vendor/google.golang.org/api/transport/http/dial.go +++ b/awsproviderlint/vendor/google.golang.org/api/transport/http/dial.go @@ -13,9 +13,6 @@ import ( "errors" "net" "net/http" - "net/url" - "os" - "strings" "time" "go.opencensus.io/plugin/ochttp" @@ -25,12 +22,7 @@ import ( "google.golang.org/api/option" "google.golang.org/api/transport/cert" "google.golang.org/api/transport/http/internal/propagation" -) - -const ( - mTLSModeAlways = "always" - mTLSModeNever = "never" - mTLSModeAuto = "auto" + "google.golang.org/api/transport/internal/dca" ) // NewClient returns an HTTP client for use communicating with a Google cloud @@ -41,11 +33,7 @@ func NewClient(ctx context.Context, opts ...option.ClientOption) (*http.Client, if err != nil { return nil, "", err } - clientCertSource, err := getClientCertificateSource(settings) - if err != nil { - return nil, "", err - } - endpoint, err := getEndpoint(settings, clientCertSource) + clientCertSource, endpoint, err := dca.GetClientCertificateSourceAndEndpoint(settings) if err != nil { return nil, "", err } @@ -218,87 +206,3 @@ func addOCTransport(trans http.RoundTripper, settings *internal.DialSettings) ht Propagation: &propagation.HTTPFormat{}, } } - -// getClientCertificateSource returns a default client certificate source, if -// not provided by the user. -// -// A nil default source can be returned if the source does not exist. Any exceptions -// encountered while initializing the default source will be reported as client -// error (ex. corrupt metadata file). -// -// The overall logic is as follows: -// 1. If both endpoint override and client certificate are specified, use them as is. -// 2. If user does not specify client certificate, we will attempt to use default -// client certificate. -// 3. If user does not specify endpoint override, we will use defaultMtlsEndpoint if -// client certificate is available and defaultEndpoint otherwise. -// -// Implications of the above logic: -// 1. If the user specifies a non-mTLS endpoint override but client certificate is -// available, we will pass along the cert anyway and let the server decide what to do. -// 2. If the user specifies an mTLS endpoint override but client certificate is not -// available, we will not fail-fast, but let backend throw error when connecting. -// -// We would like to avoid introducing client-side logic that parses whether the -// endpoint override is an mTLS url, since the url pattern may change at anytime. -func getClientCertificateSource(settings *internal.DialSettings) (cert.Source, error) { - if settings.HTTPClient != nil { - return nil, nil // HTTPClient is incompatible with ClientCertificateSource - } else if settings.ClientCertSource != nil { - return settings.ClientCertSource, nil - } else { - return cert.DefaultSource() - } - -} - -// getEndpoint returns the endpoint for the service, taking into account the -// user-provided endpoint override "settings.Endpoint" -// -// If no endpoint override is specified, we will either return the default endpoint or -// the default mTLS endpoint if a client certificate is available. -// -// You can override the default endpoint (mtls vs. regular) by setting the -// GOOGLE_API_USE_MTLS environment variable. -// -// If the endpoint override is an address (host:port) rather than full base -// URL (ex. https://...), then the user-provided address will be merged into -// the default endpoint. For example, WithEndpoint("myhost:8000") and -// WithDefaultEndpoint("https://foo.com/bar/baz") will return "https://myhost:8080/bar/baz" -func getEndpoint(settings *internal.DialSettings, clientCertSource cert.Source) (string, error) { - if settings.Endpoint == "" { - mtlsMode := getMTLSMode() - if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) { - return settings.DefaultMTLSEndpoint, nil - } - return settings.DefaultEndpoint, nil - } - if strings.Contains(settings.Endpoint, "://") { - // User passed in a full URL path, use it verbatim. - return settings.Endpoint, nil - } - if settings.DefaultEndpoint == "" { - return "", errors.New("WithEndpoint requires a full URL path") - } - - // Assume user-provided endpoint is host[:port], merge it with the default endpoint. - return mergeEndpoints(settings.DefaultEndpoint, settings.Endpoint) -} - -func getMTLSMode() string { - mode := os.Getenv("GOOGLE_API_USE_MTLS") - if mode == "" { - // TODO(shinfan): Update this to "auto" when the mTLS feature is fully released. - return mTLSModeNever - } - return strings.ToLower(mode) -} - -func mergeEndpoints(base, newHost string) (string, error) { - u, err := url.Parse(base) - if err != nil { - return "", err - } - u.Host = newHost - return u.String(), nil -} diff --git a/awsproviderlint/vendor/google.golang.org/api/transport/internal/dca/dca.go b/awsproviderlint/vendor/google.golang.org/api/transport/internal/dca/dca.go new file mode 100644 index 00000000000..b3be7e4e3a7 --- /dev/null +++ b/awsproviderlint/vendor/google.golang.org/api/transport/internal/dca/dca.go @@ -0,0 +1,145 @@ +// Copyright 2020 Google LLC. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Package dca contains utils for implementing Device Certificate +// Authentication according to https://google.aip.dev/auth/4114 +// +// The overall logic for DCA is as follows: +// 1. If both endpoint override and client certificate are specified, use them as is. +// 2. If user does not specify client certificate, we will attempt to use default +// client certificate. +// 3. If user does not specify endpoint override, we will use defaultMtlsEndpoint if +// client certificate is available and defaultEndpoint otherwise. +// +// Implications of the above logic: +// 1. If the user specifies a non-mTLS endpoint override but client certificate is +// available, we will pass along the cert anyway and let the server decide what to do. +// 2. If the user specifies an mTLS endpoint override but client certificate is not +// available, we will not fail-fast, but let backend throw error when connecting. +// +// We would like to avoid introducing client-side logic that parses whether the +// endpoint override is an mTLS url, since the url pattern may change at anytime. +// +// This package is not intended for use by end developers. Use the +// google.golang.org/api/option package to configure API clients. +package dca + +import ( + "net/url" + "os" + "strings" + + "google.golang.org/api/internal" + "google.golang.org/api/transport/cert" +) + +const ( + mTLSModeAlways = "always" + mTLSModeNever = "never" + mTLSModeAuto = "auto" +) + +// GetClientCertificateSourceAndEndpoint is a convenience function that invokes +// getClientCertificateSource and getEndpoint sequentially and returns the client +// cert source and endpoint as a tuple. +func GetClientCertificateSourceAndEndpoint(settings *internal.DialSettings) (cert.Source, string, error) { + clientCertSource, err := getClientCertificateSource(settings) + if err != nil { + return nil, "", err + } + endpoint, err := getEndpoint(settings, clientCertSource) + if err != nil { + return nil, "", err + } + return clientCertSource, endpoint, nil +} + +// getClientCertificateSource returns a default client certificate source, if +// not provided by the user. +// +// A nil default source can be returned if the source does not exist. Any exceptions +// encountered while initializing the default source will be reported as client +// error (ex. corrupt metadata file). +// +// Important Note: For now, the environment variable GOOGLE_API_USE_CLIENT_CERTIFICATE +// must be set to "true" to allow certificate to be used (including user provided +// certificates). For details, see AIP-4114. +func getClientCertificateSource(settings *internal.DialSettings) (cert.Source, error) { + if !isClientCertificateEnabled() { + return nil, nil + } else if settings.HTTPClient != nil { + return nil, nil // HTTPClient is incompatible with ClientCertificateSource + } else if settings.ClientCertSource != nil { + return settings.ClientCertSource, nil + } else { + return cert.DefaultSource() + } +} + +func isClientCertificateEnabled() bool { + useClientCert := os.Getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE") + // TODO(andyrzhao): Update default to return "true" after DCA feature is fully released. + return strings.ToLower(useClientCert) == "true" +} + +// getEndpoint returns the endpoint for the service, taking into account the +// user-provided endpoint override "settings.Endpoint". +// +// If no endpoint override is specified, we will either return the default endpoint or +// the default mTLS endpoint if a client certificate is available. +// +// You can override the default endpoint choice (mtls vs. regular) by setting the +// GOOGLE_API_USE_MTLS_ENDPOINT environment variable. +// +// If the endpoint override is an address (host:port) rather than full base +// URL (ex. https://...), then the user-provided address will be merged into +// the default endpoint. For example, WithEndpoint("myhost:8000") and +// WithDefaultEndpoint("https://foo.com/bar/baz") will return "https://myhost:8080/bar/baz" +func getEndpoint(settings *internal.DialSettings, clientCertSource cert.Source) (string, error) { + if settings.Endpoint == "" { + mtlsMode := getMTLSMode() + if mtlsMode == mTLSModeAlways || (clientCertSource != nil && mtlsMode == mTLSModeAuto) { + return settings.DefaultMTLSEndpoint, nil + } + return settings.DefaultEndpoint, nil + } + if strings.Contains(settings.Endpoint, "://") { + // User passed in a full URL path, use it verbatim. + return settings.Endpoint, nil + } + if settings.DefaultEndpoint == "" { + // If DefaultEndpoint is not configured, use the user provided endpoint verbatim. + // This allows a naked "host[:port]" URL to be used with GRPC Direct Path. + return settings.Endpoint, nil + } + + // Assume user-provided endpoint is host[:port], merge it with the default endpoint. + return mergeEndpoints(settings.DefaultEndpoint, settings.Endpoint) +} + +func getMTLSMode() string { + mode := os.Getenv("GOOGLE_API_USE_MTLS_ENDPOINT") + if mode == "" { + mode = os.Getenv("GOOGLE_API_USE_MTLS") // Deprecated. + } + if mode == "" { + return mTLSModeAuto + } + return strings.ToLower(mode) +} + +func mergeEndpoints(baseURL, newHost string) (string, error) { + u, err := url.Parse(fixScheme(baseURL)) + if err != nil { + return "", err + } + return strings.Replace(baseURL, u.Host, newHost, 1), nil +} + +func fixScheme(baseURL string) string { + if !strings.Contains(baseURL, "://") { + return "https://" + baseURL + } + return baseURL +} diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go index 2ac4deb0c9c..55111d110c7 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/annotations.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/api/annotations.proto package annotations @@ -24,9 +24,9 @@ import ( reflect "reflect" proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( @@ -42,7 +42,7 @@ const _ = proto.ProtoPackageIsVersion4 var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptor.MethodOptions)(nil), + ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: (*HttpRule)(nil), Field: 72295728, Name: "google.api.http", @@ -51,7 +51,7 @@ var file_google_api_annotations_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptor.MethodOptions. +// Extension fields to descriptorpb.MethodOptions. var ( // See `HttpRule`. // @@ -84,8 +84,8 @@ var file_google_api_annotations_proto_rawDesc = []byte{ } var file_google_api_annotations_proto_goTypes = []interface{}{ - (*descriptor.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*HttpRule)(nil), // 1: google.api.HttpRule + (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions + (*HttpRule)(nil), // 1: google.api.HttpRule } var file_google_api_annotations_proto_depIdxs = []int32{ 0, // 0: google.api.http:extendee -> google.protobuf.MethodOptions diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go index 3832df0bd53..e4324641d6c 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/client.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/api/client.proto package annotations @@ -24,9 +24,9 @@ import ( reflect "reflect" proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( @@ -42,7 +42,7 @@ const _ = proto.ProtoPackageIsVersion4 var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptor.MethodOptions)(nil), + ExtendedType: (*descriptorpb.MethodOptions)(nil), ExtensionType: ([]string)(nil), Field: 1051, Name: "google.api.method_signature", @@ -50,7 +50,7 @@ var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "google/api/client.proto", }, { - ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1049, Name: "google.api.default_host", @@ -58,7 +58,7 @@ var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "google/api/client.proto", }, { - ExtendedType: (*descriptor.ServiceOptions)(nil), + ExtendedType: (*descriptorpb.ServiceOptions)(nil), ExtensionType: (*string)(nil), Field: 1050, Name: "google.api.oauth_scopes", @@ -67,7 +67,7 @@ var file_google_api_client_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptor.MethodOptions. +// Extension fields to descriptorpb.MethodOptions. var ( // A definition of a client library method signature. // @@ -109,7 +109,7 @@ var ( E_MethodSignature = &file_google_api_client_proto_extTypes[0] ) -// Extension fields to descriptor.ServiceOptions. +// Extension fields to descriptorpb.ServiceOptions. var ( // The hostname for this service. // This should be specified with no prefix or protocol. @@ -179,8 +179,8 @@ var file_google_api_client_proto_rawDesc = []byte{ } var file_google_api_client_proto_goTypes = []interface{}{ - (*descriptor.MethodOptions)(nil), // 0: google.protobuf.MethodOptions - (*descriptor.ServiceOptions)(nil), // 1: google.protobuf.ServiceOptions + (*descriptorpb.MethodOptions)(nil), // 0: google.protobuf.MethodOptions + (*descriptorpb.ServiceOptions)(nil), // 1: google.protobuf.ServiceOptions } var file_google_api_client_proto_depIdxs = []int32{ 0, // 0: google.api.method_signature:extendee -> google.protobuf.MethodOptions diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go index 0038b20e4e4..b6b9094c9a4 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/field_behavior.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/api/field_behavior.proto package annotations @@ -25,9 +25,9 @@ import ( sync "sync" proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( @@ -124,7 +124,7 @@ func (FieldBehavior) EnumDescriptor() ([]byte, []int) { var file_google_api_field_behavior_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptor.FieldOptions)(nil), + ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: ([]FieldBehavior)(nil), Field: 1052, Name: "google.api.field_behavior", @@ -133,7 +133,7 @@ var file_google_api_field_behavior_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptor.FieldOptions. +// Extension fields to descriptorpb.FieldOptions. var ( // A designation of a specific field behavior (required, output only, etc.) // in protobuf messages. @@ -198,8 +198,8 @@ func file_google_api_field_behavior_proto_rawDescGZIP() []byte { var file_google_api_field_behavior_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_api_field_behavior_proto_goTypes = []interface{}{ - (FieldBehavior)(0), // 0: google.api.FieldBehavior - (*descriptor.FieldOptions)(nil), // 1: google.protobuf.FieldOptions + (FieldBehavior)(0), // 0: google.api.FieldBehavior + (*descriptorpb.FieldOptions)(nil), // 1: google.protobuf.FieldOptions } var file_google_api_field_behavior_proto_depIdxs = []int32{ 1, // 0: google.api.field_behavior:extendee -> google.protobuf.FieldOptions diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go index 955bc56a394..f36d981ced0 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/http.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/api/http.proto package annotations diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go index ff6147fe277..d3e36efee6d 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/api/annotations/resource.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/api/resource.proto package annotations @@ -25,9 +25,9 @@ import ( sync "sync" proto "github.com/golang/protobuf/proto" - descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + descriptorpb "google.golang.org/protobuf/types/descriptorpb" ) const ( @@ -440,7 +440,7 @@ func (x *ResourceReference) GetChildType() string { var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ { - ExtendedType: (*descriptor.FieldOptions)(nil), + ExtendedType: (*descriptorpb.FieldOptions)(nil), ExtensionType: (*ResourceReference)(nil), Field: 1055, Name: "google.api.resource_reference", @@ -448,7 +448,7 @@ var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "google/api/resource.proto", }, { - ExtendedType: (*descriptor.FileOptions)(nil), + ExtendedType: (*descriptorpb.FileOptions)(nil), ExtensionType: ([]*ResourceDescriptor)(nil), Field: 1053, Name: "google.api.resource_definition", @@ -456,7 +456,7 @@ var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ Filename: "google/api/resource.proto", }, { - ExtendedType: (*descriptor.MessageOptions)(nil), + ExtendedType: (*descriptorpb.MessageOptions)(nil), ExtensionType: (*ResourceDescriptor)(nil), Field: 1053, Name: "google.api.resource", @@ -465,7 +465,7 @@ var file_google_api_resource_proto_extTypes = []protoimpl.ExtensionInfo{ }, } -// Extension fields to descriptor.FieldOptions. +// Extension fields to descriptorpb.FieldOptions. var ( // An annotation that describes a resource reference, see // [ResourceReference][]. @@ -474,7 +474,7 @@ var ( E_ResourceReference = &file_google_api_resource_proto_extTypes[0] ) -// Extension fields to descriptor.FileOptions. +// Extension fields to descriptorpb.FileOptions. var ( // An annotation that describes a resource definition without a corresponding // message; see [ResourceDescriptor][]. @@ -483,7 +483,7 @@ var ( E_ResourceDefinition = &file_google_api_resource_proto_extTypes[1] ) -// Extension fields to descriptor.MessageOptions. +// Extension fields to descriptorpb.MessageOptions. var ( // An annotation that describes a resource definition, see // [ResourceDescriptor][]. @@ -568,12 +568,12 @@ func file_google_api_resource_proto_rawDescGZIP() []byte { var file_google_api_resource_proto_enumTypes = make([]protoimpl.EnumInfo, 1) var file_google_api_resource_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_google_api_resource_proto_goTypes = []interface{}{ - (ResourceDescriptor_History)(0), // 0: google.api.ResourceDescriptor.History - (*ResourceDescriptor)(nil), // 1: google.api.ResourceDescriptor - (*ResourceReference)(nil), // 2: google.api.ResourceReference - (*descriptor.FieldOptions)(nil), // 3: google.protobuf.FieldOptions - (*descriptor.FileOptions)(nil), // 4: google.protobuf.FileOptions - (*descriptor.MessageOptions)(nil), // 5: google.protobuf.MessageOptions + (ResourceDescriptor_History)(0), // 0: google.api.ResourceDescriptor.History + (*ResourceDescriptor)(nil), // 1: google.api.ResourceDescriptor + (*ResourceReference)(nil), // 2: google.api.ResourceReference + (*descriptorpb.FieldOptions)(nil), // 3: google.protobuf.FieldOptions + (*descriptorpb.FileOptions)(nil), // 4: google.protobuf.FileOptions + (*descriptorpb.MessageOptions)(nil), // 5: google.protobuf.MessageOptions } var file_google_api_resource_proto_depIdxs = []int32{ 0, // 0: google.api.ResourceDescriptor.history:type_name -> google.api.ResourceDescriptor.History diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go index 375d3876535..8a0cca603e4 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/iam_policy.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/iam/v1/iam_policy.proto package iam diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go index e6c2bfcba56..f8f9fb0e92f 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/options.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/iam/v1/options.proto package iam diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go index ba64dcc4690..78fa9008621 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/iam/v1/policy.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/iam/v1/policy.proto package iam diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go index 9034439ad9f..386fd7b13c4 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/code/code.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/rpc/code.proto package code diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go index 5dfabd640ba..e79a5388465 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/rpc/status/status.pb.go @@ -14,8 +14,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/rpc/status.proto package status @@ -25,9 +25,9 @@ import ( sync "sync" proto "github.com/golang/protobuf/proto" - any "github.com/golang/protobuf/ptypes/any" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" + anypb "google.golang.org/protobuf/types/known/anypb" ) const ( @@ -61,7 +61,7 @@ type Status struct { Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // A list of messages that carry the error details. There is a common set of // message types for APIs to use. - Details []*any.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` + Details []*anypb.Any `protobuf:"bytes,3,rep,name=details,proto3" json:"details,omitempty"` } func (x *Status) Reset() { @@ -110,7 +110,7 @@ func (x *Status) GetMessage() string { return "" } -func (x *Status) GetDetails() []*any.Any { +func (x *Status) GetDetails() []*anypb.Any { if x != nil { return x.Details } @@ -154,8 +154,8 @@ func file_google_rpc_status_proto_rawDescGZIP() []byte { var file_google_rpc_status_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_google_rpc_status_proto_goTypes = []interface{}{ - (*Status)(nil), // 0: google.rpc.Status - (*any.Any)(nil), // 1: google.protobuf.Any + (*Status)(nil), // 0: google.rpc.Status + (*anypb.Any)(nil), // 1: google.protobuf.Any } var file_google_rpc_status_proto_depIdxs = []int32{ 1, // 0: google.rpc.Status.details:type_name -> google.protobuf.Any diff --git a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go index 4d9a47dca94..1cc50df7366 100644 --- a/awsproviderlint/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go +++ b/awsproviderlint/vendor/google.golang.org/genproto/googleapis/type/expr/expr.pb.go @@ -15,8 +15,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.22.0 -// protoc v3.12.3 +// protoc-gen-go v1.25.0 +// protoc v3.13.0 // source: google/type/expr.proto package expr diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index 4de63983b7e..617282868dc 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -1,4 +1,4 @@ -# cloud.google.com/go v0.61.0 +# cloud.google.com/go v0.65.0 cloud.google.com/go cloud.google.com/go/compute/metadata cloud.google.com/go/iam @@ -10,8 +10,8 @@ cloud.google.com/go/internal/version cloud.google.com/go/storage # github.com/agext/levenshtein v1.2.2 github.com/agext/levenshtein -# github.com/apparentlymart/go-textseg v1.0.0 -github.com/apparentlymart/go-textseg/textseg +# github.com/apparentlymart/go-textseg/v12 v12.0.0 +github.com/apparentlymart/go-textseg/v12/textseg # github.com/aws/aws-sdk-go v1.37.4 ## explicit github.com/aws/aws-sdk-go/aws @@ -68,7 +68,7 @@ github.com/bflad/gopaniccheck/passes/logpaniccallexpr github.com/bflad/gopaniccheck/passes/logpanicfcallexpr github.com/bflad/gopaniccheck/passes/logpaniclncallexpr github.com/bflad/gopaniccheck/passes/paniccallexpr -# github.com/bflad/tfproviderlint v0.22.0 +# github.com/bflad/tfproviderlint v0.23.0 ## explicit github.com/bflad/tfproviderlint/helper/analysisutils github.com/bflad/tfproviderlint/helper/astutils @@ -195,6 +195,7 @@ github.com/bflad/tfproviderlint/passes/stdlib/timesleepcallexpr github.com/bflad/tfproviderlint/passes/testaccfuncdecl github.com/bflad/tfproviderlint/passes/testfuncdecl github.com/bflad/tfproviderlint/xpasses +github.com/bflad/tfproviderlint/xpasses/XAT001 github.com/bflad/tfproviderlint/xpasses/XR001 github.com/bflad/tfproviderlint/xpasses/XR002 github.com/bflad/tfproviderlint/xpasses/XR003 @@ -242,7 +243,7 @@ github.com/hashicorp/go-cty/cty/gocty github.com/hashicorp/go-cty/cty/json github.com/hashicorp/go-cty/cty/msgpack github.com/hashicorp/go-cty/cty/set -# github.com/hashicorp/go-getter v1.5.0 +# github.com/hashicorp/go-getter v1.5.2 github.com/hashicorp/go-getter github.com/hashicorp/go-getter/helper/url # github.com/hashicorp/go-hclog v0.15.0 @@ -258,7 +259,7 @@ github.com/hashicorp/go-safetemp github.com/hashicorp/go-uuid # github.com/hashicorp/go-version v1.2.1 github.com/hashicorp/go-version -# github.com/hashicorp/hcl/v2 v2.3.0 +# github.com/hashicorp/hcl/v2 v2.8.2 github.com/hashicorp/hcl/v2 github.com/hashicorp/hcl/v2/ext/customdecode github.com/hashicorp/hcl/v2/hclsyntax @@ -277,7 +278,7 @@ github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto github.com/hashicorp/terraform-plugin-go/tfprotov5/server github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes -# github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.3 +# github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 ## explicit github.com/hashicorp/terraform-plugin-sdk/v2/diag github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging @@ -304,6 +305,12 @@ github.com/jmespath/go-jmespath github.com/jstemmer/go-junit-report github.com/jstemmer/go-junit-report/formatter github.com/jstemmer/go-junit-report/parser +# github.com/klauspost/compress v1.11.2 +github.com/klauspost/compress/fse +github.com/klauspost/compress/huff0 +github.com/klauspost/compress/snappy +github.com/klauspost/compress/zstd +github.com/klauspost/compress/zstd/internal/xxhash # github.com/mattn/go-colorable v0.1.4 github.com/mattn/go-colorable # github.com/mattn/go-isatty v0.0.10 @@ -330,7 +337,7 @@ github.com/ulikunitz/xz/lzma # github.com/vmihailenco/msgpack v4.0.4+incompatible github.com/vmihailenco/msgpack github.com/vmihailenco/msgpack/codes -# github.com/zclconf/go-cty v1.2.1 +# github.com/zclconf/go-cty v1.7.1 github.com/zclconf/go-cty/cty github.com/zclconf/go-cty/cty/convert github.com/zclconf/go-cty/cty/function @@ -378,7 +385,7 @@ golang.org/x/net/http2/hpack golang.org/x/net/idna golang.org/x/net/internal/timeseries golang.org/x/net/trace -# golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d +# golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 golang.org/x/oauth2 golang.org/x/oauth2/google golang.org/x/oauth2/internal @@ -392,7 +399,7 @@ golang.org/x/text/secure/bidirule golang.org/x/text/transform golang.org/x/text/unicode/bidi golang.org/x/text/unicode/norm -# golang.org/x/tools v0.0.0-20200928201943-a0ef9b62deab +# golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb ## explicit golang.org/x/tools/cmd/goimports golang.org/x/tools/go/analysis @@ -430,11 +437,12 @@ golang.org/x/tools/txtar # golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 golang.org/x/xerrors golang.org/x/xerrors/internal -# google.golang.org/api v0.29.0 +# google.golang.org/api v0.34.0 google.golang.org/api/googleapi google.golang.org/api/googleapi/transport google.golang.org/api/internal google.golang.org/api/internal/gensupport +google.golang.org/api/internal/impersonate google.golang.org/api/internal/third_party/uritemplates google.golang.org/api/iterator google.golang.org/api/option @@ -443,6 +451,7 @@ google.golang.org/api/storage/v1 google.golang.org/api/transport/cert google.golang.org/api/transport/http google.golang.org/api/transport/http/internal/propagation +google.golang.org/api/transport/internal/dca # google.golang.org/appengine v1.6.6 google.golang.org/appengine google.golang.org/appengine/datastore @@ -457,7 +466,7 @@ google.golang.org/appengine/internal/modules google.golang.org/appengine/internal/remote_api google.golang.org/appengine/internal/urlfetch google.golang.org/appengine/urlfetch -# google.golang.org/genproto v0.0.0-20200711021454-869866162049 +# google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d google.golang.org/genproto/googleapis/api/annotations google.golang.org/genproto/googleapis/iam/v1 google.golang.org/genproto/googleapis/rpc/code From 2ab53ddabeb62a9db85f9710ef85bab41b6f5b51 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:09 -0400 Subject: [PATCH 0399/1252] tests/r/opsworks_application: Add ErrorCheck --- aws/resource_aws_opsworks_application_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_opsworks_application_test.go b/aws/resource_aws_opsworks_application_test.go index c3ac99b0990..7ed44c0862c 100644 --- a/aws/resource_aws_opsworks_application_test.go +++ b/aws/resource_aws_opsworks_application_test.go @@ -20,6 +20,7 @@ func TestAccAWSOpsworksApplication_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksApplicationDestroy, Steps: []resource.TestStep{ From cee378102d6c13dbc7716517dfbbaef974c09298 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:19 -0400 Subject: [PATCH 0400/1252] tests/r/opsworks_custom_layer: Add ErrorCheck --- aws/resource_aws_opsworks_custom_layer_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_opsworks_custom_layer_test.go b/aws/resource_aws_opsworks_custom_layer_test.go index d569ded72c9..01ec306ca9f 100644 --- a/aws/resource_aws_opsworks_custom_layer_test.go +++ b/aws/resource_aws_opsworks_custom_layer_test.go @@ -22,6 +22,7 @@ func TestAccAWSOpsworksCustomLayer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksCustomLayerDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func TestAccAWSOpsworksCustomLayer_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksCustomLayerDestroy, Steps: []resource.TestStep{ @@ -108,6 +110,7 @@ func TestAccAWSOpsworksCustomLayer_noVPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksCustomLayerDestroy, Steps: []resource.TestStep{ From a8c142f5fba6b22eaecd6a9ceb90e2532a5b56b3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:19 -0400 Subject: [PATCH 0401/1252] tests/r/opsworks_ganglia_layer: Add ErrorCheck --- aws/resource_aws_opsworks_ganglia_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_ganglia_layer_test.go b/aws/resource_aws_opsworks_ganglia_layer_test.go index ad3d2d6dcfe..1c53eb28769 100644 --- a/aws/resource_aws_opsworks_ganglia_layer_test.go +++ b/aws/resource_aws_opsworks_ganglia_layer_test.go @@ -16,6 +16,7 @@ func TestAccAWSOpsworksGangliaLayer_basic(t *testing.T) { resourceName := "aws_opsworks_ganglia_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksGangliaLayerDestroy, Steps: []resource.TestStep{ @@ -36,6 +37,7 @@ func TestAccAWSOpsworksGangliaLayer_tags(t *testing.T) { resourceName := "aws_opsworks_ganglia_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksGangliaLayerDestroy, Steps: []resource.TestStep{ From aa73ed2e865cc84e397177a2a297b65364320bad Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:19 -0400 Subject: [PATCH 0402/1252] tests/r/opsworks_haproxy_layer: Add ErrorCheck --- aws/resource_aws_opsworks_haproxy_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_haproxy_layer_test.go b/aws/resource_aws_opsworks_haproxy_layer_test.go index 43ab5cb86a1..8586ec8e5cd 100644 --- a/aws/resource_aws_opsworks_haproxy_layer_test.go +++ b/aws/resource_aws_opsworks_haproxy_layer_test.go @@ -16,6 +16,7 @@ func TestAccAWSOpsworksHAProxyLayer_basic(t *testing.T) { resourceName := "aws_opsworks_haproxy_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksHAProxyLayerDestroy, Steps: []resource.TestStep{ @@ -36,6 +37,7 @@ func TestAccAWSOpsworksHAProxyLayer_tags(t *testing.T) { resourceName := "aws_opsworks_haproxy_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksHAProxyLayerDestroy, Steps: []resource.TestStep{ From ae7f95c51f9485002ed8fb448f1d3564ead71319 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:29 -0400 Subject: [PATCH 0403/1252] tests/r/opsworks_instance: Add ErrorCheck --- aws/resource_aws_opsworks_instance_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_instance_test.go b/aws/resource_aws_opsworks_instance_test.go index faeabf6d69d..bcf63d3a237 100644 --- a/aws/resource_aws_opsworks_instance_test.go +++ b/aws/resource_aws_opsworks_instance_test.go @@ -20,6 +20,7 @@ func TestAccAWSOpsworksInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksInstanceDestroy, Steps: []resource.TestStep{ @@ -69,6 +70,7 @@ func TestAccAWSOpsworksInstance_UpdateHostNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksInstanceDestroy, Steps: []resource.TestStep{ From 2a1418ac80f3a4e6847b76dc2aaccc278ccf3552 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:29 -0400 Subject: [PATCH 0404/1252] tests/r/opsworks_java_app_layer: Add ErrorCheck --- aws/resource_aws_opsworks_java_app_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_java_app_layer_test.go b/aws/resource_aws_opsworks_java_app_layer_test.go index 7585bac4c92..a328bcf7b5a 100644 --- a/aws/resource_aws_opsworks_java_app_layer_test.go +++ b/aws/resource_aws_opsworks_java_app_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksJavaAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_java_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksJavaAppLayerDestroy, Steps: []resource.TestStep{ @@ -38,6 +39,7 @@ func TestAccAWSOpsworksJavaAppLayer_tags(t *testing.T) { resourceName := "aws_opsworks_java_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksJavaAppLayerDestroy, Steps: []resource.TestStep{ From c7efd3847474b3530a1032359ae57d9aac90e1fd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:30 -0400 Subject: [PATCH 0405/1252] tests/r/opsworks_memcached_layer: Add ErrorCheck --- aws/resource_aws_opsworks_memcached_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_memcached_layer_test.go b/aws/resource_aws_opsworks_memcached_layer_test.go index 53a5bc94c15..1dd554ce07a 100644 --- a/aws/resource_aws_opsworks_memcached_layer_test.go +++ b/aws/resource_aws_opsworks_memcached_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksMemcachedLayer_basic(t *testing.T) { resourceName := "aws_opsworks_memcached_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksMemcachedLayerDestroy, Steps: []resource.TestStep{ @@ -38,6 +39,7 @@ func TestAccAWSOpsworksMemcachedLayer_tags(t *testing.T) { resourceName := "aws_opsworks_memcached_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksMemcachedLayerDestroy, Steps: []resource.TestStep{ From 40eb3bec9e2e6c2e96a99c89acd28f1a5edfb307 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:14:30 -0400 Subject: [PATCH 0406/1252] tests/r/opsworks_mysql_layer: Add ErrorCheck --- aws/resource_aws_opsworks_mysql_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_mysql_layer_test.go b/aws/resource_aws_opsworks_mysql_layer_test.go index caa1ed8e4e8..2382cb0b3d1 100644 --- a/aws/resource_aws_opsworks_mysql_layer_test.go +++ b/aws/resource_aws_opsworks_mysql_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksMysqlLayer_basic(t *testing.T) { resourceName := "aws_opsworks_mysql_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksMysqlLayerDestroy, Steps: []resource.TestStep{ @@ -38,6 +39,7 @@ func TestAccAWSOpsworksMysqlLayer_tags(t *testing.T) { resourceName := "aws_opsworks_mysql_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksMysqlLayerDestroy, Steps: []resource.TestStep{ From df5344b5276556fa4a3622021982d109bbcff826 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:00 -0400 Subject: [PATCH 0407/1252] tests/r/opsworks_nodejs_app_layer: Add ErrorCheck --- aws/resource_aws_opsworks_nodejs_app_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_nodejs_app_layer_test.go b/aws/resource_aws_opsworks_nodejs_app_layer_test.go index 4f7e90dc155..c0fd756705b 100644 --- a/aws/resource_aws_opsworks_nodejs_app_layer_test.go +++ b/aws/resource_aws_opsworks_nodejs_app_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksNodejsAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_nodejs_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksNodejsAppLayerDestroy, Steps: []resource.TestStep{ @@ -38,6 +39,7 @@ func TestAccAWSOpsworksNodejsAppLayer_tags(t *testing.T) { resourceName := "aws_opsworks_nodejs_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksNodejsAppLayerDestroy, Steps: []resource.TestStep{ From d6959073c1da6b47ffd3d24a862fc71b58183e85 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:10 -0400 Subject: [PATCH 0408/1252] tests/r/opsworks_permission: Add ErrorCheck --- aws/resource_aws_opsworks_permission_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_permission_test.go b/aws/resource_aws_opsworks_permission_test.go index fb15496aff4..a60cc3b336e 100644 --- a/aws/resource_aws_opsworks_permission_test.go +++ b/aws/resource_aws_opsworks_permission_test.go @@ -17,6 +17,7 @@ func TestAccAWSOpsworksPermission_basic(t *testing.T) { var opsperm opsworks.Permission resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksPermissionDestroy, Steps: []resource.TestStep{ @@ -100,6 +101,7 @@ func TestAccAWSOpsworksPermission_Self(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, // Cannot delete own OpsWorks Permission Steps: []resource.TestStep{ From f3b14ee8d1c1dbd4ea35a3b35754e6907e41bda8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:10 -0400 Subject: [PATCH 0409/1252] tests/r/opsworks_php_app_layer: Add ErrorCheck --- aws/resource_aws_opsworks_php_app_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_php_app_layer_test.go b/aws/resource_aws_opsworks_php_app_layer_test.go index e0c5f77c347..4d95e37c507 100644 --- a/aws/resource_aws_opsworks_php_app_layer_test.go +++ b/aws/resource_aws_opsworks_php_app_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksPhpAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_php_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksPhpAppLayerDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSOpsworksPhpAppLayer_tags(t *testing.T) { resourceName := "aws_opsworks_php_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksPhpAppLayerDestroy, Steps: []resource.TestStep{ From 3dc84dde26a033107d3459bd2523d246e7a17d65 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:10 -0400 Subject: [PATCH 0410/1252] tests/r/opsworks_rails_app_layer: Add ErrorCheck --- aws/resource_aws_opsworks_rails_app_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_rails_app_layer_test.go b/aws/resource_aws_opsworks_rails_app_layer_test.go index 5ed6469a76b..f4c42fb7bde 100644 --- a/aws/resource_aws_opsworks_rails_app_layer_test.go +++ b/aws/resource_aws_opsworks_rails_app_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksRailsAppLayer_basic(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksRailsAppLayerDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSOpsworksRailsAppLayer_tags(t *testing.T) { resourceName := "aws_opsworks_rails_app_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksRailsAppLayerDestroy, Steps: []resource.TestStep{ From 8abc912998ce87daadb7ee85e9221c25676dbf59 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:20 -0400 Subject: [PATCH 0411/1252] tests/r/opsworks_rds_db_instance: Add ErrorCheck --- aws/resource_aws_opsworks_rds_db_instance_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_opsworks_rds_db_instance_test.go b/aws/resource_aws_opsworks_rds_db_instance_test.go index dc96d52a0a6..72e40153e16 100644 --- a/aws/resource_aws_opsworks_rds_db_instance_test.go +++ b/aws/resource_aws_opsworks_rds_db_instance_test.go @@ -17,6 +17,7 @@ func TestAccAWSOpsworksRdsDbInstance_basic(t *testing.T) { var opsdb opsworks.RdsDbInstance resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksRdsDbDestroy, Steps: []resource.TestStep{ From 838107ca6a56ed825e0b28f6d6ef47444225dcb1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:30 -0400 Subject: [PATCH 0412/1252] tests/r/opsworks_stack: Add ErrorCheck --- aws/resource_aws_opsworks_stack_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_opsworks_stack_test.go b/aws/resource_aws_opsworks_stack_test.go index 03535e404de..ca27369af9f 100644 --- a/aws/resource_aws_opsworks_stack_test.go +++ b/aws/resource_aws_opsworks_stack_test.go @@ -27,6 +27,7 @@ func TestAccAWSOpsworksStack_noVpcBasic(t *testing.T) { testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) testAccPreCheckAWSOpsWorksStacks(t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSOpsworksStack_noVpcChangeServiceRoleForceNew(t *testing.T) { testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) testAccPreCheckAWSOpsWorksStacks(t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ @@ -93,6 +95,7 @@ func TestAccAWSOpsworksStack_vpc(t *testing.T) { testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) testAccPreCheckAWSOpsWorksStacks(t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ @@ -141,6 +144,7 @@ func TestAccAWSOpsworksStack_noVpcCreateTags(t *testing.T) { testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) testAccPreCheckAWSOpsWorksStacks(t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ @@ -184,6 +188,7 @@ func TestAccAWSOpsworksStack_CustomCookbooks_SetPrivateProperties(t *testing.T) testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) testAccPreCheckAWSOpsWorksStacks(t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ From 32c6e7f1cf6d7909983fb7a0a34804980b8df23f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:30 -0400 Subject: [PATCH 0413/1252] tests/r/opsworks_static_web_layer: Add ErrorCheck --- aws/resource_aws_opsworks_static_web_layer_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_opsworks_static_web_layer_test.go b/aws/resource_aws_opsworks_static_web_layer_test.go index 6c7875f106e..081ea350972 100644 --- a/aws/resource_aws_opsworks_static_web_layer_test.go +++ b/aws/resource_aws_opsworks_static_web_layer_test.go @@ -19,6 +19,7 @@ func TestAccAWSOpsworksStaticWebLayer_basic(t *testing.T) { resourceName := "aws_opsworks_static_web_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStaticWebLayerDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSOpsworksStaticWebLayer_tags(t *testing.T) { resourceName := "aws_opsworks_static_web_layer.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStaticWebLayerDestroy, Steps: []resource.TestStep{ From 80796db638df82817cf31c410d4640a8f7f572c4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:17:41 -0400 Subject: [PATCH 0414/1252] tests/r/opsworks_user_profile: Add ErrorCheck --- aws/resource_aws_opsworks_user_profile_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_opsworks_user_profile_test.go b/aws/resource_aws_opsworks_user_profile_test.go index 42e91468d94..8c04f6f5b78 100644 --- a/aws/resource_aws_opsworks_user_profile_test.go +++ b/aws/resource_aws_opsworks_user_profile_test.go @@ -17,6 +17,7 @@ func TestAccAWSOpsworksUserProfile_basic(t *testing.T) { updateRName := fmt.Sprintf("test-user-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(opsworks.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksUserProfileDestroy, Steps: []resource.TestStep{ From d13ac92ab5eb62cff0f849ce7cf96a72de418fa1 Mon Sep 17 00:00:00 2001 From: Nick Venenga Date: Wed, 29 Jul 2020 13:04:38 -0400 Subject: [PATCH 0415/1252] Fix DescribeClientVpnTargetNetworks Amazon API doesn't return the correct results when using "AssociationIds" but works correctly when using a filter for the same thing --- aws/internal/service/ec2/waiter/status.go | 7 ++++++- ...ource_aws_ec2_client_vpn_network_association.go | 7 ++++++- ..._aws_ec2_client_vpn_network_association_test.go | 14 ++++++++++++-- 3 files changed, 24 insertions(+), 4 deletions(-) diff --git a/aws/internal/service/ec2/waiter/status.go b/aws/internal/service/ec2/waiter/status.go index 9e1e7e54fcd..85340dbd76f 100644 --- a/aws/internal/service/ec2/waiter/status.go +++ b/aws/internal/service/ec2/waiter/status.go @@ -154,7 +154,12 @@ func ClientVpnNetworkAssociationStatus(conn *ec2.EC2, cvnaID string, cvepID stri return func() (interface{}, string, error) { result, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(cvepID), - AssociationIds: []*string{aws.String(cvnaID)}, + Filters: []*ec2.Filter{ + { + Name: aws.String("association-id"), + Values: []*string{aws.String(cvnaID)}, + }, + }, }) if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeClientVpnAssociationIdNotFound) || tfawserr.ErrCodeEquals(err, tfec2.ErrCodeClientVpnEndpointIdNotFound) { diff --git a/aws/resource_aws_ec2_client_vpn_network_association.go b/aws/resource_aws_ec2_client_vpn_network_association.go index 040a66e147c..77f68861dae 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association.go +++ b/aws/resource_aws_ec2_client_vpn_network_association.go @@ -119,7 +119,12 @@ func resourceAwsEc2ClientVpnNetworkAssociationRead(d *schema.ResourceData, meta result, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(d.Get("client_vpn_endpoint_id").(string)), - AssociationIds: []*string{aws.String(d.Id())}, + Filters: []*ec2.Filter{ + { + Name: aws.String("association-id"), + Values: []*string{aws.String(d.Id())}, + }, + }, }) if isAWSErr(err, tfec2.ErrCodeClientVpnAssociationIdNotFound, "") || isAWSErr(err, tfec2.ErrCodeClientVpnEndpointIdNotFound, "") { diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index 55035fc4dbf..8196c507160 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -206,7 +206,12 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy(s *terraform.State) er resp, _ := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(rs.Primary.Attributes["client_vpn_endpoint_id"]), - AssociationIds: []*string{aws.String(rs.Primary.ID)}, + Filters: []*ec2.Filter{ + { + Name: aws.String("association-id"), + Values: []*string{aws.String(rs.Primary.ID)}, + }, + }, }) for _, v := range resp.ClientVpnTargetNetworks { @@ -234,7 +239,12 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationExists(name string, assoc *ec2 resp, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(rs.Primary.Attributes["client_vpn_endpoint_id"]), - AssociationIds: []*string{aws.String(rs.Primary.ID)}, + Filters: []*ec2.Filter{ + { + Name: aws.String("association-id"), + Values: []*string{aws.String(rs.Primary.ID)}, + }, + }, }) if err != nil { From 4b033d043e12d0086da1fa22be8de94fa9a0c307 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:00 -0400 Subject: [PATCH 0416/1252] tests/ds/canonical_user_id: Add ErrorCheck --- aws/data_source_aws_canonical_user_id_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_canonical_user_id_test.go b/aws/data_source_aws_canonical_user_id_test.go index 4f482b0aa10..27d57b02a5b 100644 --- a/aws/data_source_aws_canonical_user_id_test.go +++ b/aws/data_source_aws_canonical_user_id_test.go @@ -4,14 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccDataSourceAwsCanonicalUserId_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsCanonicalUserIdConfig, From cf7eb609095b7eaf98b07746f6992852d8084d74 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:10 -0400 Subject: [PATCH 0417/1252] tests/ds/s3_bucket_object: Add ErrorCheck --- aws/data_source_aws_s3_bucket_object_test.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_s3_bucket_object_test.go b/aws/data_source_aws_s3_bucket_object_test.go index dc555b570c9..9c67dd70a51 100644 --- a/aws/data_source_aws_s3_bucket_object_test.go +++ b/aws/data_source_aws_s3_bucket_object_test.go @@ -26,6 +26,7 @@ func TestAccDataSourceAWSS3BucketObject_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -57,8 +58,9 @@ func TestAccDataSourceAWSS3BucketObject_basicViaAccessPoint(t *testing.T) { accessPointResourceName := "aws_s3_access_point.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceS3ObjectConfig_basicViaAccessPoint(rName), @@ -85,6 +87,7 @@ func TestAccDataSourceAWSS3BucketObject_readableBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func TestAccDataSourceAWSS3BucketObject_kmsEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -153,6 +157,7 @@ func TestAccDataSourceAWSS3BucketObject_allParams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -202,6 +207,7 @@ func TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOff(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -236,6 +242,7 @@ func TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -272,6 +279,7 @@ func TestAccDataSourceAWSS3BucketObject_LeadingSlash(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -325,6 +333,7 @@ func TestAccDataSourceAWSS3BucketObject_MultipleSlashes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -366,6 +375,7 @@ func TestAccDataSourceAWSS3BucketObject_SingleSlashAsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ From 923e25dc9a590b99c10dda98b017c7f8ab477117 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:20 -0400 Subject: [PATCH 0418/1252] tests/ds/s3_bucket_objects: Add ErrorCheck --- aws/data_source_aws_s3_bucket_objects_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/data_source_aws_s3_bucket_objects_test.go b/aws/data_source_aws_s3_bucket_objects_test.go index f97f3adfd03..385a7b089a0 100644 --- a/aws/data_source_aws_s3_bucket_objects_test.go +++ b/aws/data_source_aws_s3_bucket_objects_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -14,6 +15,7 @@ func TestAccDataSourceAWSS3BucketObjects_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -39,6 +41,7 @@ func TestAccDataSourceAWSS3BucketObjects_basicViaAccessPoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -64,6 +67,7 @@ func TestAccDataSourceAWSS3BucketObjects_all(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -94,6 +98,7 @@ func TestAccDataSourceAWSS3BucketObjects_prefixes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -123,6 +128,7 @@ func TestAccDataSourceAWSS3BucketObjects_encoded(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -148,6 +154,7 @@ func TestAccDataSourceAWSS3BucketObjects_maxKeys(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -173,6 +180,7 @@ func TestAccDataSourceAWSS3BucketObjects_startAfter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -197,6 +205,7 @@ func TestAccDataSourceAWSS3BucketObjects_fetchOwner(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ From 8cc0be18e8589854e9dfbffe0e5be410b316c392 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:29 -0400 Subject: [PATCH 0419/1252] tests/r/s3_bucket_analytics_configuration: Add ErrorCheck --- ...ce_aws_s3_bucket_analytics_configuration_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_s3_bucket_analytics_configuration_test.go b/aws/resource_aws_s3_bucket_analytics_configuration_test.go index ccd3b84fa80..f09da9cac49 100644 --- a/aws/resource_aws_s3_bucket_analytics_configuration_test.go +++ b/aws/resource_aws_s3_bucket_analytics_configuration_test.go @@ -22,6 +22,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_removed(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_updateBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -129,6 +132,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -151,6 +155,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -192,6 +197,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -237,6 +243,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -286,6 +293,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -330,6 +338,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -360,6 +369,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -379,6 +389,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -414,6 +425,7 @@ func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, Steps: []resource.TestStep{ @@ -1106,6 +1118,7 @@ func TestFlattenS3AnalyticsFilter(t *testing.T) { } } } + func TestFlattenS3StorageClassAnalysis(t *testing.T) { testCases := map[string]struct { Input *s3.StorageClassAnalysis From 99dc0a358470983189051762afd95fe97eb8a3a2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:39 -0400 Subject: [PATCH 0420/1252] tests/r/s3_bucket_inventory: Add ErrorCheck --- aws/resource_aws_s3_bucket_inventory_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_s3_bucket_inventory_test.go b/aws/resource_aws_s3_bucket_inventory_test.go index a3ac2ef4332..24812e2f0bb 100644 --- a/aws/resource_aws_s3_bucket_inventory_test.go +++ b/aws/resource_aws_s3_bucket_inventory_test.go @@ -24,6 +24,7 @@ func TestAccAWSS3BucketInventory_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketInventoryDestroy, Steps: []resource.TestStep{ @@ -69,6 +70,7 @@ func TestAccAWSS3BucketInventory_encryptWithSSES3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketInventoryDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func TestAccAWSS3BucketInventory_encryptWithSSEKMS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketInventoryDestroy, Steps: []resource.TestStep{ From 125feb66f4a7c7f64afb3275bca806ca6cee7584 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:24:52 -0400 Subject: [PATCH 0421/1252] tests/r/s3_bucket_metric: Add ErrorCheck --- aws/resource_aws_s3_bucket_metric_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_s3_bucket_metric_test.go b/aws/resource_aws_s3_bucket_metric_test.go index dcc59b7b8ae..e32fad9f814 100644 --- a/aws/resource_aws_s3_bucket_metric_test.go +++ b/aws/resource_aws_s3_bucket_metric_test.go @@ -271,6 +271,7 @@ func TestAccAWSS3BucketMetric_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -304,6 +305,7 @@ func TestAccAWSS3BucketMetric_WithEmptyFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -330,6 +332,7 @@ func TestAccAWSS3BucketMetric_WithFilterPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -376,6 +379,7 @@ func TestAccAWSS3BucketMetric_WithFilterPrefixAndMultipleTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -424,6 +428,7 @@ func TestAccAWSS3BucketMetric_WithFilterPrefixAndSingleTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -470,6 +475,7 @@ func TestAccAWSS3BucketMetric_WithFilterMultipleTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ @@ -516,6 +522,7 @@ func TestAccAWSS3BucketMetric_WithFilterSingleTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketMetricDestroy, Steps: []resource.TestStep{ From 6f3a0b7c1d6189188a1747336332a924dd1c4a7c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:03 -0400 Subject: [PATCH 0422/1252] tests/r/s3_bucket_notification: Add ErrorCheck --- aws/resource_aws_s3_bucket_notification_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_s3_bucket_notification_test.go b/aws/resource_aws_s3_bucket_notification_test.go index e8237d5f807..c920412e4f1 100644 --- a/aws/resource_aws_s3_bucket_notification_test.go +++ b/aws/resource_aws_s3_bucket_notification_test.go @@ -21,6 +21,7 @@ func TestAccAWSS3BucketNotification_LambdaFunction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func TestAccAWSS3BucketNotification_LambdaFunction_LambdaFunctionArn_Alias(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ @@ -92,6 +94,7 @@ func TestAccAWSS3BucketNotification_Queue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ @@ -133,6 +136,7 @@ func TestAccAWSS3BucketNotification_Topic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ @@ -163,6 +167,7 @@ func TestAccAWSS3BucketNotification_Topic_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ @@ -217,6 +222,7 @@ func TestAccAWSS3BucketNotification_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy, Steps: []resource.TestStep{ From 8f6d47036dc0bc87f0f12ac2b1104de136ece995 Mon Sep 17 00:00:00 2001 From: Nick Venenga Date: Thu, 10 Sep 2020 21:04:33 -0400 Subject: [PATCH 0423/1252] Add test --- aws/resource_aws_ec2_client_vpn_network_association_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index 8196c507160..a229230352b 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -264,7 +264,7 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationExists(name string, assoc *ec2 func testAccCheckAwsEc2ClientVpnNetworkAssociationSecurityGroupID(name, key string, group *ec2.SecurityGroup) resource.TestCheckFunc { return func(s *terraform.State) error { - return resource.TestCheckTypeSetElemAttr(name, key, aws.StringValue(group.GroupId))(s) + return tfawsresource.TestCheckTypeSetElemAttr(name, key, aws.StringValue(group.GroupId))(s) } } From 44ab5a0fdad103e4769ebf58223bc11d3d8b8220 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:15 -0400 Subject: [PATCH 0424/1252] tests/r/s3_bucket_object: Add ErrorCheck --- aws/resource_aws_s3_bucket_object_test.go | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/aws/resource_aws_s3_bucket_object_test.go b/aws/resource_aws_s3_bucket_object_test.go index 03dba231973..ed3a8238ed1 100644 --- a/aws/resource_aws_s3_bucket_object_test.go +++ b/aws/resource_aws_s3_bucket_object_test.go @@ -109,6 +109,7 @@ func TestAccAWSS3BucketObject_noNameNoKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -125,6 +126,7 @@ func TestAccAWSS3BucketObject_noNameNoKey(t *testing.T) { }, }) } + func TestAccAWSS3BucketObject_empty(t *testing.T) { var obj s3.GetObjectOutput resourceName := "aws_s3_bucket_object.object" @@ -132,6 +134,7 @@ func TestAccAWSS3BucketObject_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -157,6 +160,7 @@ func TestAccAWSS3BucketObject_source(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -178,6 +182,7 @@ func TestAccAWSS3BucketObject_content(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -202,6 +207,7 @@ func TestAccAWSS3BucketObject_etagEncryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -225,6 +231,7 @@ func TestAccAWSS3BucketObject_contentBase64(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -250,6 +257,7 @@ func TestAccAWSS3BucketObject_withContentCharacteristics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -275,6 +283,7 @@ func TestAccAWSS3BucketObject_NonVersioned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAssumeRoleARNPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -302,6 +311,7 @@ func TestAccAWSS3BucketObject_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -352,6 +362,7 @@ func TestAccAWSS3BucketObject_updateSameFile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -389,6 +400,7 @@ func TestAccAWSS3BucketObject_updatesWithVersioning(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -426,6 +438,7 @@ func TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -461,6 +474,7 @@ func TestAccAWSS3BucketObject_kms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -487,6 +501,7 @@ func TestAccAWSS3BucketObject_sse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -510,6 +525,7 @@ func TestAccAWSS3BucketObject_acl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -553,6 +569,7 @@ func TestAccAWSS3BucketObject_metadata(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -592,6 +609,7 @@ func TestAccAWSS3BucketObject_storageClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -648,6 +666,7 @@ func TestAccAWSS3BucketObject_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -712,6 +731,7 @@ func TestAccAWSS3BucketObject_tagsLeadingSingleSlash(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -776,6 +796,7 @@ func TestAccAWSS3BucketObject_tagsLeadingMultipleSlashes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -840,6 +861,7 @@ func TestAccAWSS3BucketObject_tagsMultipleSlashes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -903,6 +925,7 @@ func TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithNone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -950,6 +973,7 @@ func TestAccAWSS3BucketObject_ObjectLockLegalHoldStartWithOn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -986,6 +1010,7 @@ func TestAccAWSS3BucketObject_ObjectLockRetentionStartWithNone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -1036,6 +1061,7 @@ func TestAccAWSS3BucketObject_ObjectLockRetentionStartWithSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -1093,6 +1119,7 @@ func TestAccAWSS3BucketObject_defaultBucketSSE(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ @@ -1116,6 +1143,7 @@ func TestAccAWSS3BucketObject_ignoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, Steps: []resource.TestStep{ From 75866f8b31dee1240dd2394581cfa6985805948c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:25 -0400 Subject: [PATCH 0425/1252] tests/r/s3_bucket_ownership_controls: Add ErrorCheck --- aws/resource_aws_s3_bucket_ownership_controls_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_s3_bucket_ownership_controls_test.go b/aws/resource_aws_s3_bucket_ownership_controls_test.go index 453bf167b84..d3b7750f164 100644 --- a/aws/resource_aws_s3_bucket_ownership_controls_test.go +++ b/aws/resource_aws_s3_bucket_ownership_controls_test.go @@ -18,6 +18,7 @@ func TestAccAWSS3BucketOwnershipControls_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketOwnershipControlsDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSS3BucketOwnershipControls_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketOwnershipControlsDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSS3BucketOwnershipControls_disappears_Bucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketOwnershipControlsDestroy, Steps: []resource.TestStep{ @@ -88,6 +91,7 @@ func TestAccAWSS3BucketOwnershipControls_Rule_ObjectOwnership(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketOwnershipControlsDestroy, Steps: []resource.TestStep{ From 9d2d1ad90ed29d68a22f961bbd1dfb9d658b479e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:36 -0400 Subject: [PATCH 0426/1252] tests/r/s3_bucket_policy: Add ErrorCheck --- aws/resource_aws_s3_bucket_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_s3_bucket_policy_test.go b/aws/resource_aws_s3_bucket_policy_test.go index 8fcd5bf5a5e..1c79049fdd9 100644 --- a/aws/resource_aws_s3_bucket_policy_test.go +++ b/aws/resource_aws_s3_bucket_policy_test.go @@ -36,6 +36,7 @@ func TestAccAWSS3BucketPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -101,6 +102,7 @@ func TestAccAWSS3BucketPolicy_policyUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ From aa33cc6aa76c509748e4403b3293bcd133652e23 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:47 -0400 Subject: [PATCH 0427/1252] tests/r/s3_bucket_public_access_block: Add ErrorCheck --- aws/resource_aws_s3_bucket_public_access_block_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_s3_bucket_public_access_block_test.go b/aws/resource_aws_s3_bucket_public_access_block_test.go index b065203e0fd..0805084ce2a 100644 --- a/aws/resource_aws_s3_bucket_public_access_block_test.go +++ b/aws/resource_aws_s3_bucket_public_access_block_test.go @@ -21,6 +21,7 @@ func TestAccAWSS3BucketPublicAccessBlock_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSS3BucketPublicAccessBlock_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -75,6 +77,7 @@ func TestAccAWSS3BucketPublicAccessBlock_disappears_Bucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -97,6 +100,7 @@ func TestAccAWSS3BucketPublicAccessBlock_BlockPublicAcls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -137,6 +141,7 @@ func TestAccAWSS3BucketPublicAccessBlock_BlockPublicPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -177,6 +182,7 @@ func TestAccAWSS3BucketPublicAccessBlock_IgnorePublicAcls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -217,6 +223,7 @@ func TestAccAWSS3BucketPublicAccessBlock_RestrictPublicBuckets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ From 70a397dcc7ad9e6a01aa18af465654dd957d3536 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:25:58 -0400 Subject: [PATCH 0428/1252] tests/r/s3_object_copy: Add ErrorCheck --- aws/resource_aws_s3_object_copy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_s3_object_copy_test.go b/aws/resource_aws_s3_object_copy_test.go index e0e5486e008..4c660a9ca1e 100644 --- a/aws/resource_aws_s3_object_copy_test.go +++ b/aws/resource_aws_s3_object_copy_test.go @@ -21,6 +21,7 @@ func TestAccAWSS3ObjectCopy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ObjectCopyDestroy, Steps: []resource.TestStep{ From e2a76c540f5bd98fef3101d234882a74e19df748 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:26:22 -0400 Subject: [PATCH 0429/1252] tests/ds/s3_bucket: Add ErrorCheck --- aws/data_source_aws_s3_bucket_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_s3_bucket_test.go b/aws/data_source_aws_s3_bucket_test.go index bcf5d4b1da0..42cea10b577 100644 --- a/aws/data_source_aws_s3_bucket_test.go +++ b/aws/data_source_aws_s3_bucket_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceS3Bucket_basic(t *testing.T) { hostedZoneID, _ := HostedZoneIDForRegion(region) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceS3BucketConfig_basic(bucketName), @@ -38,8 +40,9 @@ func TestAccDataSourceS3Bucket_website(t *testing.T) { region := testAccGetRegion() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceS3BucketWebsiteConfig(bucketName), From 0e924ca2efd0484495179cf3cb3dedf6e9846b97 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:26:46 -0400 Subject: [PATCH 0430/1252] tests/r/s3_bucket: Add ErrorCheck --- aws/resource_aws_s3_bucket_test.go | 47 ++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_s3_bucket_test.go b/aws/resource_aws_s3_bucket_test.go index 9c2ce501a5b..f4c9a1a0af3 100644 --- a/aws/resource_aws_s3_bucket_test.go +++ b/aws/resource_aws_s3_bucket_test.go @@ -172,6 +172,7 @@ func TestAccAWSS3Bucket_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -205,6 +206,7 @@ func TestAccAWSS3Bucket_Bucket_EmptyString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -231,6 +233,7 @@ func TestAccAWSS3Bucket_tagsWithNoSystemTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -290,8 +293,9 @@ func TestAccAWSS3Bucket_tagsWithSystemTags(t *testing.T) { var stackID string resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), + Providers: testAccProviders, CheckDestroy: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSS3BucketDestroy, func(s *terraform.State) error { @@ -373,6 +377,7 @@ func TestAccAWSS3Bucket_ignoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -417,6 +422,7 @@ func TestAccAWSS3MultiBucket_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -438,6 +444,7 @@ func TestAccAWSS3Bucket_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -463,6 +470,7 @@ func TestAccAWSS3Bucket_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -491,6 +499,7 @@ func TestAccAWSS3Bucket_acceleration(t *testing.T) { testAccPreCheck(t) testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -524,6 +533,7 @@ func TestAccAWSS3Bucket_RequestPayer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -560,6 +570,7 @@ func TestAccAWSS3Bucket_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -610,6 +621,7 @@ func TestAccAWSS3Bucket_UpdateAcl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -643,6 +655,7 @@ func TestAccAWSS3Bucket_UpdateGrant(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -700,6 +713,7 @@ func TestAccAWSS3Bucket_AclToGrant(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -729,6 +743,7 @@ func TestAccAWSS3Bucket_GrantToAcl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -759,6 +774,7 @@ func TestAccAWSS3Bucket_Website_Simple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -803,6 +819,7 @@ func TestAccAWSS3Bucket_WebsiteRedirect(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -847,6 +864,7 @@ func TestAccAWSS3Bucket_WebsiteRoutingRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -897,6 +915,7 @@ func TestAccAWSS3Bucket_enableDefaultEncryption_whenTypical(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -927,6 +946,7 @@ func TestAccAWSS3Bucket_enableDefaultEncryption_whenAES256IsUsed(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -957,6 +977,7 @@ func TestAccAWSS3Bucket_disableDefaultEncryption_whenDefaultEncryptionIsEnabled( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -992,6 +1013,7 @@ func TestAccAWSS3Bucket_shouldFailNotFound(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1013,6 +1035,7 @@ func TestAccAWSS3Bucket_Versioning(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1080,6 +1103,7 @@ func TestAccAWSS3Bucket_Cors_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1155,6 +1179,7 @@ func TestAccAWSS3Bucket_Cors_Delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1176,6 +1201,7 @@ func TestAccAWSS3Bucket_Cors_EmptyOrigin(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1213,6 +1239,7 @@ func TestAccAWSS3Bucket_Logging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1239,6 +1266,7 @@ func TestAccAWSS3Bucket_LifecycleBasic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1355,6 +1383,7 @@ func TestAccAWSS3Bucket_LifecycleExpireMarkerOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1392,6 +1421,7 @@ func TestAccAWSS3Bucket_LifecycleRule_Expiration_EmptyConfigurationBlock(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1412,6 +1442,7 @@ func TestAccAWSS3Bucket_LifecycleRule_AbortIncompleteMultipartUploadDays_NoExpir resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -1447,6 +1478,7 @@ func TestAccAWSS3Bucket_Replication(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -1759,6 +1791,7 @@ func TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlT testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -1851,6 +1884,7 @@ func TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessContr testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -1931,6 +1965,7 @@ func TestAccAWSS3Bucket_ReplicationWithoutStorageClass(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -1963,6 +1998,7 @@ func TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError(t *testing.T) testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -1989,6 +2025,7 @@ func TestAccAWSS3Bucket_ReplicationWithoutPrefix(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -2026,6 +2063,7 @@ func TestAccAWSS3Bucket_ReplicationSchemaV2(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckWithProviders(testAccCheckAWSS3BucketDestroyWithProvider, &providers), Steps: []resource.TestStep{ @@ -2204,6 +2242,7 @@ func TestAccAWSS3Bucket_SameRegionReplicationSchemaV2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -2255,6 +2294,7 @@ func TestAccAWSS3Bucket_objectLock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -2294,6 +2334,7 @@ func TestAccAWSS3Bucket_forceDestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -2319,6 +2360,7 @@ func TestAccAWSS3Bucket_forceDestroyWithEmptyPrefixes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ @@ -2339,6 +2381,7 @@ func TestAccAWSS3Bucket_forceDestroyWithObjectLockEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, Steps: []resource.TestStep{ From 26455f2019c449f4604e097bd22aaa2ce79cf2ed Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:34:37 -0400 Subject: [PATCH 0431/1252] tests/r/sagemaker_app_image_config: Add ErrorCheck --- aws/resource_aws_sagemaker_app_image_config_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sagemaker_app_image_config_test.go b/aws/resource_aws_sagemaker_app_image_config_test.go index c45642bca65..1883f61bec3 100644 --- a/aws/resource_aws_sagemaker_app_image_config_test.go +++ b/aws/resource_aws_sagemaker_app_image_config_test.go @@ -77,6 +77,7 @@ func TestAccAWSSagemakerAppImageConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppImageConfigDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAWSSagemakerAppImageConfig_kernelGatewayImageConfig_kernalSpecs(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppImageConfigDestroy, Steps: []resource.TestStep{ @@ -148,6 +150,7 @@ func TestAccAWSSagemakerAppImageConfig_kernelGatewayImageConfig_fileSystemConfig resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppImageConfigDestroy, Steps: []resource.TestStep{ @@ -193,6 +196,7 @@ func TestAccAWSSagemakerAppImageConfig_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppImageConfigDestroy, Steps: []resource.TestStep{ From 6b359c606507b140072d84f49094cc3449c5a5fb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:34:47 -0400 Subject: [PATCH 0432/1252] tests/r/sagemaker_app: Add ErrorCheck --- aws/resource_aws_sagemaker_app_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sagemaker_app_test.go b/aws/resource_aws_sagemaker_app_test.go index 2279e9c9ff7..9f64cc3bc09 100644 --- a/aws/resource_aws_sagemaker_app_test.go +++ b/aws/resource_aws_sagemaker_app_test.go @@ -75,6 +75,7 @@ func testAccAWSSagemakerApp_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppDestroy, Steps: []resource.TestStep{ @@ -108,6 +109,7 @@ func testAccAWSSagemakerApp_resourceSpec(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppDestroy, Steps: []resource.TestStep{ @@ -137,6 +139,7 @@ func testAccAWSSagemakerApp_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppDestroy, Steps: []resource.TestStep{ @@ -181,6 +184,7 @@ func testAccAWSSagemakerApp_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerAppDestroy, Steps: []resource.TestStep{ From 10ffa1accd347994008225f7f3abf5945285e962 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:34:57 -0400 Subject: [PATCH 0433/1252] tests/r/sagemaker_code_repository: Add ErrorCheck --- aws/resource_aws_sagemaker_code_repository_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sagemaker_code_repository_test.go b/aws/resource_aws_sagemaker_code_repository_test.go index af2327c9f39..6ecfc250dff 100644 --- a/aws/resource_aws_sagemaker_code_repository_test.go +++ b/aws/resource_aws_sagemaker_code_repository_test.go @@ -64,6 +64,7 @@ func TestAccAWSSagemakerCodeRepository_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerCodeRepositoryDestroy, Steps: []resource.TestStep{ @@ -93,6 +94,7 @@ func TestAccAWSSagemakerCodeRepository_gitConfig_branch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerCodeRepositoryDestroy, Steps: []resource.TestStep{ @@ -123,6 +125,7 @@ func TestAccAWSSagemakerCodeRepository_gitConfig_secret(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerCodeRepositoryDestroy, Steps: []resource.TestStep{ @@ -164,6 +167,7 @@ func TestAccAWSSagemakerCodeRepository_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerCodeRepositoryDestroy, Steps: []resource.TestStep{ From 3fbefc5b04b0eba4bf5e0bb5fbbe3eab6e41c7e6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:35:07 -0400 Subject: [PATCH 0434/1252] tests/r/sagemaker_domain: Add ErrorCheck --- aws/resource_aws_sagemaker_domain_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_sagemaker_domain_test.go b/aws/resource_aws_sagemaker_domain_test.go index afa16ffa799..dcc4ff77334 100644 --- a/aws/resource_aws_sagemaker_domain_test.go +++ b/aws/resource_aws_sagemaker_domain_test.go @@ -119,6 +119,7 @@ func testAccAWSSagemakerDomain_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -155,6 +156,7 @@ func testAccAWSSagemakerDomain_kms(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -181,6 +183,7 @@ func testAccAWSSagemakerDomain_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -225,6 +228,7 @@ func testAccAWSSagemakerDomain_securityGroup(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -260,6 +264,7 @@ func testAccAWSSagemakerDomain_sharingSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -290,6 +295,7 @@ func testAccAWSSagemakerDomain_tensorboardAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -319,6 +325,7 @@ func testAccAWSSagemakerDomain_tensorboardAppSettingsWithImage(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -349,6 +356,7 @@ func testAccAWSSagemakerDomain_kernelGatewayAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -384,6 +392,7 @@ func testAccAWSSagemakerDomain_kernelGatewayAppSettings_customImage(t *testing.T resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -415,6 +424,7 @@ func testAccAWSSagemakerDomain_jupyterServerAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ @@ -444,6 +454,7 @@ func testAccAWSSagemakerDomain_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerDomainDestroy, Steps: []resource.TestStep{ From 40885eeab23fa164685a052c1cf5346264332e18 Mon Sep 17 00:00:00 2001 From: bill-rich Date: Thu, 18 Mar 2021 11:28:13 -0700 Subject: [PATCH 0435/1252] Only include acceptance test --- aws/internal/service/ec2/waiter/status.go | 7 +- ...source_aws_ec2_client_vpn_endpoint_test.go | 7 +- ..._aws_ec2_client_vpn_network_association.go | 7 +- ...ec2_client_vpn_network_association_test.go | 106 +++++++++++++++--- 4 files changed, 99 insertions(+), 28 deletions(-) diff --git a/aws/internal/service/ec2/waiter/status.go b/aws/internal/service/ec2/waiter/status.go index 85340dbd76f..9e1e7e54fcd 100644 --- a/aws/internal/service/ec2/waiter/status.go +++ b/aws/internal/service/ec2/waiter/status.go @@ -154,12 +154,7 @@ func ClientVpnNetworkAssociationStatus(conn *ec2.EC2, cvnaID string, cvepID stri return func() (interface{}, string, error) { result, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(cvepID), - Filters: []*ec2.Filter{ - { - Name: aws.String("association-id"), - Values: []*string{aws.String(cvnaID)}, - }, - }, + AssociationIds: []*string{aws.String(cvnaID)}, }) if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeClientVpnAssociationIdNotFound) || tfawserr.ErrCodeEquals(err, tfec2.ErrCodeClientVpnEndpointIdNotFound) { diff --git a/aws/resource_aws_ec2_client_vpn_endpoint_test.go b/aws/resource_aws_ec2_client_vpn_endpoint_test.go index 1ef30b67f68..feedb5b5bae 100644 --- a/aws/resource_aws_ec2_client_vpn_endpoint_test.go +++ b/aws/resource_aws_ec2_client_vpn_endpoint_test.go @@ -101,9 +101,10 @@ func TestAccAwsEc2ClientVpn_serial(t *testing.T) { "disappears": testAccAwsEc2ClientVpnAuthorizationRule_disappears, }, "NetworkAssociation": { - "basic": testAccAwsEc2ClientVpnNetworkAssociation_basic, - "disappears": testAccAwsEc2ClientVpnNetworkAssociation_disappears, - "securityGroups": testAccAwsEc2ClientVpnNetworkAssociation_securityGroups, + "basic": testAccAwsEc2ClientVpnNetworkAssociation_basic, + "multipleSubnets": testAccAwsEc2ClientVpnNetworkAssociation_multipleSubnets, + "disappears": testAccAwsEc2ClientVpnNetworkAssociation_disappears, + "securityGroups": testAccAwsEc2ClientVpnNetworkAssociation_securityGroups, }, "Route": { "basic": testAccAwsEc2ClientVpnRoute_basic, diff --git a/aws/resource_aws_ec2_client_vpn_network_association.go b/aws/resource_aws_ec2_client_vpn_network_association.go index 77f68861dae..040a66e147c 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association.go +++ b/aws/resource_aws_ec2_client_vpn_network_association.go @@ -119,12 +119,7 @@ func resourceAwsEc2ClientVpnNetworkAssociationRead(d *schema.ResourceData, meta result, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(d.Get("client_vpn_endpoint_id").(string)), - Filters: []*ec2.Filter{ - { - Name: aws.String("association-id"), - Values: []*string{aws.String(d.Id())}, - }, - }, + AssociationIds: []*string{aws.String(d.Id())}, }) if isAWSErr(err, tfec2.ErrCodeClientVpnAssociationIdNotFound, "") || isAWSErr(err, tfec2.ErrCodeClientVpnEndpointIdNotFound, "") { diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index a229230352b..e234447adfa 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -131,6 +131,53 @@ func testAccAwsEc2ClientVpnNetworkAssociation_basic(t *testing.T) { }) } +func testAccAwsEc2ClientVpnNetworkAssociation_multipleSubnets(t *testing.T) { + var assoc ec2.TargetNetwork + var group ec2.SecurityGroup + rStr := acctest.RandString(5) + resourceNames := []string{"aws_ec2_client_vpn_network_association.test", "aws_ec2_client_vpn_network_association.test2"} + endpointResourceName := "aws_ec2_client_vpn_endpoint.test" + subnetResourceNames := []string{"aws_subnet.test", "aws_subnet.test2"} + vpcResourceName := "aws_vpc.test" + defaultSecurityGroupResourceName := "aws_default_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccEc2ClientVpnNetworkAssociationConfigMultipleSubnets(rStr), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsEc2ClientVpnNetworkAssociationExists(resourceNames[0], &assoc), + resource.TestMatchResourceAttr(resourceNames[0], "association_id", regexp.MustCompile("^cvpn-assoc-[a-z0-9]+$")), + resource.TestMatchResourceAttr(resourceNames[1], "association_id", regexp.MustCompile("^cvpn-assoc-[a-z0-9]+$")), + resource.TestCheckResourceAttrPair(resourceNames[0], "id", resourceNames[0], "association_id"), + resource.TestCheckResourceAttrPair(resourceNames[0], "client_vpn_endpoint_id", endpointResourceName, "id"), + resource.TestCheckResourceAttrPair(resourceNames[0], "subnet_id", subnetResourceNames[0], "id"), + resource.TestCheckResourceAttrPair(resourceNames[1], "subnet_id", subnetResourceNames[1], "id"), + testAccCheckAWSDefaultSecurityGroupExists(defaultSecurityGroupResourceName, &group), + resource.TestCheckResourceAttr(resourceNames[0], "security_groups.#", "1"), + testAccCheckAwsEc2ClientVpnNetworkAssociationSecurityGroupID(resourceNames[0], "security_groups.*", &group), + resource.TestCheckResourceAttrPair(resourceNames[0], "vpc_id", vpcResourceName, "id"), + ), + }, + { + ResourceName: resourceNames[0], + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccAwsEc2ClientVpnNetworkAssociationImportStateIdFunc(resourceNames[0]), + }, + { + ResourceName: resourceNames[1], + ImportState: true, + ImportStateVerify: true, + ImportStateIdFunc: testAccAwsEc2ClientVpnNetworkAssociationImportStateIdFunc(resourceNames[1]), + }, + }, + }) +} + func testAccAwsEc2ClientVpnNetworkAssociation_disappears(t *testing.T) { var assoc ec2.TargetNetwork rStr := acctest.RandString(5) @@ -206,12 +253,7 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy(s *terraform.State) er resp, _ := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(rs.Primary.Attributes["client_vpn_endpoint_id"]), - Filters: []*ec2.Filter{ - { - Name: aws.String("association-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, - }, + AssociationIds: []*string{aws.String(rs.Primary.ID)}, }) for _, v := range resp.ClientVpnTargetNetworks { @@ -239,12 +281,7 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationExists(name string, assoc *ec2 resp, err := conn.DescribeClientVpnTargetNetworks(&ec2.DescribeClientVpnTargetNetworksInput{ ClientVpnEndpointId: aws.String(rs.Primary.Attributes["client_vpn_endpoint_id"]), - Filters: []*ec2.Filter{ - { - Name: aws.String("association-id"), - Values: []*string{aws.String(rs.Primary.ID)}, - }, - }, + AssociationIds: []*string{aws.String(rs.Primary.ID)}, }) if err != nil { @@ -264,7 +301,7 @@ func testAccCheckAwsEc2ClientVpnNetworkAssociationExists(name string, assoc *ec2 func testAccCheckAwsEc2ClientVpnNetworkAssociationSecurityGroupID(name, key string, group *ec2.SecurityGroup) resource.TestCheckFunc { return func(s *terraform.State) error { - return tfawsresource.TestCheckTypeSetElemAttr(name, key, aws.StringValue(group.GroupId))(s) + return resource.TestCheckTypeSetElemAttr(name, key, aws.StringValue(group.GroupId))(s) } } @@ -306,6 +343,38 @@ resource "aws_ec2_client_vpn_endpoint" "test" { `, rName)) } +func testAccEc2ClientVpnNetworkAssociationConfigMultipleSubnets(rName string) string { + return composeConfig( + testAccEc2ClientVpnNetworkAssociationVpcBase(rName), + testAccEc2ClientVpnNetworkAssociationAcmCertificateBase(), + fmt.Sprintf(` +resource "aws_ec2_client_vpn_network_association" "test" { + client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.test.id + subnet_id = aws_subnet.test.id +} + +resource "aws_ec2_client_vpn_network_association" "test2" { + client_vpn_endpoint_id = aws_ec2_client_vpn_endpoint.test.id + subnet_id = aws_subnet.test2.id +} + +resource "aws_ec2_client_vpn_endpoint" "test" { + description = "terraform-testacc-clientvpn-%[1]s" + server_certificate_arn = aws_acm_certificate.test.arn + client_cidr_block = "10.0.0.0/16" + + authentication_options { + type = "certificate-authentication" + root_certificate_chain_arn = aws_acm_certificate.test.arn + } + + connection_log_options { + enabled = false + } +} +`, rName)) +} + func testAccEc2ClientVpnNetworkAssociationTwoSecurityGroups(rName string) string { return composeConfig( testAccEc2ClientVpnNetworkAssociationVpcBase(rName), @@ -410,6 +479,17 @@ resource "aws_subnet" "test" { Name = "tf-acc-subnet-%[1]s" } } + +resource "aws_subnet" "test2" { + availability_zone = data.aws_availability_zones.available.names[1] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, 1) + vpc_id = aws_vpc.test.id + map_public_ip_on_launch = true + + tags = { + Name = "tf-acc-subnet-%[1]s-2" + } +} `, rName)) } From f167b5e13e02a0fce1e28f1a8ef950e32ec453f2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:35:18 -0400 Subject: [PATCH 0436/1252] tests/r/sagemaker_endpoint_configuration: Add ErrorCheck --- aws/resource_aws_sagemaker_endpoint_configuration_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_sagemaker_endpoint_configuration_test.go b/aws/resource_aws_sagemaker_endpoint_configuration_test.go index 6e251a43bfa..19f36510b65 100644 --- a/aws/resource_aws_sagemaker_endpoint_configuration_test.go +++ b/aws/resource_aws_sagemaker_endpoint_configuration_test.go @@ -62,6 +62,7 @@ func TestAccAWSSagemakerEndpointConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -94,6 +95,7 @@ func TestAccAWSSagemakerEndpointConfiguration_productionVariants_InitialVariantW resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -120,6 +122,7 @@ func TestAccAWSSagemakerEndpointConfiguration_productionVariants_AcceleratorType resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -145,6 +148,7 @@ func TestAccAWSSagemakerEndpointConfiguration_kmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -170,6 +174,7 @@ func TestAccAWSSagemakerEndpointConfiguration_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -213,6 +218,7 @@ func TestAccAWSSagemakerEndpointConfiguration_dataCaptureConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ @@ -245,6 +251,7 @@ func TestAccAWSSagemakerEndpointConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointConfigurationDestroy, Steps: []resource.TestStep{ From 7b91e38218c9afad2744fbfe7b5ced65a2f7a525 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:35:28 -0400 Subject: [PATCH 0437/1252] tests/r/sagemaker_endpoint: Add ErrorCheck --- aws/resource_aws_sagemaker_endpoint_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_sagemaker_endpoint_test.go b/aws/resource_aws_sagemaker_endpoint_test.go index fc8a76cd745..26ca5952853 100644 --- a/aws/resource_aws_sagemaker_endpoint_test.go +++ b/aws/resource_aws_sagemaker_endpoint_test.go @@ -63,6 +63,7 @@ func TestAccAWSSagemakerEndpoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointDestroy, Steps: []resource.TestStep{ @@ -92,6 +93,7 @@ func TestAccAWSSagemakerEndpoint_EndpointConfigName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointDestroy, Steps: []resource.TestStep{ @@ -124,6 +126,7 @@ func TestAccAWSSagemakerEndpoint_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerEndpointDestroy, Steps: []resource.TestStep{ From 0999a8cff782b573ce41a9972c8f2fe02a1ece55 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:35:40 -0400 Subject: [PATCH 0438/1252] tests/r/sagemaker_feature_group: Add ErrorCheck --- aws/resource_aws_sagemaker_feature_group_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_sagemaker_feature_group_test.go b/aws/resource_aws_sagemaker_feature_group_test.go index 774b44dd8c9..2429c423992 100644 --- a/aws/resource_aws_sagemaker_feature_group_test.go +++ b/aws/resource_aws_sagemaker_feature_group_test.go @@ -65,6 +65,7 @@ func TestAccAWSSagemakerFeatureGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -100,6 +101,7 @@ func TestAccAWSSagemakerFeatureGroup_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -127,6 +129,7 @@ func TestAccAWSSagemakerFeatureGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -174,6 +177,7 @@ func TestAccAWSSagemakerFeatureGroup_multipleFeatures(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -205,6 +209,7 @@ func TestAccAWSSagemakerFeatureGroup_onlineConfigSecurityConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -235,6 +240,7 @@ func TestAccAWSSagemakerFeatureGroup_offlineConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -266,6 +272,7 @@ func TestAccAWSSagemakerFeatureGroup_offlineConfig_createCatalog(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -301,6 +308,7 @@ func TestAccAWSSagemakerFeatureGroup_offlineConfig_providedCatalog(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ @@ -335,6 +343,7 @@ func TestAccAWSSagemakerFeatureGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerFeatureGroupDestroy, Steps: []resource.TestStep{ From 86c0eeb7bd97b8fa73de593cc0197bc56e2e36fe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:35:51 -0400 Subject: [PATCH 0439/1252] tests/r/sagemaker_image: Add ErrorCheck --- aws/resource_aws_sagemaker_image_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_sagemaker_image_test.go b/aws/resource_aws_sagemaker_image_test.go index d2f25826f59..a34063ead08 100644 --- a/aws/resource_aws_sagemaker_image_test.go +++ b/aws/resource_aws_sagemaker_image_test.go @@ -64,6 +64,7 @@ func TestAccAWSSagemakerImage_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageDestroy, Steps: []resource.TestStep{ @@ -93,6 +94,7 @@ func TestAccAWSSagemakerImage_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageDestroy, Steps: []resource.TestStep{ @@ -133,6 +135,7 @@ func TestAccAWSSagemakerImage_displayName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSSagemakerImage_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageDestroy, Steps: []resource.TestStep{ @@ -217,6 +221,7 @@ func TestAccAWSSagemakerImage_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageDestroy, Steps: []resource.TestStep{ From 341818a2eaf705bd7812f74bdfd342440d7fe1e6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:02 -0400 Subject: [PATCH 0440/1252] tests/r/sagemaker_image_version: Add ErrorCheck --- aws/resource_aws_sagemaker_image_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_sagemaker_image_version_test.go b/aws/resource_aws_sagemaker_image_version_test.go index 0b39ba99661..710d4ace8cc 100644 --- a/aws/resource_aws_sagemaker_image_version_test.go +++ b/aws/resource_aws_sagemaker_image_version_test.go @@ -26,6 +26,7 @@ func TestAccAWSSagemakerImageVersion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageVersionDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSSagemakerImageVersion_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageVersionDestroy, Steps: []resource.TestStep{ @@ -91,6 +93,7 @@ func TestAccAWSSagemakerImageVersion_disappears_image(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerImageVersionDestroy, Steps: []resource.TestStep{ From dae138e1394559dbea977211d228719e6940d0a4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:12 -0400 Subject: [PATCH 0441/1252] tests/r/sagemaker_model_package_group: Add ErrorCheck --- aws/resource_aws_sagemaker_model_package_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sagemaker_model_package_group_test.go b/aws/resource_aws_sagemaker_model_package_group_test.go index 8e482f52320..af5fe7aeae8 100644 --- a/aws/resource_aws_sagemaker_model_package_group_test.go +++ b/aws/resource_aws_sagemaker_model_package_group_test.go @@ -64,6 +64,7 @@ func TestAccAWSSagemakerModelPackageGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerModelPackageGroupDestroy, Steps: []resource.TestStep{ @@ -92,6 +93,7 @@ func TestAccAWSSagemakerModelPackageGroup_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerModelPackageGroupDestroy, Steps: []resource.TestStep{ @@ -118,6 +120,7 @@ func TestAccAWSSagemakerModelPackageGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerModelPackageGroupDestroy, Steps: []resource.TestStep{ @@ -162,6 +165,7 @@ func TestAccAWSSagemakerModelPackageGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerModelPackageGroupDestroy, Steps: []resource.TestStep{ From af01007adc5b820c3523ac5ecad5e813f0b7f294 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:23 -0400 Subject: [PATCH 0442/1252] tests/r/sagemaker_model: Add ErrorCheck --- aws/resource_aws_sagemaker_model_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_sagemaker_model_test.go b/aws/resource_aws_sagemaker_model_test.go index 2caae650b3c..3b8b29e29c2 100644 --- a/aws/resource_aws_sagemaker_model_test.go +++ b/aws/resource_aws_sagemaker_model_test.go @@ -57,6 +57,7 @@ func TestAccAWSSagemakerModel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -90,6 +91,7 @@ func TestAccAWSSagemakerModel_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -133,6 +135,7 @@ func TestAccAWSSagemakerModel_primaryContainerModelDataUrl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -158,6 +161,7 @@ func TestAccAWSSagemakerModel_primaryContainerHostname(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -183,6 +187,7 @@ func TestAccAWSSagemakerModel_primaryContainerImageConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -209,6 +214,7 @@ func TestAccAWSSagemakerModel_primaryContainerEnvironment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -235,6 +241,7 @@ func TestAccAWSSagemakerModel_primaryContainerModeSingle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -260,6 +267,7 @@ func TestAccAWSSagemakerModel_containers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -287,6 +295,7 @@ func TestAccAWSSagemakerModel_vpcConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -314,6 +323,7 @@ func TestAccAWSSagemakerModel_networkIsolation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ @@ -339,6 +349,7 @@ func TestAccAWSSagemakerModel_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSagemakerModelDestroy, Steps: []resource.TestStep{ From 104f6079bb6761787defec9d9ce2229144defd6b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:35 -0400 Subject: [PATCH 0443/1252] tests/r/sagemaker_notebook_instance_lifecycle_configuration: Add ErrorCheck --- ..._sagemaker_notebook_instance_lifecycle_configuration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go b/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go index dd72f29030b..a55fc3598d0 100644 --- a/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go +++ b/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go @@ -73,6 +73,7 @@ func TestAccAWSSagemakerNotebookInstanceLifecycleConfiguration_basic(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func TestAccAWSSagemakerNotebookInstanceLifecycleConfiguration_Update(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceLifecycleConfigurationDestroy, Steps: []resource.TestStep{ From d9bca37d9eff4ae94f74bc25472ef76780927042 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:47 -0400 Subject: [PATCH 0444/1252] tests/r/sagemaker_notebook_instance: Add ErrorCheck --- aws/resource_aws_sagemaker_notebook_instance_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_sagemaker_notebook_instance_test.go b/aws/resource_aws_sagemaker_notebook_instance_test.go index 5b5d99fd2a9..cae2f956f13 100644 --- a/aws/resource_aws_sagemaker_notebook_instance_test.go +++ b/aws/resource_aws_sagemaker_notebook_instance_test.go @@ -80,6 +80,7 @@ func TestAccAWSSagemakerNotebookInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSSagemakerNotebookInstance_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -149,6 +151,7 @@ func TestAccAWSSagemakerNotebookInstance_volumesize(t *testing.T) { var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -192,6 +195,7 @@ func TestAccAWSSagemakerNotebookInstance_LifecycleConfigName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -232,6 +236,7 @@ func TestAccAWSSagemakerNotebookInstance_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -276,6 +281,7 @@ func TestAccAWSSagemakerNotebookInstance_kms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -302,6 +308,7 @@ func TestAccAWSSagemakerNotebookInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -394,6 +401,7 @@ func TestAccAWSSagemakerNotebookInstance_root_access(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -427,6 +435,7 @@ func TestAccAWSSagemakerNotebookInstance_direct_internet_access(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -465,6 +474,7 @@ func TestAccAWSSagemakerNotebookInstance_default_code_repository(t *testing.T) { var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -504,6 +514,7 @@ func TestAccAWSSagemakerNotebookInstance_additional_code_repositories(t *testing var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ @@ -554,6 +565,7 @@ func TestAccAWSSagemakerNotebookInstance_default_code_repository_sagemakerRepo(t var resourceName = "aws_sagemaker_notebook_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, Steps: []resource.TestStep{ From 2a99280d8197175f3fedd5f6a77c6debce0e5fcd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:36:59 -0400 Subject: [PATCH 0445/1252] tests/r/sagemaker_user_profile: Add ErrorCheck --- aws/resource_aws_sagemaker_user_profile_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_sagemaker_user_profile_test.go b/aws/resource_aws_sagemaker_user_profile_test.go index 7124b8a55e0..2e5640d00b1 100644 --- a/aws/resource_aws_sagemaker_user_profile_test.go +++ b/aws/resource_aws_sagemaker_user_profile_test.go @@ -72,6 +72,7 @@ func testAccAWSSagemakerUserProfile_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func testAccAWSSagemakerUserProfile_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -147,6 +149,7 @@ func testAccAWSSagemakerUserProfile_tensorboardAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -176,6 +179,7 @@ func testAccAWSSagemakerUserProfile_tensorboardAppSettingsWithImage(t *testing.T resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -206,6 +210,7 @@ func testAccAWSSagemakerUserProfile_kernelGatewayAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -235,6 +240,7 @@ func testAccAWSSagemakerUserProfile_jupyterServerAppSettings(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ @@ -264,6 +270,7 @@ func testAccAWSSagemakerUserProfile_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSagemakerUserProfileDestroy, Steps: []resource.TestStep{ From 9029bcfa3686e6a10a89c835b8a1f7abadf33f86 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 18:37:37 +0000 Subject: [PATCH 0446/1252] Update CHANGELOG.md for #14319 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0009e4af229..f00dc07bcc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ NOTES: * provider: New `default_tags` argument as a public preview for applying tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) +* resource/aws_wafv2_web_acl_logging_configuration: The `redacted_fields` configuration block `all_query_arguments`, `body`, and `single_query_argument` arguments have been deprecated to match the WAF API documentation ([#14319](https://github.com/hashicorp/terraform-provider-aws/issues/14319)) FEATURES: @@ -26,6 +27,7 @@ BUG FIXES: * resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) * resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) * resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) +* resource/aws_wafv2_web_acl_logging_configuration: Ensure `redacted_fields` are applied to the resource ([#14319](https://github.com/hashicorp/terraform-provider-aws/issues/14319)) ## 3.32.0 (March 12, 2021) From a17a8b841bc8deded3cd6955eee956fb02a422ae Mon Sep 17 00:00:00 2001 From: bill-rich Date: Thu, 18 Mar 2021 11:40:00 -0700 Subject: [PATCH 0447/1252] Add changelog --- .changelog/18199.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18199.txt diff --git a/.changelog/18199.txt b/.changelog/18199.txt new file mode 100644 index 00000000000..7dc610e6502 --- /dev/null +++ b/.changelog/18199.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ec2_client_vpn_network_association: Add test to ensure it is possible to associate multiple subnets +``` From c60760c5a08f3b5304f48d466c2152f89d96d357 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:42:44 -0400 Subject: [PATCH 0448/1252] tests/r/ses_active_receipt_rule_set: Add ErrorCheck --- aws/resource_aws_ses_active_receipt_rule_set_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ses_active_receipt_rule_set_test.go b/aws/resource_aws_ses_active_receipt_rule_set_test.go index 3bc025bf64c..2717641f360 100644 --- a/aws/resource_aws_ses_active_receipt_rule_set_test.go +++ b/aws/resource_aws_ses_active_receipt_rule_set_test.go @@ -38,6 +38,7 @@ func testAccAWSSESActiveReceiptRuleSet_basic(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESActiveReceiptRuleSetDestroy, Steps: []resource.TestStep{ @@ -62,6 +63,7 @@ func testAccAWSSESActiveReceiptRuleSet_disappears(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESActiveReceiptRuleSetDestroy, Steps: []resource.TestStep{ From 3c33c2e4f3124d973af781d1253a9911d982742f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:42:54 -0400 Subject: [PATCH 0449/1252] tests/r/ses_configuration_set: Add ErrorCheck --- aws/resource_aws_ses_configuration_set_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_ses_configuration_set_test.go b/aws/resource_aws_ses_configuration_set_test.go index 6279ff066be..775d6e51e1a 100644 --- a/aws/resource_aws_ses_configuration_set_test.go +++ b/aws/resource_aws_ses_configuration_set_test.go @@ -76,6 +76,7 @@ func TestAccAWSSESConfigurationSet_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAWSSESConfigurationSet_deliveryOptions(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSSESConfigurationSet_update_deliveryOptions(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAWSSESConfigurationSet_emptyDeliveryOptions(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ @@ -219,6 +223,7 @@ func TestAccAWSSESConfigurationSet_update_emptyDeliveryOptions(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ @@ -267,6 +272,7 @@ func TestAccAWSSESConfigurationSet_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESConfigurationSetDestroy, Steps: []resource.TestStep{ From 700be5b9bf23d6dc589109b7c2e0fe78c87123fa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:05 -0400 Subject: [PATCH 0450/1252] tests/r/ses_domain_dkim: Add ErrorCheck --- aws/resource_aws_ses_domain_dkim_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ses_domain_dkim_test.go b/aws/resource_aws_ses_domain_dkim_test.go index b2343f241cb..817fd6577bd 100644 --- a/aws/resource_aws_ses_domain_dkim_test.go +++ b/aws/resource_aws_ses_domain_dkim_test.go @@ -24,6 +24,7 @@ func TestAccAWSSESDomainDkim_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainDkimDestroy, Steps: []resource.TestStep{ From b87c229ca06f22387bd38857923a03f07eed308e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:15 -0400 Subject: [PATCH 0451/1252] tests/r/ses_domain_identity: Add ErrorCheck --- aws/resource_aws_ses_domain_identity_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ses_domain_identity_test.go b/aws/resource_aws_ses_domain_identity_test.go index 2be3189dc21..14d844e5ced 100644 --- a/aws/resource_aws_ses_domain_identity_test.go +++ b/aws/resource_aws_ses_domain_identity_test.go @@ -74,6 +74,7 @@ func TestAccAWSSESDomainIdentity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ @@ -95,6 +96,7 @@ func TestAccAWSSESDomainIdentity_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ @@ -119,6 +121,7 @@ func TestAccAWSSESDomainIdentity_trailingPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ From e83c4e9375b55c59a57a7f9fec75c04d0085de4f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:26 -0400 Subject: [PATCH 0452/1252] tests/r/ses_domain_identity_verification: Add ErrorCheck --- aws/resource_aws_ses_domain_identity_verification_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ses_domain_identity_verification_test.go b/aws/resource_aws_ses_domain_identity_verification_test.go index 869f8ba0a26..2c293815e82 100644 --- a/aws/resource_aws_ses_domain_identity_verification_test.go +++ b/aws/resource_aws_ses_domain_identity_verification_test.go @@ -31,6 +31,7 @@ func TestAccAwsSesDomainIdentityVerification_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAwsSesDomainIdentityVerification_timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAwsSesDomainIdentityVerification_nonexistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESDomainIdentityDestroy, Steps: []resource.TestStep{ From 2fb50943e4bcc03c40049ee42687b7b7551ae7b8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:37 -0400 Subject: [PATCH 0453/1252] tests/r/ses_domain_mail_from: Add ErrorCheck --- aws/resource_aws_ses_domain_mail_from_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ses_domain_mail_from_test.go b/aws/resource_aws_ses_domain_mail_from_test.go index 266819f71cc..6bf3003d7cf 100644 --- a/aws/resource_aws_ses_domain_mail_from_test.go +++ b/aws/resource_aws_ses_domain_mail_from_test.go @@ -21,6 +21,7 @@ func TestAccAWSSESDomainMailFrom_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESDomainMailFromDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSSESDomainMailFrom_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESDomainMailFromDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAWSSESDomainMailFrom_disappears_Identity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESDomainMailFromDestroy, Steps: []resource.TestStep{ @@ -107,6 +110,7 @@ func TestAccAWSSESDomainMailFrom_behaviorOnMxFailure(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESDomainMailFromDestroy, Steps: []resource.TestStep{ From 8e7c5631819608f61a82fbd38cbc96b02733e774 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:47 -0400 Subject: [PATCH 0454/1252] tests/r/ses_email_identity: Add ErrorCheck --- aws/resource_aws_ses_email_identity_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ses_email_identity_test.go b/aws/resource_aws_ses_email_identity_test.go index 423cb76b26f..ddffd93208d 100644 --- a/aws/resource_aws_ses_email_identity_test.go +++ b/aws/resource_aws_ses_email_identity_test.go @@ -28,6 +28,7 @@ func TestAccAWSSESEmailIdentity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESEmailIdentityDestroy, Steps: []resource.TestStep{ @@ -55,6 +56,7 @@ func TestAccAWSSESEmailIdentity_trailingPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESEmailIdentityDestroy, Steps: []resource.TestStep{ From 8e762a2a9a72d9dd50d7af991c8918fc0a141217 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:43:57 -0400 Subject: [PATCH 0455/1252] tests/r/ses_event_destination: Add ErrorCheck --- aws/resource_aws_ses_event_destination_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ses_event_destination_test.go b/aws/resource_aws_ses_event_destination_test.go index 0890dcc23bd..53cb2f78ea1 100644 --- a/aws/resource_aws_ses_event_destination_test.go +++ b/aws/resource_aws_ses_event_destination_test.go @@ -25,6 +25,7 @@ func TestAccAWSSESEventDestination_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESEventDestinationDestroy, Steps: []resource.TestStep{ @@ -78,6 +79,7 @@ func TestAccAWSSESEventDestination_disappears(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESEventDestinationDestroy, Steps: []resource.TestStep{ From 7baf1e549ea2c08efb99216e3b5a9ef673aed90a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:44:08 -0400 Subject: [PATCH 0456/1252] tests/r/ses_identity_notification_topic: Add ErrorCheck --- aws/resource_aws_ses_identity_notification_topic_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ses_identity_notification_topic_test.go b/aws/resource_aws_ses_identity_notification_topic_test.go index ec85138f51e..f4dd72a9b68 100644 --- a/aws/resource_aws_ses_identity_notification_topic_test.go +++ b/aws/resource_aws_ses_identity_notification_topic_test.go @@ -25,6 +25,7 @@ func TestAccAwsSESIdentityNotificationTopic_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESIdentityNotificationTopicDestroy, Steps: []resource.TestStep{ From e51168bcdfe550f3ec9af3ba7cf43db00944ee55 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:44:20 -0400 Subject: [PATCH 0457/1252] tests/r/ses_identity_policy: Add ErrorCheck --- aws/resource_aws_ses_identity_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ses_identity_policy_test.go b/aws/resource_aws_ses_identity_policy_test.go index 4db95bf9002..3c4f9cd6fa4 100644 --- a/aws/resource_aws_ses_identity_policy_test.go +++ b/aws/resource_aws_ses_identity_policy_test.go @@ -19,6 +19,7 @@ func TestAccAWSSESIdentityPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESIdentityPolicyDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSSESIdentityPolicy_Identity_Email(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESIdentityPolicyDestroy, Steps: []resource.TestStep{ @@ -71,6 +73,7 @@ func TestAccAWSSESIdentityPolicy_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSESIdentityPolicyDestroy, Steps: []resource.TestStep{ From 52d2498f44b26b5fb1ed1f70d76b18ee41cf8795 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:44:31 -0400 Subject: [PATCH 0458/1252] tests/r/ses_receipt_filter: Add ErrorCheck --- aws/resource_aws_ses_receipt_filter_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ses_receipt_filter_test.go b/aws/resource_aws_ses_receipt_filter_test.go index 7e419e5e707..1828f75ad60 100644 --- a/aws/resource_aws_ses_receipt_filter_test.go +++ b/aws/resource_aws_ses_receipt_filter_test.go @@ -17,6 +17,7 @@ func TestAccAWSSESReceiptFilter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t); testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptFilterDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSSESReceiptFilter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t); testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptFilterDestroy, Steps: []resource.TestStep{ From 77d28495174372bd9c9b01f3875bcf520a7ca9e2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:44:42 -0400 Subject: [PATCH 0459/1252] tests/r/ses_receipt_rule_set: Add ErrorCheck --- aws/resource_aws_ses_receipt_rule_set_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ses_receipt_rule_set_test.go b/aws/resource_aws_ses_receipt_rule_set_test.go index 9d754da866b..be02297e28f 100644 --- a/aws/resource_aws_ses_receipt_rule_set_test.go +++ b/aws/resource_aws_ses_receipt_rule_set_test.go @@ -86,6 +86,7 @@ func TestAccAWSSESReceiptRuleSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t); testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleSetDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSSESReceiptRuleSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t); testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleSetDestroy, Steps: []resource.TestStep{ From 8b2318f62ee29f50b896900576e3b2010feb2417 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:44:52 -0400 Subject: [PATCH 0460/1252] tests/r/ses_receipt_rule: Add ErrorCheck --- aws/resource_aws_ses_receipt_rule_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ses_receipt_rule_test.go b/aws/resource_aws_ses_receipt_rule_test.go index 9e5397b4713..e30041cd004 100644 --- a/aws/resource_aws_ses_receipt_rule_test.go +++ b/aws/resource_aws_ses_receipt_rule_test.go @@ -23,6 +23,7 @@ func TestAccAWSSESReceiptRule_basic(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSSESReceiptRule_s3Action(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSSESReceiptRule_order(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleDestroy, Steps: []resource.TestStep{ @@ -108,6 +111,7 @@ func TestAccAWSSESReceiptRule_actions(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleDestroy, Steps: []resource.TestStep{ @@ -138,6 +142,7 @@ func TestAccAWSSESReceiptRule_disappears(t *testing.T) { testAccPreCheckAWSSES(t) testAccPreCheckSESReceiptRule(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSESReceiptRuleDestroy, Steps: []resource.TestStep{ From a323af066ce3d94e3f825423cdf33989611db8bf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:45:03 -0400 Subject: [PATCH 0461/1252] tests/r/ses_template: Add ErrorCheck --- aws/resource_aws_ses_template_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ses_template_test.go b/aws/resource_aws_ses_template_test.go index d4c8f9ab94d..7796b9e82b7 100644 --- a/aws/resource_aws_ses_template_test.go +++ b/aws/resource_aws_ses_template_test.go @@ -19,6 +19,7 @@ func TestAccAWSSesTemplate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSesTemplateDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSSesTemplate_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSesTemplateDestroy, Steps: []resource.TestStep{ @@ -99,6 +101,7 @@ func TestAccAWSSesTemplate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSES(t) }, + ErrorCheck: testAccErrorCheck(t, ses.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckSesTemplateDestroy, Steps: []resource.TestStep{ From 640104a57e4145d1fa71c7dc419c2878b531782c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:02 -0400 Subject: [PATCH 0462/1252] tests/ds/apigatewayv2_apis: Add ErrorCheck --- aws/data_source_aws_apigatewayv2_apis_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_apigatewayv2_apis_test.go b/aws/data_source_aws_apigatewayv2_apis_test.go index 8bbe938df4b..9e8a1f554b4 100644 --- a/aws/data_source_aws_apigatewayv2_apis_test.go +++ b/aws/data_source_aws_apigatewayv2_apis_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSAPIGatewayV2ApisDataSource_Name(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -38,6 +40,7 @@ func TestAccAWSAPIGatewayV2ApisDataSource_ProtocolType(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -61,6 +64,7 @@ func TestAccAWSAPIGatewayV2ApisDataSource_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 2747d47e944255e71260e4487d2815acbb3a8c3f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:11 -0400 Subject: [PATCH 0463/1252] tests/r/apigatewayv2_api: Add ErrorCheck --- aws/resource_aws_apigatewayv2_api_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_api_test.go b/aws/resource_aws_apigatewayv2_api_test.go index c1f6d7da02a..64653b3d417 100644 --- a/aws/resource_aws_apigatewayv2_api_test.go +++ b/aws/resource_aws_apigatewayv2_api_test.go @@ -75,6 +75,7 @@ func TestAccAWSAPIGatewayV2Api_basicWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSAPIGatewayV2Api_basicHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -149,6 +151,7 @@ func TestAccAWSAPIGatewayV2Api_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -172,6 +175,7 @@ func TestAccAWSAPIGatewayV2Api_AllAttributesWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -253,6 +257,7 @@ func TestAccAWSAPIGatewayV2Api_AllAttributesHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -333,6 +338,7 @@ func TestAccAWSAPIGatewayV2Api_Openapi(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -379,6 +385,7 @@ func TestAccAWSAPIGatewayV2Api_Openapi_WithTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -423,6 +430,7 @@ func TestAccAWSAPIGatewayV2Api_Openapi_WithCorsConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -479,6 +487,7 @@ func TestAccAWSAPIGatewayV2Api_OpenapiWithMoreFields(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -562,6 +571,7 @@ func TestAccAWSAPIGatewayV2Api_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -614,6 +624,7 @@ func TestAccAWSAPIGatewayV2Api_CorsConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ @@ -704,6 +715,7 @@ func TestAccAWSAPIGatewayV2Api_QuickCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiDestroy, Steps: []resource.TestStep{ From dbba4bf15139e9c131421c59e4309caeb163d976 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:21 -0400 Subject: [PATCH 0464/1252] tests/r/apigatewayv2_authorizer: Add ErrorCheck --- aws/resource_aws_apigatewayv2_authorizer_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_authorizer_test.go b/aws/resource_aws_apigatewayv2_authorizer_test.go index 29dc02a15db..7d977a6b137 100644 --- a/aws/resource_aws_apigatewayv2_authorizer_test.go +++ b/aws/resource_aws_apigatewayv2_authorizer_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayV2Authorizer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSAPIGatewayV2Authorizer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccAWSAPIGatewayV2Authorizer_Credentials(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ @@ -150,6 +153,7 @@ func TestAccAWSAPIGatewayV2Authorizer_JWT(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ @@ -209,6 +213,7 @@ func TestAccAWSAPIGatewayV2Authorizer_HttpApiLambdaRequestAuthorizer_InitialMiss resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ @@ -281,6 +286,7 @@ func TestAccAWSAPIGatewayV2Authorizer_HttpApiLambdaRequestAuthorizer_InitialZero resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2AuthorizerDestroy, Steps: []resource.TestStep{ From 64c675376482d1e2fd5c7906e404c3737985e264 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:30 -0400 Subject: [PATCH 0465/1252] tests/r/apigatewayv2_deployment: Add ErrorCheck --- aws/resource_aws_apigatewayv2_deployment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_deployment_test.go b/aws/resource_aws_apigatewayv2_deployment_test.go index 8edecee1598..a1703648ef5 100644 --- a/aws/resource_aws_apigatewayv2_deployment_test.go +++ b/aws/resource_aws_apigatewayv2_deployment_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayV2Deployment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DeploymentDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSAPIGatewayV2Deployment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DeploymentDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSAPIGatewayV2Deployment_Triggers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DeploymentDestroy, Steps: []resource.TestStep{ From 41c8d92776eae8774db42bf04d1b378df4af39f0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:39 -0400 Subject: [PATCH 0466/1252] tests/r/apigatewayv2_domain_name: Add ErrorCheck --- aws/resource_aws_apigatewayv2_domain_name_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_domain_name_test.go b/aws/resource_aws_apigatewayv2_domain_name_test.go index 5efe6323f62..5073af9702a 100644 --- a/aws/resource_aws_apigatewayv2_domain_name_test.go +++ b/aws/resource_aws_apigatewayv2_domain_name_test.go @@ -76,6 +76,7 @@ func TestAccAWSAPIGatewayV2DomainName_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ @@ -114,6 +115,7 @@ func TestAccAWSAPIGatewayV2DomainName_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ @@ -140,6 +142,7 @@ func TestAccAWSAPIGatewayV2DomainName_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ @@ -198,6 +201,7 @@ func TestAccAWSAPIGatewayV2DomainName_UpdateCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ @@ -272,6 +276,7 @@ func TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ From eced62ef3d76bab8169986148abd58df30d4c668 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:49 -0400 Subject: [PATCH 0467/1252] tests/r/apigatewayv2_integration_response: Add ErrorCheck --- aws/resource_aws_apigatewayv2_integration_response_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_integration_response_test.go b/aws/resource_aws_apigatewayv2_integration_response_test.go index ce62dc29e71..cb30a074f0f 100644 --- a/aws/resource_aws_apigatewayv2_integration_response_test.go +++ b/aws/resource_aws_apigatewayv2_integration_response_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayV2IntegrationResponse_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationResponseDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSAPIGatewayV2IntegrationResponse_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationResponseDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSAPIGatewayV2IntegrationResponse_AllAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationResponseDestroy, Steps: []resource.TestStep{ From 0d6aa71b57ae9389d3cd4fa0a11bde8262428e82 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:49:59 -0400 Subject: [PATCH 0468/1252] tests/r/apigatewayv2_integration: Add ErrorCheck --- aws/resource_aws_apigatewayv2_integration_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_integration_test.go b/aws/resource_aws_apigatewayv2_integration_test.go index 2b0248cc96d..f2fe1425aab 100644 --- a/aws/resource_aws_apigatewayv2_integration_test.go +++ b/aws/resource_aws_apigatewayv2_integration_test.go @@ -19,6 +19,7 @@ func TestAccAWSAPIGatewayV2Integration_basicWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func TestAccAWSAPIGatewayV2Integration_basicHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -109,6 +111,7 @@ func TestAccAWSAPIGatewayV2Integration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -132,6 +135,7 @@ func TestAccAWSAPIGatewayV2Integration_DataMappingHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -222,6 +226,7 @@ func TestAccAWSAPIGatewayV2Integration_IntegrationTypeHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -298,6 +303,7 @@ func TestAccAWSAPIGatewayV2Integration_LambdaWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -343,6 +349,7 @@ func TestAccAWSAPIGatewayV2Integration_LambdaHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -388,6 +395,7 @@ func TestAccAWSAPIGatewayV2Integration_VpcLinkWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -435,6 +443,7 @@ func TestAccAWSAPIGatewayV2Integration_VpcLinkHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ @@ -515,6 +524,7 @@ func TestAccAWSAPIGatewayV2Integration_AwsServiceIntegration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2IntegrationDestroy, Steps: []resource.TestStep{ From a30e7bbf906668fddaa5c4da541a0bb108c51331 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:50:10 -0400 Subject: [PATCH 0469/1252] tests/r/apigatewayv2_model: Add ErrorCheck --- aws/resource_aws_apigatewayv2_model_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_model_test.go b/aws/resource_aws_apigatewayv2_model_test.go index 9b8a7ab48bb..2b8bf791ada 100644 --- a/aws/resource_aws_apigatewayv2_model_test.go +++ b/aws/resource_aws_apigatewayv2_model_test.go @@ -33,6 +33,7 @@ func TestAccAWSAPIGatewayV2Model_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ModelDestroy, Steps: []resource.TestStep{ @@ -77,6 +78,7 @@ func TestAccAWSAPIGatewayV2Model_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ModelDestroy, Steps: []resource.TestStep{ @@ -128,6 +130,7 @@ func TestAccAWSAPIGatewayV2Model_AllAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ModelDestroy, Steps: []resource.TestStep{ From 42e3dfdfc94489af997c79be2a9580c173ad0ef6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:50:21 -0400 Subject: [PATCH 0470/1252] tests/r/apigatewayv2_route_response: Add ErrorCheck --- aws/resource_aws_apigatewayv2_route_response_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_route_response_test.go b/aws/resource_aws_apigatewayv2_route_response_test.go index 2f35d9debc0..d2f47aea3b0 100644 --- a/aws/resource_aws_apigatewayv2_route_response_test.go +++ b/aws/resource_aws_apigatewayv2_route_response_test.go @@ -21,6 +21,7 @@ func TestAccAWSAPIGatewayV2RouteResponse_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteResponseDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSAPIGatewayV2RouteResponse_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteResponseDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSAPIGatewayV2RouteResponse_Model(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteResponseDestroy, Steps: []resource.TestStep{ From 74ec7d05e0050efa70c2cb6218a16cd211f1bfd3 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 14:50:25 -0400 Subject: [PATCH 0471/1252] add CHANGELOG entry --- .changelog/17589.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17589.txt diff --git a/.changelog/17589.txt b/.changelog/17589.txt new file mode 100644 index 00000000000..17a28b7e405 --- /dev/null +++ b/.changelog/17589.txt @@ -0,0 +1,3 @@ +```release-note:new-data-source +aws_ec2_transit_gateway_route_tables +``` \ No newline at end of file From 9f284f193b67f27f8f4a737135829973d005e8ed Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:50:33 -0400 Subject: [PATCH 0472/1252] tests/r/apigatewayv2_route: Add ErrorCheck --- aws/resource_aws_apigatewayv2_route_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_route_test.go b/aws/resource_aws_apigatewayv2_route_test.go index e1a136c535c..9fdf09aa95a 100644 --- a/aws/resource_aws_apigatewayv2_route_test.go +++ b/aws/resource_aws_apigatewayv2_route_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayV2Route_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSAPIGatewayV2Route_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSAPIGatewayV2Route_Authorizer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -134,6 +137,7 @@ func TestAccAWSAPIGatewayV2Route_JwtAuthorization(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -189,6 +193,7 @@ func TestAccAWSAPIGatewayV2Route_Model(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -226,6 +231,7 @@ func TestAccAWSAPIGatewayV2Route_SimpleAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -294,6 +300,7 @@ func TestAccAWSAPIGatewayV2Route_Target(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ @@ -330,6 +337,7 @@ func TestAccAWSAPIGatewayV2Route_UpdateRouteKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2RouteDestroy, Steps: []resource.TestStep{ From 4074ac2dd265ca58c81e2e4dd7b61754e28b05a1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:50:44 -0400 Subject: [PATCH 0473/1252] tests/r/apigatewayv2_stage: Add ErrorCheck --- aws/resource_aws_apigatewayv2_stage_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_stage_test.go b/aws/resource_aws_apigatewayv2_stage_test.go index 5e725e00e6b..a8fe7785224 100644 --- a/aws/resource_aws_apigatewayv2_stage_test.go +++ b/aws/resource_aws_apigatewayv2_stage_test.go @@ -20,6 +20,7 @@ func TestAccAWSAPIGatewayV2Stage_basicWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -65,6 +66,7 @@ func TestAccAWSAPIGatewayV2Stage_basicHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -110,6 +112,7 @@ func TestAccAWSAPIGatewayV2Stage_defaultHttpStage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -155,6 +158,7 @@ func TestAccAWSAPIGatewayV2Stage_autoDeployHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -226,6 +230,7 @@ func TestAccAWSAPIGatewayV2Stage_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -250,6 +255,7 @@ func TestAccAWSAPIGatewayV2Stage_AccessLogSettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAPIGatewayAccountCloudWatchRoleArn(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -321,6 +327,7 @@ func TestAccAWSAPIGatewayV2Stage_ClientCertificateIdAndDescription(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -390,6 +397,7 @@ func TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAPIGatewayAccountCloudWatchRoleArn(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -480,6 +488,7 @@ func TestAccAWSAPIGatewayV2Stage_DefaultRouteSettingsHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -571,6 +580,7 @@ func TestAccAWSAPIGatewayV2Stage_Deployment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -616,6 +626,7 @@ func TestAccAWSAPIGatewayV2Stage_RouteSettingsWebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAPIGatewayAccountCloudWatchRoleArn(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -743,6 +754,7 @@ func TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -847,6 +859,7 @@ func TestAccAWSAPIGatewayV2Stage_RouteSettingsHttp_WithRoute(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -930,6 +943,7 @@ func TestAccAWSAPIGatewayV2Stage_StageVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ @@ -998,6 +1012,7 @@ func TestAccAWSAPIGatewayV2Stage_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2StageDestroy, Steps: []resource.TestStep{ From 90c2f462d45f966d9edefa24ee33f81dd2708f4c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 14:50:54 -0400 Subject: [PATCH 0474/1252] tests/r/apigatewayv2_vpc_link: Add ErrorCheck --- aws/resource_aws_apigatewayv2_vpc_link_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_vpc_link_test.go b/aws/resource_aws_apigatewayv2_vpc_link_test.go index 2aee38728d0..dc36f90dcc5 100644 --- a/aws/resource_aws_apigatewayv2_vpc_link_test.go +++ b/aws/resource_aws_apigatewayv2_vpc_link_test.go @@ -85,6 +85,7 @@ func TestAccAWSAPIGatewayV2VpcLink_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2VpcLinkDestroy, Steps: []resource.TestStep{ @@ -126,6 +127,7 @@ func TestAccAWSAPIGatewayV2VpcLink_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2VpcLinkDestroy, Steps: []resource.TestStep{ @@ -148,6 +150,7 @@ func TestAccAWSAPIGatewayV2VpcLink_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2VpcLinkDestroy, Steps: []resource.TestStep{ From c6ce593bdce0fa529458f20224067267c7bc7485 Mon Sep 17 00:00:00 2001 From: Bill Rich Date: Thu, 18 Mar 2021 12:38:27 -0700 Subject: [PATCH 0475/1252] Update .changelog/18199.txt Co-authored-by: Brian Flad --- .changelog/18199.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.changelog/18199.txt b/.changelog/18199.txt index 7dc610e6502..8b137891791 100644 --- a/.changelog/18199.txt +++ b/.changelog/18199.txt @@ -1,3 +1 @@ -```release-note:enhancement -resource/aws_ec2_client_vpn_network_association: Add test to ensure it is possible to associate multiple subnets -``` + From e6619cd43271ba537bda1537cc871ad570bdb584 Mon Sep 17 00:00:00 2001 From: Bill Rich Date: Thu, 18 Mar 2021 12:39:15 -0700 Subject: [PATCH 0476/1252] Delete 18199.txt --- .changelog/18199.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .changelog/18199.txt diff --git a/.changelog/18199.txt b/.changelog/18199.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/.changelog/18199.txt +++ /dev/null @@ -1 +0,0 @@ - From 74dd06ab16418f7f872797aea0754ff664666e51 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:00:18 -0400 Subject: [PATCH 0477/1252] ci/goreleaser: Look for more performance --- .goreleaser.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index fe1eb97fe8c..b6388e74ef6 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,17 +11,16 @@ builds: flags: - -trimpath goarch: - - '386' + - 386 - amd64 - arm - arm64 goos: - - darwin - - freebsd - linux + - darwin - windows ignore: - - goarch: '386' + - goarch: 386 goos: darwin ldflags: - -s -w -X version.ProviderVersion={{.Version}} @@ -31,8 +30,6 @@ changelog: checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 -env: - - CGO_ENABLED=0 release: disable: true signs: From a1acf9174bf2141d829b19420f1b5c6743128f44 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 18 Mar 2021 16:10:19 -0400 Subject: [PATCH 0478/1252] tests/provider: Fix and enable AWS SDK Go pointer conversion linting (A-B resources) (#18028) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12992 The path matching in semgrep is quite limited, so unfortunately the exclude list is temporarily long until existing reports are fixed up. This does have the benefit of enabling the checking for some additional files beyond resources a and b though. Previously: ``` aws/resource_aws_ami.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 386: state = *image.State aws/resource_aws_api_gateway_base_path_mapping.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 170: mappingBasePath := *mapping.BasePath aws/resource_aws_api_gateway_documentation_part.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 203: m["type"] = *l.Type -------------------------------------------------------------------------------- 205: m["method"] = *l.Method -------------------------------------------------------------------------------- 208: m["name"] = *l.Name -------------------------------------------------------------------------------- 211: m["path"] = *l.Path -------------------------------------------------------------------------------- 214: m["status_code"] = *l.StatusCode aws/resource_aws_api_gateway_integration.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 179: if *connectionType == apigateway.ConnectionTypeVpcLink { aws/resource_aws_api_gateway_stage.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 172: if waitForCache && *out.CacheClusterStatus != apigateway.CacheClusterStatusNotAvailable { -------------------------------------------------------------------------------- 232: if stage.CacheClusterStatus != nil && *stage.CacheClusterStatus == apigateway.CacheClusterStatusDeleteInProgress { -------------------------------------------------------------------------------- 382: if waitForCache && *out.CacheClusterStatus != apigateway.CacheClusterStatusNotAvailable { aws/resource_aws_app_cookie_stickiness_policy.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 135: if *cookieAttr.AttributeName != "CookieName" { -------------------------------------------------------------------------------- 176: if policyName == *name { aws/resource_aws_appautoscaling_policy.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 708: m["target_value"] = *cfg.TargetValue -------------------------------------------------------------------------------- 711: m["disable_scale_in"] = *cfg.DisableScaleIn -------------------------------------------------------------------------------- 714: m["scale_in_cooldown"] = *cfg.ScaleInCooldown -------------------------------------------------------------------------------- 717: m["scale_out_cooldown"] = *cfg.ScaleOutCooldown -------------------------------------------------------------------------------- 745: m["unit"] = *cfg.Unit -------------------------------------------------------------------------------- 769: m["resource_label"] = *cfg.ResourceLabel aws/resource_aws_appautoscaling_target.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 194: if *tgt.ResourceId == resourceId && *tgt.ScalableDimension == dimension { -------------------------------------------------------------------------------- 194: if *tgt.ResourceId == resourceId && *tgt.ScalableDimension == dimension { aws/resource_aws_appsync_resolver.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 319: if len(c.CachingKeys) == 0 && *(c.Ttl) == 0 { aws/resource_aws_athena_database.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 180: if *datum.VarCharValue == dbName { -------------------------------------------------------------------------------- 233: if *status.State == athena.QueryExecutionStateFailed && aws/resource_aws_autoscaling_attachment.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 96: if v.(string) == *i { -------------------------------------------------------------------------------- 112: if v.(string) == *i { aws/resource_aws_autoscaling_group.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 1584: lbInstanceStates[*lbName][*is.InstanceId] = *is.State -------------------------------------------------------------------------------- 1613: targetInstanceStates[*targetGroupARN][*desc.Target.Id] = *desc.TargetHealth.State -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 1307: if len(g.Instances) > 0 || *g.DesiredCapacity > 0 { -------------------------------------------------------------------------------- 1391: if *asc.AutoScalingGroupName == asgName { aws/resource_aws_autoscaling_lifecycle_hook.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 198: if *sp.LifecycleHookName == name { aws/resource_aws_autoscaling_notification.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 86: if *n.TopicARN == topic { aws/resource_aws_autoscaling_policy.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 487: result["disable_scale_in"] = *config.DisableScaleIn -------------------------------------------------------------------------------- 488: result["target_value"] = *config.TargetValue -------------------------------------------------------------------------------- 491: spec["predefined_metric_type"] = *config.PredefinedMetricSpecification.PredefinedMetricType -------------------------------------------------------------------------------- 493: spec["resource_label"] = *config.PredefinedMetricSpecification.ResourceLabel -------------------------------------------------------------------------------- 499: spec["metric_name"] = *config.CustomizedMetricSpecification.MetricName -------------------------------------------------------------------------------- 500: spec["namespace"] = *config.CustomizedMetricSpecification.Namespace -------------------------------------------------------------------------------- 501: spec["statistic"] = *config.CustomizedMetricSpecification.Statistic -------------------------------------------------------------------------------- 503: spec["unit"] = *config.CustomizedMetricSpecification.Unit -------------------------------------------------------------------------------- 510: dim["name"] = *rawDim.Name -------------------------------------------------------------------------------- 511: dim["value"] = *rawDim.Value -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 407: if *sp.PolicyName == name { aws/resource_aws_autoscaling_schedule.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 239: *actions.ScheduledUpdateGroupActions[0].ScheduledActionName != d.Id() { aws/resource_aws_batch_job_definition.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 239: if *resp.JobDefinitions[0].Status == "ACTIVE" { aws/resource_aws_batch_job_queue.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 94: arn := *out.JobQueueArn aws/resource_aws_budgets_budget_test.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 516: costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] -------------------------------------------------------------------------------- 537: costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] -------------------------------------------------------------------------------- 558: costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] -------------------------------------------------------------------------------- 585: costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] -------------------------------------------------------------------------------- 606: costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] ``` Output from acceptance testing: ``` --- PASS: TestAccAWSAMI_disappears (42.05s) --- PASS: TestAccAWSAMI_basic (45.35s) --- PASS: TestAccAWSAMI_description (58.66s) --- PASS: TestAccAWSAMI_Gp3BlockDevice (60.55s) --- PASS: TestAccAWSAMI_EphemeralBlockDevices (60.56s) --- PASS: TestAccAWSAMI_tags (72.08s) --- PASS: TestAccAWSAPIGatewayBasePathMapping_basic (79.61s) --- PASS: TestAccAWSAPIGatewayBasePathMapping_disappears (85.78s) --- PASS: TestAccAWSAPIGatewayBasePathMapping_updates (137.34s) --- PASS: TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty (162.17s) --- PASS: TestAccAWSAPIGatewayDocumentationPart_disappears (17.88s) --- PASS: TestAccAWSAPIGatewayDocumentationPart_method (57.48s) --- PASS: TestAccAWSAPIGatewayDocumentationPart_basic (81.28s) --- PASS: TestAccAWSAPIGatewayDocumentationPart_responseHeader (144.04s) --- PASS: TestAccAWSAPIGatewayIntegration_cache_key_parameters (29.83s) --- PASS: TestAccAWSAPIGatewayIntegration_contentHandling (63.05s) --- PASS: TestAccAWSAPIGatewayIntegration_basic (92.39s) --- PASS: TestAccAWSAPIGatewayIntegration_TlsConfig_InsecureSkipVerification (120.65s) --- PASS: TestAccAWSAPIGatewayIntegration_disappears (267.23s) --- PASS: TestAccAWSAPIGatewayIntegration_integrationType (689.99s) --- PASS: TestAccAWSAPIGatewayStage_disappears_ReferencingDeployment (53.04s) --- PASS: TestAccAWSAPIGatewayStage_disappears (90.60s) --- PASS: TestAccAWSAPIGatewayStage_accessLogSettings (425.17s) --- PASS: TestAccAWSAPIGatewayStage_accessLogSettings_kinesis (484.94s) --- PASS: TestAccAWSAPIGatewayStage_basic (716.29s) --- PASS: TestAccAWSAppCookieStickinessPolicy_disappears_ELB (22.35s) --- PASS: TestAccAWSAppCookieStickinessPolicy_disappears (24.07s) --- PASS: TestAccAWSAppCookieStickinessPolicy_basic (45.25s) --- PASS: TestAccAWSAppautoScalingPolicy_dynamodb_table (36.85s) --- PASS: TestAccAWSAppautoScalingPolicy_multiplePoliciesSameName (38.45s) --- PASS: TestAccAWSAppautoScalingPolicy_multiplePoliciesSameResource (41.02s) --- PASS: TestAccAWSAppautoScalingPolicy_dynamodb_index (44.74s) --- PASS: TestAccAWSAppautoScalingPolicy_disappears (83.02s) --- PASS: TestAccAWSAppautoScalingPolicy_basic (86.04s) --- PASS: TestAccAWSAppautoScalingPolicy_spotFleetRequest (86.95s) --- PASS: TestAccAWSAppautoScalingPolicy_scaleOutAndIn (89.54s) --- PASS: TestAccAWSAppautoScalingPolicy_ResourceId_ForceNew (97.35s) --- PASS: TestAccAWSAppautoScalingTarget_multipleTargets (26.50s) --- PASS: TestAccAWSAppautoScalingTarget_optionalRoleArn (27.17s) --- PASS: TestAccAWSAppautoScalingTarget_basic (55.16s) --- PASS: TestAccAWSAppautoScalingTarget_spotFleetRequest (73.87s) --- PASS: TestAccAWSAppautoScalingTarget_disappears (86.80s) --- PASS: TestAccAWSAppautoScalingTarget_emrCluster (1607.58s) --- PASS: TestAccAwsAppsyncResolver_CachingConfig (22.06s) --- PASS: TestAccAwsAppsyncResolver_basic (24.35s) --- PASS: TestAccAwsAppsyncResolver_disappears (25.39s) --- PASS: TestAccAwsAppsyncResolver_PipelineConfig (28.28s) --- PASS: TestAccAwsAppsyncResolver_multipleResolvers (29.17s) --- PASS: TestAccAwsAppsyncResolver_ResponseTemplate (32.16s) --- PASS: TestAccAwsAppsyncResolver_RequestTemplate (36.21s) --- PASS: TestAccAwsAppsyncResolver_DataSource (38.43s) --- PASS: TestAccAWSASGNotification_basic (163.55s) --- PASS: TestAccAWSASGNotification_Pagination (209.09s) --- PASS: TestAccAWSASGNotification_update (267.50s) --- PASS: TestAccAWSAthenaDatabase_basic (62.24s) --- PASS: TestAccAWSAthenaDatabase_destroyFailsIfTablesExist (74.13s) --- PASS: TestAccAWSAthenaDatabase_encryption (62.78s) --- PASS: TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds (60.06s) --- PASS: TestAccAWSAthenaDatabase_nameCantHaveUppercase (0.89s) --- PASS: TestAccAWSAthenaDatabase_nameStartsWithUnderscore (55.47s) --- PASS: TestAccAWSAutoscalingAttachment_albTargetGroup (212.13s) --- PASS: TestAccAWSAutoscalingAttachment_elb (199.26s) --- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups (201.41s) --- PASS: TestAccAWSAutoScalingGroup_ALB_TargetGroups_ELBCapacity (320.35s) --- PASS: TestAccAWSAutoScalingGroup_autoGeneratedName (38.57s) --- PASS: TestAccAWSAutoScalingGroup_basic (289.78s) --- PASS: TestAccAWSAutoScalingGroup_classicVpcZoneIdentifier (60.48s) --- PASS: TestAccAWSAutoScalingGroup_enablingMetrics (143.25s) --- PASS: TestAccAWSAutoScalingGroup_initialLifecycleHook (294.41s) --- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Basic (214.22s) --- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Start (336.67s) --- PASS: TestAccAWSAutoScalingGroup_InstanceRefresh_Triggers (199.75s) --- PASS: TestAccAWSAutoScalingGroup_launchTemplate (57.70s) --- PASS: TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile (71.11s) --- PASS: TestAccAWSAutoScalingGroup_launchTemplate_update (212.00s) --- PASS: TestAccAWSAutoScalingGroup_launchTempPartitionNum (77.11s) --- PASS: TestAccAWSAutoScalingGroup_LoadBalancers (494.74s) --- PASS: TestAccAWSAutoScalingGroup_MaxInstanceLifetime (93.55s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy (36.47s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_CapacityRebalance (64.39s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandAllocationStrategy (69.23s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandBaseCapacity (101.46s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_OnDemandPercentageAboveBaseCapacity (61.91s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotAllocationStrategy (46.71s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotInstancePools (64.41s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_SpotMaxPrice (102.21s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_InstancesDistribution_UpdateToZeroOnDemandBaseCapacity (82.98s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_LaunchTemplateName (70.74s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_LaunchTemplateSpecification_Version (89.77s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType (57.79s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_InstanceType_With_LaunchTemplateSpecification (62.46s) --- PASS: TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity (145.44s) --- PASS: TestAccAWSAutoScalingGroup_namePrefix (41.24s) --- PASS: TestAccAWSAutoScalingGroup_serviceLinkedRoleARN (39.17s) --- PASS: TestAccAWSAutoScalingGroup_suspendingProcesses (290.76s) --- PASS: TestAccAWSAutoScalingGroup_tags (307.64s) --- PASS: TestAccAWSAutoScalingGroup_TargetGroupArns (239.15s) --- PASS: TestAccAWSAutoScalingGroup_terminationPolicies (130.55s) --- PASS: TestAccAWSAutoScalingGroup_VpcUpdates (103.76s) --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer (320.59s) --- PASS: TestAccAWSAutoScalingGroup_WithLoadBalancer_ToTargetGroup (510.78s) --- PASS: TestAccAWSAutoScalingGroup_withMetrics (107.06s) --- PASS: TestAccAWSAutoScalingGroup_withPlacementGroup (151.02s) --- PASS: TestAccAWSAutoscalingLifecycleHook_basic (163.19s) --- PASS: TestAccAWSAutoscalingLifecycleHook_omitDefaultResult (152.17s) --- PASS: TestAccAWSAutoscalingPolicy_basic (159.49s) --- PASS: TestAccAWSAutoscalingPolicy_disappears (54.90s) --- PASS: TestAccAWSAutoscalingPolicy_SimpleScalingStepAdjustment (65.16s) --- PASS: TestAccAWSAutoscalingPolicy_TargetTrack_Custom (61.68s) --- PASS: TestAccAWSAutoscalingPolicy_TargetTrack_Predefined (62.63s) --- PASS: TestAccAWSAutoscalingPolicy_zerovalue (64.20s) --- PASS: TestAccAWSAutoscalingSchedule_basic (161.88s) --- PASS: TestAccAWSAutoscalingSchedule_disappears (145.38s) --- PASS: TestAccAWSAutoscalingSchedule_negativeOne (143.80s) --- PASS: TestAccAWSAutoscalingSchedule_recurrence (214.82s) --- PASS: TestAccAWSAutoscalingSchedule_zeroValues (173.62s) --- PASS: TestAccAWSBatchJobDefinition_basic (16.64s) --- PASS: TestAccAWSBatchJobDefinition_ContainerProperties_Advanced (16.53s) --- PASS: TestAccAWSBatchJobDefinition_Tags (35.57s) --- PASS: TestAccAWSBatchJobDefinition_updateForcesNewResource (26.91s) --- PASS: TestAccAWSBatchJobQueue_basic (162.85s) --- PASS: TestAccAWSBatchJobQueue_ComputeEnvironments_ExternalOrderUpdate (132.15s) --- PASS: TestAccAWSBatchJobQueue_disappears (113.08s) --- PASS: TestAccAWSBatchJobQueue_Priority (147.46s) --- PASS: TestAccAWSBatchJobQueue_State (138.84s) --- PASS: TestAccAWSBatchJobQueue_Tags (151.88s) --- PASS: TestAccAWSBudgetsBudget_basic (38.97s) --- PASS: TestAccAWSBudgetsBudget_disappears (15.59s) --- PASS: TestAccAWSBudgetsBudget_notification (97.30s) --- PASS: TestAccAWSBudgetsBudget_prefix (36.26s) ``` --- .semgrep.yml | 32 +++++- aws/resource_aws_ami.go | 2 +- ...ource_aws_api_gateway_base_path_mapping.go | 2 +- ...urce_aws_api_gateway_documentation_part.go | 25 ++-- aws/resource_aws_api_gateway_integration.go | 108 +++++++----------- aws/resource_aws_api_gateway_stage.go | 6 +- ...source_aws_app_cookie_stickiness_policy.go | 6 +- aws/resource_aws_appautoscaling_policy.go | 84 +++++++++----- aws/resource_aws_appautoscaling_target.go | 6 +- aws/resource_aws_appsync_resolver.go | 2 +- aws/resource_aws_athena_database.go | 22 +++- aws/resource_aws_autoscaling_attachment.go | 4 +- aws/resource_aws_autoscaling_group.go | 20 ++-- ...resource_aws_autoscaling_lifecycle_hook.go | 6 +- aws/resource_aws_autoscaling_notification.go | 10 +- aws/resource_aws_autoscaling_policy.go | 26 +++-- aws/resource_aws_autoscaling_schedule.go | 2 +- aws/resource_aws_batch_job_definition.go | 2 +- aws/resource_aws_batch_job_queue.go | 2 +- aws/resource_aws_budgets_budget_test.go | 24 ++-- 20 files changed, 231 insertions(+), 160 deletions(-) diff --git a/.semgrep.yml b/.semgrep.yml index c16413504bc..e9cd3e63069 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -57,7 +57,20 @@ rules: - aws/cloudfront_distribution_configuration_structure.go - aws/data_source_aws_route_table.go - aws/opsworks_layers.go - - aws/resource* + - aws/resource_aws_c* + - aws/resource_aws_d* + - aws/resource_aws_e* + - aws/resource_aws_g* + - aws/resource_aws_i* + - aws/resource_aws_k* + - aws/resource_aws_l* + - aws/resource_aws_mq_broker.go + - aws/resource_aws_o* + - aws/resource_aws_r* + - aws/resource_aws_s* + - aws/resource_aws_transfer_ssh_key.go + - aws/resource_aws_vpc.go + - aws/resource_aws_w* - aws/structure.go - aws/waf_helpers.go - aws/internal/generators/ @@ -81,7 +94,22 @@ rules: - aws/data_source_aws_route* - aws/ecs_task_definition_equivalency.go - aws/opsworks_layers.go - - aws/resource* + - aws/resource_aws_c*.go + - aws/resource_aws_d*.go + - aws/resource_aws_e*.go + - aws/resource_aws_g*.go + - aws/resource_aws_i*.go + - aws/resource_aws_k*.go + - aws/resource_aws_l*.go + - aws/resource_aws_main_route_table_association.go + - aws/resource_aws_n*.go + - aws/resource_aws_o*.go + - aws/resource_aws_r*.go + - aws/resource_aws_s*.go + - aws/resource_aws_transfer_ssh_key.go + - aws/resource_aws_v*.go + - aws/resource_aws_w* + - aws/resource*_test.go - aws/structure.go - aws/internal/generators/ - aws/internal/keyvaluetags/ diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 3f59a9d220b..574a9ad7a1f 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -375,7 +375,7 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { if err != nil { return err } - state = *image.State + state = aws.StringValue(image.State) } if state == ec2.ImageStateDeregistered { diff --git a/aws/resource_aws_api_gateway_base_path_mapping.go b/aws/resource_aws_api_gateway_base_path_mapping.go index 30e1385174c..f4b0205ad3d 100644 --- a/aws/resource_aws_api_gateway_base_path_mapping.go +++ b/aws/resource_aws_api_gateway_base_path_mapping.go @@ -167,7 +167,7 @@ func resourceAwsApiGatewayBasePathMappingRead(d *schema.ResourceData, meta inter return fmt.Errorf("Error reading Gateway base path mapping: %s", err) } - mappingBasePath := *mapping.BasePath + mappingBasePath := aws.StringValue(mapping.BasePath) if mappingBasePath == emptyBasePathMappingValue { mappingBasePath = "" diff --git a/aws/resource_aws_api_gateway_documentation_part.go b/aws/resource_aws_api_gateway_documentation_part.go index a3b5df3c2c1..9131db18840 100644 --- a/aws/resource_aws_api_gateway_documentation_part.go +++ b/aws/resource_aws_api_gateway_documentation_part.go @@ -200,18 +200,25 @@ func flattenApiGatewayDocumentationPartLocation(l *apigateway.DocumentationPartL } m := make(map[string]interface{}) - m["type"] = *l.Type - if l.Method != nil { - m["method"] = *l.Method + + if v := l.Method; v != nil { + m["method"] = aws.StringValue(v) + } + + if v := l.Name; v != nil { + m["name"] = aws.StringValue(v) } - if l.Name != nil { - m["name"] = *l.Name + + if v := l.Path; v != nil { + m["path"] = aws.StringValue(v) } - if l.Path != nil { - m["path"] = *l.Path + + if v := l.StatusCode; v != nil { + m["status_code"] = aws.StringValue(v) } - if l.StatusCode != nil { - m["status_code"] = *l.StatusCode + + if v := l.Type; v != nil { + m["type"] = aws.StringValue(v) } return []interface{}{m} diff --git a/aws/resource_aws_api_gateway_integration.go b/aws/resource_aws_api_gateway_integration.go index f2c3813375b..bace0b28e27 100644 --- a/aws/resource_aws_api_gateway_integration.go +++ b/aws/resource_aws_api_gateway_integration.go @@ -174,95 +174,69 @@ func resourceAwsApiGatewayIntegrationCreate(d *schema.ResourceData, meta interfa log.Print("[DEBUG] Creating API Gateway Integration") - connectionType := aws.String(d.Get("connection_type").(string)) - var connectionId *string - if *connectionType == apigateway.ConnectionTypeVpcLink { - if _, ok := d.GetOk("connection_id"); !ok { - return fmt.Errorf("connection_id required when connection_type set to VPC_LINK") - } - connectionId = aws.String(d.Get("connection_id").(string)) + input := &apigateway.PutIntegrationInput{ + HttpMethod: aws.String(d.Get("http_method").(string)), + ResourceId: aws.String(d.Get("resource_id").(string)), + RestApiId: aws.String(d.Get("rest_api_id").(string)), + Type: aws.String(d.Get("type").(string)), } - var integrationHttpMethod *string - if v, ok := d.GetOk("integration_http_method"); ok { - integrationHttpMethod = aws.String(v.(string)) + if v, ok := d.GetOk("cache_key_parameters"); ok && v.(*schema.Set).Len() > 0 { + input.CacheKeyParameters = expandStringSet(v.(*schema.Set)) } - var uri *string - if v, ok := d.GetOk("uri"); ok { - uri = aws.String(v.(string)) + if v, ok := d.GetOk("cache_namespace"); ok { + input.CacheNamespace = aws.String(v.(string)) + } else if input.CacheKeyParameters != nil { + input.CacheNamespace = aws.String(d.Get("resource_id").(string)) } - templates := make(map[string]string) - for k, v := range d.Get("request_templates").(map[string]interface{}) { - templates[k] = v.(string) + if v, ok := d.GetOk("connection_id"); ok { + input.ConnectionId = aws.String(v.(string)) } - parameters := make(map[string]string) - if kv, ok := d.GetOk("request_parameters"); ok { - for k, v := range kv.(map[string]interface{}) { - parameters[k] = v.(string) - } + if v, ok := d.GetOk("connection_type"); ok { + input.ConnectionType = aws.String(v.(string)) } - var passthroughBehavior *string - if v, ok := d.GetOk("passthrough_behavior"); ok { - passthroughBehavior = aws.String(v.(string)) + if v, ok := d.GetOk("content_handling"); ok { + input.ContentHandling = aws.String(v.(string)) } - var credentials *string - if val, ok := d.GetOk("credentials"); ok { - credentials = aws.String(val.(string)) + if v, ok := d.GetOk("credentials"); ok { + input.Credentials = aws.String(v.(string)) } - var contentHandling *string - if val, ok := d.GetOk("content_handling"); ok { - contentHandling = aws.String(val.(string)) + if v, ok := d.GetOk("integration_http_method"); ok { + input.IntegrationHttpMethod = aws.String(v.(string)) } - var cacheKeyParameters []*string - if v, ok := d.GetOk("cache_key_parameters"); ok { - cacheKeyParameters = expandStringSet(v.(*schema.Set)) + if v, ok := d.GetOk("passthrough_behavior"); ok { + input.PassthroughBehavior = aws.String(v.(string)) } - var cacheNamespace *string - if cacheKeyParameters != nil { - // Use resource_id unless user provides a custom name - cacheNamespace = aws.String(d.Get("resource_id").(string)) + if v, ok := d.GetOk("request_parameters"); ok && len(v.(map[string]interface{})) > 0 { + input.RequestParameters = stringMapToPointers(v.(map[string]interface{})) } - if v, ok := d.GetOk("cache_namespace"); ok { - cacheNamespace = aws.String(v.(string)) + + if v, ok := d.GetOk("request_templates"); ok && len(v.(map[string]interface{})) > 0 { + input.RequestTemplates = stringMapToPointers(v.(map[string]interface{})) } - var timeoutInMillis *int64 if v, ok := d.GetOk("timeout_milliseconds"); ok { - timeoutInMillis = aws.Int64(int64(v.(int))) - } - - var tlsConfig *apigateway.TlsConfig - if v, ok := d.GetOk("tls_config"); ok { - tlsConfig = expandApiGatewayTlsConfig(v.([]interface{})) - } - - _, err := conn.PutIntegration(&apigateway.PutIntegrationInput{ - HttpMethod: aws.String(d.Get("http_method").(string)), - ResourceId: aws.String(d.Get("resource_id").(string)), - RestApiId: aws.String(d.Get("rest_api_id").(string)), - Type: aws.String(d.Get("type").(string)), - IntegrationHttpMethod: integrationHttpMethod, - Uri: uri, - RequestParameters: aws.StringMap(parameters), - RequestTemplates: aws.StringMap(templates), - Credentials: credentials, - CacheNamespace: cacheNamespace, - CacheKeyParameters: cacheKeyParameters, - PassthroughBehavior: passthroughBehavior, - ContentHandling: contentHandling, - ConnectionType: connectionType, - ConnectionId: connectionId, - TimeoutInMillis: timeoutInMillis, - TlsConfig: tlsConfig, - }) + input.TimeoutInMillis = aws.Int64(int64(v.(int))) + } + + if v, ok := d.GetOk("tls_config"); ok && len(v.([]interface{})) > 0 { + input.TlsConfig = expandApiGatewayTlsConfig(v.([]interface{})) + } + + if v, ok := d.GetOk("uri"); ok { + input.Uri = aws.String(v.(string)) + } + + _, err := conn.PutIntegration(input) + if err != nil { return fmt.Errorf("Error creating API Gateway Integration: %s", err) } diff --git a/aws/resource_aws_api_gateway_stage.go b/aws/resource_aws_api_gateway_stage.go index a7d4b39f6a5..d496e9df4ad 100644 --- a/aws/resource_aws_api_gateway_stage.go +++ b/aws/resource_aws_api_gateway_stage.go @@ -169,7 +169,7 @@ func resourceAwsApiGatewayStageCreate(d *schema.ResourceData, meta interface{}) d.SetId(fmt.Sprintf("ags-%s-%s", d.Get("rest_api_id").(string), d.Get("stage_name").(string))) - if waitForCache && *out.CacheClusterStatus != apigateway.CacheClusterStatusNotAvailable { + if waitForCache && out != nil && aws.StringValue(out.CacheClusterStatus) != apigateway.CacheClusterStatusNotAvailable { stateConf := &resource.StateChangeConf{ Pending: []string{ apigateway.CacheClusterStatusCreateInProgress, @@ -229,7 +229,7 @@ func resourceAwsApiGatewayStageRead(d *schema.ResourceData, meta interface{}) er d.Set("client_certificate_id", stage.ClientCertificateId) - if stage.CacheClusterStatus != nil && *stage.CacheClusterStatus == apigateway.CacheClusterStatusDeleteInProgress { + if aws.StringValue(stage.CacheClusterStatus) == apigateway.CacheClusterStatusDeleteInProgress { d.Set("cache_cluster_enabled", false) d.Set("cache_cluster_size", nil) } else { @@ -379,7 +379,7 @@ func resourceAwsApiGatewayStageUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Updating API Gateway Stage failed: %s", err) } - if waitForCache && *out.CacheClusterStatus != apigateway.CacheClusterStatusNotAvailable { + if waitForCache && out != nil && aws.StringValue(out.CacheClusterStatus) != apigateway.CacheClusterStatusNotAvailable { stateConf := &resource.StateChangeConf{ Pending: []string{ apigateway.CacheClusterStatusCreateInProgress, diff --git a/aws/resource_aws_app_cookie_stickiness_policy.go b/aws/resource_aws_app_cookie_stickiness_policy.go index 71be5ef2878..846e8304042 100644 --- a/aws/resource_aws_app_cookie_stickiness_policy.go +++ b/aws/resource_aws_app_cookie_stickiness_policy.go @@ -132,7 +132,7 @@ func resourceAwsAppCookieStickinessPolicyRead(d *schema.ResourceData, meta inter // cookie expiration, in these descriptions. policyDesc := getResp.PolicyDescriptions[0] cookieAttr := policyDesc.PolicyAttributeDescriptions[0] - if *cookieAttr.AttributeName != "CookieName" { + if aws.StringValue(cookieAttr.AttributeName) != "CookieName" { return fmt.Errorf("Unable to find cookie Name.") } @@ -168,12 +168,12 @@ func resourceAwsELBSticknessPolicyAssigned(policyName, lbName, lbPort string, el lb := describeResp.LoadBalancerDescriptions[0] assigned := false for _, listener := range lb.ListenerDescriptions { - if lbPort != strconv.Itoa(int(*listener.Listener.LoadBalancerPort)) { + if listener == nil || listener.Listener == nil || lbPort != strconv.Itoa(int(aws.Int64Value(listener.Listener.LoadBalancerPort))) { continue } for _, name := range listener.PolicyNames { - if policyName == *name { + if policyName == aws.StringValue(name) { assigned = true break } diff --git a/aws/resource_aws_appautoscaling_policy.go b/aws/resource_aws_appautoscaling_policy.go index fdcb9d5e700..351ef2239e3 100644 --- a/aws/resource_aws_appautoscaling_policy.go +++ b/aws/resource_aws_appautoscaling_policy.go @@ -705,22 +705,29 @@ func flattenTargetTrackingScalingPolicyConfiguration(cfg *applicationautoscaling } m := make(map[string]interface{}) - m["target_value"] = *cfg.TargetValue - if cfg.DisableScaleIn != nil { - m["disable_scale_in"] = *cfg.DisableScaleIn + if v := cfg.CustomizedMetricSpecification; v != nil { + m["customized_metric_specification"] = flattenCustomizedMetricSpecification(v) } - if cfg.ScaleInCooldown != nil { - m["scale_in_cooldown"] = *cfg.ScaleInCooldown + + if v := cfg.DisableScaleIn; v != nil { + m["disable_scale_in"] = aws.BoolValue(v) + } + + if v := cfg.PredefinedMetricSpecification; v != nil { + m["predefined_metric_specification"] = flattenPredefinedMetricSpecification(v) } - if cfg.ScaleOutCooldown != nil { - m["scale_out_cooldown"] = *cfg.ScaleOutCooldown + + if v := cfg.ScaleInCooldown; v != nil { + m["scale_in_cooldown"] = aws.Int64Value(v) } - if cfg.CustomizedMetricSpecification != nil { - m["customized_metric_specification"] = flattenCustomizedMetricSpecification(cfg.CustomizedMetricSpecification) + + if v := cfg.ScaleOutCooldown; v != nil { + m["scale_out_cooldown"] = aws.Int64Value(v) } - if cfg.PredefinedMetricSpecification != nil { - m["predefined_metric_specification"] = flattenPredefinedMetricSpecification(cfg.PredefinedMetricSpecification) + + if v := cfg.TargetValue; v != nil { + m["target_value"] = aws.Float64Value(v) } return []interface{}{m} @@ -731,29 +738,49 @@ func flattenCustomizedMetricSpecification(cfg *applicationautoscaling.Customized return []interface{}{} } - m := map[string]interface{}{ - "metric_name": *cfg.MetricName, - "namespace": *cfg.Namespace, - "statistic": *cfg.Statistic, - } + m := map[string]interface{}{} - if len(cfg.Dimensions) > 0 { + if v := cfg.Dimensions; len(v) > 0 { m["dimensions"] = flattenMetricDimensions(cfg.Dimensions) } - if cfg.Unit != nil { - m["unit"] = *cfg.Unit + if v := cfg.MetricName; v != nil { + m["metric_name"] = aws.StringValue(v) + } + + if v := cfg.Namespace; v != nil { + m["namespace"] = aws.StringValue(v) + } + + if v := cfg.Statistic; v != nil { + m["statistic"] = aws.StringValue(v) + } + + if v := cfg.Unit; v != nil { + m["unit"] = aws.StringValue(v) } + return []interface{}{m} } func flattenMetricDimensions(ds []*applicationautoscaling.MetricDimension) []interface{} { l := make([]interface{}, len(ds)) for i, d := range ds { - l[i] = map[string]interface{}{ - "name": *d.Name, - "value": *d.Value, + if ds == nil { + continue + } + + m := map[string]interface{}{} + + if v := d.Name; v != nil { + m["name"] = aws.StringValue(v) + } + + if v := d.Value; v != nil { + m["value"] = aws.StringValue(v) } + + l[i] = m } return l } @@ -762,11 +789,16 @@ func flattenPredefinedMetricSpecification(cfg *applicationautoscaling.Predefined if cfg == nil { return []interface{}{} } - m := map[string]interface{}{ - "predefined_metric_type": *cfg.PredefinedMetricType, + + m := map[string]interface{}{} + + if v := cfg.PredefinedMetricType; v != nil { + m["predefined_metric_type"] = aws.StringValue(v) } - if cfg.ResourceLabel != nil { - m["resource_label"] = *cfg.ResourceLabel + + if v := cfg.ResourceLabel; v != nil { + m["resource_label"] = aws.StringValue(v) } + return []interface{}{m} } diff --git a/aws/resource_aws_appautoscaling_target.go b/aws/resource_aws_appautoscaling_target.go index 6cfbf04a9de..edda7e57d1a 100644 --- a/aws/resource_aws_appautoscaling_target.go +++ b/aws/resource_aws_appautoscaling_target.go @@ -191,7 +191,11 @@ func getAwsAppautoscalingTarget(resourceId, namespace, dimension string, } for idx, tgt := range describeTargets.ScalableTargets { - if *tgt.ResourceId == resourceId && *tgt.ScalableDimension == dimension { + if tgt == nil { + continue + } + + if aws.StringValue(tgt.ResourceId) == resourceId && aws.StringValue(tgt.ScalableDimension) == dimension { return describeTargets.ScalableTargets[idx], nil } } diff --git a/aws/resource_aws_appsync_resolver.go b/aws/resource_aws_appsync_resolver.go index fd16d129dbf..98e91b1a4a4 100644 --- a/aws/resource_aws_appsync_resolver.go +++ b/aws/resource_aws_appsync_resolver.go @@ -316,7 +316,7 @@ func flattenAppsyncCachingConfig(c *appsync.CachingConfig) []interface{} { return nil } - if len(c.CachingKeys) == 0 && *(c.Ttl) == 0 { + if len(c.CachingKeys) == 0 && aws.Int64Value(c.Ttl) == 0 { return nil } diff --git a/aws/resource_aws_athena_database.go b/aws/resource_aws_athena_database.go index c2f3f389e07..001fa459856 100644 --- a/aws/resource_aws_athena_database.go +++ b/aws/resource_aws_athena_database.go @@ -177,7 +177,11 @@ func executeAndExpectMatchingRow(qeid string, dbName string, conn *athena.Athena } for _, row := range rs.Rows { for _, datum := range row.Data { - if *datum.VarCharValue == dbName { + if datum == nil { + continue + } + + if aws.StringValue(datum.VarCharValue) == dbName { return nil } } @@ -229,12 +233,18 @@ func queryExecutionStateRefreshFunc(qeid string, conn *athena.Athena) resource.S if err != nil { return nil, "failed", err } + + if out == nil || out.QueryExecution == nil || out.QueryExecution.Status == nil { + return nil, "", nil + } + status := out.QueryExecution.Status - if *status.State == athena.QueryExecutionStateFailed && - status.StateChangeReason != nil { - err = fmt.Errorf("reason: %s", *status.StateChangeReason) + + if aws.StringValue(status.State) == athena.QueryExecutionStateFailed && status.StateChangeReason != nil { + err = fmt.Errorf("reason: %s", aws.StringValue(status.StateChangeReason)) } - return out, *out.QueryExecution.Status.State, err + + return out, aws.StringValue(out.QueryExecution.Status.State), err } } @@ -242,7 +252,7 @@ func flattenAthenaResultSet(rs *athena.ResultSet) string { ss := make([]string, 0) for _, row := range rs.Rows { for _, datum := range row.Data { - ss = append(ss, *datum.VarCharValue) + ss = append(ss, aws.StringValue(datum.VarCharValue)) } } return strings.Join(ss, "\n") diff --git a/aws/resource_aws_autoscaling_attachment.go b/aws/resource_aws_autoscaling_attachment.go index f15e1abde08..9648d86f572 100644 --- a/aws/resource_aws_autoscaling_attachment.go +++ b/aws/resource_aws_autoscaling_attachment.go @@ -93,7 +93,7 @@ func resourceAwsAutoscalingAttachmentRead(d *schema.ResourceData, meta interface if v, ok := d.GetOk("elb"); ok { found := false for _, i := range asg.LoadBalancerNames { - if v.(string) == *i { + if v.(string) == aws.StringValue(i) { d.Set("elb", v.(string)) found = true break @@ -109,7 +109,7 @@ func resourceAwsAutoscalingAttachmentRead(d *schema.ResourceData, meta interface if v, ok := d.GetOk("alb_target_group_arn"); ok { found := false for _, i := range asg.TargetGroupARNs { - if v.(string) == *i { + if v.(string) == aws.StringValue(i) { d.Set("alb_target_group_arn", v.(string)) found = true break diff --git a/aws/resource_aws_autoscaling_group.go b/aws/resource_aws_autoscaling_group.go index fe0d98e4930..7e8f76d5a9d 100644 --- a/aws/resource_aws_autoscaling_group.go +++ b/aws/resource_aws_autoscaling_group.go @@ -1304,7 +1304,7 @@ func resourceAwsAutoscalingGroupDelete(d *schema.ResourceData, meta interface{}) log.Printf("[WARN] Auto Scaling Group (%s) not found, removing from state", d.Id()) return nil } - if len(g.Instances) > 0 || *g.DesiredCapacity > 0 { + if len(g.Instances) > 0 || aws.Int64Value(g.DesiredCapacity) > 0 { if err := resourceAwsAutoscalingGroupDrain(d, meta); err != nil { return err } @@ -1388,7 +1388,11 @@ func getAwsAutoscalingGroup(asgName string, conn *autoscaling.AutoScaling) (*aut // Search for the Auto Scaling Group for idx, asc := range describeGroups.AutoScalingGroups { - if *asc.AutoScalingGroupName == asgName { + if asc == nil { + continue + } + + if aws.StringValue(asc.AutoScalingGroupName) == asgName { return describeGroups.AutoScalingGroups[idx], nil } } @@ -1571,17 +1575,17 @@ func getELBInstanceStates(g *autoscaling.Group, meta interface{}) (map[string]ma elbconn := meta.(*AWSClient).elbconn for _, lbName := range g.LoadBalancerNames { - lbInstanceStates[*lbName] = make(map[string]string) + lbInstanceStates[aws.StringValue(lbName)] = make(map[string]string) opts := &elb.DescribeInstanceHealthInput{LoadBalancerName: lbName} r, err := elbconn.DescribeInstanceHealth(opts) if err != nil { return nil, err } for _, is := range r.InstanceStates { - if is.InstanceId == nil || is.State == nil { + if is == nil || is.InstanceId == nil || is.State == nil { continue } - lbInstanceStates[*lbName][*is.InstanceId] = *is.State + lbInstanceStates[aws.StringValue(lbName)][aws.StringValue(is.InstanceId)] = aws.StringValue(is.State) } } @@ -1600,17 +1604,17 @@ func getTargetGroupInstanceStates(g *autoscaling.Group, meta interface{}) (map[s elbv2conn := meta.(*AWSClient).elbv2conn for _, targetGroupARN := range g.TargetGroupARNs { - targetInstanceStates[*targetGroupARN] = make(map[string]string) + targetInstanceStates[aws.StringValue(targetGroupARN)] = make(map[string]string) opts := &elbv2.DescribeTargetHealthInput{TargetGroupArn: targetGroupARN} r, err := elbv2conn.DescribeTargetHealth(opts) if err != nil { return nil, err } for _, desc := range r.TargetHealthDescriptions { - if desc.Target == nil || desc.Target.Id == nil || desc.TargetHealth == nil || desc.TargetHealth.State == nil { + if desc == nil || desc.Target == nil || desc.Target.Id == nil || desc.TargetHealth == nil || desc.TargetHealth.State == nil { continue } - targetInstanceStates[*targetGroupARN][*desc.Target.Id] = *desc.TargetHealth.State + targetInstanceStates[aws.StringValue(targetGroupARN)][aws.StringValue(desc.Target.Id)] = aws.StringValue(desc.TargetHealth.State) } } diff --git a/aws/resource_aws_autoscaling_lifecycle_hook.go b/aws/resource_aws_autoscaling_lifecycle_hook.go index 1e9ac0cf2a2..9249ef9b5b4 100644 --- a/aws/resource_aws_autoscaling_lifecycle_hook.go +++ b/aws/resource_aws_autoscaling_lifecycle_hook.go @@ -195,7 +195,11 @@ func getAwsAutoscalingLifecycleHook(d *schema.ResourceData, meta interface{}) (* // find lifecycle hooks name := d.Get("name") for idx, sp := range resp.LifecycleHooks { - if *sp.LifecycleHookName == name { + if sp == nil { + continue + } + + if aws.StringValue(sp.LifecycleHookName) == name { return resp.LifecycleHooks[idx], nil } } diff --git a/aws/resource_aws_autoscaling_notification.go b/aws/resource_aws_autoscaling_notification.go index 2868fb2ce51..5e706df6ec2 100644 --- a/aws/resource_aws_autoscaling_notification.go +++ b/aws/resource_aws_autoscaling_notification.go @@ -83,9 +83,13 @@ func resourceAwsAutoscalingNotificationRead(d *schema.ResourceData, meta interfa } for _, n := range resp.NotificationConfigurations { - if *n.TopicARN == topic { - gRaw[*n.AutoScalingGroupName] = true - nRaw[*n.NotificationType] = true + if n == nil { + continue + } + + if aws.StringValue(n.TopicARN) == topic { + gRaw[aws.StringValue(n.AutoScalingGroupName)] = true + nRaw[aws.StringValue(n.NotificationType)] = true } } return true // return false to stop paging diff --git a/aws/resource_aws_autoscaling_policy.go b/aws/resource_aws_autoscaling_policy.go index b1fbcc3b1b7..3b55f7b5bb4 100644 --- a/aws/resource_aws_autoscaling_policy.go +++ b/aws/resource_aws_autoscaling_policy.go @@ -404,7 +404,11 @@ func getAwsAutoscalingPolicy(d *schema.ResourceData, meta interface{}) (*autosca // find scaling policy name := d.Get("name") for idx, sp := range resp.ScalingPolicies { - if *sp.PolicyName == name { + if sp == nil { + continue + } + + if aws.StringValue(sp.PolicyName) == name { return resp.ScalingPolicies[idx], nil } } @@ -484,31 +488,31 @@ func flattenTargetTrackingConfiguration(config *autoscaling.TargetTrackingConfig } result := map[string]interface{}{} - result["disable_scale_in"] = *config.DisableScaleIn - result["target_value"] = *config.TargetValue + result["disable_scale_in"] = aws.BoolValue(config.DisableScaleIn) + result["target_value"] = aws.Float64Value(config.TargetValue) if config.PredefinedMetricSpecification != nil { spec := map[string]interface{}{} - spec["predefined_metric_type"] = *config.PredefinedMetricSpecification.PredefinedMetricType + spec["predefined_metric_type"] = aws.StringValue(config.PredefinedMetricSpecification.PredefinedMetricType) if config.PredefinedMetricSpecification.ResourceLabel != nil { - spec["resource_label"] = *config.PredefinedMetricSpecification.ResourceLabel + spec["resource_label"] = aws.StringValue(config.PredefinedMetricSpecification.ResourceLabel) } result["predefined_metric_specification"] = []map[string]interface{}{spec} } if config.CustomizedMetricSpecification != nil { spec := map[string]interface{}{} - spec["metric_name"] = *config.CustomizedMetricSpecification.MetricName - spec["namespace"] = *config.CustomizedMetricSpecification.Namespace - spec["statistic"] = *config.CustomizedMetricSpecification.Statistic + spec["metric_name"] = aws.StringValue(config.CustomizedMetricSpecification.MetricName) + spec["namespace"] = aws.StringValue(config.CustomizedMetricSpecification.Namespace) + spec["statistic"] = aws.StringValue(config.CustomizedMetricSpecification.Statistic) if config.CustomizedMetricSpecification.Unit != nil { - spec["unit"] = *config.CustomizedMetricSpecification.Unit + spec["unit"] = aws.StringValue(config.CustomizedMetricSpecification.Unit) } if config.CustomizedMetricSpecification.Dimensions != nil { dimSpec := make([]interface{}, len(config.CustomizedMetricSpecification.Dimensions)) for i := range dimSpec { dim := map[string]interface{}{} rawDim := config.CustomizedMetricSpecification.Dimensions[i] - dim["name"] = *rawDim.Name - dim["value"] = *rawDim.Value + dim["name"] = aws.StringValue(rawDim.Name) + dim["value"] = aws.StringValue(rawDim.Value) dimSpec[i] = dim } spec["metric_dimension"] = dimSpec diff --git a/aws/resource_aws_autoscaling_schedule.go b/aws/resource_aws_autoscaling_schedule.go index d57fb39a02d..0131045e3b4 100644 --- a/aws/resource_aws_autoscaling_schedule.go +++ b/aws/resource_aws_autoscaling_schedule.go @@ -236,7 +236,7 @@ func resourceAwsASGScheduledActionRetrieve(d *schema.ResourceData, meta interfac } if len(actions.ScheduledUpdateGroupActions) != 1 || - *actions.ScheduledUpdateGroupActions[0].ScheduledActionName != d.Id() { + aws.StringValue(actions.ScheduledUpdateGroupActions[0].ScheduledActionName) != d.Id() { return nil, false, nil } diff --git a/aws/resource_aws_batch_job_definition.go b/aws/resource_aws_batch_job_definition.go index 43407c7c455..32c1ca11273 100644 --- a/aws/resource_aws_batch_job_definition.go +++ b/aws/resource_aws_batch_job_definition.go @@ -236,7 +236,7 @@ func getJobDefinition(conn *batch.Batch, arn string) (*batch.JobDefinition, erro case numJobDefinitions == 0: return nil, nil case numJobDefinitions == 1: - if *resp.JobDefinitions[0].Status == "ACTIVE" { + if aws.StringValue(resp.JobDefinitions[0].Status) == "ACTIVE" { return resp.JobDefinitions[0], nil } return nil, nil diff --git a/aws/resource_aws_batch_job_queue.go b/aws/resource_aws_batch_job_queue.go index 1fc1e51f1e2..924c74404bc 100644 --- a/aws/resource_aws_batch_job_queue.go +++ b/aws/resource_aws_batch_job_queue.go @@ -91,7 +91,7 @@ func resourceAwsBatchJobQueueCreate(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("Error waiting for JobQueue state to be \"VALID\": %s", err) } - arn := *out.JobQueueArn + arn := aws.StringValue(out.JobQueueArn) log.Printf("[DEBUG] JobQueue created: %s", arn) d.SetId(arn) diff --git a/aws/resource_aws_budgets_budget_test.go b/aws/resource_aws_budgets_budget_test.go index 98de8e4de9b..c1ee3a8b3ba 100644 --- a/aws/resource_aws_budgets_budget_test.go +++ b/aws/resource_aws_budgets_budget_test.go @@ -513,7 +513,7 @@ func testAccAWSBudgetsBudgetNotificationConfigUpdate() budgets.Notification { func testAccAWSBudgetsBudgetConfig_WithAccountID(budgetConfig budgets.Budget, accountID, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") - costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] + costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) return fmt.Sprintf(` resource "aws_budgets_budget" "test" { @@ -529,12 +529,12 @@ resource "aws_budgets_budget" "test" { "%s" = "%s" } } -`, accountID, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, timePeriodStart, *budgetConfig.TimeUnit, costFilterKey, costFilterValue) +`, accountID, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), timePeriodStart, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } func testAccAWSBudgetsBudgetConfig_PrefixDefaults(budgetConfig budgets.Budget, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") - costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] + costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) return fmt.Sprintf(` resource "aws_budgets_budget" "test" { @@ -549,13 +549,13 @@ resource "aws_budgets_budget" "test" { "%s" = "%s" } } -`, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, timePeriodStart, *budgetConfig.TimeUnit, costFilterKey, costFilterValue) +`, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), timePeriodStart, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } func testAccAWSBudgetsBudgetConfig_Prefix(budgetConfig budgets.Budget, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") timePeriodEnd := budgetConfig.TimePeriod.End.Format("2006-01-02_15:04") - costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] + costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) return fmt.Sprintf(` resource "aws_budgets_budget" "test" { @@ -578,11 +578,11 @@ resource "aws_budgets_budget" "test" { "%s" = "%s" } } -`, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, *budgetConfig.CostTypes.IncludeTax, *budgetConfig.CostTypes.IncludeSubscription, *budgetConfig.CostTypes.UseBlended, timePeriodStart, timePeriodEnd, *budgetConfig.TimeUnit, costFilterKey, costFilterValue) +`, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), aws.BoolValue(budgetConfig.CostTypes.IncludeTax), aws.BoolValue(budgetConfig.CostTypes.IncludeSubscription), aws.BoolValue(budgetConfig.CostTypes.UseBlended), timePeriodStart, timePeriodEnd, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } func testAccAWSBudgetsBudgetConfig_BasicDefaults(budgetConfig budgets.Budget, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") - costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] + costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) return fmt.Sprintf(` resource "aws_budgets_budget" "test" { @@ -597,13 +597,13 @@ resource "aws_budgets_budget" "test" { "%s" = "%s" } } -`, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, timePeriodStart, *budgetConfig.TimeUnit, costFilterKey, costFilterValue) +`, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), timePeriodStart, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } func testAccAWSBudgetsBudgetConfig_Basic(budgetConfig budgets.Budget, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") timePeriodEnd := budgetConfig.TimePeriod.End.Format("2006-01-02_15:04") - costFilterValue := *budgetConfig.CostFilters[costFilterKey][0] + costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) return fmt.Sprintf(` resource "aws_budgets_budget" "test" { @@ -626,7 +626,7 @@ resource "aws_budgets_budget" "test" { "%s" = "%s" } } -`, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, *budgetConfig.CostTypes.IncludeTax, *budgetConfig.CostTypes.IncludeSubscription, *budgetConfig.CostTypes.UseBlended, timePeriodStart, timePeriodEnd, *budgetConfig.TimeUnit, costFilterKey, costFilterValue) +`, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), aws.BoolValue(budgetConfig.CostTypes.IncludeTax), aws.BoolValue(budgetConfig.CostTypes.IncludeSubscription), aws.BoolValue(budgetConfig.CostTypes.UseBlended), timePeriodStart, timePeriodEnd, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } func testAccAWSBudgetsBudgetConfigWithNotification_Basic(budgetConfig budgets.Budget, notifications []budgets.Notification, emails []string, topics []string) string { @@ -659,7 +659,7 @@ resource "aws_budgets_budget" "test" { time_unit = "%s" %s } -`, *budgetConfig.BudgetName, *budgetConfig.BudgetType, *budgetConfig.BudgetLimit.Amount, *budgetConfig.BudgetLimit.Unit, *budgetConfig.CostTypes.IncludeTax, *budgetConfig.CostTypes.IncludeSubscription, *budgetConfig.CostTypes.UseBlended, timePeriodStart, timePeriodEnd, *budgetConfig.TimeUnit, strings.Join(notificationStrings, "\n")) +`, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), aws.BoolValue(budgetConfig.CostTypes.IncludeTax), aws.BoolValue(budgetConfig.CostTypes.IncludeSubscription), aws.BoolValue(budgetConfig.CostTypes.UseBlended), timePeriodStart, timePeriodEnd, aws.StringValue(budgetConfig.TimeUnit), strings.Join(notificationStrings, "\n")) } @@ -683,5 +683,5 @@ notification { subscriber_sns_topic_arns = [%s] comparison_operator = "%s" } -`, *notification.Threshold, *notification.ThresholdType, *notification.NotificationType, strings.Join(quotedEMails, ","), strings.Join(quotedTopics, ","), *notification.ComparisonOperator) +`, aws.Float64Value(notification.Threshold), aws.StringValue(notification.ThresholdType), aws.StringValue(notification.NotificationType), strings.Join(quotedEMails, ","), strings.Join(quotedTopics, ","), aws.StringValue(notification.ComparisonOperator)) } From fb649846c46a67aa82f1c00d79cd1f616271c74b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:27:53 -0400 Subject: [PATCH 0479/1252] ci: Remove goreleaser from normal PR CI --- .github/workflows/terraform_provider.yml | 26 ------------------------ .goreleaser.yml | 9 +++++--- 2 files changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 086fd031f95..0ceba698f2b 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -275,32 +275,6 @@ jobs: - run: cd tools && go install github.com/pavius/impi/cmd/impi - run: impi --local . --scheme stdThirdPartyLocal ./... - goreleaser: - needs: [go_mod_download] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - # See also: https://github.com/actions/setup-go/pull/62 - - run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV - - uses: actions/setup-go@v2 - with: - go-version: ${{ env.GO_VERSION }} - - uses: actions/cache@v2 - continue-on-error: true - timeout-minutes: 2 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - - name: goreleaser check - continue-on-error: true - uses: goreleaser/goreleaser-action@v2 - with: - args: check - - name: goreleaser build - uses: goreleaser/goreleaser-action@v2 - with: - args: build --snapshot --timeout 2h - semgrep: runs-on: ubuntu-latest steps: diff --git a/.goreleaser.yml b/.goreleaser.yml index b6388e74ef6..fe1eb97fe8c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -11,16 +11,17 @@ builds: flags: - -trimpath goarch: - - 386 + - '386' - amd64 - arm - arm64 goos: - - linux - darwin + - freebsd + - linux - windows ignore: - - goarch: 386 + - goarch: '386' goos: darwin ldflags: - -s -w -X version.ProviderVersion={{.Version}} @@ -30,6 +31,8 @@ changelog: checksum: name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' algorithm: sha256 +env: + - CGO_ENABLED=0 release: disable: true signs: From 2a914519031163be1d176d686d57ed12ee2c0a1c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:28:52 -0400 Subject: [PATCH 0480/1252] ci: Remove goreleaser from normal PR CI --- .github/workflows/terraform_provider.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 0ceba698f2b..75e6e9ddabe 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -10,7 +10,6 @@ on: - .github/workflows/terraform_provider.yml - .go-version - .golangci.yml - - .goreleaser.yml - .semgrep.yml - aws/** - awsproviderlint/** From 1186f8514e22e87985a7f60f6fded723ffb468b2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:43:36 -0400 Subject: [PATCH 0481/1252] tests/ds/lambda_alias: Add ErrorCheck --- aws/data_source_aws_lambda_alias_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_lambda_alias_test.go b/aws/data_source_aws_lambda_alias_test.go index 3caa4a665fc..222d13571f4 100644 --- a/aws/data_source_aws_lambda_alias_test.go +++ b/aws/data_source_aws_lambda_alias_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSLambdaAlias_basic(t *testing.T) { resourceName := "aws_lambda_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaAliasConfigBasic(rName), From 13f3d33f3da129c016c25a54fe20dd51b7aacc1f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:43:47 -0400 Subject: [PATCH 0482/1252] tests/ds/lambda_code_signing_config: Add ErrorCheck --- ...source_aws_lambda_code_signing_config_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_lambda_code_signing_config_test.go b/aws/data_source_aws_lambda_code_signing_config_test.go index cacc267b287..57cec74f8b2 100644 --- a/aws/data_source_aws_lambda_code_signing_config_test.go +++ b/aws/data_source_aws_lambda_code_signing_config_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,8 +11,9 @@ func TestAccDataSourceAWSLambdaCodeSigningConfig_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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaCodeSigningConfigBasic, @@ -28,8 +30,9 @@ func TestAccDataSourceAWSLambdaCodeSigningConfig_PolicyConfigId(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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaCodeSigningConfigConfigurePolicy, @@ -48,8 +51,9 @@ func TestAccDataSourceAWSLambdaCodeSigningConfig_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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaCodeSigningConfigConfigureDescription, From 4f9dd577c429251f1cfd447656ff765991ab10c1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:43:58 -0400 Subject: [PATCH 0483/1252] tests/ds/lambda_function: Add ErrorCheck --- aws/data_source_aws_lambda_function_test.go | 41 +++++++++++++-------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/aws/data_source_aws_lambda_function_test.go b/aws/data_source_aws_lambda_function_test.go index a39366c13d1..4d065ebae28 100644 --- a/aws/data_source_aws_lambda_function_test.go +++ b/aws/data_source_aws_lambda_function_test.go @@ -5,6 +5,7 @@ import ( "os" "testing" + "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSLambdaFunction_basic(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigBasic(rName), @@ -55,8 +57,9 @@ func TestAccDataSourceAWSLambdaFunction_version(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigVersion(rName), @@ -78,8 +81,9 @@ func TestAccDataSourceAWSLambdaFunction_alias(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigAlias(rName), @@ -100,8 +104,9 @@ func TestAccDataSourceAWSLambdaFunction_layers(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigLayers(rName), @@ -120,8 +125,9 @@ func TestAccDataSourceAWSLambdaFunction_vpc(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigVPC(rName), @@ -142,8 +148,9 @@ func TestAccDataSourceAWSLambdaFunction_environment(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigEnvironment(rName), @@ -165,8 +172,9 @@ func TestAccDataSourceAWSLambdaFunction_fileSystemConfig(t *testing.T) { resourceName := "aws_lambda_function.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigFileSystemConfigs(rName), @@ -189,8 +197,9 @@ func TestAccDataSourceAWSLambdaFunction_imageConfig(t *testing.T) { imageLatestID := os.Getenv("AWS_LAMBDA_IMAGE_LATEST_ID") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccDataSourceLambdaImagePreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccDataSourceLambdaImagePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaFunctionConfigImageConfig(rName, imageLatestID), From b1dc9bd5fa8ce32ab64a2f0aab4cf29104efd6e3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:44:08 -0400 Subject: [PATCH 0484/1252] tests/ds/lambda_invocation: Add ErrorCheck --- aws/data_source_aws_lambda_invocation_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_lambda_invocation_test.go b/aws/data_source_aws_lambda_invocation_test.go index 83ad3f1611c..cf876f77ed7 100644 --- a/aws/data_source_aws_lambda_invocation_test.go +++ b/aws/data_source_aws_lambda_invocation_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -39,8 +40,9 @@ func TestAccDataSourceAwsLambdaInvocation_basic(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsLambdaInvocation_basic_config(rName, testData), @@ -57,8 +59,9 @@ func TestAccDataSourceAwsLambdaInvocation_qualifier(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsLambdaInvocation_qualifier_config(rName, testData), @@ -75,8 +78,9 @@ func TestAccDataSourceAwsLambdaInvocation_complex(t *testing.T) { testData := "value3" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsLambdaInvocation_complex_config(rName, testData), From 99746fdcab06570a36bae1726a621b3517109669 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:44:19 -0400 Subject: [PATCH 0485/1252] tests/ds/lambda_layer_version: Add ErrorCheck --- aws/data_source_aws_lambda_layer_version_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_lambda_layer_version_test.go b/aws/data_source_aws_lambda_layer_version_test.go index b4611c4f171..7b36d7171da 100644 --- a/aws/data_source_aws_lambda_layer_version_test.go +++ b/aws/data_source_aws_lambda_layer_version_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/lambda" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAWSLambdaLayerVersion_basic(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigBasic(rName), @@ -44,8 +46,9 @@ func TestAccDataSourceAWSLambdaLayerVersion_version(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigVersion(rName), @@ -64,8 +67,9 @@ func TestAccDataSourceAWSLambdaLayerVersion_runtime(t *testing.T) { resourceName := "aws_lambda_layer_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLambdaLayerVersionConfigRuntimes(rName), From 161bda7286da1d3838d1111e8e5842eefdce484e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:44:30 -0400 Subject: [PATCH 0486/1252] tests/r/lambda_alias: Add ErrorCheck --- aws/resource_aws_lambda_alias_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_lambda_alias_test.go b/aws/resource_aws_lambda_alias_test.go index 5be508daecc..6386632e6a7 100644 --- a/aws/resource_aws_lambda_alias_test.go +++ b/aws/resource_aws_lambda_alias_test.go @@ -26,6 +26,7 @@ func TestAccAWSLambdaAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLambdaAliasDestroy, Steps: []resource.TestStep{ @@ -61,6 +62,7 @@ func TestAccAWSLambdaAlias_FunctionName_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLambdaAliasDestroy, Steps: []resource.TestStep{ @@ -101,6 +103,7 @@ func TestAccAWSLambdaAlias_nameupdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLambdaAliasDestroy, Steps: []resource.TestStep{ @@ -145,6 +148,7 @@ func TestAccAWSLambdaAlias_routingconfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLambdaAliasDestroy, Steps: []resource.TestStep{ From b0151b0c532ce233cb27851f5531920b933a4456 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:44:41 -0400 Subject: [PATCH 0487/1252] tests/r/lambda_code_signing_config: Add ErrorCheck --- aws/resource_aws_lambda_code_signing_config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_lambda_code_signing_config_test.go b/aws/resource_aws_lambda_code_signing_config_test.go index f2cd480ab52..4a4c7a1a512 100644 --- a/aws/resource_aws_lambda_code_signing_config_test.go +++ b/aws/resource_aws_lambda_code_signing_config_test.go @@ -19,6 +19,7 @@ func TestAccAWSLambdaCodeSigningConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeSigningConfigDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSLambdaCodeSigningConfig_UpdatePolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeSigningConfigDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func TestAccAWSLambdaCodeSigningConfig_UpdatePublishers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeSigningConfigDestroy, Steps: []resource.TestStep{ From 0a6a033508aee0217e50c2d59c64a6798f197d6e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:44:53 -0400 Subject: [PATCH 0488/1252] tests/r/lambda_event_source_mapping: Add ErrorCheck --- ...ource_aws_lambda_event_source_mapping_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aws/resource_aws_lambda_event_source_mapping_test.go b/aws/resource_aws_lambda_event_source_mapping_test.go index 64bfdaccbe5..590d4d09667 100644 --- a/aws/resource_aws_lambda_event_source_mapping_test.go +++ b/aws/resource_aws_lambda_event_source_mapping_test.go @@ -32,6 +32,7 @@ func TestAccAWSLambdaEventSourceMapping_kinesis_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -88,6 +89,7 @@ func TestAccAWSLambdaEventSourceMapping_kinesis_removeBatchSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSLambdaEventSourceMapping_sqs_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSLambdaEventSourceMapping_sqs_withFunctionName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -220,6 +224,7 @@ func TestAccAWSLambdaEventSourceMapping_SQSBatchWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -260,6 +265,7 @@ func TestAccAWSLambdaEventSourceMapping_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -288,6 +294,7 @@ func TestAccAWSLambdaEventSourceMapping_changesInEnabledAreDetected(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -311,6 +318,7 @@ func TestAccAWSLambdaEventSourceMapping_StartingPositionTimestamp(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -344,6 +352,7 @@ func TestAccAWSLambdaEventSourceMapping_KinesisBatchWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -383,6 +392,7 @@ func TestAccAWSLambdaEventSourceMapping_ParallelizationFactor(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -422,6 +432,7 @@ func TestAccAWSLambdaEventSourceMapping_MaximumRetryAttempts(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -461,6 +472,7 @@ func TestAccAWSLambdaEventSourceMapping_MaximumRetryAttemptsZero(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -507,6 +519,7 @@ func TestAccAWSLambdaEventSourceMapping_MaximumRecordAgeInSeconds(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -546,6 +559,7 @@ func TestAccAWSLambdaEventSourceMapping_BisectBatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -588,6 +602,7 @@ func TestAccAWSLambdaEventSourceMapping_KinesisDestinationConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ @@ -630,6 +645,7 @@ func TestAccAWSLambdaEventSourceMapping_MSK(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaEventSourceMappingDestroy, Steps: []resource.TestStep{ From 645ecc529cbf41505f1a751e6018556877a183dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:45:04 -0400 Subject: [PATCH 0489/1252] tests/r/lambda_function_event_invoke_config: Add ErrorCheck --- ...aws_lambda_function_event_invoke_config_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_lambda_function_event_invoke_config_test.go b/aws/resource_aws_lambda_function_event_invoke_config_test.go index f1107fb0cc9..4b58d409200 100644 --- a/aws/resource_aws_lambda_function_event_invoke_config_test.go +++ b/aws/resource_aws_lambda_function_event_invoke_config_test.go @@ -18,6 +18,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunction(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -71,6 +73,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunctionEventInv resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -94,6 +97,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnFailure_Desti resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -132,6 +136,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnSuccess_Desti resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -169,6 +174,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Remove(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -204,6 +210,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Swap(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -241,6 +248,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_FunctionName_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -268,6 +276,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionName_Arn(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -294,6 +303,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_MaximumEventAgeInSeconds(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -326,6 +336,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_MaximumRetryAttempts(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -366,6 +377,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_AliasName(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -392,6 +404,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionVersion(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ @@ -418,6 +431,7 @@ func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_Latest(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, Steps: []resource.TestStep{ From c2bb8220b00a7881b187bc13a16b98b33acb5590 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:45:16 -0400 Subject: [PATCH 0490/1252] tests/r/lambda_function: Add ErrorCheck --- aws/resource_aws_lambda_function_test.go | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/aws/resource_aws_lambda_function_test.go b/aws/resource_aws_lambda_function_test.go index 06b78494ec5..9d4b0e4462d 100644 --- a/aws/resource_aws_lambda_function_test.go +++ b/aws/resource_aws_lambda_function_test.go @@ -72,6 +72,7 @@ func TestAccAWSLambdaFunction_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAWSLambdaFunction_UnpublishedCodeUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -165,6 +167,7 @@ func TestAccAWSLambdaFunction_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -192,6 +195,7 @@ func TestAccAWSLambdaFunction_codeSigningConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -250,6 +254,7 @@ func TestAccAWSLambdaFunction_concurrency(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -293,6 +298,7 @@ func TestAccAWSLambdaFunction_concurrencyCycle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -342,6 +348,7 @@ func TestAccAWSLambdaFunction_expectFilenameAndS3Attributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -365,6 +372,7 @@ func TestAccAWSLambdaFunction_envVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -422,6 +430,7 @@ func TestAccAWSLambdaFunction_Environment_Variables_NoValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -455,6 +464,7 @@ func TestAccAWSLambdaFunction_encryptedEnvVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -502,6 +512,7 @@ func TestAccAWSLambdaFunction_versioned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -548,6 +559,7 @@ func TestAccAWSLambdaFunction_versionedUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -622,6 +634,7 @@ func TestAccAWSLambdaFunction_enablePublish(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -685,6 +698,7 @@ func TestAccAWSLambdaFunction_disablePublish(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -734,6 +748,7 @@ func TestAccAWSLambdaFunction_DeadLetterConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -785,6 +800,7 @@ func TestAccAWSLambdaFunction_DeadLetterConfigUpdated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -824,6 +840,7 @@ func TestAccAWSLambdaFunction_nilDeadLetterConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -848,6 +865,7 @@ func TestAccAWSLambdaFunction_FileSystemConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -916,6 +934,7 @@ func TestAccAWSLambdaFunction_imageConfig(t *testing.T) { testAccPreCheck(t) testAccLambdaImagePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -978,6 +997,7 @@ func TestAccAWSLambdaFunction_tracingConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1021,6 +1041,7 @@ func TestAccAWSLambdaFunction_KmsKeyArn_NoEnvironmentVariables(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1055,6 +1076,7 @@ func TestAccAWSLambdaFunction_Layers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1092,6 +1114,7 @@ func TestAccAWSLambdaFunction_LayersUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1137,6 +1160,7 @@ func TestAccAWSLambdaFunction_VPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1171,6 +1195,7 @@ func TestAccAWSLambdaFunction_VPCRemoval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1211,6 +1236,7 @@ func TestAccAWSLambdaFunction_VPCUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1262,6 +1288,7 @@ func TestAccAWSLambdaFunction_VPC_withInvocation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1292,6 +1319,7 @@ func TestAccAWSLambdaFunction_VpcConfig_ProperIamDependencies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1321,6 +1349,7 @@ func TestAccAWSLambdaFunction_EmptyVpcConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1352,6 +1381,7 @@ func TestAccAWSLambdaFunction_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1392,6 +1422,7 @@ func TestAccAWSLambdaFunction_localUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1459,6 +1490,7 @@ func TestAccAWSLambdaFunction_localUpdate_nameOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1519,6 +1551,7 @@ func TestAccAWSLambdaFunction_s3Update_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1581,6 +1614,7 @@ func TestAccAWSLambdaFunction_s3Update_unversioned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1636,6 +1670,7 @@ func TestAccAWSLambdaFunction_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: []resource.TestStep{ @@ -1729,6 +1764,7 @@ func TestAccAWSLambdaFunction_runtimes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaFunctionDestroy, Steps: steps, From 78f37522386e2c543859a10f1f26a07ee052a61c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:45:28 -0400 Subject: [PATCH 0491/1252] tests/r/lambda_layer_version: Add ErrorCheck --- aws/resource_aws_lambda_layer_version_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_lambda_layer_version_test.go b/aws/resource_aws_lambda_layer_version_test.go index 61e35a6934a..9825bdd3981 100644 --- a/aws/resource_aws_lambda_layer_version_test.go +++ b/aws/resource_aws_lambda_layer_version_test.go @@ -69,6 +69,7 @@ func TestAccAWSLambdaLayerVersion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSLambdaLayerVersion_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSLambdaLayerVersion_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ @@ -160,6 +163,7 @@ func TestAccAWSLambdaLayerVersion_compatibleRuntimes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ @@ -189,6 +193,7 @@ func TestAccAWSLambdaLayerVersion_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ @@ -218,6 +223,7 @@ func TestAccAWSLambdaLayerVersion_licenseInfo(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaLayerVersionDestroy, Steps: []resource.TestStep{ From 7f2a2507ce4a2a591a88d9eac7af576330b63747 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:45:39 -0400 Subject: [PATCH 0492/1252] tests/r/lambda_permission: Add ErrorCheck --- aws/resource_aws_lambda_permission_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_lambda_permission_test.go b/aws/resource_aws_lambda_permission_test.go index e0e6e15e033..19a7b531006 100644 --- a/aws/resource_aws_lambda_permission_test.go +++ b/aws/resource_aws_lambda_permission_test.go @@ -70,6 +70,7 @@ func TestLambdaPermissionGetQualifierFromLambdaAliasOrVersionArn_alias(t *testin t.Fatalf("Expected qualifier to match (%q != %q)", qualifier, expectedQualifier) } } + func TestLambdaPermissionGetQualifierFromLambdaAliasOrVersionArn_govcloud(t *testing.T) { arnWithAlias := "arn:aws-us-gov:lambda:us-gov-west-1:187636751137:function:lambda_function_name:testalias" // lintignore:AWSAT003,AWSAT005 // unit test expectedQualifier := "testalias" @@ -176,6 +177,7 @@ func TestAccAWSLambdaPermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -206,6 +208,7 @@ func TestAccAWSLambdaPermission_StatementId_Duplicate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -229,6 +232,7 @@ func TestAccAWSLambdaPermission_withRawFunctionName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -263,6 +267,7 @@ func TestAccAWSLambdaPermission_withStatementIdPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -300,6 +305,7 @@ func TestAccAWSLambdaPermission_withQualifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -333,6 +339,7 @@ func TestAccAWSLambdaPermission_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -368,6 +375,7 @@ func TestAccAWSLambdaPermission_multiplePerms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -441,6 +449,7 @@ func TestAccAWSLambdaPermission_withS3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -479,6 +488,7 @@ func TestAccAWSLambdaPermission_withSNS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ @@ -516,6 +526,7 @@ func TestAccAWSLambdaPermission_withIAMRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLambdaPermissionDestroy, Steps: []resource.TestStep{ From cad7a6da1fc506f08cd94e191fd7157a0be7afa0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:45:51 -0400 Subject: [PATCH 0493/1252] tests/r/lambda_provisioned_concurrency_config: Add ErrorCheck --- ...esource_aws_lambda_provisioned_concurrency_config_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_lambda_provisioned_concurrency_config_test.go b/aws/resource_aws_lambda_provisioned_concurrency_config_test.go index 1a2b3b24494..002dddef34f 100644 --- a/aws/resource_aws_lambda_provisioned_concurrency_config_test.go +++ b/aws/resource_aws_lambda_provisioned_concurrency_config_test.go @@ -18,6 +18,7 @@ func TestAccAWSLambdaProvisionedConcurrencyConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaProvisionedConcurrencyConfigDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSLambdaProvisionedConcurrencyConfig_disappears_LambdaFunction(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaProvisionedConcurrencyConfigDestroy, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAWSLambdaProvisionedConcurrencyConfig_disappears_LambdaProvisionedCo resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaProvisionedConcurrencyConfigDestroy, Steps: []resource.TestStep{ @@ -90,6 +93,7 @@ func TestAccAWSLambdaProvisionedConcurrencyConfig_ProvisionedConcurrentExecution resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaProvisionedConcurrencyConfigDestroy, Steps: []resource.TestStep{ @@ -127,6 +131,7 @@ func TestAccAWSLambdaProvisionedConcurrencyConfig_Qualifier_AliasName(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lambda.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLambdaProvisionedConcurrencyConfigDestroy, Steps: []resource.TestStep{ From 333e7a1ebb531f898f704eb9f520cb1f92009b71 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:49:57 -0400 Subject: [PATCH 0494/1252] tests/ds/ssm_document: Add ErrorCheck --- aws/data_source_aws_ssm_document_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ssm_document_test.go b/aws/data_source_aws_ssm_document_test.go index d2bf0d727e5..1e86e69a48d 100644 --- a/aws/data_source_aws_ssm_document_test.go +++ b/aws/data_source_aws_ssm_document_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSSsmDocumentDataSource_basic(t *testing.T) { name := fmt.Sprintf("test_document-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSsmDocumentDataSourceConfig(name, "JSON"), From 773d74acd790dcec46a1d929fa577256503544bd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:07 -0400 Subject: [PATCH 0495/1252] tests/ds/ssm_parameter: Add ErrorCheck --- aws/data_source_aws_ssm_parameter_test.go | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_ssm_parameter_test.go b/aws/data_source_aws_ssm_parameter_test.go index 65c484943fd..b8f64fd1318 100644 --- a/aws/data_source_aws_ssm_parameter_test.go +++ b/aws/data_source_aws_ssm_parameter_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,10 +14,9 @@ func TestAccAWSSsmParameterDataSource_basic(t *testing.T) { name := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSsmParameterDataSourceConfig(name, "false"), @@ -48,10 +48,9 @@ func TestAccAWSSsmParameterDataSource_fullPath(t *testing.T) { name := acctest.RandomWithPrefix("/tf-acc-test/tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSsmParameterDataSourceConfig(name, "false"), From 6b6c4cc2d96bd408447a7ab2249e92e22f8c389d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:17 -0400 Subject: [PATCH 0496/1252] tests/ds/ssm_patch_baseline: Add ErrorCheck --- aws/data_source_aws_ssm_patch_baseline_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ssm_patch_baseline_test.go b/aws/data_source_aws_ssm_patch_baseline_test.go index 292922d06bc..a2d661a0997 100644 --- a/aws/data_source_aws_ssm_patch_baseline_test.go +++ b/aws/data_source_aws_ssm_patch_baseline_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSSsmPatchBaselineDataSource_existingBaseline(t *testing.T) { resourceName := "data.aws_ssm_patch_baseline.test_existing" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSsmPatchBaselineDataSourceConfig_existingBaseline(), @@ -32,6 +34,7 @@ func TestAccAWSSsmPatchBaselineDataSource_newBaseline(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ From cc737bd3dc0975125431b43921c4c0f9533aa8fd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:27 -0400 Subject: [PATCH 0497/1252] tests/r/ssm_activation: Add ErrorCheck --- aws/resource_aws_ssm_activation_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ssm_activation_test.go b/aws/resource_aws_ssm_activation_test.go index 6122f59610a..0dc68d3453b 100644 --- a/aws/resource_aws_ssm_activation_test.go +++ b/aws/resource_aws_ssm_activation_test.go @@ -20,6 +20,7 @@ func TestAccAWSSSMActivation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMActivationDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSSSMActivation_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMActivationDestroy, Steps: []resource.TestStep{ @@ -102,6 +104,7 @@ func TestAccAWSSSMActivation_expirationDate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMActivationDestroy, Steps: []resource.TestStep{ @@ -132,6 +135,7 @@ func TestAccAWSSSMActivation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMActivationDestroy, Steps: []resource.TestStep{ From e5331e2a0aaead12cdc6f17d7192ad6f600af5ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 Mar 2021 20:50:32 +0000 Subject: [PATCH 0498/1252] build(deps): bump github.com/hashicorp/go-multierror from 1.1.0 to 1.1.1 (#18064) --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 9244f193744..537f5a6a804 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/hashicorp/aws-sdk-go-base v0.7.0 github.com/hashicorp/go-cleanhttp v0.5.2 github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 - github.com/hashicorp/go-multierror v1.1.0 + github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-version v1.2.1 github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 github.com/jen20/awspolicyequivalence v1.1.0 diff --git a/go.sum b/go.sum index 064733a8e3b..3839426bf4b 100644 --- a/go.sum +++ b/go.sum @@ -171,8 +171,8 @@ github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39 github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= -github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= +github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= From 43b20b5e9af170a6ce33b399328574934084c6e4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:36 -0400 Subject: [PATCH 0499/1252] tests/r/ssm_association: Add ErrorCheck --- aws/resource_aws_ssm_association_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_ssm_association_test.go b/aws/resource_aws_ssm_association_test.go index cbea001e4a0..48526d47212 100644 --- a/aws/resource_aws_ssm_association_test.go +++ b/aws/resource_aws_ssm_association_test.go @@ -17,6 +17,7 @@ func TestAccAWSSSMAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSSSMAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -63,6 +65,7 @@ func TestAccAWSSSMAssociation_ApplyOnlyAtCronInterval(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -115,6 +118,7 @@ targets { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -173,6 +177,7 @@ func TestAccAWSSSMAssociation_withParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -210,6 +215,7 @@ func TestAccAWSSSMAssociation_withAssociationName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -247,6 +253,7 @@ func TestAccAWSSSMAssociation_withAssociationNameAndScheduleExpression(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -281,6 +288,7 @@ func TestAccAWSSSMAssociation_withDocumentVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -307,6 +315,7 @@ func TestAccAWSSSMAssociation_withOutputLocation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -355,6 +364,7 @@ func TestAccAWSSSMAssociation_withAutomationTargetParamName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -390,6 +400,7 @@ func TestAccAWSSSMAssociation_withScheduleExpression(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -425,6 +436,7 @@ func TestAccAWSSSMAssociation_withComplianceSeverity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ @@ -463,6 +475,7 @@ func TestAccAWSSSMAssociation_rateControl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMAssociationDestroy, Steps: []resource.TestStep{ From 46b21d78e992087f0be6538e2403b57e3c4b21cd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:45 -0400 Subject: [PATCH 0500/1252] tests/r/ssm_document: Add ErrorCheck --- aws/resource_aws_ssm_document_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aws/resource_aws_ssm_document_test.go b/aws/resource_aws_ssm_document_test.go index 4ff60969b4b..9d7872f7e3d 100644 --- a/aws/resource_aws_ssm_document_test.go +++ b/aws/resource_aws_ssm_document_test.go @@ -17,6 +17,7 @@ func TestAccAWSSSMDocument_basic(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSSSMDocument_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSSSMDocument_target_type(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -110,6 +113,7 @@ func TestAccAWSSSMDocument_VersionName(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -141,6 +145,7 @@ func TestAccAWSSSMDocument_update(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -175,6 +180,7 @@ func TestAccAWSSSMDocument_permission_public(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -201,6 +207,7 @@ func TestAccAWSSSMDocument_permission_private(t *testing.T) { ids := "123456789012" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -226,6 +233,7 @@ func TestAccAWSSSMDocument_permission_batching(t *testing.T) { 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() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -253,6 +261,7 @@ func TestAccAWSSSMDocument_permission_change(t *testing.T) { idsAdd := "123456789012,123456789014" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -294,6 +303,7 @@ func TestAccAWSSSMDocument_params(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -323,6 +333,7 @@ func TestAccAWSSSMDocument_automation(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -350,6 +361,7 @@ func TestAccAWSSSMDocument_package(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -383,6 +395,7 @@ func TestAccAWSSSMDocument_SchemaVersion_1(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -414,6 +427,7 @@ func TestAccAWSSSMDocument_session(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -460,6 +474,7 @@ mainSteps: ` resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -494,6 +509,7 @@ func TestAccAWSSSMDocument_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ @@ -536,6 +552,7 @@ func TestAccAWSSSMDocument_disappears(t *testing.T) { resourceName := "aws_ssm_document.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMDocumentDestroy, Steps: []resource.TestStep{ From 9751aa31453f6636f9ebfb2faf08bdf860601f6a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:50:55 -0400 Subject: [PATCH 0501/1252] tests/r/ssm_maintenance_window_target: Add ErrorCheck --- aws/resource_aws_ssm_maintenance_window_target_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_ssm_maintenance_window_target_test.go b/aws/resource_aws_ssm_maintenance_window_target_test.go index 0112b2b50ee..5a6941a9dd9 100644 --- a/aws/resource_aws_ssm_maintenance_window_target_test.go +++ b/aws/resource_aws_ssm_maintenance_window_target_test.go @@ -18,6 +18,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_basic(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_noNameOrDescription(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_validation(t *testing.T) { name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -108,6 +111,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_update(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -163,6 +167,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_resourceGroup(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -197,6 +202,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_disappears(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ @@ -218,6 +224,7 @@ func TestAccAWSSSMMaintenanceWindowTarget_disappears_window(t *testing.T) { resourceName := "aws_ssm_maintenance_window_target.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTargetDestroy, Steps: []resource.TestStep{ From dc171d40e89713b1d96de3bb0ed982e7c34d9bb9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:51:07 -0400 Subject: [PATCH 0502/1252] tests/r/ssm_maintenance_window_task: Add ErrorCheck --- aws/resource_aws_ssm_maintenance_window_task_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_ssm_maintenance_window_task_test.go b/aws/resource_aws_ssm_maintenance_window_task_test.go index 2ad5b7a3e1a..ba0e17cf074 100644 --- a/aws/resource_aws_ssm_maintenance_window_task_test.go +++ b/aws/resource_aws_ssm_maintenance_window_task_test.go @@ -18,6 +18,7 @@ func TestAccAWSSSMMaintenanceWindowTask_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -58,6 +59,7 @@ func TestAccAWSSSMMaintenanceWindowTask_noRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSSSMMaintenanceWindowTask_updateForcesNewResource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -113,6 +116,7 @@ func TestAccAWSSSMMaintenanceWindowTask_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -148,6 +152,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationAutomationParameters(t *te rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -188,6 +193,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationLambdaParameters(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -216,6 +222,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParameters(t *te rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -257,6 +264,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationRunCommandParametersCloudW name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -306,6 +314,7 @@ func TestAccAWSSSMMaintenanceWindowTask_TaskInvocationStepFunctionParameters(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -332,6 +341,7 @@ func TestAccAWSSSMMaintenanceWindowTask_emptyNotificationConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ @@ -353,6 +363,7 @@ func TestAccAWSSSMMaintenanceWindowTask_disappears(t *testing.T) { name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowTaskDestroy, Steps: []resource.TestStep{ From 39754226f8d1aba5ded785a628df1546e1920463 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:51:17 -0400 Subject: [PATCH 0503/1252] tests/r/ssm_maintenance_window: Add ErrorCheck --- aws/resource_aws_ssm_maintenance_window_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_ssm_maintenance_window_test.go b/aws/resource_aws_ssm_maintenance_window_test.go index 0f2b01e61a2..ec54f19e54d 100644 --- a/aws/resource_aws_ssm_maintenance_window_test.go +++ b/aws/resource_aws_ssm_maintenance_window_test.go @@ -83,6 +83,7 @@ func TestAccAWSSSMMaintenanceWindow_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -118,6 +119,7 @@ func TestAccAWSSSMMaintenanceWindow_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -153,6 +155,7 @@ func TestAccAWSSSMMaintenanceWindow_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -197,6 +200,7 @@ func TestAccAWSSSMMaintenanceWindow_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -220,6 +224,7 @@ func TestAccAWSSSMMaintenanceWindow_multipleUpdates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -256,6 +261,7 @@ func TestAccAWSSSMMaintenanceWindow_Cutoff(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -289,6 +295,7 @@ func TestAccAWSSSMMaintenanceWindow_Duration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -322,6 +329,7 @@ func TestAccAWSSSMMaintenanceWindow_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -357,6 +365,7 @@ func TestAccAWSSSMMaintenanceWindow_EndDate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -397,6 +406,7 @@ func TestAccAWSSSMMaintenanceWindow_Schedule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -430,6 +440,7 @@ func TestAccAWSSSMMaintenanceWindow_ScheduleTimezone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -470,6 +481,7 @@ func TestAccAWSSSMMaintenanceWindow_ScheduleOffset(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ @@ -505,6 +517,7 @@ func TestAccAWSSSMMaintenanceWindow_StartDate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMMaintenanceWindowDestroy, Steps: []resource.TestStep{ From c99b54f59709f61ac04e913dff46b711ecdee4c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:51:28 -0400 Subject: [PATCH 0504/1252] tests/r/ssm_parameter: Add ErrorCheck --- aws/resource_aws_ssm_parameter_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_ssm_parameter_test.go b/aws/resource_aws_ssm_parameter_test.go index c1ca33f899a..9114e3b19ae 100644 --- a/aws/resource_aws_ssm_parameter_test.go +++ b/aws/resource_aws_ssm_parameter_test.go @@ -19,6 +19,7 @@ func TestAccAWSSSMParameter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSSSMParameter_Tier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -93,6 +95,7 @@ func TestAccAWSSSMParameter_Tier_IntelligentTieringToStandard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -140,6 +143,7 @@ func TestAccAWSSSMParameter_Tier_IntelligentTieringToAdvanced(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -187,6 +191,7 @@ func TestAccAWSSSMParameter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -209,6 +214,7 @@ func TestAccAWSSSMParameter_overwrite(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -240,6 +246,7 @@ func TestAccAWSSSMParameter_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -285,6 +292,7 @@ func TestAccAWSSSMParameter_updateType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -315,6 +323,7 @@ func TestAccAWSSSMParameter_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -346,6 +355,7 @@ func TestAccAWSSSMParameter_changeNameForcesNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -379,6 +389,7 @@ func TestAccAWSSSMParameter_fullPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -408,6 +419,7 @@ func TestAccAWSSSMParameter_secure(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -437,6 +449,7 @@ func TestAccAWSSSMParameter_DataType_AwsEc2Image(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -465,6 +478,7 @@ func TestAccAWSSSMParameter_secure_with_key(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ @@ -495,6 +509,7 @@ func TestAccAWSSSMParameter_secure_keyUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ From a019947d528cd51407bd0764842aa58d8da0297b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:51:40 -0400 Subject: [PATCH 0505/1252] tests/r/ssm_patch_baseline: Add ErrorCheck --- aws/resource_aws_ssm_patch_baseline_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_ssm_patch_baseline_test.go b/aws/resource_aws_ssm_patch_baseline_test.go index be6d53bf8f6..e5ca2676f67 100644 --- a/aws/resource_aws_ssm_patch_baseline_test.go +++ b/aws/resource_aws_ssm_patch_baseline_test.go @@ -18,6 +18,7 @@ func TestAccAWSSSMPatchBaseline_basic(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAWSSSMPatchBaseline_tags(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -114,6 +116,7 @@ func TestAccAWSSSMPatchBaseline_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -135,6 +138,7 @@ func TestAccAWSSSMPatchBaseline_OperatingSystem(t *testing.T) { resourceName := "aws_ssm_patch_baseline.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -178,6 +182,7 @@ func TestAccAWSSSMPatchBaseline_ApproveUntilDateParam(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -226,6 +231,7 @@ func TestAccAWSSSMPatchBaseline_Sources(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -277,6 +283,7 @@ func TestAccAWSSSMPatchBaseline_ApprovedPatchesNonSec(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ @@ -303,6 +310,7 @@ func TestAccAWSSSMPatchBaseline_RejectPatchesAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, Steps: []resource.TestStep{ From e193a9232af4d3643fb318f7eb26174d1f17e77b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:51:50 -0400 Subject: [PATCH 0506/1252] tests/r/ssm_patch_group: Add ErrorCheck --- aws/resource_aws_ssm_patch_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ssm_patch_group_test.go b/aws/resource_aws_ssm_patch_group_test.go index d985be2320a..f749c468eee 100644 --- a/aws/resource_aws_ssm_patch_group_test.go +++ b/aws/resource_aws_ssm_patch_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -16,6 +17,7 @@ func TestAccAWSSSMPatchGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchGroupDestroy, Steps: []resource.TestStep{ @@ -35,6 +37,7 @@ func TestAccAWSSSMPatchGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -58,6 +61,7 @@ func TestAccAWSSSMPatchGroup_multipleBaselines(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSMPatchGroupDestroy, Steps: []resource.TestStep{ From 8570197c810ca265053502fbd43b0c2b953d2e9c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:52:00 -0400 Subject: [PATCH 0507/1252] tests/r/ssm_resource_data_sync: Add ErrorCheck --- aws/resource_aws_ssm_resource_data_sync_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ssm_resource_data_sync_test.go b/aws/resource_aws_ssm_resource_data_sync_test.go index 3a0ba8024c0..0f39968fb1d 100644 --- a/aws/resource_aws_ssm_resource_data_sync_test.go +++ b/aws/resource_aws_ssm_resource_data_sync_test.go @@ -5,6 +5,7 @@ import ( "log" "testing" + "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -15,6 +16,7 @@ func TestAccAWSSsmResourceDataSync_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSsmResourceDataSyncDestroy, Steps: []resource.TestStep{ @@ -39,6 +41,7 @@ func TestAccAWSSsmResourceDataSync_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ssm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSsmResourceDataSyncDestroy, Steps: []resource.TestStep{ From 26856e2bfbf25d69d66390a9368c0b95ee36d29b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:55:29 -0400 Subject: [PATCH 0508/1252] tests/ds/wafregional_ipset: Add ErrorCheck --- aws/data_source_aws_wafregional_ipset_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafregional_ipset_test.go b/aws/data_source_aws_wafregional_ipset_test.go index e4ab2fec968..443b3015e7a 100644 --- a/aws/data_source_aws_wafregional_ipset_test.go +++ b/aws/data_source_aws_wafregional_ipset_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRegionalIPSet_basic(t *testing.T) { datasourceName := "data.aws_wafregional_ipset.ipset" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRegionalIPSet_NonExistent, From 787140816c69dccb45774477eba31628966a547e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:55:29 -0400 Subject: [PATCH 0509/1252] tests/ds/wafregional_rate_based_rule: Add ErrorCheck --- aws/data_source_aws_wafregional_rate_based_rule_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafregional_rate_based_rule_test.go b/aws/data_source_aws_wafregional_rate_based_rule_test.go index 51588166193..f83d0425f30 100644 --- a/aws/data_source_aws_wafregional_rate_based_rule_test.go +++ b/aws/data_source_aws_wafregional_rate_based_rule_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRegionalRateBasedRule_basic(t *testing.T) { datasourceName := "data.aws_wafregional_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRegionalRateBasedRuleConfig_NonExistent, From 91f93105b0b2434154337a2c360664325a3aa833 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:55:30 -0400 Subject: [PATCH 0510/1252] tests/ds/wafregional_rule: Add ErrorCheck --- aws/data_source_aws_wafregional_rule_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafregional_rule_test.go b/aws/data_source_aws_wafregional_rule_test.go index 1563833169c..ad330a33737 100644 --- a/aws/data_source_aws_wafregional_rule_test.go +++ b/aws/data_source_aws_wafregional_rule_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRegionalRule_basic(t *testing.T) { datasourceName := "data.aws_wafregional_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRegionalRuleConfig_NonExistent, From 951900db6b74b7c85af15de76b2baffb0dec54cc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:55:30 -0400 Subject: [PATCH 0511/1252] tests/ds/wafregional_web_acl: Add ErrorCheck --- aws/data_source_aws_wafregional_web_acl_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafregional_web_acl_test.go b/aws/data_source_aws_wafregional_web_acl_test.go index 2b3a874a967..2e22a4e1d4f 100644 --- a/aws/data_source_aws_wafregional_web_acl_test.go +++ b/aws/data_source_aws_wafregional_web_acl_test.go @@ -16,8 +16,9 @@ func TestAccDataSourceAwsWafRegionalWebAcl_basic(t *testing.T) { datasourceName := "data.aws_wafregional_web_acl.web_acl" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafRegionalWebAclConfig_NonExistent, From 7e8bf730614242246c454309fc47eff58a47bb03 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:55:40 -0400 Subject: [PATCH 0512/1252] tests/r/wafregional_web_acl_association: Add ErrorCheck --- aws/resource_aws_wafregional_web_acl_association_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_wafregional_web_acl_association_test.go b/aws/resource_aws_wafregional_web_acl_association_test.go index 8f92d371d20..137dc163dfb 100644 --- a/aws/resource_aws_wafregional_web_acl_association_test.go +++ b/aws/resource_aws_wafregional_web_acl_association_test.go @@ -16,6 +16,7 @@ func TestAccAWSWafRegionalWebAclAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckWafRegionalWebAclAssociationDestroy, Steps: []resource.TestStep{ @@ -37,6 +38,7 @@ func TestAccAWSWafRegionalWebAclAssociation_basic(t *testing.T) { func TestAccAWSWafRegionalWebAclAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckWafRegionalWebAclAssociationDestroy, Steps: []resource.TestStep{ @@ -57,6 +59,7 @@ func TestAccAWSWafRegionalWebAclAssociation_multipleAssociations(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckWafRegionalWebAclAssociationDestroy, Steps: []resource.TestStep{ @@ -86,6 +89,7 @@ func TestAccAWSWafRegionalWebAclAssociation_ResourceArn_ApiGatewayStage(t *testi testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckWafRegionalWebAclAssociationDestroy, Steps: []resource.TestStep{ From 846777e50c1c2a661f34bdd282794361d5672301 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:56:13 -0400 Subject: [PATCH 0513/1252] tests/r/wafregional_byte_match_set: Add ErrorCheck --- aws/resource_aws_wafregional_byte_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafregional_byte_match_set_test.go b/aws/resource_aws_wafregional_byte_match_set_test.go index 8480d346689..2adf9e15414 100644 --- a/aws/resource_aws_wafregional_byte_match_set_test.go +++ b/aws/resource_aws_wafregional_byte_match_set_test.go @@ -19,6 +19,7 @@ func TestAccAWSWafRegionalByteMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -65,6 +66,7 @@ func TestAccAWSWafRegionalByteMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -136,6 +138,7 @@ func TestAccAWSWafRegionalByteMatchSet_changeByteMatchTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -205,6 +208,7 @@ func TestAccAWSWafRegionalByteMatchSet_noByteMatchTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalByteMatchSetDestroy, Steps: []resource.TestStep{ @@ -232,6 +236,7 @@ func TestAccAWSWafRegionalByteMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalByteMatchSetDestroy, Steps: []resource.TestStep{ From aecd0163ee93480af14d1e52395cc843239f1241 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:56:45 -0400 Subject: [PATCH 0514/1252] tests/r/wafregional_geo_match_set: Add ErrorCheck --- aws/resource_aws_wafregional_geo_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafregional_geo_match_set_test.go b/aws/resource_aws_wafregional_geo_match_set_test.go index 3e51a512150..00c2bc313ce 100644 --- a/aws/resource_aws_wafregional_geo_match_set_test.go +++ b/aws/resource_aws_wafregional_geo_match_set_test.go @@ -19,6 +19,7 @@ func TestAccAWSWafRegionalGeoMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSWafRegionalGeoMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSWafRegionalGeoMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -119,6 +122,7 @@ func TestAccAWSWafRegionalGeoMatchSet_changeConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalGeoMatchSetDestroy, Steps: []resource.TestStep{ @@ -174,6 +178,7 @@ func TestAccAWSWafRegionalGeoMatchSet_noConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalGeoMatchSetDestroy, Steps: []resource.TestStep{ From 2baec325f5c060e46e5703d45265baea091600f4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:57:10 -0400 Subject: [PATCH 0515/1252] tests/r/wafregional_ipset: Add ErrorCheck --- aws/resource_aws_wafregional_ipset_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_wafregional_ipset_test.go b/aws/resource_aws_wafregional_ipset_test.go index 54b785dfcfd..fd6e23a8be6 100644 --- a/aws/resource_aws_wafregional_ipset_test.go +++ b/aws/resource_aws_wafregional_ipset_test.go @@ -24,6 +24,7 @@ func TestAccAWSWafRegionalIPSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSWafRegionalIPSet_disappears(t *testing.T) { ipsetName := fmt.Sprintf("ip-set-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -77,6 +79,7 @@ func TestAccAWSWafRegionalIPSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func TestAccAWSWafRegionalIPSet_changeDescriptors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -180,6 +184,7 @@ func TestAccAWSWafRegionalIPSet_IpSetDescriptors_1000UpdateLimit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -206,6 +211,7 @@ func TestAccAWSWafRegionalIPSet_noDescriptors(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ From 28f2184fe6aeaf0e5ee905322661a0772c4c7dd4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:57:42 -0400 Subject: [PATCH 0516/1252] tests/r/wafregional_rate_based_rule: Add ErrorCheck --- aws/resource_aws_wafregional_rate_based_rule_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_wafregional_rate_based_rule_test.go b/aws/resource_aws_wafregional_rate_based_rule_test.go index 42aee9619e6..60b634b87ce 100644 --- a/aws/resource_aws_wafregional_rate_based_rule_test.go +++ b/aws/resource_aws_wafregional_rate_based_rule_test.go @@ -123,6 +123,7 @@ func TestAccAWSWafRegionalRateBasedRule_basic(t *testing.T) { wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -151,6 +152,7 @@ func TestAccAWSWafRegionalRateBasedRule_tags(t *testing.T) { wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -196,6 +198,7 @@ func TestAccAWSWafRegionalRateBasedRule_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -233,6 +236,7 @@ func TestAccAWSWafRegionalRateBasedRule_disappears(t *testing.T) { wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -258,6 +262,7 @@ func TestAccAWSWafRegionalRateBasedRule_changePredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -305,6 +310,7 @@ func TestAccAWSWafRegionalRateBasedRule_changeRateLimit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ @@ -340,6 +346,7 @@ func TestAccAWSWafRegionalRateBasedRule_noPredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, Steps: []resource.TestStep{ From f80300057b590e6cd699adbf9e8a614c45d9df46 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:58:04 -0400 Subject: [PATCH 0517/1252] tests/r/wafregional_regex_match_set: Add ErrorCheck --- aws/resource_aws_wafregional_regex_match_set_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_wafregional_regex_match_set_test.go b/aws/resource_aws_wafregional_regex_match_set_test.go index 8830e16133c..054348b3aac 100644 --- a/aws/resource_aws_wafregional_regex_match_set_test.go +++ b/aws/resource_aws_wafregional_regex_match_set_test.go @@ -120,6 +120,7 @@ func testAccAWSWafRegionalRegexMatchSet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -159,6 +160,7 @@ func testAccAWSWafRegionalRegexMatchSet_changePatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -210,6 +212,7 @@ func testAccAWSWafRegionalRegexMatchSet_noPatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexMatchSetDestroy, Steps: []resource.TestStep{ @@ -238,6 +241,7 @@ func testAccAWSWafRegionalRegexMatchSet_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexMatchSetDestroy, Steps: []resource.TestStep{ From a524c020cb9d80d20a94c46b96e1261b204f250e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:58:27 -0400 Subject: [PATCH 0518/1252] tests/r/wafregional_regex_pattern_set: Add ErrorCheck --- aws/resource_aws_wafregional_regex_pattern_set_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_wafregional_regex_pattern_set_test.go b/aws/resource_aws_wafregional_regex_pattern_set_test.go index 326d63674ad..42ff1e50b4a 100644 --- a/aws/resource_aws_wafregional_regex_pattern_set_test.go +++ b/aws/resource_aws_wafregional_regex_pattern_set_test.go @@ -37,6 +37,7 @@ func testAccAWSWafRegionalRegexPatternSet_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -66,6 +67,7 @@ func testAccAWSWafRegionalRegexPatternSet_changePatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -106,6 +108,7 @@ func testAccAWSWafRegionalRegexPatternSet_noPatterns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -133,6 +136,7 @@ func testAccAWSWafRegionalRegexPatternSet_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRegexPatternSetDestroy, Steps: []resource.TestStep{ From f397d66d8119888e04470c3682fb25cd0988dd2c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:58:59 -0400 Subject: [PATCH 0519/1252] tests/r/wafregional_rule_group: Add ErrorCheck --- aws/resource_aws_wafregional_rule_group_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_wafregional_rule_group_test.go b/aws/resource_aws_wafregional_rule_group_test.go index ab71574d091..0229d11b3bb 100644 --- a/aws/resource_aws_wafregional_rule_group_test.go +++ b/aws/resource_aws_wafregional_rule_group_test.go @@ -71,6 +71,7 @@ func TestAccAWSWafRegionalRuleGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ @@ -110,6 +111,7 @@ func TestAccAWSWafRegionalRuleGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ @@ -160,6 +162,7 @@ func TestAccAWSWafRegionalRuleGroup_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ @@ -198,6 +201,7 @@ func TestAccAWSWafRegionalRuleGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ @@ -226,6 +230,7 @@ func TestAccAWSWafRegionalRuleGroup_changeActivatedRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ @@ -292,6 +297,7 @@ func TestAccAWSWafRegionalRuleGroup_noActivatedRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, Steps: []resource.TestStep{ From a4dbce1c0fe66707fafabba8a4615982c0fab16a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:59:30 -0400 Subject: [PATCH 0520/1252] tests/r/wafregional_rule: Add ErrorCheck --- aws/resource_aws_wafregional_rule_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_wafregional_rule_test.go b/aws/resource_aws_wafregional_rule_test.go index 6e8671aa17a..d3e7cabde46 100644 --- a/aws/resource_aws_wafregional_rule_test.go +++ b/aws/resource_aws_wafregional_rule_test.go @@ -124,6 +124,7 @@ func TestAccAWSWafRegionalRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleDestroy, Steps: []resource.TestStep{ @@ -153,6 +154,7 @@ func TestAccAWSWafRegionalRule_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleDestroy, Steps: []resource.TestStep{ @@ -198,6 +200,7 @@ func TestAccAWSWafRegionalRule_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalIPSetDestroy, Steps: []resource.TestStep{ @@ -235,6 +238,7 @@ func TestAccAWSWafRegionalRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleDestroy, Steps: []resource.TestStep{ @@ -257,6 +261,7 @@ func TestAccAWSWafRegionalRule_noPredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalRuleDestroy, Steps: []resource.TestStep{ @@ -288,6 +293,7 @@ func TestAccAWSWafRegionalRule_changePredicates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRuleDestroy, Steps: []resource.TestStep{ From a9f012f10ef1d3d0939dc5a6496479a2445a9388 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 16:59:55 -0400 Subject: [PATCH 0521/1252] tests/r/wafregional_size_constraint_set: Add ErrorCheck --- aws/resource_aws_wafregional_size_constraint_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafregional_size_constraint_set_test.go b/aws/resource_aws_wafregional_size_constraint_set_test.go index 89854a1646c..3ddd7df966c 100644 --- a/aws/resource_aws_wafregional_size_constraint_set_test.go +++ b/aws/resource_aws_wafregional_size_constraint_set_test.go @@ -19,6 +19,7 @@ func TestAccAWSWafRegionalSizeConstraintSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSWafRegionalSizeConstraintSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func TestAccAWSWafRegionalSizeConstraintSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -120,6 +123,7 @@ func TestAccAWSWafRegionalSizeConstraintSet_changeConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSizeConstraintSetDestroy, Steps: []resource.TestStep{ @@ -179,6 +183,7 @@ func TestAccAWSWafRegionalSizeConstraintSet_noConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSizeConstraintSetDestroy, Steps: []resource.TestStep{ From 3ee2ab2e1352eb627c02e330aa60b9373e143193 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 17:00:20 -0400 Subject: [PATCH 0522/1252] tests/r/wafregional_sql_injection_match_set: Add ErrorCheck --- aws/resource_aws_wafregional_sql_injection_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafregional_sql_injection_match_set_test.go b/aws/resource_aws_wafregional_sql_injection_match_set_test.go index aa52399177b..c73f17751d4 100644 --- a/aws/resource_aws_wafregional_sql_injection_match_set_test.go +++ b/aws/resource_aws_wafregional_sql_injection_match_set_test.go @@ -19,6 +19,7 @@ func TestAccAWSWafRegionalSqlInjectionMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSWafRegionalSqlInjectionMatchSet_changeNameForceNew(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -92,6 +94,7 @@ func TestAccAWSWafRegionalSqlInjectionMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -114,6 +117,7 @@ func TestAccAWSWafRegionalSqlInjectionMatchSet_changeTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ @@ -165,6 +169,7 @@ func TestAccAWSWafRegionalSqlInjectionMatchSet_noTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalSqlInjectionMatchSetDestroy, Steps: []resource.TestStep{ From 4cf6a1cdd91971e9cd32e018b32c9ae1dc931691 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 17:00:51 -0400 Subject: [PATCH 0523/1252] tests/r/wafregional_web_acl: Add ErrorCheck --- aws/resource_aws_wafregional_web_acl_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_wafregional_web_acl_test.go b/aws/resource_aws_wafregional_web_acl_test.go index ab333e39e1e..4bbaca1413e 100644 --- a/aws/resource_aws_wafregional_web_acl_test.go +++ b/aws/resource_aws_wafregional_web_acl_test.go @@ -122,6 +122,7 @@ func TestAccAWSWafRegionalWebAcl_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -154,6 +155,7 @@ func TestAccAWSWafRegionalWebAcl_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -198,6 +200,7 @@ func TestAccAWSWafRegionalWebAcl_createRateBased(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -228,6 +231,7 @@ func TestAccAWSWafRegionalWebAcl_createGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -259,6 +263,7 @@ func TestAccAWSWafRegionalWebAcl_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -301,6 +306,7 @@ func TestAccAWSWafRegionalWebAcl_changeDefaultAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -342,6 +348,7 @@ func TestAccAWSWafRegionalWebAcl_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -364,6 +371,7 @@ func TestAccAWSWafRegionalWebAcl_noRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -395,6 +403,7 @@ func TestAccAWSWafRegionalWebAcl_changeRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ @@ -439,6 +448,7 @@ func TestAccAWSWafRegionalWebAcl_LoggingConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, Steps: []resource.TestStep{ From 9a2521611b9eedffd66c81aa11e970ca6c2ccacd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 17:01:14 -0400 Subject: [PATCH 0524/1252] tests/r/wafregional_xss_match_set: Add ErrorCheck --- aws/resource_aws_wafregional_xss_match_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafregional_xss_match_set_test.go b/aws/resource_aws_wafregional_xss_match_set_test.go index 6cbe35b2908..c776843fe33 100644 --- a/aws/resource_aws_wafregional_xss_match_set_test.go +++ b/aws/resource_aws_wafregional_xss_match_set_test.go @@ -19,6 +19,7 @@ func TestAccAWSWafRegionalXssMatchSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSWafRegionalXssMatchSet_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -94,6 +96,7 @@ func TestAccAWSWafRegionalXssMatchSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func TestAccAWSWafRegionalXssMatchSet_changeTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalXssMatchSetDestroy, Steps: []resource.TestStep{ @@ -175,6 +179,7 @@ func TestAccAWSWafRegionalXssMatchSet_noTuples(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(wafregional.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, wafregional.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafRegionalXssMatchSetDestroy, Steps: []resource.TestStep{ From 2595f48d78d614f1ea42d8f28a0e432f3c86c992 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 18 Mar 2021 17:04:00 -0400 Subject: [PATCH 0525/1252] CR updates; update filter usge and describe method pagination and additional test coverage, doc updates --- ...ce_aws_ec2_transit_gateway_route_tables.go | 60 +++++++++++-------- ...s_ec2_transit_gateway_route_tables_test.go | 48 +++++++++++---- aws/provider.go | 2 +- ...transit_gateway_route_tables.html.markdown | 33 ++++++---- 4 files changed, 96 insertions(+), 47 deletions(-) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables.go b/aws/data_source_aws_ec2_transit_gateway_route_tables.go index 979899ce4d0..5be6e306ec9 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables.go @@ -1,13 +1,12 @@ package aws import ( - "errors" "fmt" - "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayRouteTables() *schema.Resource { @@ -15,17 +14,16 @@ func dataSourceAwsEc2TransitGatewayRouteTables() *schema.Resource { Read: dataSourceAwsEc2TransitGatewayRouteTablesRead, Schema: map[string]*schema.Schema{ - "transit_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, "filter": ec2CustomFiltersSchema(), + "ids": { Type: schema.TypeSet, Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, + + "tags": tagsSchemaComputed(), }, } } @@ -35,39 +33,53 @@ func dataSourceAwsEc2TransitGatewayRouteTablesRead(d *schema.ResourceData, meta input := &ec2.DescribeTransitGatewayRouteTablesInput{} - if v, ok := d.GetOk("transit_gateway_id"); ok { - input.Filters = buildEC2AttributeFilterList( - map[string]string{ - "transit-gateway-id": v.(string), - }, - ) - } + input.Filters = append(input.Filters, buildEC2TagFilterList( + keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), + )...) input.Filters = append(input.Filters, buildEC2CustomFilterList( d.Get("filter").(*schema.Set), )...) - log.Printf("[DEBUG] Reading EC2 Transit Gateway Route Tables: %s", input) - output, err := conn.DescribeTransitGatewayRouteTables(input) + if len(input.Filters) == 0 { + // Don't send an empty filters list; the EC2 API won't accept it. + input.Filters = nil + } + + var transitGatewayRouteTables []*ec2.TransitGatewayRouteTable + + err := conn.DescribeTransitGatewayRouteTablesPages(input, func(page *ec2.DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + transitGatewayRouteTables = append(transitGatewayRouteTables, page.TransitGatewayRouteTables...) + + return !lastPage + }) if err != nil { - return fmt.Errorf("error reading EC2 Transit Gateway Route Tables: %s", err) + return fmt.Errorf("error describing EC2 Transit Gateway Route Tables: %w", err) } - if output == nil || len(output.TransitGatewayRouteTables) == 0 { - return errors.New("error reading EC2 Transit Gateway Route Tables: no results found") + if len(transitGatewayRouteTables) == 0 { + return fmt.Errorf("no matching EC2 Transit Gateway Route Tables found") } - d.SetId(meta.(*AWSClient).region) + var ids []string - routeTables := make([]string, 0) + for _, transitGatewayRouteTable := range transitGatewayRouteTables { + if transitGatewayRouteTable == nil { + continue + } - for _, routeTable := range output.TransitGatewayRouteTables { - routeTables = append(routeTables, aws.StringValue(routeTable.TransitGatewayRouteTableId)) + ids = append(ids, aws.StringValue(transitGatewayRouteTable.TransitGatewayRouteTableId)) } - if err = d.Set("ids", routeTables); err != nil { - return fmt.Errorf("error setting ids: %s", err) + d.SetId(meta.(*AWSClient).region) + + if err = d.Set("ids", ids); err != nil { + return fmt.Errorf("error setting ids: %w", err) } return nil diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go index 9656dd874d3..8e9ffa52da7 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go @@ -6,27 +6,41 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) -func TestAccAWSEc2TransitGatewayRouteTablesDataSource_TransitGatewayFilter(t *testing.T) { +func TestAccDataSourceAwsEc2TransitGatewayRouteTables_basic(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" - resourceName := "aws_ec2_transit_gateway_route_table.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEc2TransitGatewayDestroy, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccAWSEc2TransitGatewayRouteTablesDataSourceTransitGatewayFilter(), + Config: testAccDataSourceAwsEc2TransitGatewayRouteTablesConfig, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), + testCheckResourceAttrGreaterThanValue(dataSourceName, "ids.#", "0"), ), }, }, }) } -func testAccAWSEc2TransitGatewayRouteTablesDataSourceTransitGatewayFilter() string { - return ` +func TestAccDataSourceAwsEc2TransitGatewayRouteTables_Filter(t *testing.T) { + dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsEc2TransitGatewayRouteTablesTransitGatewayFilter, + Check: resource.ComposeTestCheckFunc( + testCheckResourceAttrGreaterThanValue(dataSourceName, "ids.#", "0"), + ), + }, + }, + }) +} + +const testAccDataSourceAwsEc2TransitGatewayRouteTablesConfig = ` resource "aws_ec2_transit_gateway" "test" {} resource "aws_ec2_transit_gateway_route_table" "test" { @@ -34,9 +48,23 @@ resource "aws_ec2_transit_gateway_route_table" "test" { } data "aws_ec2_transit_gateway_route_tables" "test" { + depends_on = [aws_ec2_transit_gateway_route_table.test] +} +` + +const testAccDataSourceAwsEc2TransitGatewayRouteTablesTransitGatewayFilter = ` +resource "aws_ec2_transit_gateway" "test" {} + +resource "aws_ec2_transit_gateway_route_table" "test" { transit_gateway_id = aws_ec2_transit_gateway.test.id +} + +data "aws_ec2_transit_gateway_route_tables" "test" { + filter { + name = "transit-gateway-id" + values = [aws_ec2_transit_gateway.test.id] + } depends_on = [aws_ec2_transit_gateway_route_table.test] } ` -} diff --git a/aws/provider.go b/aws/provider.go index 7fe13a6f0af..9e3ca4b43f4 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -234,8 +234,8 @@ func Provider() *schema.Provider { "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), "aws_ec2_transit_gateway_peering_attachment": dataSourceAwsEc2TransitGatewayPeeringAttachment(), - "aws_ec2_transit_gateway_route_tables": dataSourceAwsEc2TransitGatewayRouteTables(), "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), + "aws_ec2_transit_gateway_route_tables": dataSourceAwsEc2TransitGatewayRouteTables(), "aws_ec2_transit_gateway_vpc_attachment": dataSourceAwsEc2TransitGatewayVpcAttachment(), "aws_ec2_transit_gateway_vpn_attachment": dataSourceAwsEc2TransitGatewayVpnAttachment(), "aws_ecr_authorization_token": dataSourceAwsEcrAuthorizationToken(), diff --git a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown index 64f4c8632d8..9d1f3dbe74a 100644 --- a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown +++ b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown @@ -3,20 +3,22 @@ subcategory: "EC2" layout: "aws" page_title: "AWS: aws_ec2_transit_gateway_route_tables" description: |- - Get information on EC2 Transit Gateway Route Tables + Provides information for multiple EC2 Transit Gateway Route Tables --- # Data Source: aws_ec2_transit_gateway_route_tables -Get information on EC2 Transit Gateway Route Tables. +Provides information for multiple EC2 Transit Gateway Route Tables, such as their identifiers. ## Example Usage -### By Transit Gateway Id +The following shows outputing all Transit Gateway Route Table Ids. ```hcl -data "aws_ec2_transit_gateway_route_tables" "example" { - transit_gateway_id = "tgw-12345678" +data "aws_ec2_transit_gateway_route_tables" "example" {} + +output "example" { + value = data.aws_ec2_transit_gateway_route_table.example.ids } ``` @@ -24,16 +26,23 @@ data "aws_ec2_transit_gateway_route_tables" "example" { The following arguments are supported: -* `filter` - (Optional) One or more configuration blocks containing name-values filters. Detailed below. -* `transit_gateway_id` - (Optional) Identifier of the EC2 Transit Gateway. +* `filter` - (Optional) Custom filter block as described below. + +* `tags` - (Optional) A mapping of tags, each pair of which must exactly match + a pair on the desired transit gateway route table. + +More complex filters can be expressed using one or more `filter` sub-blocks, +which take the following arguments: -### filter Argument Reference +* `name` - (Required) The name of the field to filter by, as defined by + [the underlying AWS API](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGatewayRouteTables.html). -* `name` - (Required) Name of the filter. -* `values` - (Required) List of one or more values for the filter. +* `values` - (Required) Set of values that are accepted for the given field. + A Transit Gateway Route Table will be selected if any one of the given values matches. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `ids` - A set of all the transit gateway route table ids found. This data source will fail if none are found. +* `id` - AWS Region. +* `ids` - Set of Transit Gateway Route Table identifiers. From 314680eb851b0f553a1102c1c391cbbc04fe812c Mon Sep 17 00:00:00 2001 From: Alexander Tarasov Date: Thu, 18 Mar 2021 22:20:40 +0100 Subject: [PATCH 0526/1252] Fix import example for wafv2_web_acl_logging_configuration Add closing backticks for the import example. See bottom of this page: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/wafv2_web_acl_logging_configuration --- website/docs/r/wafv2_web_acl_logging_configuration.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown index 56537095307..3c183691ad7 100644 --- a/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown +++ b/website/docs/r/wafv2_web_acl_logging_configuration.html.markdown @@ -76,3 +76,4 @@ WAFv2 Web ACL Logging Configurations can be imported using the WAFv2 Web ACL ARN ``` $ terraform import aws_wafv2_web_acl_logging_configuration.example arn:aws:wafv2:us-west-2:123456789012:regional/webacl/test-logs/a1b2c3d4-5678-90ab-cdef +``` From 7b1583c2f1603231aa32e5797d29def144a3d11e Mon Sep 17 00:00:00 2001 From: Jack Batzner Date: Thu, 18 Mar 2021 10:48:33 -0500 Subject: [PATCH 0527/1252] [WIP] First pass at fix --- aws/resource_aws_lakeformation_permissions.go | 110 +++++++++++++----- ...urce_aws_lakeformation_permissions_test.go | 99 ++++++++++++++++ aws/resource_aws_lakeformation_test.go | 37 +++--- 3 files changed, 200 insertions(+), 46 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index beeba8b41e3..52deb13e853 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -271,6 +271,11 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf if resourceAwsLakeFormationPermissionsCompareResource(*matchResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) } + + // AWS treats SELECT permissions differently. A separate resource is created for the {db}.{table}.* to grant select on all columns + if resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(*matchResource, *permission.Resource) { + principalResourcePermissions = append(principalResourcePermissions, permission) + } } return !lastPage }) @@ -294,6 +299,12 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf if resourceAwsLakeFormationPermissionsCompareResource(*matchResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) } + + // AWS treats SELECT permissions differently. A separate resource is created for the {db}.{table}.* to grant select on all columns + // Only check for this case if we don't have any specified column names + if resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(*matchResource, *permission.Resource) { + principalResourcePermissions = append(principalResourcePermissions, permission) + } } return !lastPage }) @@ -309,42 +320,43 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf return fmt.Errorf("error reading Lake Formation permissions: %w", err) } - if len(principalResourcePermissions) > 1 { - return fmt.Errorf("error reading Lake Formation permissions: %s", "multiple permissions found for same resource") + if len(principalResourcePermissions) == 0 { + return fmt.Errorf("error reading Lake Formation permissions: %s", "no permissions found") } - for _, permissions := range principalResourcePermissions { - d.Set("principal", permissions.Principal.DataLakePrincipalIdentifier) - d.Set("permissions", permissions.Permissions) - d.Set("permissions_with_grant_option", permissions.PermissionsWithGrantOption) + if len(principalResourcePermissions) > 2 { + return fmt.Errorf("error reading Lake Formation permissions: %s", "multiple permissions found for same resource") + } - if permissions.Resource.Catalog != nil { - d.Set("catalog_resource", true) - } + d.Set("principal", principalResourcePermissions[0].Principal.DataLakePrincipalIdentifier) + d.Set("permissions", flattenPermissions(principalResourcePermissions)) + d.Set("permissions_with_grant_option", flattenGrantPermissions(principalResourcePermissions)) - if permissions.Resource.DataLocation != nil { - d.Set("data_location", []interface{}{flattenLakeFormationDataLocationResource(permissions.Resource.DataLocation)}) - } else { - d.Set("data_location", nil) - } + if principalResourcePermissions[0].Resource.Catalog != nil { + d.Set("catalog_resource", true) + } - if permissions.Resource.Database != nil { - d.Set("database", []interface{}{flattenLakeFormationDatabaseResource(permissions.Resource.Database)}) - } else { - d.Set("database", nil) - } + if principalResourcePermissions[0].Resource.DataLocation != nil { + d.Set("data_location", []interface{}{flattenLakeFormationDataLocationResource(principalResourcePermissions[0].Resource.DataLocation)}) + } else { + d.Set("data_location", nil) + } - // table with columns permissions will include the table and table with columns - if permissions.Resource.TableWithColumns != nil { - d.Set("table_with_columns", []interface{}{flattenLakeFormationTableWithColumnsResource(permissions.Resource.TableWithColumns)}) - } else if permissions.Resource.Table != nil { - d.Set("table_with_columns", nil) - d.Set("table", []interface{}{flattenLakeFormationTableResource(permissions.Resource.Table)}) - } else { - d.Set("table", nil) - } + if principalResourcePermissions[0].Resource.Database != nil { + d.Set("database", []interface{}{flattenLakeFormationDatabaseResource(principalResourcePermissions[0].Resource.Database)}) + } else { + d.Set("database", nil) } + // table with columns permissions will include the table and table with columns + if principalResourcePermissions[0].Resource.TableWithColumns != nil { + d.Set("table_with_columns", []interface{}{flattenLakeFormationTableWithColumnsResource(principalResourcePermissions[0].Resource.TableWithColumns)}) + } else if principalResourcePermissions[0].Resource.Table != nil { + d.Set("table_with_columns", nil) + d.Set("table", []interface{}{flattenLakeFormationTableResource(principalResourcePermissions[0].Resource.Table)}) + } else { + d.Set("table", nil) + } return nil } @@ -415,6 +427,24 @@ func resourceAwsLakeFormationPermissionsCompareResource(in, out lakeformation.Re return reflect.DeepEqual(in, out) } +// The SELECT permission always appears on the Data permissions page of the Lake Formation console as a separate row +func resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(in, out lakeformation.Resource) bool { + if in.TableWithColumns == nil || in.TableWithColumns.ColumnNames == nil { + return false + } + + if len(in.TableWithColumns.ColumnNames) > 0 { + return false + } + + columnNames := make([]*string, 0) + columnNames = append(columnNames, aws.String("*")) + + in.TableWithColumns.ColumnNames = columnNames + + return reflect.DeepEqual(in, out) +} + // expandLakeFormationResourceType returns the Lake Formation resource type represented by the resource. // This is helpful in distinguishing between TABLE and TABLE_WITH_COLUMNS types when filtering ListPermission results. func expandLakeFormationResourceType(d *schema.ResourceData) string { @@ -647,3 +677,27 @@ func flattenLakeFormationTableWithColumnsResource(apiObject *lakeformation.Table return tfMap } + +func flattenPermissions(principalResourcePermissions []*lakeformation.PrincipalResourcePermissions) []string { + permissions := make([]string, 0) + + for _, resourcePermission := range principalResourcePermissions { + for _, permission := range resourcePermission.Permissions { + permissions = append(permissions, aws.StringValue(permission)) + } + } + + return permissions +} + +func flattenGrantPermissions(principalResourcePermissions []*lakeformation.PrincipalResourcePermissions) []string { + grantPermissions := make([]string, 0) + + for _, resourcePermission := range principalResourcePermissions { + for _, grantPermission := range resourcePermission.PermissionsWithGrantOption { + grantPermissions = append(grantPermissions, aws.StringValue(grantPermission)) + } + } + + return grantPermissions +} diff --git a/aws/resource_aws_lakeformation_permissions_test.go b/aws/resource_aws_lakeformation_permissions_test.go index c33019ffcdb..d41a8837043 100644 --- a/aws/resource_aws_lakeformation_permissions_test.go +++ b/aws/resource_aws_lakeformation_permissions_test.go @@ -207,6 +207,37 @@ func testAccAWSLakeFormationPermissions_tableWithColumnsAndTable(t *testing.T) { }) } +func testAccAWSLakeFormationPermissions_selectPermissions(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lakeformation_permissions.test" + roleName := "aws_iam_role.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLakeFormationPermissionsConfig_selectPermissions(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLakeFormationPermissionsExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "principal", roleName, "arn"), + resource.TestCheckResourceAttr(resourceName, "permissions.#", "7"), + ), + }, + { + Config: testAccAWSLakeFormationPermissionsConfig_selectPermissions(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLakeFormationPermissionsExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "principal", roleName, "arn"), + resource.TestCheckResourceAttr(resourceName, "permissions.#", "7"), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSLakeFormationPermissionsDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).lakeformationconn @@ -735,3 +766,71 @@ resource "aws_lakeformation_permissions" "test" { } `, rName) } + +func testAccAWSLakeFormationPermissionsConfig_selectPermissions(rName string) string { + return fmt.Sprintf(` +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = %[1]q + path = "/" + + assume_role_policy = < Date: Thu, 18 Mar 2021 14:37:17 -0500 Subject: [PATCH 0528/1252] Put back all tests --- ...urce_aws_lakeformation_permissions_test.go | 16 +++----- aws/resource_aws_lakeformation_test.go | 38 +++++++++---------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions_test.go b/aws/resource_aws_lakeformation_permissions_test.go index d41a8837043..46438cce7d6 100644 --- a/aws/resource_aws_lakeformation_permissions_test.go +++ b/aws/resource_aws_lakeformation_permissions_test.go @@ -223,17 +223,9 @@ func testAccAWSLakeFormationPermissions_selectPermissions(t *testing.T) { testAccCheckAWSLakeFormationPermissionsExists(resourceName), resource.TestCheckResourceAttrPair(resourceName, "principal", roleName, "arn"), resource.TestCheckResourceAttr(resourceName, "permissions.#", "7"), + resource.TestCheckResourceAttr(resourceName, "permissions_with_grant_option.#", "7"), ), }, - { - Config: testAccAWSLakeFormationPermissionsConfig_selectPermissions(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLakeFormationPermissionsExists(resourceName), - resource.TestCheckResourceAttrPair(resourceName, "principal", roleName, "arn"), - resource.TestCheckResourceAttr(resourceName, "permissions.#", "7"), - ), - ExpectNonEmptyPlan: true, - }, }, }) } @@ -824,12 +816,14 @@ resource "aws_lakeformation_data_lake_settings" "test" { } resource "aws_lakeformation_permissions" "test" { - permissions = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] principal = aws_iam_role.test.arn + permissions = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] + permissions_with_grant_option = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] + table { database_name = aws_glue_catalog_table.test.database_name - wildcard = true + name = aws_glue_catalog_table.test.name } } `, rName) diff --git a/aws/resource_aws_lakeformation_test.go b/aws/resource_aws_lakeformation_test.go index 874d23e9334..c98ea06b706 100644 --- a/aws/resource_aws_lakeformation_test.go +++ b/aws/resource_aws_lakeformation_test.go @@ -6,26 +6,26 @@ import ( func TestAccAWSLakeFormation_serial(t *testing.T) { testCases := map[string]map[string]func(t *testing.T){ - // "DataLakeSettings": { - // "basic": testAccAWSLakeFormationDataLakeSettings_basic, - // "disappears": testAccAWSLakeFormationDataLakeSettings_disappears, - // "withoutCatalogId": testAccAWSLakeFormationDataLakeSettings_withoutCatalogId, - // "dataSource": testAccAWSLakeFormationDataLakeSettingsDataSource_basic, - // }, + "DataLakeSettings": { + "basic": testAccAWSLakeFormationDataLakeSettings_basic, + "disappears": testAccAWSLakeFormationDataLakeSettings_disappears, + "withoutCatalogId": testAccAWSLakeFormationDataLakeSettings_withoutCatalogId, + "dataSource": testAccAWSLakeFormationDataLakeSettingsDataSource_basic, + }, "Permissions": { - // "basic": testAccAWSLakeFormationPermissions_basic, - // "dataLocation": testAccAWSLakeFormationPermissions_dataLocation, - // "database": testAccAWSLakeFormationPermissions_database, - // "tableName": testAccAWSLakeFormationPermissions_table_name, - // "tableWildcard": testAccAWSLakeFormationPermissions_table_wildcard, - // "tableWithColumns": testAccAWSLakeFormationPermissions_tableWithColumns, - // "tableWithColumnsAndTable": testAccAWSLakeFormationPermissions_tableWithColumnsAndTable, - // "basicDataSource": testAccAWSLakeFormationPermissionsDataSource_basic, - // "dataLocationDataSource": testAccAWSLakeFormationPermissionsDataSource_dataLocation, - // "databaseDataSource": testAccAWSLakeFormationPermissionsDataSource_database, - // "tableDataSource": testAccAWSLakeFormationPermissionsDataSource_table, - // "tableWithColumnsDataSource": testAccAWSLakeFormationPermissionsDataSource_tableWithColumns, - "selectPermissions": testAccAWSLakeFormationPermissions_selectPermissions, + "basic": testAccAWSLakeFormationPermissions_basic, + "dataLocation": testAccAWSLakeFormationPermissions_dataLocation, + "database": testAccAWSLakeFormationPermissions_database, + "tableName": testAccAWSLakeFormationPermissions_table_name, + "tableWildcard": testAccAWSLakeFormationPermissions_table_wildcard, + "tableWithColumns": testAccAWSLakeFormationPermissions_tableWithColumns, + "tableWithColumnsAndTable": testAccAWSLakeFormationPermissions_tableWithColumnsAndTable, + "basicDataSource": testAccAWSLakeFormationPermissionsDataSource_basic, + "dataLocationDataSource": testAccAWSLakeFormationPermissionsDataSource_dataLocation, + "databaseDataSource": testAccAWSLakeFormationPermissionsDataSource_database, + "tableDataSource": testAccAWSLakeFormationPermissionsDataSource_table, + "tableWithColumnsDataSource": testAccAWSLakeFormationPermissionsDataSource_tableWithColumns, + "selectPermissions": testAccAWSLakeFormationPermissions_selectPermissions, }, } From 95c890b6ff80feec87ccd23597478086d9f14971 Mon Sep 17 00:00:00 2001 From: Jack Batzner Date: Thu, 18 Mar 2021 14:38:12 -0500 Subject: [PATCH 0529/1252] Fixes from running existing tests --- aws/resource_aws_lakeformation_permissions.go | 40 +++++++++++++++++-- 1 file changed, 37 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index 52deb13e853..63d70946698 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -257,6 +257,8 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf input.Resource = expandLakeFormationResource(d, true) matchResource := expandLakeFormationResource(d, false) + // AWS treats SELECT permissions differently. A separate resource is created for the {db}.{table}.* to grant select on all columns + selectPermissionsResource := expandLakeFormationResourceForSelectPermissions(d) log.Printf("[DEBUG] Reading Lake Formation permissions: %v", input) var principalResourcePermissions []*lakeformation.PrincipalResourcePermissions @@ -270,10 +272,11 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf if resourceAwsLakeFormationPermissionsCompareResource(*matchResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) + continue } // AWS treats SELECT permissions differently. A separate resource is created for the {db}.{table}.* to grant select on all columns - if resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(*matchResource, *permission.Resource) { + if selectPermissionsResource != nil && resourceAwsLakeFormationPermissionsCompareResource(*selectPermissionsResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) } } @@ -298,11 +301,11 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf if resourceAwsLakeFormationPermissionsCompareResource(*matchResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) + continue } // AWS treats SELECT permissions differently. A separate resource is created for the {db}.{table}.* to grant select on all columns - // Only check for this case if we don't have any specified column names - if resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(*matchResource, *permission.Resource) { + if selectPermissionsResource != nil && resourceAwsLakeFormationPermissionsCompareResource(*selectPermissionsResource, *permission.Resource) { principalResourcePermissions = append(principalResourcePermissions, permission) } } @@ -494,6 +497,37 @@ func expandLakeFormationResource(d *schema.ResourceData, squashTableWithColumns return res } +func expandLakeFormationResourceForSelectPermissions(d *schema.ResourceData) *lakeformation.Resource { + tableMapSchema := d.Get("table").([]interface{}) + if len(tableMapSchema) == 0 { + return nil + } + + tableSchema := tableMapSchema[0].(map[string]interface{}) + if tableSchema == nil { + return nil + } + + databaseName, ok := tableSchema["database_name"].(string) + if !ok { + return nil + } + name, ok := tableSchema["name"].(string) + if !ok { + return nil + } + + res := &lakeformation.Resource{ + TableWithColumns: &lakeformation.TableWithColumnsResource{ + DatabaseName: aws.String(databaseName), + Name: aws.String(name), + ColumnWildcard: &lakeformation.ColumnWildcard{}, // A wildcard is used for SELECT permissions + }, + } + + return res +} + func expandLakeFormationDataLocationResource(tfMap map[string]interface{}) *lakeformation.DataLocationResource { if tfMap == nil { return nil From 0eefdf4d9407b85c693f7546eabf45fd38db30a6 Mon Sep 17 00:00:00 2001 From: Jack Batzner Date: Thu, 18 Mar 2021 14:48:13 -0500 Subject: [PATCH 0530/1252] remove dead code & fmt --- aws/resource_aws_lakeformation_permissions.go | 18 ------------------ ...ource_aws_lakeformation_permissions_test.go | 4 ++-- 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index 63d70946698..6e180fed6d9 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -430,24 +430,6 @@ func resourceAwsLakeFormationPermissionsCompareResource(in, out lakeformation.Re return reflect.DeepEqual(in, out) } -// The SELECT permission always appears on the Data permissions page of the Lake Formation console as a separate row -func resourceAwsLakeFormationPermissionsCompareSelectSeparateRow(in, out lakeformation.Resource) bool { - if in.TableWithColumns == nil || in.TableWithColumns.ColumnNames == nil { - return false - } - - if len(in.TableWithColumns.ColumnNames) > 0 { - return false - } - - columnNames := make([]*string, 0) - columnNames = append(columnNames, aws.String("*")) - - in.TableWithColumns.ColumnNames = columnNames - - return reflect.DeepEqual(in, out) -} - // expandLakeFormationResourceType returns the Lake Formation resource type represented by the resource. // This is helpful in distinguishing between TABLE and TABLE_WITH_COLUMNS types when filtering ListPermission results. func expandLakeFormationResourceType(d *schema.ResourceData) string { diff --git a/aws/resource_aws_lakeformation_permissions_test.go b/aws/resource_aws_lakeformation_permissions_test.go index 46438cce7d6..37724ad9354 100644 --- a/aws/resource_aws_lakeformation_permissions_test.go +++ b/aws/resource_aws_lakeformation_permissions_test.go @@ -816,9 +816,9 @@ resource "aws_lakeformation_data_lake_settings" "test" { } resource "aws_lakeformation_permissions" "test" { - principal = aws_iam_role.test.arn + principal = aws_iam_role.test.arn - permissions = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] + permissions = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] permissions_with_grant_option = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] table { From 865d1999013ae60bcc3bcb6087497f98b63aa0ac Mon Sep 17 00:00:00 2001 From: Jack Batzner Date: Thu, 18 Mar 2021 14:51:48 -0500 Subject: [PATCH 0531/1252] CHANGELOG --- .changelog/18203.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18203.txt diff --git a/.changelog/18203.txt b/.changelog/18203.txt new file mode 100644 index 00000000000..4ea0164c897 --- /dev/null +++ b/.changelog/18203.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_lakeformation_permissions: Properly serialize SELECT permission for `permissions` and `permissions_with_grant_option` fields +``` From ce6c722e983eedb2f0e8e8bac244dc0493c51b93 Mon Sep 17 00:00:00 2001 From: Jack Batzner Date: Thu, 18 Mar 2021 14:52:54 -0500 Subject: [PATCH 0532/1252] fmt again --- aws/resource_aws_lakeformation_permissions_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_lakeformation_permissions_test.go b/aws/resource_aws_lakeformation_permissions_test.go index 37724ad9354..4d77a297c2f 100644 --- a/aws/resource_aws_lakeformation_permissions_test.go +++ b/aws/resource_aws_lakeformation_permissions_test.go @@ -816,7 +816,7 @@ resource "aws_lakeformation_data_lake_settings" "test" { } resource "aws_lakeformation_permissions" "test" { - principal = aws_iam_role.test.arn + principal = aws_iam_role.test.arn permissions = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] permissions_with_grant_option = ["ALL", "ALTER", "DELETE", "DESCRIBE", "DROP", "INSERT", "SELECT"] From e266ce0f1d1a02e392b7c18a4e774a9b5ab8f5ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 17:35:34 -0400 Subject: [PATCH 0533/1252] r/lakeformation_permissions: Minor refactor --- aws/resource_aws_lakeformation_permissions.go | 32 ++++++++++++------- aws/resource_aws_lakeformation_test.go | 20 +++++++----- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index 6e180fed6d9..9bbfc98011d 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -332,8 +332,8 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf } d.Set("principal", principalResourcePermissions[0].Principal.DataLakePrincipalIdentifier) - d.Set("permissions", flattenPermissions(principalResourcePermissions)) - d.Set("permissions_with_grant_option", flattenGrantPermissions(principalResourcePermissions)) + d.Set("permissions", flattenLakeFormationPermissions(principalResourcePermissions)) + d.Set("permissions_with_grant_option", flattenLakeFormationGrantPermissions(principalResourcePermissions)) if principalResourcePermissions[0].Resource.Catalog != nil { d.Set("catalog_resource", true) @@ -694,26 +694,34 @@ func flattenLakeFormationTableWithColumnsResource(apiObject *lakeformation.Table return tfMap } -func flattenPermissions(principalResourcePermissions []*lakeformation.PrincipalResourcePermissions) []string { - permissions := make([]string, 0) +func flattenLakeFormationPermissions(apiObjects []*lakeformation.PrincipalResourcePermissions) []string { + if apiObjects == nil || len(apiObjects) == 0 { + return nil + } + + tfList := make([]string, 0) - for _, resourcePermission := range principalResourcePermissions { + for _, resourcePermission := range apiObjects { for _, permission := range resourcePermission.Permissions { - permissions = append(permissions, aws.StringValue(permission)) + tfList = append(tfList, aws.StringValue(permission)) } } - return permissions + return tfList } -func flattenGrantPermissions(principalResourcePermissions []*lakeformation.PrincipalResourcePermissions) []string { - grantPermissions := make([]string, 0) +func flattenLakeFormationGrantPermissions(apiObjects []*lakeformation.PrincipalResourcePermissions) []string { + if apiObjects == nil || len(apiObjects) == 0 { + return nil + } + + tfList := make([]string, 0) - for _, resourcePermission := range principalResourcePermissions { + for _, resourcePermission := range apiObjects { for _, grantPermission := range resourcePermission.PermissionsWithGrantOption { - grantPermissions = append(grantPermissions, aws.StringValue(grantPermission)) + tfList = append(tfList, aws.StringValue(grantPermission)) } } - return grantPermissions + return tfList } diff --git a/aws/resource_aws_lakeformation_test.go b/aws/resource_aws_lakeformation_test.go index c98ea06b706..ac9e38dd089 100644 --- a/aws/resource_aws_lakeformation_test.go +++ b/aws/resource_aws_lakeformation_test.go @@ -13,19 +13,23 @@ func TestAccAWSLakeFormation_serial(t *testing.T) { "dataSource": testAccAWSLakeFormationDataLakeSettingsDataSource_basic, }, "Permissions": { - "basic": testAccAWSLakeFormationPermissions_basic, - "dataLocation": testAccAWSLakeFormationPermissions_dataLocation, - "database": testAccAWSLakeFormationPermissions_database, - "tableName": testAccAWSLakeFormationPermissions_table_name, - "tableWildcard": testAccAWSLakeFormationPermissions_table_wildcard, - "tableWithColumns": testAccAWSLakeFormationPermissions_tableWithColumns, - "tableWithColumnsAndTable": testAccAWSLakeFormationPermissions_tableWithColumnsAndTable, + "basic": testAccAWSLakeFormationPermissions_basic, + "dataLocation": testAccAWSLakeFormationPermissions_dataLocation, + "database": testAccAWSLakeFormationPermissions_database, + "selectPermissions": testAccAWSLakeFormationPermissions_selectPermissions, + }, + "TablePermissions": { + "tableName": testAccAWSLakeFormationPermissions_table_name, + "tableWildcard": testAccAWSLakeFormationPermissions_table_wildcard, + "tableWithColumns": testAccAWSLakeFormationPermissions_tableWithColumns, + "tableWithColumnsAndTable": testAccAWSLakeFormationPermissions_tableWithColumnsAndTable, + }, + "DataSourcePermissions": { "basicDataSource": testAccAWSLakeFormationPermissionsDataSource_basic, "dataLocationDataSource": testAccAWSLakeFormationPermissionsDataSource_dataLocation, "databaseDataSource": testAccAWSLakeFormationPermissionsDataSource_database, "tableDataSource": testAccAWSLakeFormationPermissionsDataSource_table, "tableWithColumnsDataSource": testAccAWSLakeFormationPermissionsDataSource_tableWithColumns, - "selectPermissions": testAccAWSLakeFormationPermissions_selectPermissions, }, } From 4e854b3ccd29565551119b73c3a15297ba506a39 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 21:46:48 +0000 Subject: [PATCH 0534/1252] Update CHANGELOG.md for #18188 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f00dc07bcc5..86e0e3ca524 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ NOTES: FEATURES: +* **New Data Source:** `aws_ec2_transit_gateway_route_tables` ([#17589](https://github.com/hashicorp/terraform-provider-aws/issues/17589)) * **New Data Source:** `aws_kinesis_stream_consumer` ([#17149](https://github.com/hashicorp/terraform-provider-aws/issues/17149)) * **New Resource:** `aws_kinesis_stream_consumer` ([#17149](https://github.com/hashicorp/terraform-provider-aws/issues/17149)) From 2e9bb88c345aa873594aafae8764acaa9231efc0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 17:47:51 -0400 Subject: [PATCH 0535/1252] r/lakeformation_permissions: Lint --- aws/resource_aws_lakeformation_permissions.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index 9bbfc98011d..d350782e6a3 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -695,7 +695,7 @@ func flattenLakeFormationTableWithColumnsResource(apiObject *lakeformation.Table } func flattenLakeFormationPermissions(apiObjects []*lakeformation.PrincipalResourcePermissions) []string { - if apiObjects == nil || len(apiObjects) == 0 { + if apiObjects == nil { return nil } @@ -711,7 +711,7 @@ func flattenLakeFormationPermissions(apiObjects []*lakeformation.PrincipalResour } func flattenLakeFormationGrantPermissions(apiObjects []*lakeformation.PrincipalResourcePermissions) []string { - if apiObjects == nil || len(apiObjects) == 0 { + if apiObjects == nil { return nil } From 1889b6331eeb4a1f57d18603a839da3472e7b428 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:00:55 -0400 Subject: [PATCH 0536/1252] tests/ds/elb: Add ErrorCheck --- aws/data_source_aws_elb_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_elb_test.go b/aws/data_source_aws_elb_test.go index 2cfe33dd220..5c60882dd50 100644 --- a/aws/data_source_aws_elb_test.go +++ b/aws/data_source_aws_elb_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAWSELB_basic(t *testing.T) { rName := fmt.Sprintf("TestAccDataSourceAWSELB-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSELBConfigBasic(rName, t.Name()), From 8ab92a95826902e4e32f031a7488142a8f14b3c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:01:32 -0400 Subject: [PATCH 0537/1252] tests/r/app_cookie_stickiness_policy: Add ErrorCheck --- aws/resource_aws_app_cookie_stickiness_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_app_cookie_stickiness_policy_test.go b/aws/resource_aws_app_cookie_stickiness_policy_test.go index 146d55858ca..38460d4b50f 100644 --- a/aws/resource_aws_app_cookie_stickiness_policy_test.go +++ b/aws/resource_aws_app_cookie_stickiness_policy_test.go @@ -17,6 +17,7 @@ func TestAccAWSAppCookieStickinessPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSAppCookieStickinessPolicy_disappears_ELB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ @@ -132,6 +134,7 @@ func TestAccAWSAppCookieStickinessPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ From c763f2616c665a5114160738ce10eee9d9cabcec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:01:53 -0400 Subject: [PATCH 0538/1252] tests/r/elb: Add ErrorCheck --- aws/resource_aws_elb_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_elb_test.go b/aws/resource_aws_elb_test.go index 97fdb487ca1..1187d28b89e 100644 --- a/aws/resource_aws_elb_test.go +++ b/aws/resource_aws_elb_test.go @@ -107,6 +107,7 @@ func TestAccAWSELB_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, Steps: []resource.TestStep{ @@ -383,6 +384,7 @@ func TestAccAWSELB_Listener_SSLCertificateID_IAMServerCertificate(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, Steps: []resource.TestStep{ From 9ec7c19297387dbcb4d849a20aeee67ddb2f7797 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:03 -0400 Subject: [PATCH 0539/1252] tests/r/lb_cookie_stickiness_policy: Add ErrorCheck --- aws/resource_aws_lb_cookie_stickiness_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_lb_cookie_stickiness_policy_test.go b/aws/resource_aws_lb_cookie_stickiness_policy_test.go index 9a86dedbcb5..f943f6662fa 100644 --- a/aws/resource_aws_lb_cookie_stickiness_policy_test.go +++ b/aws/resource_aws_lb_cookie_stickiness_policy_test.go @@ -17,6 +17,7 @@ func TestAccAWSLBCookieStickinessPolicy_basic(t *testing.T) { resourceName := "aws_lb_cookie_stickiness_policy.foo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSLBCookieStickinessPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ @@ -129,6 +131,7 @@ func TestAccAWSLBCookieStickinessPolicy_disappears_ELB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBCookieStickinessPolicyDestroy, Steps: []resource.TestStep{ From a230d1ef641b0caa411300a90f6b2d2abeca358c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:14 -0400 Subject: [PATCH 0540/1252] tests/r/lb_ssl_negotiation_policy: Add ErrorCheck --- aws/resource_aws_lb_ssl_negotiation_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_lb_ssl_negotiation_policy_test.go b/aws/resource_aws_lb_ssl_negotiation_policy_test.go index 3fbc362a008..db04811d891 100644 --- a/aws/resource_aws_lb_ssl_negotiation_policy_test.go +++ b/aws/resource_aws_lb_ssl_negotiation_policy_test.go @@ -22,6 +22,7 @@ func TestAccAWSLBSSLNegotiationPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSLBSSLNegotiationPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLBSSLNegotiationPolicyDestroy, Steps: []resource.TestStep{ From 19a7ae853e7ab1c77ba92eb94d7862d3b30a21ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:25 -0400 Subject: [PATCH 0541/1252] tests/r/load_balancer_backend_server_policy: Add ErrorCheck --- aws/resource_aws_load_balancer_backend_server_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_load_balancer_backend_server_policy_test.go b/aws/resource_aws_load_balancer_backend_server_policy_test.go index b524a7b2436..14a47e4a8a1 100644 --- a/aws/resource_aws_load_balancer_backend_server_policy_test.go +++ b/aws/resource_aws_load_balancer_backend_server_policy_test.go @@ -23,6 +23,7 @@ func TestAccAWSLoadBalancerBackendServerPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLoadBalancerBackendServerPolicyDestroy, Steps: []resource.TestStep{ From cbc621b2185263129835ced3c3f378fd8a17cf00 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:36 -0400 Subject: [PATCH 0542/1252] tests/r/load_balancer_listener_policy: Add ErrorCheck --- aws/resource_aws_load_balancer_listener_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_load_balancer_listener_policy_test.go b/aws/resource_aws_load_balancer_listener_policy_test.go index 5b26e5d6cfd..9bae9b386f0 100644 --- a/aws/resource_aws_load_balancer_listener_policy_test.go +++ b/aws/resource_aws_load_balancer_listener_policy_test.go @@ -19,6 +19,7 @@ func TestAccAWSLoadBalancerListenerPolicy_basic(t *testing.T) { mcName := rChar resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLoadBalancerListenerPolicyDestroy, Steps: []resource.TestStep{ From 9cf771f46f8be6ea151878ab3cb8000267f23b93 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:46 -0400 Subject: [PATCH 0543/1252] tests/r/load_balancer_policy: Add ErrorCheck --- aws/resource_aws_load_balancer_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_load_balancer_policy_test.go b/aws/resource_aws_load_balancer_policy_test.go index 598c439c685..4a53fe68454 100644 --- a/aws/resource_aws_load_balancer_policy_test.go +++ b/aws/resource_aws_load_balancer_policy_test.go @@ -22,6 +22,7 @@ func TestAccAWSLoadBalancerPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLoadBalancerPolicyDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSLoadBalancerPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLoadBalancerPolicyDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSLoadBalancerPolicy_updateWhileAssigned(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLoadBalancerPolicyDestroy, Steps: []resource.TestStep{ From 8a7cb19db7d18d1344ec42ed9fc22c3e1da83ccf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:02:56 -0400 Subject: [PATCH 0544/1252] tests/r/proxy_protocol_policy: Add ErrorCheck --- aws/resource_aws_proxy_protocol_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_proxy_protocol_policy_test.go b/aws/resource_aws_proxy_protocol_policy_test.go index 7e5cd01042b..e7c4019be15 100644 --- a/aws/resource_aws_proxy_protocol_policy_test.go +++ b/aws/resource_aws_proxy_protocol_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSProxyProtocolPolicy_basic(t *testing.T) { lbName := fmt.Sprintf("tf-test-lb-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckProxyProtocolPolicyDestroy, Steps: []resource.TestStep{ From a28825503ef919c19319df74085e34bef15db284 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:08:20 -0400 Subject: [PATCH 0545/1252] tests/ds/imagebuilder_component: Add ErrorCheck --- aws/data_source_aws_imagebuilder_component_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_component_test.go b/aws/data_source_aws_imagebuilder_component_test.go index feb31cfcc83..edee2d426d8 100644 --- a/aws/data_source_aws_imagebuilder_component_test.go +++ b/aws/data_source_aws_imagebuilder_component_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsImageBuilderComponentDataSource_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ From 5f05d4f79f5f78421af47d31a4a6bdbd301c9df0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:08:30 -0400 Subject: [PATCH 0546/1252] tests/ds/imagebuilder_distribution_configuration: Add ErrorCheck --- ...a_source_aws_imagebuilder_distribution_configuration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_distribution_configuration_test.go b/aws/data_source_aws_imagebuilder_distribution_configuration_test.go index 5b25a6c352a..76e89d4777a 100644 --- a/aws/data_source_aws_imagebuilder_distribution_configuration_test.go +++ b/aws/data_source_aws_imagebuilder_distribution_configuration_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsImageBuilderDistributionConfigurationDataSource_Arn(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ From 69b9897592e1ff5cdbf935efaefc21ed71837dd9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:08:41 -0400 Subject: [PATCH 0547/1252] tests/ds/imagebuilder_image_pipeline: Add ErrorCheck --- aws/data_source_aws_imagebuilder_image_pipeline_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_image_pipeline_test.go b/aws/data_source_aws_imagebuilder_image_pipeline_test.go index 4f5b4d6cdcb..07daaab65e7 100644 --- a/aws/data_source_aws_imagebuilder_image_pipeline_test.go +++ b/aws/data_source_aws_imagebuilder_image_pipeline_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsImageBuilderImagePipelineDataSource_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ From 7a268bb57c4d0fb887fd801722d62759fa45dbba Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:08:50 -0400 Subject: [PATCH 0548/1252] tests/ds/imagebuilder_image_recipe: Add ErrorCheck --- aws/data_source_aws_imagebuilder_image_recipe_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_image_recipe_test.go b/aws/data_source_aws_imagebuilder_image_recipe_test.go index 205e872dc0e..c212914d8ed 100644 --- a/aws/data_source_aws_imagebuilder_image_recipe_test.go +++ b/aws/data_source_aws_imagebuilder_image_recipe_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsImageBuilderImageRecipeDataSource_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ From 2dfa3aee4fd5942a13b96ee0dcc0e1f74551bcbb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:08:50 -0400 Subject: [PATCH 0549/1252] tests/ds/imagebuilder_image: Add ErrorCheck --- aws/data_source_aws_imagebuilder_image_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_image_test.go b/aws/data_source_aws_imagebuilder_image_test.go index cc4fbfd4981..efacf9e9c91 100644 --- a/aws/data_source_aws_imagebuilder_image_test.go +++ b/aws/data_source_aws_imagebuilder_image_test.go @@ -15,6 +15,7 @@ func TestAccAwsImageBuilderImageDataSource_Arn_Aws(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAwsImageBuilderImageDataSource_Arn_Self(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ From 6b54b041a8de407711bd851d7ec017a9d309d825 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:09:00 -0400 Subject: [PATCH 0550/1252] tests/ds/imagebuilder_infrastructure_configuration: Add ErrorCheck --- ...source_aws_imagebuilder_infrastructure_configuration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_imagebuilder_infrastructure_configuration_test.go b/aws/data_source_aws_imagebuilder_infrastructure_configuration_test.go index 3b7d31c8e80..4a44c306fc7 100644 --- a/aws/data_source_aws_imagebuilder_infrastructure_configuration_test.go +++ b/aws/data_source_aws_imagebuilder_infrastructure_configuration_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsImageBuilderInfrastructureConfigurationDataSource_Arn(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ From 5dc6fb24f26e34cf31d95b23690c6f5dababd67e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:09:11 -0400 Subject: [PATCH 0551/1252] tests/r/imagebuilder_component: Add ErrorCheck --- aws/resource_aws_imagebuilder_component_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_imagebuilder_component_test.go b/aws/resource_aws_imagebuilder_component_test.go index 0bee0113e67..c9cdf73be00 100644 --- a/aws/resource_aws_imagebuilder_component_test.go +++ b/aws/resource_aws_imagebuilder_component_test.go @@ -108,6 +108,7 @@ func TestAccAwsImageBuilderComponent_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -146,6 +147,7 @@ func TestAccAwsImageBuilderComponent_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -167,6 +169,7 @@ func TestAccAwsImageBuilderComponent_ChangeDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -192,6 +195,7 @@ func TestAccAwsImageBuilderComponent_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -218,6 +222,7 @@ func TestAccAwsImageBuilderComponent_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -243,6 +248,7 @@ func TestAccAwsImageBuilderComponent_Platform_Windows(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -268,6 +274,7 @@ func TestAccAwsImageBuilderComponent_SupportedOsVersions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -293,6 +300,7 @@ func TestAccAwsImageBuilderComponent_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ @@ -336,6 +344,7 @@ func TestAccAwsImageBuilderComponent_Uri(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderComponentDestroy, Steps: []resource.TestStep{ From 0818991463d4254185b330a210a20c148a1e04e5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:09:20 -0400 Subject: [PATCH 0552/1252] tests/r/imagebuilder_distribution_configuration: Add ErrorCheck --- ..._imagebuilder_distribution_configuration_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_imagebuilder_distribution_configuration_test.go b/aws/resource_aws_imagebuilder_distribution_configuration_test.go index 7f44e6e445e..0f0f53c7cdc 100644 --- a/aws/resource_aws_imagebuilder_distribution_configuration_test.go +++ b/aws/resource_aws_imagebuilder_distribution_configuration_test.go @@ -79,6 +79,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -130,6 +132,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -166,6 +169,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution(t *testing.T) testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(nil, 2), CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -191,6 +195,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -234,6 +239,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -277,6 +283,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -312,6 +319,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -338,6 +346,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -373,6 +382,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -414,6 +424,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_AmiDistributio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -451,6 +462,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Distribution_LicenseConfigu resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ @@ -486,6 +498,7 @@ func TestAccAwsImageBuilderDistributionConfiguration_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderDistributionConfigurationDestroy, Steps: []resource.TestStep{ From 22e75ac338ffd9cbeba6171788907e78936a1091 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:09:32 -0400 Subject: [PATCH 0553/1252] tests/r/imagebuilder_image_pipeline: Add ErrorCheck --- ...resource_aws_imagebuilder_image_pipeline_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_imagebuilder_image_pipeline_test.go b/aws/resource_aws_imagebuilder_image_pipeline_test.go index a16d74f185f..7ad2b30ffa4 100644 --- a/aws/resource_aws_imagebuilder_image_pipeline_test.go +++ b/aws/resource_aws_imagebuilder_image_pipeline_test.go @@ -81,6 +81,7 @@ func TestAccAwsImageBuilderImagePipeline_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -123,6 +124,7 @@ func TestAccAwsImageBuilderImagePipeline_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -144,6 +146,7 @@ func TestAccAwsImageBuilderImagePipeline_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -177,6 +180,7 @@ func TestAccAwsImageBuilderImagePipeline_DistributionConfigurationArn(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -209,6 +213,7 @@ func TestAccAwsImageBuilderImagePipeline_EnhancedImageMetadataEnabled(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -243,6 +248,7 @@ func TestAccAwsImageBuilderImagePipeline_ImageRecipeArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -275,6 +281,7 @@ func TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_ImageTestsEnabl resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -309,6 +316,7 @@ func TestAccAwsImageBuilderImagePipeline_ImageTestsConfiguration_TimeoutMinutes( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -345,6 +353,7 @@ func TestAccAwsImageBuilderImagePipeline_InfrastructureConfigurationArn(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -377,6 +386,7 @@ func TestAccAwsImageBuilderImagePipeline_Schedule_PipelineExecutionStartConditio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -411,6 +421,7 @@ func TestAccAwsImageBuilderImagePipeline_Schedule_ScheduleExpression(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -445,6 +456,7 @@ func TestAccAwsImageBuilderImagePipeline_Status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ @@ -477,6 +489,7 @@ func TestAccAwsImageBuilderImagePipeline_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImagePipelineDestroy, Steps: []resource.TestStep{ From 5ef424cc104c6e1f6b5406f7d2114a3e81aebffa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:09:46 -0400 Subject: [PATCH 0554/1252] tests/r/imagebuilder_image_recipe: Add ErrorCheck --- ...source_aws_imagebuilder_image_recipe_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aws/resource_aws_imagebuilder_image_recipe_test.go b/aws/resource_aws_imagebuilder_image_recipe_test.go index 97321b489a1..4f2c06534ce 100644 --- a/aws/resource_aws_imagebuilder_image_recipe_test.go +++ b/aws/resource_aws_imagebuilder_image_recipe_test.go @@ -83,6 +83,7 @@ func TestAccAwsImageBuilderImageRecipe_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -118,6 +119,7 @@ func TestAccAwsImageBuilderImageRecipe_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -139,6 +141,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_DeviceName(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -167,6 +170,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_DeleteOnTerminatio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -195,6 +199,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_Encrypted(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -223,6 +228,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_Iops(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -252,6 +258,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_KmsKeyId(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -279,6 +286,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_SnapshotId(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -305,6 +313,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_VolumeSize(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -333,6 +342,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_VolumeTypeGp2(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -361,6 +371,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_Ebs_VolumeTypeGp3(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -389,6 +400,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_NoDevice(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -417,6 +429,7 @@ func TestAccAwsImageBuilderImageRecipe_BlockDeviceMapping_VirtualName(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -445,6 +458,7 @@ func TestAccAwsImageBuilderImageRecipe_Component(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -473,6 +487,7 @@ func TestAccAwsImageBuilderImageRecipe_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -498,6 +513,7 @@ func TestAccAwsImageBuilderImageRecipe_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ @@ -541,6 +557,7 @@ func TestAccAwsImageBuilderImageRecipe_WorkingDirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageRecipeDestroy, Steps: []resource.TestStep{ From 27222ddd1263a956d8a2cbb0218c7cbbd64b808a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:10:02 -0400 Subject: [PATCH 0555/1252] tests/r/imagebuilder_image: Add ErrorCheck --- aws/resource_aws_imagebuilder_image_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_imagebuilder_image_test.go b/aws/resource_aws_imagebuilder_image_test.go index 159da5627bd..e9cf3058945 100644 --- a/aws/resource_aws_imagebuilder_image_test.go +++ b/aws/resource_aws_imagebuilder_image_test.go @@ -84,6 +84,7 @@ func TestAccAwsImageBuilderImage_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -123,6 +124,7 @@ func TestAccAwsImageBuilderImage_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -145,6 +147,7 @@ func TestAccAwsImageBuilderImage_DistributionConfigurationArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -170,6 +173,7 @@ func TestAccAwsImageBuilderImage_EnhancedImageMetadataEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -195,6 +199,7 @@ func TestAccAwsImageBuilderImage_ImageTestsConfiguration_ImageTestsEnabled(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -221,6 +226,7 @@ func TestAccAwsImageBuilderImage_ImageTestsConfiguration_TimeoutMinutes(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ @@ -247,6 +253,7 @@ func TestAccAwsImageBuilderImage_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsImageBuilderImageDestroy, Steps: []resource.TestStep{ From d8d6baa30110c055f37cba06f839d3612d22336c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 18:10:19 -0400 Subject: [PATCH 0556/1252] tests/r/imagebuilder_infrastructure_configuration: Add ErrorCheck --- ...agebuilder_infrastructure_configuration_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_imagebuilder_infrastructure_configuration_test.go b/aws/resource_aws_imagebuilder_infrastructure_configuration_test.go index 607f4bb46cc..26ffb5e5825 100644 --- a/aws/resource_aws_imagebuilder_infrastructure_configuration_test.go +++ b/aws/resource_aws_imagebuilder_infrastructure_configuration_test.go @@ -80,6 +80,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_disappears(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -140,6 +142,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_Description(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -175,6 +178,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_InstanceProfileName(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -208,6 +212,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_InstanceTypes(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -243,6 +248,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_KeyPair(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -278,6 +284,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_Logging_S3Logs_S3BucketNa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -315,6 +322,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_Logging_S3Logs_S3KeyPrefi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -352,6 +360,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_ResourceTags(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -389,6 +398,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_SecurityGroupIds(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -426,6 +436,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_SnsTopicArn(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -461,6 +472,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_SubnetId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -494,6 +506,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ @@ -537,6 +550,7 @@ func TestAccAwsImageBuilderInfrastructureConfiguration_TerminateInstanceOnFailur resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, imagebuilder.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsImageBuilderInfrastructureConfigurationDestroy, Steps: []resource.TestStep{ From d0f1b0505d2497c00d53fd4394950ac48c6d1672 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 18 Mar 2021 19:08:18 -0400 Subject: [PATCH 0557/1252] tests/provider: Add aws_s3_bucket resource force_destroy argument in log bucket configurations (#18096) * tests/resource/aws_cloudfront_distribution: Add aws_s3_bucket resource force_destroy argument in log bucket configurations Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18093 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18094 Previously: ``` === CONT TestAccAWSCloudFrontDistribution_originPolicyOrdered testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1 Error: error deleting S3 Bucket (mylogs.2357952446407137479): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: MPKM026WH6589YVB, host id: lht+Qof4FYrYfdN/8GtjzeaAjoOsZ6aj69agmshQhUJyxNMoFnU6K6cLGU8eR53nV9e4q8nD0H8= --- FAIL: TestAccAWSCloudFrontDistribution_originPolicyOrdered (343.36s) === CONT TestAccAWSCloudFrontDistribution_S3Origin testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1 Error: error deleting S3 Bucket (mylogs.3372655815263830900): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: XE65MK42EWF6Y4CN, host id: Lrn6YBKiBDwkzn+ge4i7QHa5kzaZOazWHAG899H7tzWpWQoLutfr1VM3HoSPXPGihNvEfRYsmJ8= --- FAIL: TestAccAWSCloudFrontDistribution_S3Origin (405.80s) === CONT TestAccAWSCloudFrontDistribution_multiOrigin testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1 Error: error deleting S3 Bucket (mylogs.3276133232211037586): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: XE64PFJ4MXABGV9D, host id: iV0ph9Kutj5Sjb+lGfulrXTh/HMowzHzHwtjG1+h9leJ1uvnDFIxA6ZCwe1BJJrH3h4UU0TAxb4= --- FAIL: TestAccAWSCloudFrontDistribution_multiOrigin (377.78s) === CONT TestAccAWSCloudFrontDistribution_customOrigin testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1 Error: error deleting S3 Bucket (mylogs.513520244091798268): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: 96KBJSB2W4DTE8XQ, host id: irsAvk26kB0RehhtFu2kfYz7gOZGNrGVgwy2PRhZlRagE9cgePqsN75xJ64M2/WXB26Il7VHPak= --- FAIL: TestAccAWSCloudFrontDistribution_customOrigin (399.82s) === CONT TestAccAWSCloudFrontDistribution_originPolicyDefault testing_new.go:63: Error running post-test destroy, there may be dangling resources: exit status 1 Error: error deleting S3 Bucket (mylogs.7021845477121765752): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409, request id: 96K02Y0K8CYDH6SS, host id: /jR8/SGpMVR8T+mApYmB66cqcoJqgxPYeMvUYDUthRvlonhGj5PVIsF2MdWRRKXSBc/IsLNd4WU= --- FAIL: TestAccAWSCloudFrontDistribution_originPolicyDefault (386.06s) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSCloudFrontDistribution_customOrigin (367.76s) --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (190.05s) --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (247.83s) --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_RealtimeLogConfigArn (243.37s) --- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_TrustedSigners (190.48s) --- PASS: TestAccAWSCloudFrontDistribution_disappears (197.40s) --- PASS: TestAccAWSCloudFrontDistribution_Enabled (557.82s) --- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (347.99s) --- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (351.98s) --- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (366.99s) --- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (347.64s) --- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (347.64s) --- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (371.75s) --- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (187.25s) --- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (192.30s) --- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_RealtimeLogConfigArn (238.96s) --- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy (394.25s) --- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (0.89s) --- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (4.48s) --- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (389.83s) --- PASS: TestAccAWSCloudFrontDistribution_originPolicyDefault (400.43s) --- PASS: TestAccAWSCloudFrontDistribution_originPolicyOrdered (368.67s) --- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (371.51s) --- PASS: TestAccAWSCloudFrontDistribution_S3Origin (355.44s) --- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (552.18s) --- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (201.80s) --- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (236.43s) --- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (385.55s) --- PASS: TestAccAWSMskCluster_LoggingInfo (1690.65s) ``` * tests/resource/aws_globalaccelerator_accelerator: Add force_destroy to aws_s3_bucket resource in test configuration Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18121 Previously: ``` Error: error deleting S3 Bucket (tf-acc-test-8066618524275417147): BucketNotEmpty: The bucket you tried to delete is not empty status code: 409 --- FAIL: TestAccAwsGlobalAcceleratorAccelerator_attributes (519.52s) ``` Output from acceptance testing: ``` --- PASS: TestAccAwsGlobalAcceleratorAccelerator_attributes (364.11s) ``` --- aws/resource_aws_cloudfront_distribution_test.go | 5 +++-- aws/resource_aws_globalaccelerator_accelerator_test.go | 4 +++- aws/resource_aws_msk_cluster_test.go | 5 +++-- docs/contributing/running-and-writing-acceptance-tests.md | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index b0d1cf3c1ba..193f8120505 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -1248,8 +1248,9 @@ resource "aws_s3_bucket" "s3_backup_bucket_origin" { var logBucket = ` resource "aws_s3_bucket" "s3_bucket_logs" { - bucket = "mylogs.${var.rand_id}" - acl = "public-read" + acl = "public-read" + bucket = "mylogs.${var.rand_id}" + force_destroy = true } ` diff --git a/aws/resource_aws_globalaccelerator_accelerator_test.go b/aws/resource_aws_globalaccelerator_accelerator_test.go index a100e600129..19657d5b93a 100644 --- a/aws/resource_aws_globalaccelerator_accelerator_test.go +++ b/aws/resource_aws_globalaccelerator_accelerator_test.go @@ -439,7 +439,9 @@ resource "aws_globalaccelerator_accelerator" "test" { func testAccGlobalAcceleratorAcceleratorConfigAttributes(rName string, flowLogsEnabled bool, flowLogsPrefix string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = %[1]q + acl = "private" + bucket = %[1]q + force_destroy = true } resource "aws_globalaccelerator_accelerator" "test" { diff --git a/aws/resource_aws_msk_cluster_test.go b/aws/resource_aws_msk_cluster_test.go index 4efd96dbf68..98419019ff0 100644 --- a/aws/resource_aws_msk_cluster_test.go +++ b/aws/resource_aws_msk_cluster_test.go @@ -1242,8 +1242,9 @@ resource "aws_cloudwatch_log_group" "test" { } resource "aws_s3_bucket" "bucket" { - bucket = %[1]q - acl = "private" + acl = "private" + bucket = %[1]q + force_destroy = true } resource "aws_iam_role" "firehose_role" { diff --git a/docs/contributing/running-and-writing-acceptance-tests.md b/docs/contributing/running-and-writing-acceptance-tests.md index 5340c133425..fb54e614449 100644 --- a/docs/contributing/running-and-writing-acceptance-tests.md +++ b/docs/contributing/running-and-writing-acceptance-tests.md @@ -1280,6 +1280,7 @@ The below are required items that will be noted during submission review and pre - [ ] __Uses resource.ParallelTest__: Tests should utilize [`resource.ParallelTest()`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#ParallelTest) instead of [`resource.Test()`](https://godoc.org/github.com/hashicorp/terraform/helper/resource#Test) except where serialized testing is absolutely required. - [ ] __Uses fmt.Sprintf()__: Test configurations preferably should to be separated into their own functions (typically named `testAccAws{SERVICE}{RESOURCE}Config{PURPOSE}`) that call [`fmt.Sprintf()`](https://golang.org/pkg/fmt/#Sprintf) for variable injection or a string `const` for completely static configurations. Test configurations should avoid `var` or other variable injection functionality such as [`text/template`](https://golang.org/pkg/text/template/). - [ ] __Uses Randomized Infrastructure Naming__: Test configurations that utilize resources where a unique name is required should generate a random name. Typically this is created via `rName := acctest.RandomWithPrefix("tf-acc-test")` in the acceptance test function before generating the configuration. +- [ ] __Prevents S3 Bucket Deletion Errors__: Test configurations that utilize `aws_s3_bucket` resources as a logging destination should include the `force_destroy = true` configuration. This is to prevent race conditions where logging objects may be written during the testing duration which will cause `BucketNotEmpty` errors during deletion. For resources that support import, the additional item below is required that will be noted during submission review and prevent immediate merging: From 551b75e61e7b33d6989d021ea5c6590c0f237608 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:08:38 -0400 Subject: [PATCH 0558/1252] tests/r/pinpoint_app: Add ErrorCheck --- aws/resource_aws_pinpoint_app_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_app_test.go b/aws/resource_aws_pinpoint_app_test.go index 422e15d252b..808793530c8 100644 --- a/aws/resource_aws_pinpoint_app_test.go +++ b/aws/resource_aws_pinpoint_app_test.go @@ -180,6 +180,7 @@ func TestAccAWSPinpointApp_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ From 42ebcba4f92f076ec4281eae66939ac00b8a2f3e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:09:35 -0400 Subject: [PATCH 0559/1252] tests/r/pinpoint_sms_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_sms_channel_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_sms_channel_test.go b/aws/resource_aws_pinpoint_sms_channel_test.go index df923097541..f72d9edca04 100644 --- a/aws/resource_aws_pinpoint_sms_channel_test.go +++ b/aws/resource_aws_pinpoint_sms_channel_test.go @@ -51,6 +51,7 @@ func TestAccAWSPinpointSMSChannel_basic(t *testing.T) { }, }) } + func TestAccAWSPinpointSMSChannel_full(t *testing.T) { var channel pinpoint.SMSChannelResponse resourceName := "aws_pinpoint_sms_channel.test_sms_channel" From e1df5707d2847a1c76adbefb0de21f8df4a5bbdf Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 18 Mar 2021 19:09:55 -0400 Subject: [PATCH 0560/1252] data-source/aws_vpc_endpoint_service: Switch service_type filtering from client-side to API (#17641) * data-soruce/aws_vpc_endpoint_service: Switch service_type filtering from client-side to API Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17417 Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccDataSourceAwsVpcEndpointService_interface (12.25s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Interface (12.65s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Gateway (12.65s) --- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (12.65s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom (217.41s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter (219.87s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter_tags (228.91s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (16.05s) --- PASS: TestAccDataSourceAwsVpcEndpointService_interface (16.25s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Interface (16.26s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Gateway (16.26s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter_tags (229.07s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom (229.30s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter (229.52s) ``` * Update CHANGELOG for #17641 * data-source/aws_vpc_endpoint_service: Validate service_type argument, update CHANGELOG for #17641 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17419 Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccDataSourceAwsVpcEndpointService_interface (21.03s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Interface (22.39s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Gateway (22.48s) --- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (23.76s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter (230.43s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter_tags (235.33s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom (238.79s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccDataSourceAwsVpcEndpointService_interface (30.12s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Interface (30.15s) --- PASS: TestAccDataSourceAwsVpcEndpointService_gateway (30.16s) --- PASS: TestAccDataSourceAwsVpcEndpointService_ServiceType_Gateway (30.16s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter_tags (249.96s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom (259.01s) --- PASS: TestAccDataSourceAwsVpcEndpointService_custom_filter (261.24s) ``` --- .changelog/17641.txt | 7 ++++ aws/data_source_aws_vpc_endpoint_service.go | 38 ++++++++------------- 2 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 .changelog/17641.txt diff --git a/.changelog/17641.txt b/.changelog/17641.txt new file mode 100644 index 00000000000..9b6da489e96 --- /dev/null +++ b/.changelog/17641.txt @@ -0,0 +1,7 @@ +```release-note:note +data-source/aws_vpc_endpoint_service: The `service_type` argument filtering has been switched from client-side to new EC2 API functionality +``` + +```release-note:bug +data-source/aws_vpc_endpoint_service: Prevent panic with incorrect `service_type` argument values +``` diff --git a/aws/data_source_aws_vpc_endpoint_service.go b/aws/data_source_aws_vpc_endpoint_service.go index ce7ba5e0eb6..15626866d16 100644 --- a/aws/data_source_aws_vpc_endpoint_service.go +++ b/aws/data_source_aws_vpc_endpoint_service.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) @@ -66,9 +67,10 @@ func dataSourceAwsVpcEndpointService() *schema.Resource { ConflictsWith: []string{"service"}, }, "service_type": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(ec2.ServiceType_Values(), false), }, "tags": tagsSchemaComputed(), "vpc_endpoint_policy_supported": { @@ -104,6 +106,14 @@ func dataSourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{ if serviceNameOk { req.ServiceNames = aws.StringSlice([]string{serviceName}) } + + if v, ok := d.GetOk("service_type"); ok { + req.Filters = append(req.Filters, &ec2.Filter{ + Name: aws.String("service-type"), + Values: aws.StringSlice([]string{v.(string)}), + }) + } + if tagsOk { req.Filters = append(req.Filters, ec2TagFiltersFromMap(tags.(map[string]interface{}))...) } @@ -134,29 +144,11 @@ func dataSourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("no matching VPC Endpoint Service found") } - var serviceDetails []*ec2.ServiceDetail - - // Client-side filtering. When the EC2 API supports this functionality - // server-side it should be moved. - for _, serviceDetail := range resp.ServiceDetails { - if serviceDetail == nil { - continue - } - - if v, ok := d.GetOk("service_type"); ok { - if len(serviceDetail.ServiceType) > 0 && serviceDetail.ServiceType[0] != nil && v.(string) != aws.StringValue(serviceDetail.ServiceType[0].ServiceType) { - continue - } - } - - serviceDetails = append(serviceDetails, serviceDetail) - } - - if len(serviceDetails) > 1 { + if len(resp.ServiceDetails) > 1 { return fmt.Errorf("multiple VPC Endpoint Services matched; use additional constraints to reduce matches to a single VPC Endpoint Service") } - sd := serviceDetails[0] + sd := resp.ServiceDetails[0] serviceId := aws.StringValue(sd.ServiceId) serviceName = aws.StringValue(sd.ServiceName) From 3f3b22c2aac316b36e45aa59c4e33a3b029de330 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 18 Mar 2021 23:11:44 +0000 Subject: [PATCH 0561/1252] Update CHANGELOG.md for #17641 --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e0e3ca524..8d1e1d9da96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ NOTES: +* data-source/aws_vpc_endpoint_service: The `service_type` argument filtering has been switched from client-side to new EC2 API functionality ([#17641](https://github.com/hashicorp/terraform-provider-aws/issues/17641)) * provider: New `default_tags` argument as a public preview for applying tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ([#17974](https://github.com/hashicorp/terraform-provider-aws/issues/17974)) * resource/aws_codebuild_project: The `source` and `secondary_sources` configuration block `auth` attributes have been deprecated to match the CodeBuild API documentation. Use the `aws_codebuild_source_credential` resource instead. ([#17465](https://github.com/hashicorp/terraform-provider-aws/issues/17465)) * resource/aws_wafv2_web_acl_logging_configuration: The `redacted_fields` configuration block `all_query_arguments`, `body`, and `single_query_argument` arguments have been deprecated to match the WAF API documentation ([#14319](https://github.com/hashicorp/terraform-provider-aws/issues/14319)) @@ -23,8 +24,10 @@ ENHANCEMENTS: BUG FIXES: +* data-source/aws_vpc_endpoint_service: Prevent panic with incorrect `service_type` argument values ([#17641](https://github.com/hashicorp/terraform-provider-aws/issues/17641)) * resource/aws_dms_certificate: Correctly base64 decode `certificate_wallet` value ([#17958](https://github.com/hashicorp/terraform-provider-aws/issues/17958)) * resource/aws_globalaccelerator_accelerator: Correct length for `name` attribute validation ([#17985](https://github.com/hashicorp/terraform-provider-aws/issues/17985)) +* resource/aws_lakeformation_permissions: Properly serialize SELECT permission for `permissions` and `permissions_with_grant_option` fields ([#18203](https://github.com/hashicorp/terraform-provider-aws/issues/18203)) * resource/aws_ssm_patch_group: Allow for a single patch group to be registered with multiple patch baselines ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) * resource/aws_ssm_patch_group: Replace `Provider produced inconsistent result after apply` with actual error message ([#15213](https://github.com/hashicorp/terraform-provider-aws/issues/15213)) * resource/aws_waf_rule: Fix rule deletion when still referenced by a WebACL ([#17876](https://github.com/hashicorp/terraform-provider-aws/issues/17876)) From 66cfbfbe882f8970735ed966763ddddbb5d8d5d2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:25 -0400 Subject: [PATCH 0562/1252] tests/r/pinpoint_adm_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_adm_channel_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_adm_channel_test.go b/aws/resource_aws_pinpoint_adm_channel_test.go index b4be543cd53..33139e84e98 100644 --- a/aws/resource_aws_pinpoint_adm_channel_test.go +++ b/aws/resource_aws_pinpoint_adm_channel_test.go @@ -48,6 +48,7 @@ func TestAccAWSPinpointADMChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointADMChannelDestroy, From ab43496b33792d369954d7aca003b85a40949aec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:25 -0400 Subject: [PATCH 0563/1252] tests/r/pinpoint_apns_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_channel_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_pinpoint_apns_channel_test.go b/aws/resource_aws_pinpoint_apns_channel_test.go index b3f7803b6f6..f03c34c9d1a 100644 --- a/aws/resource_aws_pinpoint_apns_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_channel_test.go @@ -95,6 +95,7 @@ func TestAccAWSPinpointAPNSChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSChannelDestroy, @@ -129,6 +130,7 @@ func TestAccAWSPinpointAPNSChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSChannelDestroy, From f4e4b0a31ba7e928f8fbefcc8b232cbd11c25e43 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:26 -0400 Subject: [PATCH 0564/1252] tests/r/pinpoint_apns_sandbox_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_sandbox_channel_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go b/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go index 16a4420e249..b7a392207f4 100644 --- a/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go @@ -95,6 +95,7 @@ func TestAccAWSPinpointAPNSSandboxChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSSandboxChannelDestroy, @@ -129,6 +130,7 @@ func TestAccAWSPinpointAPNSSandboxChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSSandboxChannelDestroy, From 4e32115882100049e405e5b8a90198e162771623 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:26 -0400 Subject: [PATCH 0565/1252] tests/r/pinpoint_apns_voip_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_voip_channel_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_pinpoint_apns_voip_channel_test.go b/aws/resource_aws_pinpoint_apns_voip_channel_test.go index 06eeb2074d0..edc2d1a30f5 100644 --- a/aws/resource_aws_pinpoint_apns_voip_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_voip_channel_test.go @@ -95,6 +95,7 @@ func TestAccAWSPinpointAPNSVoipChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipChannelDestroy, @@ -129,6 +130,7 @@ func TestAccAWSPinpointAPNSVoipChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipChannelDestroy, From e5b903f584f0335786ce175f91d234879de56544 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:26 -0400 Subject: [PATCH 0566/1252] tests/r/pinpoint_apns_voip_sandbox_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go b/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go index defd42ad74b..743744335f7 100644 --- a/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go @@ -95,6 +95,7 @@ func TestAccAWSPinpointAPNSVoipSandboxChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipSandboxChannelDestroy, @@ -129,6 +130,7 @@ func TestAccAWSPinpointAPNSVoipSandboxChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipSandboxChannelDestroy, From 9a3545efbe3a812055a0594fe8bd0785f9507410 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:26 -0400 Subject: [PATCH 0567/1252] tests/r/pinpoint_app: Add ErrorCheck --- aws/resource_aws_pinpoint_app_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_pinpoint_app_test.go b/aws/resource_aws_pinpoint_app_test.go index 808793530c8..0be32c1c40a 100644 --- a/aws/resource_aws_pinpoint_app_test.go +++ b/aws/resource_aws_pinpoint_app_test.go @@ -70,6 +70,7 @@ func TestAccAWSPinpointApp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -96,6 +97,7 @@ func TestAccAWSPinpointApp_CampaignHookLambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -124,6 +126,7 @@ func TestAccAWSPinpointApp_Limits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -152,6 +155,7 @@ func TestAccAWSPinpointApp_QuietTime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, From 7448a40655af98ebe5f34ef80612a38150575ef2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:26 -0400 Subject: [PATCH 0568/1252] tests/r/pinpoint_baidu_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_baidu_channel_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_baidu_channel_test.go b/aws/resource_aws_pinpoint_baidu_channel_test.go index 8d279a3eff8..22ff1b05c53 100644 --- a/aws/resource_aws_pinpoint_baidu_channel_test.go +++ b/aws/resource_aws_pinpoint_baidu_channel_test.go @@ -20,6 +20,7 @@ func TestAccAWSPinpointBaiduChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointBaiduChannelDestroy, From 5e92e0fb4a4e4bac8a7dcb49922ba635f6070178 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:27 -0400 Subject: [PATCH 0569/1252] tests/r/pinpoint_email_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_email_channel_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_email_channel_test.go b/aws/resource_aws_pinpoint_email_channel_test.go index e492bbc5df0..459d69528bd 100644 --- a/aws/resource_aws_pinpoint_email_channel_test.go +++ b/aws/resource_aws_pinpoint_email_channel_test.go @@ -16,6 +16,7 @@ func TestAccAWSPinpointEmailChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointEmailChannelDestroy, From fcf7bd1a7269fe8d0d19030892d043e70fdb6c97 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:27 -0400 Subject: [PATCH 0570/1252] tests/r/pinpoint_event_stream: Add ErrorCheck --- aws/resource_aws_pinpoint_event_stream_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_event_stream_test.go b/aws/resource_aws_pinpoint_event_stream_test.go index ff8299538b4..86a760c603a 100644 --- a/aws/resource_aws_pinpoint_event_stream_test.go +++ b/aws/resource_aws_pinpoint_event_stream_test.go @@ -19,6 +19,7 @@ func TestAccAWSPinpointEventStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointEventStreamDestroy, From 08e26d5e7746456286786b7eda9ade94fed2e230 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:27 -0400 Subject: [PATCH 0571/1252] tests/r/pinpoint_gcm_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_gcm_channel_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_gcm_channel_test.go b/aws/resource_aws_pinpoint_gcm_channel_test.go index 08f13037404..8742e29d04c 100644 --- a/aws/resource_aws_pinpoint_gcm_channel_test.go +++ b/aws/resource_aws_pinpoint_gcm_channel_test.go @@ -29,6 +29,7 @@ func TestAccAWSPinpointGCMChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointGCMChannelDestroy, From a30275f341c09a42d4adbf4750bde160c06a1485 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:15:27 -0400 Subject: [PATCH 0572/1252] tests/r/pinpoint_sms_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_sms_channel_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_pinpoint_sms_channel_test.go b/aws/resource_aws_pinpoint_sms_channel_test.go index f72d9edca04..fe83454ee86 100644 --- a/aws/resource_aws_pinpoint_sms_channel_test.go +++ b/aws/resource_aws_pinpoint_sms_channel_test.go @@ -16,6 +16,7 @@ func TestAccAWSPinpointSMSChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointSMSChannelDestroy, @@ -61,6 +62,7 @@ func TestAccAWSPinpointSMSChannel_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, +ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointSMSChannelDestroy, From 4f7e32eb3c72b090c5eacf061d72daee4aa43c8b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:25:20 -0400 Subject: [PATCH 0573/1252] tests/r/pinpoint_adm_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_adm_channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_pinpoint_adm_channel_test.go b/aws/resource_aws_pinpoint_adm_channel_test.go index 33139e84e98..f7431ab2771 100644 --- a/aws/resource_aws_pinpoint_adm_channel_test.go +++ b/aws/resource_aws_pinpoint_adm_channel_test.go @@ -48,7 +48,7 @@ func TestAccAWSPinpointADMChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointADMChannelDestroy, From 3b06afffab194573f5acfbc3998f20cc2e0b8c86 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:25:30 -0400 Subject: [PATCH 0574/1252] tests/r/pinpoint_apns_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_channel_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_apns_channel_test.go b/aws/resource_aws_pinpoint_apns_channel_test.go index f03c34c9d1a..3d0abd30825 100644 --- a/aws/resource_aws_pinpoint_apns_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_channel_test.go @@ -95,7 +95,7 @@ func TestAccAWSPinpointAPNSChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSChannelDestroy, @@ -130,7 +130,7 @@ func TestAccAWSPinpointAPNSChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSChannelDestroy, From f27e0c5fb89c843a278ac27cae2f59108e08ffb4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:25:39 -0400 Subject: [PATCH 0575/1252] tests/r/pinpoint_apns_sandbox_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_sandbox_channel_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go b/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go index b7a392207f4..01552afd4d8 100644 --- a/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_sandbox_channel_test.go @@ -95,7 +95,7 @@ func TestAccAWSPinpointAPNSSandboxChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSSandboxChannelDestroy, @@ -130,7 +130,7 @@ func TestAccAWSPinpointAPNSSandboxChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSSandboxChannelDestroy, From 3b56a12063c13fb302ac14e86d9b2971fb067be8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:25:48 -0400 Subject: [PATCH 0576/1252] tests/r/pinpoint_apns_voip_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_voip_channel_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_apns_voip_channel_test.go b/aws/resource_aws_pinpoint_apns_voip_channel_test.go index edc2d1a30f5..6bb2bb994bd 100644 --- a/aws/resource_aws_pinpoint_apns_voip_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_voip_channel_test.go @@ -95,7 +95,7 @@ func TestAccAWSPinpointAPNSVoipChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipChannelDestroy, @@ -130,7 +130,7 @@ func TestAccAWSPinpointAPNSVoipChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipChannelDestroy, From bcd0dceaaba9f816a691d62fc17084d363d7e574 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:25:58 -0400 Subject: [PATCH 0577/1252] tests/r/pinpoint_apns_voip_sandbox_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go b/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go index 743744335f7..7089abddc0c 100644 --- a/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go +++ b/aws/resource_aws_pinpoint_apns_voip_sandbox_channel_test.go @@ -95,7 +95,7 @@ func TestAccAWSPinpointAPNSVoipSandboxChannel_basicCertificate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipSandboxChannelDestroy, @@ -130,7 +130,7 @@ func TestAccAWSPinpointAPNSVoipSandboxChannel_basicToken(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAPNSVoipSandboxChannelDestroy, From 332b530a08d540d276a1be3c7c68b7d1428e88da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:26:10 -0400 Subject: [PATCH 0578/1252] tests/r/pinpoint_app: Add ErrorCheck --- aws/resource_aws_pinpoint_app_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_pinpoint_app_test.go b/aws/resource_aws_pinpoint_app_test.go index 0be32c1c40a..b72affc0f27 100644 --- a/aws/resource_aws_pinpoint_app_test.go +++ b/aws/resource_aws_pinpoint_app_test.go @@ -70,7 +70,7 @@ func TestAccAWSPinpointApp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -97,7 +97,7 @@ func TestAccAWSPinpointApp_CampaignHookLambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -126,7 +126,7 @@ func TestAccAWSPinpointApp_Limits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -155,7 +155,7 @@ func TestAccAWSPinpointApp_QuietTime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, From 1f4906a310cd3ed5df5f39447ef8a20b9c5d21d3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:26:21 -0400 Subject: [PATCH 0579/1252] tests/r/pinpoint_baidu_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_baidu_channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_pinpoint_baidu_channel_test.go b/aws/resource_aws_pinpoint_baidu_channel_test.go index 22ff1b05c53..d313c2b2d79 100644 --- a/aws/resource_aws_pinpoint_baidu_channel_test.go +++ b/aws/resource_aws_pinpoint_baidu_channel_test.go @@ -20,7 +20,7 @@ func TestAccAWSPinpointBaiduChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointBaiduChannelDestroy, From 8cb79e6c95eddeb937c1a07f4f39d64d0d473aac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:26:32 -0400 Subject: [PATCH 0580/1252] tests/r/pinpoint_email_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_email_channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_pinpoint_email_channel_test.go b/aws/resource_aws_pinpoint_email_channel_test.go index 459d69528bd..bcc2c84b72e 100644 --- a/aws/resource_aws_pinpoint_email_channel_test.go +++ b/aws/resource_aws_pinpoint_email_channel_test.go @@ -16,7 +16,7 @@ func TestAccAWSPinpointEmailChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointEmailChannelDestroy, From 6ef9a9368b45cf4912f9bdbd0f94f3a212beb41c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:26:44 -0400 Subject: [PATCH 0581/1252] tests/r/pinpoint_event_stream: Add ErrorCheck --- aws/resource_aws_pinpoint_event_stream_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_pinpoint_event_stream_test.go b/aws/resource_aws_pinpoint_event_stream_test.go index 86a760c603a..29298040762 100644 --- a/aws/resource_aws_pinpoint_event_stream_test.go +++ b/aws/resource_aws_pinpoint_event_stream_test.go @@ -19,7 +19,7 @@ func TestAccAWSPinpointEventStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointEventStreamDestroy, From 13c09d721cf4b1d48345a112094f21dd693f6cc8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:26:56 -0400 Subject: [PATCH 0582/1252] tests/r/pinpoint_gcm_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_gcm_channel_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_pinpoint_gcm_channel_test.go b/aws/resource_aws_pinpoint_gcm_channel_test.go index 8742e29d04c..97434beab33 100644 --- a/aws/resource_aws_pinpoint_gcm_channel_test.go +++ b/aws/resource_aws_pinpoint_gcm_channel_test.go @@ -29,7 +29,7 @@ func TestAccAWSPinpointGCMChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointGCMChannelDestroy, From 1f349e72305eed5e298e226122bb08fc2d71f234 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:27:07 -0400 Subject: [PATCH 0583/1252] tests/r/pinpoint_sms_channel: Add ErrorCheck --- aws/resource_aws_pinpoint_sms_channel_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_sms_channel_test.go b/aws/resource_aws_pinpoint_sms_channel_test.go index fe83454ee86..8ece762ec0e 100644 --- a/aws/resource_aws_pinpoint_sms_channel_test.go +++ b/aws/resource_aws_pinpoint_sms_channel_test.go @@ -16,7 +16,7 @@ func TestAccAWSPinpointSMSChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointSMSChannelDestroy, @@ -62,7 +62,7 @@ func TestAccAWSPinpointSMSChannel_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, -ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointSMSChannelDestroy, From fa772ee2b61598c4ae7eb2b72f0524087f4cfc78 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:29:41 -0400 Subject: [PATCH 0584/1252] tests/r/backup_global_settings: Add ErrorCheck --- aws/resource_aws_backup_global_settings_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_backup_global_settings_test.go b/aws/resource_aws_backup_global_settings_test.go index bca27e84086..ad15741fe5e 100644 --- a/aws/resource_aws_backup_global_settings_test.go +++ b/aws/resource_aws_backup_global_settings_test.go @@ -18,6 +18,7 @@ func TestAccAwsBackupGlobalSettings_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 62881d89185dd7809ac46b77edc441dc73139581 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:29:51 -0400 Subject: [PATCH 0585/1252] tests/r/backup_plan: Add ErrorCheck --- aws/resource_aws_backup_plan_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_backup_plan_test.go b/aws/resource_aws_backup_plan_test.go index 5ccd41b4ab5..1ae97622b95 100644 --- a/aws/resource_aws_backup_plan_test.go +++ b/aws/resource_aws_backup_plan_test.go @@ -20,6 +20,7 @@ func TestAccAwsBackupPlan_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAwsBackupPlan_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -111,6 +113,7 @@ func TestAccAwsBackupPlan_withRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -193,6 +196,7 @@ func TestAccAwsBackupPlan_withLifecycle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -264,6 +268,7 @@ func TestAccAwsBackupPlan_withRecoveryPointTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -336,6 +341,7 @@ func TestAccAwsBackupPlan_Rule_CopyAction_SameRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -398,6 +404,7 @@ func TestAccAwsBackupPlan_Rule_CopyAction_NoLifecycle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -458,6 +465,7 @@ func TestAccAwsBackupPlan_Rule_CopyAction_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -497,6 +505,7 @@ func TestAccAwsBackupPlan_Rule_CopyAction_CrossRegion(t *testing.T) { testAccPreCheckAWSBackup(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -532,6 +541,7 @@ func TestAccAwsBackupPlan_AdvancedBackupSetting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ @@ -577,6 +587,7 @@ func TestAccAwsBackupPlan_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ From 38837ebf3306fd1067f5d574b53a8b6efce3d650 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:30:01 -0400 Subject: [PATCH 0586/1252] tests/r/backup_selection: Add ErrorCheck --- aws/resource_aws_backup_selection_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_backup_selection_test.go b/aws/resource_aws_backup_selection_test.go index 9d6c72f5a2c..9fba2e814e9 100644 --- a/aws/resource_aws_backup_selection_test.go +++ b/aws/resource_aws_backup_selection_test.go @@ -18,6 +18,7 @@ func TestAccAwsBackupSelection_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAwsBackupSelection_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAwsBackupSelection_disappears_BackupPlan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ @@ -90,6 +93,7 @@ func TestAccAwsBackupSelection_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ @@ -117,6 +121,7 @@ func TestAccAwsBackupSelection_withResources(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ @@ -144,6 +149,7 @@ func TestAccAwsBackupSelection_updateTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupSelectionDestroy, Steps: []resource.TestStep{ From 86ba10ba24f8d3325c03855cc75fc99ed15086dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:30:11 -0400 Subject: [PATCH 0587/1252] tests/r/backup_vault: Add ErrorCheck --- aws/resource_aws_backup_vault_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_backup_vault_test.go b/aws/resource_aws_backup_vault_test.go index 011cf0b9f58..f1c41103dfb 100644 --- a/aws/resource_aws_backup_vault_test.go +++ b/aws/resource_aws_backup_vault_test.go @@ -18,6 +18,7 @@ func TestAccAwsBackupVault_basic(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAwsBackupVault_withKmsKey(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultDestroy, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAwsBackupVault_withTags(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultDestroy, Steps: []resource.TestStep{ @@ -117,6 +120,7 @@ func TestAccAwsBackupVault_disappears(t *testing.T) { resourceName := "aws_backup_vault.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultDestroy, Steps: []resource.TestStep{ From 3e98178ad939ca4314220f863ab39b3e85da8e99 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:30:20 -0400 Subject: [PATCH 0588/1252] tests/r/backup_vault_notifications: Add ErrorCheck --- aws/resource_aws_backup_vault_notifications_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_backup_vault_notifications_test.go b/aws/resource_aws_backup_vault_notifications_test.go index 78500e920ee..45c983015f9 100644 --- a/aws/resource_aws_backup_vault_notifications_test.go +++ b/aws/resource_aws_backup_vault_notifications_test.go @@ -77,6 +77,7 @@ func TestAccAwsBackupVaultNotification_basic(t *testing.T) { resourceName := "aws_backup_vault_notifications.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultNotificationDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func TestAccAwsBackupVaultNotification_disappears(t *testing.T) { resourceName := "aws_backup_vault_notifications.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultNotificationDestroy, Steps: []resource.TestStep{ From 174c77f4814f6f2816cdb4a39cfd37402a0c684a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:30:30 -0400 Subject: [PATCH 0589/1252] tests/r/backup_vault_policy: Add ErrorCheck --- aws/resource_aws_backup_vault_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_backup_vault_policy_test.go b/aws/resource_aws_backup_vault_policy_test.go index 9903b751b4e..4185e4834d7 100644 --- a/aws/resource_aws_backup_vault_policy_test.go +++ b/aws/resource_aws_backup_vault_policy_test.go @@ -78,6 +78,7 @@ func TestAccAwsBackupVaultPolicy_basic(t *testing.T) { resourceName := "aws_backup_vault_policy.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultPolicyDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAwsBackupVaultPolicy_disappears(t *testing.T) { resourceName := "aws_backup_vault_policy.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsBackupVaultPolicyDestroy, Steps: []resource.TestStep{ From ae957155681ffebf8798ed4c6374cb218687efb6 Mon Sep 17 00:00:00 2001 From: tf-release-bot Date: Thu, 18 Mar 2021 23:30:44 +0000 Subject: [PATCH 0590/1252] v3.33.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d1e1d9da96..4423156a3be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.33.0 (Unreleased) +## 3.33.0 (March 18, 2021) NOTES: From 6d368b978a1b43a0b69fba37d304bea1eb165960 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:30:52 -0400 Subject: [PATCH 0591/1252] tests/ds/backup_plan: Add ErrorCheck --- aws/data_source_aws_backup_plan_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_backup_plan_test.go b/aws/data_source_aws_backup_plan_test.go index 51c501e3beb..767778cb469 100644 --- a/aws/data_source_aws_backup_plan_test.go +++ b/aws/data_source_aws_backup_plan_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSBackupPlanDataSource_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsBackupPlanDataSourceConfig_nonExistent, From f822799c10231eb9e0fb92a81cebb1c8363ccc48 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:31:03 -0400 Subject: [PATCH 0592/1252] tests/ds/backup_selection: Add ErrorCheck --- aws/data_source_aws_backup_selection_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_backup_selection_test.go b/aws/data_source_aws_backup_selection_test.go index 9a6adf16876..ec2c1b87bb2 100644 --- a/aws/data_source_aws_backup_selection_test.go +++ b/aws/data_source_aws_backup_selection_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSBackupSelectionDataSource_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsBackupSelectionDataSourceConfig_nonExistent, From a3acfe29c2a6fe075e0e05c1f4bd2ab6a31db03a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:31:15 -0400 Subject: [PATCH 0593/1252] tests/ds/backup_vault: Add ErrorCheck --- aws/data_source_aws_backup_vault_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_backup_vault_test.go b/aws/data_source_aws_backup_vault_test.go index 674bb0ef016..cfc70f6b7ae 100644 --- a/aws/data_source_aws_backup_vault_test.go +++ b/aws/data_source_aws_backup_vault_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSBackupVaultDataSource_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsBackupVaultDataSourceConfig_nonExistent, From 8099e85d5bdece9e0f475ae52c6d185073e40921 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:31:50 -0400 Subject: [PATCH 0594/1252] tests/r/backup_region_settings: Add ErrorCheck --- aws/resource_aws_backup_region_settings_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_backup_region_settings_test.go b/aws/resource_aws_backup_region_settings_test.go index c6a2cda56f1..9ccee4284ae 100644 --- a/aws/resource_aws_backup_region_settings_test.go +++ b/aws/resource_aws_backup_region_settings_test.go @@ -21,6 +21,7 @@ func TestAccAwsBackupRegionSettings_basic(t *testing.T) { testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) testAccPreCheckAWSBackup(t) }, + ErrorCheck: testAccErrorCheck(t, backup.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From e90ce057df9574b271b68c2fd2dd77749cd0cc7e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:33:58 -0400 Subject: [PATCH 0595/1252] tests/r/config_aggregate_authorization: Add ErrorCheck --- aws/resource_aws_config_aggregate_authorization_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_config_aggregate_authorization_test.go b/aws/resource_aws_config_aggregate_authorization_test.go index 7c6675c2e37..bf34a2fd2ed 100644 --- a/aws/resource_aws_config_aggregate_authorization_test.go +++ b/aws/resource_aws_config_aggregate_authorization_test.go @@ -64,6 +64,7 @@ func TestAccAWSConfigAggregateAuthorization_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigAggregateAuthorizationDestroy, Steps: []resource.TestStep{ @@ -90,6 +91,7 @@ func TestAccAWSConfigAggregateAuthorization_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigAggregateAuthorizationDestroy, Steps: []resource.TestStep{ From c5a9f96c0d9e6d5b417045ba69810477bad3580b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:34:08 -0400 Subject: [PATCH 0596/1252] tests/r/config_config_rule: Add ErrorCheck --- aws/resource_aws_config_config_rule_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_config_config_rule_test.go b/aws/resource_aws_config_config_rule_test.go index d3eae39a2e3..eb8bd4580f1 100644 --- a/aws/resource_aws_config_config_rule_test.go +++ b/aws/resource_aws_config_config_rule_test.go @@ -19,6 +19,7 @@ func testAccConfigConfigRule_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func testAccConfigConfigRule_ownerAws(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func testAccConfigConfigRule_customlambda(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -117,6 +120,7 @@ func testAccConfigConfigRule_importAws(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -141,6 +145,7 @@ func testAccConfigConfigRule_importLambda(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -164,6 +169,7 @@ func testAccConfigConfigRule_Scope_TagKey(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -194,6 +200,7 @@ func testAccConfigConfigRule_Scope_TagKey_Empty(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -214,6 +221,7 @@ func testAccConfigConfigRule_Scope_TagValue(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ @@ -244,6 +252,7 @@ func testAccConfigConfigRule_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigRuleDestroy, Steps: []resource.TestStep{ From 9f48976341eed224c6c81c785cdcd035c6e17571 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:34:18 -0400 Subject: [PATCH 0597/1252] tests/r/config_configuration_aggregator: Add ErrorCheck --- aws/resource_aws_config_configuration_aggregator_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index fbc87975062..34570fa9f2c 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -63,6 +63,7 @@ func TestAccAWSConfigConfigurationAggregator_account(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ @@ -95,6 +96,7 @@ func TestAccAWSConfigConfigurationAggregator_organization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ @@ -124,6 +126,7 @@ func TestAccAWSConfigConfigurationAggregator_switch(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ @@ -152,6 +155,7 @@ func TestAccAWSConfigConfigurationAggregator_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ From 60cd2198d2f149a670e1697c99edaf03a260f3db Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:34:28 -0400 Subject: [PATCH 0598/1252] tests/r/config_configuration_recorder: Add ErrorCheck --- aws/resource_aws_config_configuration_recorder_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_config_configuration_recorder_test.go b/aws/resource_aws_config_configuration_recorder_test.go index 038874c0b0f..987b66b0386 100644 --- a/aws/resource_aws_config_configuration_recorder_test.go +++ b/aws/resource_aws_config_configuration_recorder_test.go @@ -72,6 +72,7 @@ func testAccConfigConfigurationRecorder_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderDestroy, Steps: []resource.TestStep{ @@ -98,6 +99,7 @@ func testAccConfigConfigurationRecorder_allParams(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderDestroy, Steps: []resource.TestStep{ @@ -124,6 +126,7 @@ func testAccConfigConfigurationRecorder_importBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderDestroy, Steps: []resource.TestStep{ From 14cd56b6785f9ba5e4f6efe95c6a3d88129b9063 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:34:38 -0400 Subject: [PATCH 0599/1252] tests/r/config_configuration_recorder_status: Add ErrorCheck --- aws/resource_aws_config_configuration_recorder_status_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_config_configuration_recorder_status_test.go b/aws/resource_aws_config_configuration_recorder_status_test.go index e3f12987c9e..7a81ed5f7fc 100644 --- a/aws/resource_aws_config_configuration_recorder_status_test.go +++ b/aws/resource_aws_config_configuration_recorder_status_test.go @@ -19,6 +19,7 @@ func testAccConfigConfigurationRecorderStatus_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderStatusDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func testAccConfigConfigurationRecorderStatus_startEnabled(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderStatusDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func testAccConfigConfigurationRecorderStatus_importBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConfigurationRecorderStatusDestroy, Steps: []resource.TestStep{ From 5e5e6e5efa35f243f5b17359d712f100a4e2d205 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:34:58 -0400 Subject: [PATCH 0600/1252] tests/r/config_conformance_pack: Add ErrorCheck --- aws/resource_aws_config_conformance_pack_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_config_conformance_pack_test.go b/aws/resource_aws_config_conformance_pack_test.go index e771be14bd0..2c00fa0be6b 100644 --- a/aws/resource_aws_config_conformance_pack_test.go +++ b/aws/resource_aws_config_conformance_pack_test.go @@ -20,6 +20,7 @@ func testAccConfigConformancePack_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func testAccConfigConformancePack_forceNew(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -94,6 +96,7 @@ func testAccConfigConformancePack_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func testAccConfigConformancePack_inputParameters(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -151,6 +155,7 @@ func testAccConfigConformancePack_S3Delivery(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -182,6 +187,7 @@ func testAccConfigConformancePack_S3Template(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -213,6 +219,7 @@ func testAccConfigConformancePack_updateInputParameters(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -262,6 +269,7 @@ func testAccConfigConformancePack_updateS3Delivery(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -300,6 +308,7 @@ func testAccConfigConformancePack_updateS3Template(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -337,6 +346,7 @@ func testAccConfigConformancePack_updateTemplateBody(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ @@ -376,6 +386,7 @@ func testAccConfigConformancePack_S3TemplateAndTemplateBody(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigConformancePackDestroy, Steps: []resource.TestStep{ From a716306fc7d3fdaaf1873f308e577728a04e7717 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:35:10 -0400 Subject: [PATCH 0601/1252] tests/r/config_delivery_channel: Add ErrorCheck --- aws/resource_aws_config_delivery_channel_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_config_delivery_channel_test.go b/aws/resource_aws_config_delivery_channel_test.go index 6cddec1021a..741e1add713 100644 --- a/aws/resource_aws_config_delivery_channel_test.go +++ b/aws/resource_aws_config_delivery_channel_test.go @@ -79,6 +79,7 @@ func testAccConfigDeliveryChannel_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigDeliveryChannelDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func testAccConfigDeliveryChannel_allParams(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigDeliveryChannelDestroy, Steps: []resource.TestStep{ @@ -129,6 +131,7 @@ func testAccConfigDeliveryChannel_importBasic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigDeliveryChannelDestroy, Steps: []resource.TestStep{ From ae2d8cf7b264105108eb6f460ef585e253cd27de Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:35:21 -0400 Subject: [PATCH 0602/1252] tests/r/config_organization_custom_rule: Add ErrorCheck --- ...urce_aws_config_organization_custom_rule_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_config_organization_custom_rule_test.go b/aws/resource_aws_config_organization_custom_rule_test.go index 568ae55b23b..227071ea761 100644 --- a/aws/resource_aws_config_organization_custom_rule_test.go +++ b/aws/resource_aws_config_organization_custom_rule_test.go @@ -19,6 +19,7 @@ func testAccConfigOrganizationCustomRule_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func testAccConfigOrganizationCustomRule_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func testAccConfigOrganizationCustomRule_errorHandling(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -94,6 +97,7 @@ func testAccConfigOrganizationCustomRule_Description(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -127,6 +131,7 @@ func testAccConfigOrganizationCustomRule_ExcludedAccounts(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -163,6 +168,7 @@ func testAccConfigOrganizationCustomRule_InputParameters(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -198,6 +204,7 @@ func testAccConfigOrganizationCustomRule_LambdaFunctionArn(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -231,6 +238,7 @@ func testAccConfigOrganizationCustomRule_MaximumExecutionFrequency(t *testing.T) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -264,6 +272,7 @@ func testAccConfigOrganizationCustomRule_ResourceIdScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -297,6 +306,7 @@ func testAccConfigOrganizationCustomRule_ResourceTypesScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -330,6 +340,7 @@ func testAccConfigOrganizationCustomRule_TagKeyScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -363,6 +374,7 @@ func testAccConfigOrganizationCustomRule_TagValueScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ @@ -396,6 +408,7 @@ func testAccConfigOrganizationCustomRule_TriggerTypes(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationCustomRuleDestroy, Steps: []resource.TestStep{ From c72fb0d99b880230d477f40c67ee8c8c6a4d0741 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:35:32 -0400 Subject: [PATCH 0603/1252] tests/r/config_organization_managed_rule: Add ErrorCheck --- ...urce_aws_config_organization_managed_rule_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_config_organization_managed_rule_test.go b/aws/resource_aws_config_organization_managed_rule_test.go index 7c95d6446e4..2de03bd51e5 100644 --- a/aws/resource_aws_config_organization_managed_rule_test.go +++ b/aws/resource_aws_config_organization_managed_rule_test.go @@ -18,6 +18,7 @@ func testAccConfigOrganizationManagedRule_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func testAccConfigOrganizationManagedRule_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func testAccConfigOrganizationManagedRule_errorHandling(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -92,6 +95,7 @@ func testAccConfigOrganizationManagedRule_Description(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -125,6 +129,7 @@ func testAccConfigOrganizationManagedRule_ExcludedAccounts(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -161,6 +166,7 @@ func testAccConfigOrganizationManagedRule_InputParameters(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -194,6 +200,7 @@ func testAccConfigOrganizationManagedRule_MaximumExecutionFrequency(t *testing.T resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -227,6 +234,7 @@ func testAccConfigOrganizationManagedRule_ResourceIdScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -260,6 +268,7 @@ func testAccConfigOrganizationManagedRule_ResourceTypesScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -293,6 +302,7 @@ func testAccConfigOrganizationManagedRule_RuleIdentifier(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -326,6 +336,7 @@ func testAccConfigOrganizationManagedRule_TagKeyScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ @@ -359,6 +370,7 @@ func testAccConfigOrganizationManagedRule_TagValueScope(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigOrganizationManagedRuleDestroy, Steps: []resource.TestStep{ From b5d7cc30063b5b0e0bc401e6f5b0c2ae89866e80 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:35:43 -0400 Subject: [PATCH 0604/1252] tests/r/config_remediation_configuration: Add ErrorCheck --- aws/resource_aws_config_remediation_configuration_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_config_remediation_configuration_test.go b/aws/resource_aws_config_remediation_configuration_test.go index f5a1e044af4..c651ddc54c2 100644 --- a/aws/resource_aws_config_remediation_configuration_test.go +++ b/aws/resource_aws_config_remediation_configuration_test.go @@ -21,6 +21,7 @@ func testAccConfigRemediationConfiguration_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigRemediationConfigurationDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func testAccConfigRemediationConfiguration_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigRemediationConfigurationDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func testAccConfigRemediationConfiguration_recreates(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigRemediationConfigurationDestroy, Steps: []resource.TestStep{ @@ -113,6 +116,7 @@ func testAccConfigRemediationConfiguration_updates(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckConfigRemediationConfigurationDestroy, Steps: []resource.TestStep{ From da77548e90450b421a17fb50ef14cd1796b3e672 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:37:04 -0400 Subject: [PATCH 0605/1252] tests/r/alb_target_group: Add ErrorCheck --- aws/resource_aws_alb_target_group_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_alb_target_group_test.go b/aws/resource_aws_alb_target_group_test.go index c1061cb746e..f05873f99e9 100644 --- a/aws/resource_aws_alb_target_group_test.go +++ b/aws/resource_aws_alb_target_group_test.go @@ -50,6 +50,7 @@ func TestAccAWSALBTargetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -92,6 +93,7 @@ func TestAccAWSALBTargetGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -112,6 +114,7 @@ func TestAccAWSALBTargetGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -133,6 +136,7 @@ func TestAccAWSALBTargetGroup_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -161,6 +165,7 @@ func TestAccAWSALBTargetGroup_changeProtocolForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -189,6 +194,7 @@ func TestAccAWSALBTargetGroup_changePortForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -217,6 +223,7 @@ func TestAccAWSALBTargetGroup_changeVpcForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -243,6 +250,7 @@ func TestAccAWSALBTargetGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -274,6 +282,7 @@ func TestAccAWSALBTargetGroup_updateHealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -336,6 +345,7 @@ func TestAccAWSALBTargetGroup_updateSticknessEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -421,6 +431,7 @@ func TestAccAWSALBTargetGroup_setAndUpdateSlowStart(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -449,6 +460,7 @@ func TestAccAWSALBTargetGroup_updateLoadBalancingAlgorithmType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_target_group.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, @@ -552,6 +564,7 @@ func TestAccAWSALBTargetGroup_lambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -585,6 +598,7 @@ func TestAccAWSALBTargetGroup_lambdaMultiValueHeadersEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -632,6 +646,7 @@ func TestAccAWSALBTargetGroup_missingPortProtocolVpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, Steps: []resource.TestStep{ From c75895c4d4c3fb123de3dcb78259c01a10c406ae Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:37:14 -0400 Subject: [PATCH 0606/1252] tests/r/lb: Add ErrorCheck --- aws/resource_aws_lb_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/aws/resource_aws_lb_test.go b/aws/resource_aws_lb_test.go index a7fdef25991..4f9248fbcb0 100644 --- a/aws/resource_aws_lb_test.go +++ b/aws/resource_aws_lb_test.go @@ -99,6 +99,7 @@ func TestAccAWSLB_ALB_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -136,6 +137,7 @@ func TestAccAWSLB_NLB_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -169,6 +171,7 @@ func TestAccAWSLB_LoadBalancerType_Gateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLBDestroy, Steps: []resource.TestStep{ @@ -201,6 +204,7 @@ func TestAccAWSLB_IPv6SubnetMapping(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLBDestroy, Steps: []resource.TestStep{ @@ -234,6 +238,7 @@ func TestAccAWSLB_LoadBalancerType_Gateway_EnableCrossZoneLoadBalancing(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLBDestroy, Steps: []resource.TestStep{ @@ -276,6 +281,7 @@ func TestAccAWSLB_ALB_outpost(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -315,6 +321,7 @@ func TestAccAWSLB_networkLoadbalancerEIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, Steps: []resource.TestStep{ @@ -344,6 +351,7 @@ func TestAccAWSLB_NLB_privateipv4address(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -373,6 +381,7 @@ func TestAccAWSLB_BackwardsCompatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -407,6 +416,7 @@ func TestAccAWSLB_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -428,6 +438,7 @@ func TestAccAWSLB_generatesNameForZeroValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -449,6 +460,7 @@ func TestAccAWSLB_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -473,6 +485,7 @@ func TestAccAWSLB_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -513,6 +526,7 @@ func TestAccAWSLB_networkLoadbalancer_updateCrossZone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -554,6 +568,7 @@ func TestAccAWSLB_applicationLoadBalancer_updateHttp2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -594,6 +609,7 @@ func TestAccAWSLB_applicationLoadBalancer_updateDropInvalidHeaderFields(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb.lb_test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -635,6 +651,7 @@ func TestAccAWSLB_applicationLoadBalancer_updateDeletionProtection(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -676,6 +693,7 @@ func TestAccAWSLB_updatedSecurityGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -706,6 +724,7 @@ func TestAccAWSLB_updatedSubnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -736,6 +755,7 @@ func TestAccAWSLB_updatedIpAddressType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -768,6 +788,7 @@ func TestAccAWSLB_noSecurityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -801,6 +822,7 @@ func TestAccAWSLB_ALB_AccessLogs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -889,6 +911,7 @@ func TestAccAWSLB_ALB_AccessLogs_Prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -959,6 +982,7 @@ func TestAccAWSLB_NLB_AccessLogs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -1047,6 +1071,7 @@ func TestAccAWSLB_NLB_AccessLogs_Prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, @@ -1116,6 +1141,7 @@ func TestAccAWSLB_networkLoadbalancer_subnet_change(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBDestroy, From 8ae4c372ac99c1c456adacf60496d685b53aef1f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:37:24 -0400 Subject: [PATCH 0607/1252] tests/r/lb_listener: Add ErrorCheck --- aws/resource_aws_lb_listener_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_lb_listener_test.go b/aws/resource_aws_lb_listener_test.go index 2b75c502602..40ea4039543 100644 --- a/aws/resource_aws_lb_listener_test.go +++ b/aws/resource_aws_lb_listener_test.go @@ -20,6 +20,7 @@ func TestAccAWSLBListener_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -53,6 +54,7 @@ func TestAccAWSLBListener_forwardWeighted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -124,6 +126,7 @@ func TestAccAWSLBListener_basicUdp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -155,6 +158,7 @@ func TestAccAWSLBListener_BackwardsCompatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_alb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -187,6 +191,7 @@ func TestAccAWSLBListener_https(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -247,6 +252,7 @@ func TestAccAWSLBListener_Protocol_Tls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ @@ -267,6 +273,7 @@ func TestAccAWSLBListener_redirect(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -303,6 +310,7 @@ func TestAccAWSLBListener_fixedResponse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.front_end", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -376,6 +384,7 @@ func TestAccAWSLBListener_oidc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: "aws_lb_listener.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, @@ -417,6 +426,7 @@ func TestAccAWSLBListener_DefaultAction_Order(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ @@ -443,6 +453,7 @@ func TestAccAWSLBListener_DefaultAction_Order_Recreates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ From 620502484f503e9bf4ac2d9660ffa0fbd5531917 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:37:34 -0400 Subject: [PATCH 0608/1252] tests/r/lb_listener_certificate: Add ErrorCheck --- aws/resource_aws_lb_listener_certificate_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_lb_listener_certificate_test.go b/aws/resource_aws_lb_listener_certificate_test.go index 3d5f4a07edc..c319db8bd46 100644 --- a/aws/resource_aws_lb_listener_certificate_test.go +++ b/aws/resource_aws_lb_listener_certificate_test.go @@ -22,6 +22,7 @@ func TestAccAwsLbListenerCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLbListenerCertificateDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAwsLbListenerCertificate_CertificateArn_Underscores(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLbListenerCertificateDestroy, Steps: []resource.TestStep{ @@ -86,6 +88,7 @@ func TestAccAwsLbListenerCertificate_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLbListenerCertificateDestroy, Steps: []resource.TestStep{ @@ -152,6 +155,7 @@ func TestAccAwsLbListenerCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLbListenerCertificateDestroy, Steps: []resource.TestStep{ From 3d03b109855c6b9073b207ae799a852fed75ab53 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:37:43 -0400 Subject: [PATCH 0609/1252] tests/r/lb_listener_rule: Add ErrorCheck --- aws/resource_aws_lb_listener_rule_test.go | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/aws/resource_aws_lb_listener_rule_test.go b/aws/resource_aws_lb_listener_rule_test.go index 065a46689a2..c4804d3768d 100644 --- a/aws/resource_aws_lb_listener_rule_test.go +++ b/aws/resource_aws_lb_listener_rule_test.go @@ -65,6 +65,7 @@ func TestAccAWSLBListenerRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSLBListenerRule_forwardWeighted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -190,6 +192,7 @@ func TestAccAWSLBListenerRule_BackwardsCompatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -234,6 +237,7 @@ func TestAccAWSLBListenerRule_redirect(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -274,6 +278,7 @@ func TestAccAWSLBListenerRule_fixedResponse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -311,6 +316,7 @@ func TestAccAWSLBListenerRule_updateFixedResponse(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -341,6 +347,7 @@ func TestAccAWSLBListenerRule_updateRulePriority(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -371,6 +378,7 @@ func TestAccAWSLBListenerRule_changeListenerRuleArnForcesNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -398,6 +406,7 @@ func TestAccAWSLBListenerRule_priority(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -479,6 +488,7 @@ func TestAccAWSLBListenerRule_cognito(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -519,6 +529,7 @@ func TestAccAWSLBListenerRule_oidc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -559,6 +570,7 @@ func TestAccAWSLBListenerRule_Action_Order(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -585,6 +597,7 @@ func TestAccAWSLBListenerRule_Action_Order_Recreates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -608,6 +621,7 @@ func TestAccAWSLBListenerRule_conditionAttributesCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -644,6 +658,7 @@ func TestAccAWSLBListenerRule_conditionHostHeader(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -682,6 +697,7 @@ func TestAccAWSLBListenerRule_conditionHttpHeader(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -726,6 +742,7 @@ func TestAccAWSLBListenerRule_conditionHttpHeader(t *testing.T) { func TestAccAWSLBListenerRule_conditionHttpHeader_invalid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -746,6 +763,7 @@ func TestAccAWSLBListenerRule_conditionHttpRequestMethod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -784,6 +802,7 @@ func TestAccAWSLBListenerRule_conditionPathPattern(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -822,6 +841,7 @@ func TestAccAWSLBListenerRule_conditionQueryString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -884,6 +904,7 @@ func TestAccAWSLBListenerRule_conditionSourceIp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -922,6 +943,7 @@ func TestAccAWSLBListenerRule_conditionUpdateMixed(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -995,6 +1017,7 @@ func TestAccAWSLBListenerRule_conditionMultiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ @@ -1077,6 +1100,7 @@ func TestAccAWSLBListenerRule_conditionUpdateMultiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ From c984192d75dc9b629effa7300d2cad9fce2cc31b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:38:07 -0400 Subject: [PATCH 0610/1252] tests/r/lb_target_group: Add ErrorCheck --- aws/resource_aws_lb_target_group_test.go | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/aws/resource_aws_lb_target_group_test.go b/aws/resource_aws_lb_target_group_test.go index b1ceba292d5..9e03807d7aa 100644 --- a/aws/resource_aws_lb_target_group_test.go +++ b/aws/resource_aws_lb_target_group_test.go @@ -98,6 +98,7 @@ func TestAccAWSLBTargetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -143,6 +144,7 @@ func TestAccAWSLBTargetGroup_basicUdp(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -174,6 +176,7 @@ func TestAccAWSLBTargetGroup_ProtocolVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -219,6 +222,7 @@ func TestAccAWSLBTargetGroup_withoutHealthcheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -244,6 +248,7 @@ func TestAccAWSLBTargetGroup_networkLB_TargetGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -324,6 +329,7 @@ func TestAccAWSLBTargetGroup_Protocol_Geneve(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -356,6 +362,7 @@ func TestAccAWSLBTargetGroup_Protocol_Tcp_HealthCheck_Protocol(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -388,6 +395,7 @@ func TestAccAWSLBTargetGroup_Protocol_Tls(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -409,6 +417,7 @@ func TestAccAWSLBTargetGroup_ProtocolVersion_GRPC_HealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -433,6 +442,7 @@ func TestAccAWSLBTargetGroup_ProtocolVersion_HTTP_GRPC_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -463,6 +473,7 @@ func TestAccAWSLBTargetGroup_networkLB_TargetGroupWithProxy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -493,6 +504,7 @@ func TestAccAWSLBTargetGroup_TCP_HTTPHealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -560,6 +572,7 @@ func TestAccAWSLBTargetGroup_BackwardsCompatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -602,6 +615,7 @@ func TestAccAWSLBTargetGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -623,6 +637,7 @@ func TestAccAWSLBTargetGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -645,6 +660,7 @@ func TestAccAWSLBTargetGroup_changeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -674,6 +690,7 @@ func TestAccAWSLBTargetGroup_changeProtocolForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -703,6 +720,7 @@ func TestAccAWSLBTargetGroup_changePortForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -732,6 +750,7 @@ func TestAccAWSLBTargetGroup_changeVpcForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -759,6 +778,7 @@ func TestAccAWSLBTargetGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -799,6 +819,7 @@ func TestAccAWSLBTargetGroup_enableHealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -836,6 +857,7 @@ func TestAccAWSLBTargetGroup_updateHealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -908,6 +930,7 @@ func TestAccAWSLBTargetGroup_updateSticknessEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -994,6 +1017,7 @@ func TestAccAWSLBTargetGroup_defaults_application(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1055,6 +1079,7 @@ protocol = "TCP" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1103,6 +1128,7 @@ func TestAccAWSLBTargetGroup_stickinessDefaultNLB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1144,6 +1170,7 @@ func TestAccAWSLBTargetGroup_stickinessDefaultALB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1167,6 +1194,7 @@ func TestAccAWSLBTargetGroup_stickinessValidNLB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1226,6 +1254,7 @@ func TestAccAWSLBTargetGroup_stickinessValidALB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, @@ -1257,6 +1286,7 @@ func TestAccAWSLBTargetGroup_stickinessValidALB(t *testing.T) { func TestAccAWSLBTargetGroup_stickinessInvalidNLB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, Steps: []resource.TestStep{ @@ -1279,6 +1309,7 @@ func TestAccAWSLBTargetGroup_stickinessInvalidNLB(t *testing.T) { func TestAccAWSLBTargetGroup_stickinessInvalidALB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupDestroy, Steps: []resource.TestStep{ From 0818b9baba6a740661aba574c51d1de6614bf3a5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:38:20 -0400 Subject: [PATCH 0611/1252] tests/r/lb_target_group_attachment: Add ErrorCheck --- aws/resource_aws_lb_target_group_attachment_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_lb_target_group_attachment_test.go b/aws/resource_aws_lb_target_group_attachment_test.go index af3fed5fef6..e331ba2e5f1 100644 --- a/aws/resource_aws_lb_target_group_attachment_test.go +++ b/aws/resource_aws_lb_target_group_attachment_test.go @@ -18,6 +18,7 @@ func TestAccAWSLBTargetGroupAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ @@ -35,6 +36,7 @@ func TestAccAWSLBTargetGroupAttachment_disappears(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ @@ -55,6 +57,7 @@ func TestAccAWSLBTargetGroupAttachment_BackwardsCompatibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ @@ -73,6 +76,7 @@ func TestAccAWSLBTargetGroupAttachment_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ @@ -91,6 +95,7 @@ func TestAccAWSLBTargetGroupAttachment_ipAddress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ @@ -109,6 +114,7 @@ func TestAccAWSLBTargetGroupAttachment_lambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ From e9aeba3f654ae8f2265db345c7403cd36833ac50 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:38:54 -0400 Subject: [PATCH 0612/1252] tests/ds/lb: Add ErrorCheck --- aws/data_source_aws_lb_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_lb_test.go b/aws/data_source_aws_lb_test.go index 4e7b18db73f..d7ae474fbe2 100644 --- a/aws/data_source_aws_lb_test.go +++ b/aws/data_source_aws_lb_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSLB_basic(t *testing.T) { resourceName := "aws_lb.alb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBConfigBasic(lbName), @@ -61,8 +63,9 @@ func TestAccDataSourceAWSLB_outpost(t *testing.T) { resourceName := "aws_lb.alb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBConfigOutpost(lbName), @@ -95,8 +98,9 @@ func TestAccDataSourceAWSLB_BackwardsCompatibility(t *testing.T) { resourceName := "aws_alb.alb_test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBConfigBackardsCompatibility(lbName), From 8eeb33082c4c5060bc8403537ccacb45af708cbe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:39:06 -0400 Subject: [PATCH 0613/1252] tests/ds/lb_listener: Add ErrorCheck --- aws/data_source_aws_lb_listener_test.go | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_lb_listener_test.go b/aws/data_source_aws_lb_listener_test.go index 7247ac2d94e..b15f0336c30 100644 --- a/aws/data_source_aws_lb_listener_test.go +++ b/aws/data_source_aws_lb_listener_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAWSLBListener_basic(t *testing.T) { targetGroupName := fmt.Sprintf("testtargetgroup-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBListenerConfigBasic(lbName, targetGroupName), @@ -44,8 +46,9 @@ func TestAccDataSourceAWSLBListener_BackwardsCompatibility(t *testing.T) { targetGroupName := fmt.Sprintf("testtargetgroup-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBListenerConfigBackwardsCompatibility(lbName, targetGroupName), @@ -77,8 +80,9 @@ func TestAccDataSourceAWSLBListener_https(t *testing.T) { certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBListenerConfigHTTPS(lbName, targetGroupName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)), @@ -113,8 +117,9 @@ func TestAccDataSourceAWSLBListener_DefaultAction_Forward(t *testing.T) { resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBListenerConfigDefaultActionForward(rName), From c1fdc0b85140bcf4efb3045b17a8ad5ac8aead88 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:39:18 -0400 Subject: [PATCH 0614/1252] tests/ds/lb_target_group: Add ErrorCheck --- aws/data_source_aws_lb_target_group_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_lb_target_group_test.go b/aws/data_source_aws_lb_target_group_test.go index 2bf0191f30c..388cd5706f1 100644 --- a/aws/data_source_aws_lb_target_group_test.go +++ b/aws/data_source_aws_lb_target_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elbv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSALBTargetGroup_basic(t *testing.T) { resourceName := "data.aws_lb_target_group.alb_tg_test_with_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBTargetGroupConfigBasic(lbName, targetGroupName), @@ -76,8 +78,9 @@ func TestAccDataSourceAWSLBTargetGroup_BackwardsCompatibility(t *testing.T) { resourceName := "data.aws_alb_target_group.alb_tg_test_with_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elbv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSLBTargetGroupConfigBackwardsCompatibility(lbName, targetGroupName), From 7b52c07149780d9de01f93fc69ccb511a20aeded Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:41:39 -0400 Subject: [PATCH 0615/1252] tests/r/guardduty_detector: Add ErrorCheck --- aws/resource_aws_guardduty_detector_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_guardduty_detector_test.go b/aws/resource_aws_guardduty_detector_test.go index e41b211b667..cdb38919126 100644 --- a/aws/resource_aws_guardduty_detector_test.go +++ b/aws/resource_aws_guardduty_detector_test.go @@ -72,6 +72,7 @@ func testAccAwsGuardDutyDetector_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyDetectorDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func testAccAwsGuardDutyDetector_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyDetectorDestroy, Steps: []resource.TestStep{ From f33d3bcc6ac31376f7bf99369b37c786595b9ea0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:41:49 -0400 Subject: [PATCH 0616/1252] tests/r/guardduty_filter: Add ErrorCheck --- aws/resource_aws_guardduty_filter_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_guardduty_filter_test.go b/aws/resource_aws_guardduty_filter_test.go index 44b5b4d62f2..2d80d7d7736 100644 --- a/aws/resource_aws_guardduty_filter_test.go +++ b/aws/resource_aws_guardduty_filter_test.go @@ -21,6 +21,7 @@ func testAccAwsGuardDutyFilter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyFilterDestroy, Steps: []resource.TestStep{ @@ -86,6 +87,7 @@ func testAccAwsGuardDutyFilter_update(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyFilterDestroy, Steps: []resource.TestStep{ @@ -129,6 +131,7 @@ func testAccAwsGuardDutyFilter_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyFilterDestroy, Steps: []resource.TestStep{ @@ -169,6 +172,7 @@ func testAccAwsGuardDutyFilter_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ From 16fa2d01b0018af3149c9408a2c3b89ccb01a300 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:41:59 -0400 Subject: [PATCH 0617/1252] tests/r/guardduty_invite_accepter: Add ErrorCheck --- aws/resource_aws_guardduty_invite_accepter_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_guardduty_invite_accepter_test.go b/aws/resource_aws_guardduty_invite_accepter_test.go index 588a6210cf3..61540719ffa 100644 --- a/aws/resource_aws_guardduty_invite_accepter_test.go +++ b/aws/resource_aws_guardduty_invite_accepter_test.go @@ -23,6 +23,7 @@ func testAccAwsGuardDutyInviteAccepter_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsGuardDutyInviteAccepterDestroy, Steps: []resource.TestStep{ From 2cb225a09943faee154663322fa38d66190898c1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:42:09 -0400 Subject: [PATCH 0618/1252] tests/r/guardduty_ipset: Add ErrorCheck --- aws/resource_aws_guardduty_ipset_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_guardduty_ipset_test.go b/aws/resource_aws_guardduty_ipset_test.go index fe1cdd0077b..fd4cb7e5089 100644 --- a/aws/resource_aws_guardduty_ipset_test.go +++ b/aws/resource_aws_guardduty_ipset_test.go @@ -22,6 +22,7 @@ func testAccAwsGuardDutyIpset_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyIpsetDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func testAccAwsGuardDutyIpset_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyIpsetDestroy, Steps: []resource.TestStep{ From d9f027b79b738915a6944dcb2f3555b7899ecb8c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:42:18 -0400 Subject: [PATCH 0619/1252] tests/r/guardduty_member: Add ErrorCheck --- aws/resource_aws_guardduty_member_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_guardduty_member_test.go b/aws/resource_aws_guardduty_member_test.go index 943fe8b2c09..0ee8172e143 100644 --- a/aws/resource_aws_guardduty_member_test.go +++ b/aws/resource_aws_guardduty_member_test.go @@ -17,6 +17,7 @@ func testAccAwsGuardDutyMember_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyMemberDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func testAccAwsGuardDutyMember_invite_disassociate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyMemberDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func testAccAwsGuardDutyMember_invite_onUpdate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyMemberDestroy, Steps: []resource.TestStep{ @@ -122,6 +125,7 @@ func testAccAwsGuardDutyMember_invitationMessage(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyMemberDestroy, Steps: []resource.TestStep{ From c4ff3fd85bf9a96ae67d5775c8c0d6ab95a093ca Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:42:28 -0400 Subject: [PATCH 0620/1252] tests/r/guardduty_organization_admin_account: Add ErrorCheck --- aws/resource_aws_guardduty_organization_admin_account_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_guardduty_organization_admin_account_test.go b/aws/resource_aws_guardduty_organization_admin_account_test.go index c84baad899a..f8b1559fff1 100644 --- a/aws/resource_aws_guardduty_organization_admin_account_test.go +++ b/aws/resource_aws_guardduty_organization_admin_account_test.go @@ -17,6 +17,7 @@ func testAccAwsGuardDutyOrganizationAdminAccount_basic(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyOrganizationAdminAccountDestroy, Steps: []resource.TestStep{ From e142c04d1f4cfedf5eb1760413f8f3ea881b1c13 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:42:40 -0400 Subject: [PATCH 0621/1252] tests/r/guardduty_organization_configuration: Add ErrorCheck --- aws/resource_aws_guardduty_organization_configuration_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_guardduty_organization_configuration_test.go b/aws/resource_aws_guardduty_organization_configuration_test.go index 7efdefc5176..5d31055cf7b 100644 --- a/aws/resource_aws_guardduty_organization_configuration_test.go +++ b/aws/resource_aws_guardduty_organization_configuration_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,7 +17,8 @@ func testAccAwsGuardDutyOrganizationConfiguration_basic(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), + Providers: testAccProviders, // GuardDuty Organization Configuration cannot be deleted separately. // Ensure parent resource is destroyed instead. CheckDestroy: testAccCheckAwsGuardDutyDetectorDestroy, From ea7edc062cfc1fd0e517047109e398fa464dae4e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:42:53 -0400 Subject: [PATCH 0622/1252] tests/r/guardduty_publishing_destination: Add ErrorCheck --- aws/resource_aws_guardduty_publishing_destination_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_guardduty_publishing_destination_test.go b/aws/resource_aws_guardduty_publishing_destination_test.go index a05c13d9396..9e3aefeec07 100644 --- a/aws/resource_aws_guardduty_publishing_destination_test.go +++ b/aws/resource_aws_guardduty_publishing_destination_test.go @@ -87,6 +87,7 @@ func testAccAwsGuardDutyPublishingDestination_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyPublishingDestinationDestroy, Steps: []resource.TestStep{ @@ -114,6 +115,7 @@ func testAccAwsGuardDutyPublishingDestination_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyPublishingDestinationDestroy, Steps: []resource.TestStep{ From bceeab5eb938c4a366b30167b007088a5182f3b0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:43:04 -0400 Subject: [PATCH 0623/1252] tests/r/guardduty_threatintelset: Add ErrorCheck --- aws/resource_aws_guardduty_threatintelset_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_guardduty_threatintelset_test.go b/aws/resource_aws_guardduty_threatintelset_test.go index 8a0769a689e..4b0a6fa848b 100644 --- a/aws/resource_aws_guardduty_threatintelset_test.go +++ b/aws/resource_aws_guardduty_threatintelset_test.go @@ -22,6 +22,7 @@ func testAccAwsGuardDutyThreatintelset_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyThreatintelsetDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func testAccAwsGuardDutyThreatintelset_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsGuardDutyThreatintelsetDestroy, Steps: []resource.TestStep{ From ba77bb1f43b344a0656fc9f9bd86ef0e796a1bf3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 19:43:16 -0400 Subject: [PATCH 0624/1252] tests/ds/guardduty_detector: Add ErrorCheck --- aws/data_source_aws_guardduty_detector_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_guardduty_detector_test.go b/aws/data_source_aws_guardduty_detector_test.go index bccba21cce0..79dec12b641 100644 --- a/aws/data_source_aws_guardduty_detector_test.go +++ b/aws/data_source_aws_guardduty_detector_test.go @@ -3,12 +3,14 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/guardduty" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func testAccAWSGuarddutyDetectorDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), Providers: testAccProviders, PreventPostDestroyRefresh: true, Steps: []resource.TestStep{ @@ -31,8 +33,9 @@ func testAccAWSGuarddutyDetectorDataSource_basic(t *testing.T) { func testAccAWSGuarddutyDetectorDataSource_Id(t *testing.T) { resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, guardduty.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsGuarddutyDetectorExplicitConfig(), From 34a47861484ee6237b5622d0cf58fb0d7c7d5494 Mon Sep 17 00:00:00 2001 From: Simon Davis Date: Thu, 18 Mar 2021 16:47:15 -0700 Subject: [PATCH 0625/1252] Update CHANGELOG.md after release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4423156a3be..c0374df7c75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 3.34.0 (Unreleased) + ## 3.33.0 (March 18, 2021) NOTES: From e150eeb9f6f703507da4e719aeb5add7d060f270 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:03:00 -0400 Subject: [PATCH 0626/1252] tests/r/kms_alias: Add ErrorCheck --- aws/resource_aws_kms_alias_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_kms_alias_test.go b/aws/resource_aws_kms_alias_test.go index f67f27ae2a8..810ea7e511b 100644 --- a/aws/resource_aws_kms_alias_test.go +++ b/aws/resource_aws_kms_alias_test.go @@ -5,6 +5,7 @@ import ( "testing" "time" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -17,6 +18,7 @@ func TestAccAWSKmsAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsAliasDestroy, Steps: []resource.TestStep{ @@ -49,6 +51,7 @@ func TestAccAWSKmsAlias_name_prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsAliasDestroy, Steps: []resource.TestStep{ @@ -75,6 +78,7 @@ func TestAccAWSKmsAlias_no_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsAliasDestroy, Steps: []resource.TestStep{ @@ -101,6 +105,7 @@ func TestAccAWSKmsAlias_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsAliasDestroy, Steps: []resource.TestStep{ @@ -129,6 +134,7 @@ func TestAccAWSKmsAlias_ArnDiffSuppress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsAliasDestroy, Steps: []resource.TestStep{ From 453fbfef094212f70c52f4ba14c74da53faa601a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:03:10 -0400 Subject: [PATCH 0627/1252] tests/r/kms_ciphertext: Add ErrorCheck --- aws/resource_aws_kms_ciphertext_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_kms_ciphertext_test.go b/aws/resource_aws_kms_ciphertext_test.go index bb675ad4492..59d3b01e648 100644 --- a/aws/resource_aws_kms_ciphertext_test.go +++ b/aws/resource_aws_kms_ciphertext_test.go @@ -3,12 +3,14 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccResourceAwsKmsCiphertext_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -29,6 +31,7 @@ func TestAccResourceAwsKmsCiphertext_validate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -49,6 +52,7 @@ func TestAccResourceAwsKmsCiphertext_validate_withContext(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 365affd780bbec79cec6c67f7c745746d7c07a9e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:03:21 -0400 Subject: [PATCH 0628/1252] tests/r/kms_external_key: Add ErrorCheck --- aws/resource_aws_kms_external_key_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_kms_external_key_test.go b/aws/resource_aws_kms_external_key_test.go index e306eac0d50..dd5fda2094d 100644 --- a/aws/resource_aws_kms_external_key_test.go +++ b/aws/resource_aws_kms_external_key_test.go @@ -20,6 +20,7 @@ func TestAccAWSKmsExternalKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -58,6 +59,7 @@ func TestAccAWSKmsExternalKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSKmsExternalKey_DeletionWindowInDays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func TestAccAWSKmsExternalKey_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -153,6 +157,7 @@ func TestAccAWSKmsExternalKey_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -198,6 +203,7 @@ func TestAccAWSKmsExternalKey_KeyMaterialBase64(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -239,6 +245,7 @@ func TestAccAWSKmsExternalKey_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -276,6 +283,7 @@ func TestAccAWSKmsExternalKey_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ @@ -327,6 +335,7 @@ func TestAccAWSKmsExternalKey_ValidTo(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsExternalKeyDestroy, Steps: []resource.TestStep{ From 0a325d8dbc49e2ce577152565ce4bd7b07a81600 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:03:32 -0400 Subject: [PATCH 0629/1252] tests/r/kms_grant: Add ErrorCheck --- aws/resource_aws_kms_grant_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_kms_grant_test.go b/aws/resource_aws_kms_grant_test.go index 0f189298532..28df984cfc2 100644 --- a/aws/resource_aws_kms_grant_test.go +++ b/aws/resource_aws_kms_grant_test.go @@ -17,6 +17,7 @@ func TestAccAWSKmsGrant_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSKmsGrant_withConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -95,6 +97,7 @@ func TestAccAWSKmsGrant_withRetiringPrincipal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -121,6 +124,7 @@ func TestAccAWSKmsGrant_bare(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -149,6 +153,7 @@ func TestAccAWSKmsGrant_ARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -180,6 +185,7 @@ func TestAccAWSKmsGrant_AsymmetricKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ @@ -205,6 +211,7 @@ func TestAccAWSKmsGrant_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsGrantDestroy, Steps: []resource.TestStep{ From 57c717d06003596eb4423d6018f0ff6d224d16b1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:03:42 -0400 Subject: [PATCH 0630/1252] tests/r/kms_key: Add ErrorCheck --- aws/resource_aws_kms_key_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_kms_key_test.go b/aws/resource_aws_kms_key_test.go index c4be79ad2c3..300f0ffffb2 100644 --- a/aws/resource_aws_kms_key_test.go +++ b/aws/resource_aws_kms_key_test.go @@ -74,6 +74,7 @@ func TestAccAWSKmsKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -102,6 +103,7 @@ func TestAccAWSKmsKey_asymmetricKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -124,6 +126,7 @@ func TestAccAWSKmsKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -147,6 +150,7 @@ func TestAccAWSKmsKey_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -180,6 +184,7 @@ func TestAccAWSKmsKey_Policy_IamRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -207,6 +212,7 @@ func TestAccAWSKmsKey_Policy_IamServiceLinkedRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -233,6 +239,7 @@ func TestAccAWSKmsKey_isEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ @@ -280,6 +287,7 @@ func TestAccAWSKmsKey_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ From f741b4e97289781d4b870f71278666b047ef3cc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:04:06 -0400 Subject: [PATCH 0631/1252] tests/ds/kms_alias: Add ErrorCheck --- aws/data_source_aws_kms_alias_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_kms_alias_test.go b/aws/data_source_aws_kms_alias_test.go index 0964dfe5e64..f4eed540139 100644 --- a/aws/data_source_aws_kms_alias_test.go +++ b/aws/data_source_aws_kms_alias_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -15,8 +16,9 @@ func TestAccDataSourceAwsKmsAlias_AwsService(t *testing.T) { resourceName := "data.aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsAlias_name(name), @@ -38,8 +40,9 @@ func TestAccDataSourceAwsKmsAlias_CMK(t *testing.T) { datasourceAliasResourceName := "data.aws_kms_alias.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsAlias_CMK(rInt), From 139de1bf1ed7a35178561ddab1b6274f9aab2623 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:04:19 -0400 Subject: [PATCH 0632/1252] tests/ds/kms_ciphertext: Add ErrorCheck --- aws/data_source_aws_kms_ciphertext_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_kms_ciphertext_test.go b/aws/data_source_aws_kms_ciphertext_test.go index b29aea85ac4..66395e47591 100644 --- a/aws/data_source_aws_kms_ciphertext_test.go +++ b/aws/data_source_aws_kms_ciphertext_test.go @@ -3,13 +3,15 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccDataSourceAwsKmsCiphertext_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsCiphertextConfig_basic, @@ -24,8 +26,9 @@ func TestAccDataSourceAwsKmsCiphertext_basic(t *testing.T) { func TestAccDataSourceAwsKmsCiphertext_validate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsCiphertextConfig_validate, @@ -40,8 +43,9 @@ func TestAccDataSourceAwsKmsCiphertext_validate(t *testing.T) { func TestAccDataSourceAwsKmsCiphertext_validate_withContext(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsCiphertextConfig_validate_withContext, From 9e69511f738cd7e6b7c77343bf7c1c5bad5c9491 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:04:31 -0400 Subject: [PATCH 0633/1252] tests/ds/kms_key: Add ErrorCheck --- aws/data_source_aws_kms_key_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_kms_key_test.go b/aws/data_source_aws_kms_key_test.go index 4f374ed25a7..63249d6d5f2 100644 --- a/aws/data_source_aws_kms_key_test.go +++ b/aws/data_source_aws_kms_key_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -15,8 +16,9 @@ func TestAccDataSourceAwsKmsKey_basic(t *testing.T) { rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandString(13)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsKmsKeyConfig(rName), From d30c3e15327ba10ed2b816eb9a39f6ea6f6c05c4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:04:44 -0400 Subject: [PATCH 0634/1252] tests/ds/kms_secrets: Add ErrorCheck --- aws/data_source_aws_kms_secrets_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_kms_secrets_test.go b/aws/data_source_aws_kms_secrets_test.go index c6e6cae242d..e74d5417931 100644 --- a/aws/data_source_aws_kms_secrets_test.go +++ b/aws/data_source_aws_kms_secrets_test.go @@ -20,8 +20,9 @@ func TestAccAWSKmsSecretsDataSource_basic(t *testing.T) { // Run a resource test to setup our KMS key resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsKmsSecretsDataSourceKey, @@ -64,8 +65,9 @@ func testAccDataSourceAwsKmsSecretsDecrypt(t *testing.T, plaintext string, encry dataSourceName := "data.aws_kms_secrets.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsKmsSecretsDataSourceSecret(*encryptedPayload), From 1f7b754cfd5c513d2fa3e4896f86641b90a0dd94 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:06:50 -0400 Subject: [PATCH 0635/1252] tests/r/redshift_cluster: Add ErrorCheck --- aws/resource_aws_redshift_cluster_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_redshift_cluster_test.go b/aws/resource_aws_redshift_cluster_test.go index 3c9aad7fe63..2b269b46022 100644 --- a/aws/resource_aws_redshift_cluster_test.go +++ b/aws/resource_aws_redshift_cluster_test.go @@ -68,6 +68,7 @@ func TestAccAWSRedshiftCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func TestAccAWSRedshiftCluster_withFinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterSnapshot(rInt), Steps: []resource.TestStep{ @@ -136,6 +138,7 @@ func TestAccAWSRedshiftCluster_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -171,6 +174,7 @@ func TestAccAWSRedshiftCluster_enhancedVpcRoutingEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -210,6 +214,7 @@ func TestAccAWSRedshiftCluster_loggingEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -255,6 +260,7 @@ func TestAccAWSRedshiftCluster_snapshotCopy(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -289,6 +295,7 @@ func TestAccAWSRedshiftCluster_iamRoles(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -319,6 +326,7 @@ func TestAccAWSRedshiftCluster_publiclyAccessible(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -352,6 +360,7 @@ func TestAccAWSRedshiftCluster_updateNodeCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -389,6 +398,7 @@ func TestAccAWSRedshiftCluster_updateNodeType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -426,6 +436,7 @@ func TestAccAWSRedshiftCluster_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -461,6 +472,7 @@ func TestAccAWSRedshiftCluster_forceNewUsername(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -494,6 +506,7 @@ func TestAccAWSRedshiftCluster_changeAvailabilityZone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -525,6 +538,7 @@ func TestAccAWSRedshiftCluster_changeEncryption1(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ @@ -557,6 +571,7 @@ func TestAccAWSRedshiftCluster_changeEncryption2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftClusterDestroy, Steps: []resource.TestStep{ From fa08c1fe1bd548f56538e363fde9e2590b5070eb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:07:10 -0400 Subject: [PATCH 0636/1252] tests/r/redshift_event_subscription: Add ErrorCheck --- aws/resource_aws_redshift_event_subscription_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_redshift_event_subscription_test.go b/aws/resource_aws_redshift_event_subscription_test.go index 22b33486e35..446fcb38645 100644 --- a/aws/resource_aws_redshift_event_subscription_test.go +++ b/aws/resource_aws_redshift_event_subscription_test.go @@ -71,6 +71,7 @@ func TestAccAWSRedshiftEventSubscription_basicUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -111,6 +112,7 @@ func TestAccAWSRedshiftEventSubscription_withPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -144,6 +146,7 @@ func TestAccAWSRedshiftEventSubscription_withSourceIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -191,6 +194,7 @@ func TestAccAWSRedshiftEventSubscription_categoryUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -232,6 +236,7 @@ func TestAccAWSRedshiftEventSubscription_tagsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftEventSubscriptionDestroy, Steps: []resource.TestStep{ From da6942f1861f2fb4d4ccabb7eb13bc8588d5b60f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:07:20 -0400 Subject: [PATCH 0637/1252] tests/r/redshift_parameter_group: Add ErrorCheck --- aws/resource_aws_redshift_parameter_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_redshift_parameter_group_test.go b/aws/resource_aws_redshift_parameter_group_test.go index 5be1bdd5493..2dff133a96c 100644 --- a/aws/resource_aws_redshift_parameter_group_test.go +++ b/aws/resource_aws_redshift_parameter_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSRedshiftParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftParameterGroupDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAWSRedshiftParameterGroup_withParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftParameterGroupDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSRedshiftParameterGroup_withoutParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftParameterGroupDestroy, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func TestAccAWSRedshiftParameterGroup_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftParameterGroupDestroy, Steps: []resource.TestStep{ From 94c981fa5f75080255f772b97f9f5603f0197311 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:07:32 -0400 Subject: [PATCH 0638/1252] tests/r/redshift_security_group: Add ErrorCheck --- aws/resource_aws_redshift_security_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_redshift_security_group_test.go b/aws/resource_aws_redshift_security_group_test.go index 36aeedd653c..96284e92282 100644 --- a/aws/resource_aws_redshift_security_group_test.go +++ b/aws/resource_aws_redshift_security_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSRedshiftSecurityGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAWSRedshiftSecurityGroup_ingressCidr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSRedshiftSecurityGroup_updateIngressCidr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -121,6 +124,7 @@ func TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ @@ -152,6 +156,7 @@ func TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSRedshiftSecurityGroupDestroy, Steps: []resource.TestStep{ From 4527c22c340f57d7258ccc73ea50115309246b48 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:07:46 -0400 Subject: [PATCH 0639/1252] tests/r/redshift_snapshot_copy_grant: Add ErrorCheck --- aws/resource_aws_redshift_snapshot_copy_grant_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_redshift_snapshot_copy_grant_test.go b/aws/resource_aws_redshift_snapshot_copy_grant_test.go index 28e546d773a..b7c6092e5de 100644 --- a/aws/resource_aws_redshift_snapshot_copy_grant_test.go +++ b/aws/resource_aws_redshift_snapshot_copy_grant_test.go @@ -17,6 +17,7 @@ func TestAccAWSRedshiftSnapshotCopyGrant_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotCopyGrantDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAWSRedshiftSnapshotCopyGrant_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotCopyGrantDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSRedshiftSnapshotCopyGrant_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotCopyGrantDestroy, Steps: []resource.TestStep{ From 586114ed94115aa69bc47b4ce0d3aa7ffcb45273 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:07:59 -0400 Subject: [PATCH 0640/1252] tests/r/redshift_snapshot_schedule: Add ErrorCheck --- aws/resource_aws_redshift_snapshot_schedule_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_redshift_snapshot_schedule_test.go b/aws/resource_aws_redshift_snapshot_schedule_test.go index 950cbec2d07..7877c2a047f 100644 --- a/aws/resource_aws_redshift_snapshot_schedule_test.go +++ b/aws/resource_aws_redshift_snapshot_schedule_test.go @@ -84,6 +84,7 @@ func TestAccAWSRedshiftSnapshotSchedule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSRedshiftSnapshotSchedule_withMultipleDefinition(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ @@ -158,6 +160,7 @@ func TestAccAWSRedshiftSnapshotSchedule_withIdentifierPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ @@ -188,6 +191,7 @@ func TestAccAWSRedshiftSnapshotSchedule_withDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ @@ -219,6 +223,7 @@ func TestAccAWSRedshiftSnapshotSchedule_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ @@ -262,6 +267,7 @@ func TestAccAWSRedshiftSnapshotSchedule_withForceDestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleDestroy, Steps: []resource.TestStep{ From a640af5e7f07ee9c1b1d09181a3b7541de14907a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:08:11 -0400 Subject: [PATCH 0641/1252] tests/r/redshift_snapshot_schedule_association: Add ErrorCheck --- aws/resource_aws_redshift_snapshot_schedule_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_redshift_snapshot_schedule_association_test.go b/aws/resource_aws_redshift_snapshot_schedule_association_test.go index e053bca0953..9f8b3e0c053 100644 --- a/aws/resource_aws_redshift_snapshot_schedule_association_test.go +++ b/aws/resource_aws_redshift_snapshot_schedule_association_test.go @@ -20,6 +20,7 @@ func TestAccAWSRedshiftSnapshotScheduleAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRedshiftSnapshotScheduleAssociationDestroy, Steps: []resource.TestStep{ From 132826835a6affbc6c0345599b25da21d4a22e34 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:08:37 -0400 Subject: [PATCH 0642/1252] tests/r/redshift_subnet_group: Add ErrorCheck --- aws/resource_aws_redshift_subnet_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_redshift_subnet_group_test.go b/aws/resource_aws_redshift_subnet_group_test.go index 39b5d138c16..dcd47e605e4 100644 --- a/aws/resource_aws_redshift_subnet_group_test.go +++ b/aws/resource_aws_redshift_subnet_group_test.go @@ -85,6 +85,7 @@ func TestAccAWSRedshiftSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSRedshiftSubnetGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -138,6 +140,7 @@ func TestAccAWSRedshiftSubnetGroup_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -175,6 +178,7 @@ func TestAccAWSRedshiftSubnetGroup_updateSubnetIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -212,6 +216,7 @@ func TestAccAWSRedshiftSubnetGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRedshiftSubnetGroupDestroy, Steps: []resource.TestStep{ From 462e5b4e4a52ddd4abf17f086182923ca6a722ee Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:08:50 -0400 Subject: [PATCH 0643/1252] tests/ds/redshift_cluster: Add ErrorCheck --- aws/data_source_aws_redshift_cluster_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_redshift_cluster_test.go b/aws/data_source_aws_redshift_cluster_test.go index 5d91358d91e..34fd5c2f130 100644 --- a/aws/data_source_aws_redshift_cluster_test.go +++ b/aws/data_source_aws_redshift_cluster_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/redshift" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,8 +12,9 @@ import ( func TestAccAWSDataSourceRedshiftCluster_basic(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceRedshiftClusterConfig(rInt), @@ -44,8 +46,9 @@ func TestAccAWSDataSourceRedshiftCluster_basic(t *testing.T) { func TestAccAWSDataSourceRedshiftCluster_vpc(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceRedshiftClusterConfigWithVpc(rInt), @@ -63,8 +66,9 @@ func TestAccAWSDataSourceRedshiftCluster_vpc(t *testing.T) { func TestAccAWSDataSourceRedshiftCluster_logging(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSDataSourceRedshiftClusterConfigWithLogging(rInt), From b839427b5e824b3c26377909cb42addb66ff844e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:09:03 -0400 Subject: [PATCH 0644/1252] tests/ds/redshift_orderable_cluster: Add ErrorCheck --- aws/data_source_aws_redshift_orderable_cluster_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_redshift_orderable_cluster_test.go b/aws/data_source_aws_redshift_orderable_cluster_test.go index 48ba04454c0..6b0d606d7a5 100644 --- a/aws/data_source_aws_redshift_orderable_cluster_test.go +++ b/aws/data_source_aws_redshift_orderable_cluster_test.go @@ -14,6 +14,7 @@ func TestAccAWSRedshiftOrderableClusterDataSource_ClusterType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRedshiftOrderableClusterPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -32,6 +33,7 @@ func TestAccAWSRedshiftOrderableClusterDataSource_ClusterVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRedshiftOrderableClusterPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -51,6 +53,7 @@ func TestAccAWSRedshiftOrderableClusterDataSource_NodeType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRedshiftOrderableClusterPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -70,6 +73,7 @@ func TestAccAWSRedshiftOrderableClusterDataSource_PreferredNodeTypes(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSRedshiftOrderableClusterPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 4fe02e17f72c3673020bd1e61b636b13df04424d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:10:20 -0400 Subject: [PATCH 0645/1252] tests/r/storagegateway_cache: Add ErrorCheck --- aws/resource_aws_storagegateway_cache_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_storagegateway_cache_test.go b/aws/resource_aws_storagegateway_cache_test.go index e29a156a664..0b4fd6053ae 100644 --- a/aws/resource_aws_storagegateway_cache_test.go +++ b/aws/resource_aws_storagegateway_cache_test.go @@ -73,8 +73,9 @@ func TestAccAWSStorageGatewayCache_FileGateway(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), + Providers: testAccProviders, // Storage Gateway API does not support removing caches, // but we want to ensure other resources are removed. CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, @@ -102,8 +103,9 @@ func TestAccAWSStorageGatewayCache_TapeAndVolumeGateway(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), + Providers: testAccProviders, // Storage Gateway API does not support removing caches, // but we want to ensure other resources are removed. CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, From d1c22a23c44cad79151d8e208ceccff550972d6e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:10:30 -0400 Subject: [PATCH 0646/1252] tests/r/storagegateway_cached_iscsi_volume: Add ErrorCheck --- aws/resource_aws_storagegateway_cached_iscsi_volume_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go b/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go index efa074b30ac..fe6483aaea3 100644 --- a/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go +++ b/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go @@ -75,6 +75,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -114,6 +115,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_kms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -141,6 +143,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -188,6 +191,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_SnapshotId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -226,6 +230,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_SourceVolumeArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -263,6 +268,7 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, Steps: []resource.TestStep{ From ef97b8fe6a139f47a6865f339975abb4d9fae590 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:10:40 -0400 Subject: [PATCH 0647/1252] tests/r/storagegateway_gateway: Add ErrorCheck --- ...resource_aws_storagegateway_gateway_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/aws/resource_aws_storagegateway_gateway_test.go b/aws/resource_aws_storagegateway_gateway_test.go index f7184d4c04f..c81371ffd18 100644 --- a/aws/resource_aws_storagegateway_gateway_test.go +++ b/aws/resource_aws_storagegateway_gateway_test.go @@ -69,6 +69,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Cached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -110,6 +111,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_FileS3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Stored(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Vtl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -228,6 +232,7 @@ func TestAccAWSStorageGatewayGateway_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -275,6 +280,7 @@ func TestAccAWSStorageGatewayGateway_GatewayName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -310,6 +316,7 @@ func TestAccAWSStorageGatewayGateway_CloudWatchLogs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -337,6 +344,7 @@ func TestAccAWSStorageGatewayGateway_GatewayTimezone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -372,6 +380,7 @@ func TestAccAWSStorageGatewayGateway_GatewayVpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -399,6 +408,7 @@ func TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -429,6 +439,7 @@ func TestAccAWSStorageGatewayGateway_SmbActiveDirectorySettings_timeout(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -458,6 +469,7 @@ func TestAccAWSStorageGatewayGateway_SmbGuestPassword(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -492,6 +504,7 @@ func TestAccAWSStorageGatewayGateway_SMBSecurityStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -527,6 +540,7 @@ func TestAccAWSStorageGatewayGateway_SMBVisibility(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -568,6 +582,7 @@ func TestAccAWSStorageGatewayGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -590,6 +605,7 @@ func TestAccAWSStorageGatewayGateway_bandwidthUpload(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -631,6 +647,7 @@ func TestAccAWSStorageGatewayGateway_bandwidthDownload(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -672,6 +689,7 @@ func TestAccAWSStorageGatewayGateway_bandwidthAll(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ From 43b4b3e46f13850301e214f0c7de710abba99223 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:10:50 -0400 Subject: [PATCH 0648/1252] tests/r/storagegateway_nfs_file_share: Add ErrorCheck --- ...rce_aws_storagegateway_nfs_file_share_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aws/resource_aws_storagegateway_nfs_file_share_test.go b/aws/resource_aws_storagegateway_nfs_file_share_test.go index 5176a1467b4..fa7319e0d7c 100644 --- a/aws/resource_aws_storagegateway_nfs_file_share_test.go +++ b/aws/resource_aws_storagegateway_nfs_file_share_test.go @@ -22,6 +22,7 @@ func TestAccAWSStorageGatewayNfsFileShare_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -68,6 +69,7 @@ func TestAccAWSStorageGatewayNfsFileShare_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -115,6 +117,7 @@ func TestAccAWSStorageGatewayNfsFileShare_fileShareName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -148,6 +151,7 @@ func TestAccAWSStorageGatewayNfsFileShare_ClientList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -192,6 +196,7 @@ func TestAccAWSStorageGatewayNfsFileShare_DefaultStorageClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -225,6 +230,7 @@ func TestAccAWSStorageGatewayNfsFileShare_GuessMIMETypeEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -258,6 +264,7 @@ func TestAccAWSStorageGatewayNfsFileShare_KMSEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -290,6 +297,7 @@ func TestAccAWSStorageGatewayNfsFileShare_KMSKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -332,6 +340,7 @@ func TestAccAWSStorageGatewayNfsFileShare_NFSFileShareDefaults(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -373,6 +382,7 @@ func TestAccAWSStorageGatewayNfsFileShare_ObjectACL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -406,6 +416,7 @@ func TestAccAWSStorageGatewayNfsFileShare_ReadOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -439,6 +450,7 @@ func TestAccAWSStorageGatewayNfsFileShare_RequesterPays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -472,6 +484,7 @@ func TestAccAWSStorageGatewayNfsFileShare_Squash(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -505,6 +518,7 @@ func TestAccAWSStorageGatewayNfsFileShare_notificationPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -545,6 +559,7 @@ func TestAccAWSStorageGatewayNfsFileShare_cacheAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ @@ -588,6 +603,7 @@ func TestAccAWSStorageGatewayNfsFileShare_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, Steps: []resource.TestStep{ From 255ec6e02d6b7c73d60ead570cd2186db690040e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:11:03 -0400 Subject: [PATCH 0649/1252] tests/r/storagegateway_smb_file_share: Add ErrorCheck --- ..._aws_storagegateway_smb_file_share_test.go | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/aws/resource_aws_storagegateway_smb_file_share_test.go b/aws/resource_aws_storagegateway_smb_file_share_test.go index aa9ada6cef7..c0a27f6e37e 100644 --- a/aws/resource_aws_storagegateway_smb_file_share_test.go +++ b/aws/resource_aws_storagegateway_smb_file_share_test.go @@ -22,6 +22,7 @@ func TestAccAWSStorageGatewaySmbFileShare_Authentication_ActiveDirectory(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAWSStorageGatewaySmbFileShare_Authentication_GuestAccess(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -116,6 +118,7 @@ func TestAccAWSStorageGatewaySmbFileShare_accessBasedEnumeration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -156,6 +159,7 @@ func TestAccAWSStorageGatewaySmbFileShare_notificationPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -196,6 +200,7 @@ func TestAccAWSStorageGatewaySmbFileShare_DefaultStorageClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -229,6 +234,7 @@ func TestAccAWSStorageGatewaySmbFileShare_FileShareName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -262,6 +268,7 @@ func TestAccAWSStorageGatewaySmbFileShare_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -306,6 +313,7 @@ func TestAccAWSStorageGatewaySmbFileShare_GuessMIMETypeEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -339,6 +347,7 @@ func TestAccAWSStorageGatewaySmbFileShare_InvalidUserList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -379,6 +388,7 @@ func TestAccAWSStorageGatewaySmbFileShare_KMSEncrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -411,6 +421,7 @@ func TestAccAWSStorageGatewaySmbFileShare_KMSKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -453,6 +464,7 @@ func TestAccAWSStorageGatewaySmbFileShare_ObjectACL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -486,6 +498,7 @@ func TestAccAWSStorageGatewaySmbFileShare_ReadOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -519,6 +532,7 @@ func TestAccAWSStorageGatewaySmbFileShare_RequesterPays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -552,6 +566,7 @@ func TestAccAWSStorageGatewaySmbFileShare_ValidUserList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -592,6 +607,7 @@ func TestAccAWSStorageGatewaySmbFileShare_smb_acl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -634,6 +650,7 @@ func TestAccAWSStorageGatewaySmbFileShare_audit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -667,6 +684,7 @@ func TestAccAWSStorageGatewaySmbFileShare_cacheAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -710,6 +728,7 @@ func TestAccAWSStorageGatewaySmbFileShare_caseSensitivity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -750,6 +769,7 @@ func TestAccAWSStorageGatewaySmbFileShare_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ @@ -772,6 +792,7 @@ func TestAccAWSStorageGatewaySmbFileShare_AdminUserList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, Steps: []resource.TestStep{ From a22c3806fcbf306c258839e4330d00105ca616a4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:11:16 -0400 Subject: [PATCH 0650/1252] tests/r/storagegateway_stored_iscsi_volume: Add ErrorCheck --- aws/resource_aws_storagegateway_stored_iscsi_volume_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_storagegateway_stored_iscsi_volume_test.go b/aws/resource_aws_storagegateway_stored_iscsi_volume_test.go index f617e624e83..9519ceea78f 100644 --- a/aws/resource_aws_storagegateway_stored_iscsi_volume_test.go +++ b/aws/resource_aws_storagegateway_stored_iscsi_volume_test.go @@ -19,6 +19,7 @@ func TestAccAWSStorageGatewayStoredIscsiVolume_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayStoredIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSStorageGatewayStoredIscsiVolume_kms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayStoredIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSStorageGatewayStoredIscsiVolume_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayStoredIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -134,6 +137,7 @@ func TestAccAWSStorageGatewayStoredIscsiVolume_snapshotId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayStoredIscsiVolumeDestroy, Steps: []resource.TestStep{ @@ -170,6 +174,7 @@ func TestAccAWSStorageGatewayStoredIscsiVolume_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayStoredIscsiVolumeDestroy, Steps: []resource.TestStep{ From 2deee30f63573b6eb540e15d6b48c5e7c2f24d08 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:11:28 -0400 Subject: [PATCH 0651/1252] tests/r/storagegateway_tape_pool: Add ErrorCheck --- aws/resource_aws_storagegateway_tape_pool_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_storagegateway_tape_pool_test.go b/aws/resource_aws_storagegateway_tape_pool_test.go index 2a94777c638..095dce398bc 100644 --- a/aws/resource_aws_storagegateway_tape_pool_test.go +++ b/aws/resource_aws_storagegateway_tape_pool_test.go @@ -19,6 +19,7 @@ func TestAccAWSStorageGatewayTapePool_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayTapePoolDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSStorageGatewayTapePool_retention(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayTapePoolDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSStorageGatewayTapePool_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayTapePoolDestroy, Steps: []resource.TestStep{ @@ -123,6 +126,7 @@ func TestAccAWSStorageGatewayTapePool_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayTapePoolDestroy, Steps: []resource.TestStep{ From 50003b506cc3c3044b0c2dbd72bc35cbb73ace17 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:11:41 -0400 Subject: [PATCH 0652/1252] tests/r/storagegateway_upload_buffer: Add ErrorCheck --- aws/resource_aws_storagegateway_upload_buffer_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_storagegateway_upload_buffer_test.go b/aws/resource_aws_storagegateway_upload_buffer_test.go index 2a65867545a..a1c8d939665 100644 --- a/aws/resource_aws_storagegateway_upload_buffer_test.go +++ b/aws/resource_aws_storagegateway_upload_buffer_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/storagegateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -73,8 +74,9 @@ func TestAccAWSStorageGatewayUploadBuffer_basic(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), + Providers: testAccProviders, // Storage Gateway API does not support removing upload buffers, // but we want to ensure other resources are removed. CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, From 35391fab0150aa67dd6f69734187f5306bbf1cc9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:11:53 -0400 Subject: [PATCH 0653/1252] tests/r/storagegateway_working_storage: Add ErrorCheck --- aws/resource_aws_storagegateway_working_storage_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_storagegateway_working_storage_test.go b/aws/resource_aws_storagegateway_working_storage_test.go index baaf4e80e65..aaa833c0dac 100644 --- a/aws/resource_aws_storagegateway_working_storage_test.go +++ b/aws/resource_aws_storagegateway_working_storage_test.go @@ -74,8 +74,9 @@ func TestAccAWSStorageGatewayWorkingStorage_basic(t *testing.T) { gatewayResourceName := "aws_storagegateway_gateway.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), + Providers: testAccProviders, // Storage Gateway API does not support removing working storages, // but we want to ensure other resources are removed. CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, From 2b98a86c60f2afdd743a295607bcce0c5f448b1b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:12:05 -0400 Subject: [PATCH 0654/1252] tests/ds/storagegateway_local_disk: Add ErrorCheck --- aws/data_source_aws_storagegateway_local_disk_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_storagegateway_local_disk_test.go b/aws/data_source_aws_storagegateway_local_disk_test.go index 2c37af7da9c..989f8d98218 100644 --- a/aws/data_source_aws_storagegateway_local_disk_test.go +++ b/aws/data_source_aws_storagegateway_local_disk_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/storagegateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -16,6 +17,7 @@ func TestAccAWSStorageGatewayLocalDiskDataSource_DiskNode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ @@ -40,6 +42,7 @@ func TestAccAWSStorageGatewayLocalDiskDataSource_DiskPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ From 73f59606d6c21182e861c757b702aacf9c3f8543 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:12:40 -0400 Subject: [PATCH 0655/1252] tests/r/wafv2_ip_set: Add ErrorCheck --- aws/resource_aws_wafv2_ip_set_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_wafv2_ip_set_test.go b/aws/resource_aws_wafv2_ip_set_test.go index f274eefe60a..c03de18e63f 100644 --- a/aws/resource_aws_wafv2_ip_set_test.go +++ b/aws/resource_aws_wafv2_ip_set_test.go @@ -85,6 +85,7 @@ func TestAccAwsWafv2IPSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -132,6 +133,7 @@ func TestAccAwsWafv2IPSet_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAwsWafv2IPSet_IPv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -189,6 +192,7 @@ func TestAccAwsWafv2IPSet_Minimal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -222,6 +226,7 @@ func TestAccAwsWafv2IPSet_ChangeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -260,6 +265,7 @@ func TestAccAwsWafv2IPSet_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ @@ -308,6 +314,7 @@ func TestAccAwsWafv2IPSet_Large(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2IPSetDestroy, Steps: []resource.TestStep{ From ca772febb5118677527cec0594f5113d811beac7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:12:50 -0400 Subject: [PATCH 0656/1252] tests/r/wafv2_regex_pattern_set: Add ErrorCheck --- aws/resource_aws_wafv2_regex_pattern_set_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_wafv2_regex_pattern_set_test.go b/aws/resource_aws_wafv2_regex_pattern_set_test.go index f1e82cfaa57..933e953ec9a 100644 --- a/aws/resource_aws_wafv2_regex_pattern_set_test.go +++ b/aws/resource_aws_wafv2_regex_pattern_set_test.go @@ -85,6 +85,7 @@ func TestAccAwsWafv2RegexPatternSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2RegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -144,6 +145,7 @@ func TestAccAwsWafv2RegexPatternSet_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2RegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAwsWafv2RegexPatternSet_Minimal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2RegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -192,6 +195,7 @@ func TestAccAwsWafv2RegexPatternSet_ChangeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2RegexPatternSetDestroy, Steps: []resource.TestStep{ @@ -228,6 +232,7 @@ func TestAccAwsWafv2RegexPatternSet_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2RegexPatternSetDestroy, Steps: []resource.TestStep{ From b95d18ef0128f444940451352d78540d7de029ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:13:01 -0400 Subject: [PATCH 0657/1252] tests/r/wafv2_rule_group: Add ErrorCheck --- aws/resource_aws_wafv2_rule_group_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/aws/resource_aws_wafv2_rule_group_test.go b/aws/resource_aws_wafv2_rule_group_test.go index 8bac5ed5740..9aba6423d58 100644 --- a/aws/resource_aws_wafv2_rule_group_test.go +++ b/aws/resource_aws_wafv2_rule_group_test.go @@ -84,6 +84,7 @@ func TestAccAwsWafv2RuleGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAwsWafv2RuleGroup_updateRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -187,6 +189,7 @@ func TestAccAwsWafv2RuleGroup_updateRuleProperties(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -358,6 +361,7 @@ func TestAccAwsWafv2RuleGroup_ByteMatchStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -420,6 +424,7 @@ func TestAccAwsWafv2RuleGroup_ByteMatchStatement_FieldToMatch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -583,6 +588,7 @@ func TestAccAwsWafv2RuleGroup_ChangeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -629,6 +635,7 @@ func TestAccAwsWafv2RuleGroup_ChangeCapacityForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -675,6 +682,7 @@ func TestAccAwsWafv2RuleGroup_ChangeMetricNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -721,6 +729,7 @@ func TestAccAwsWafv2RuleGroup_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -743,6 +752,7 @@ func TestAccAwsWafv2RuleGroup_GeoMatchStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -796,6 +806,7 @@ func TestAccAwsWafv2RuleGroup_GeoMatchStatement_ForwardedIPConfig(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -852,6 +863,7 @@ func TestAccAwsWafv2RuleGroup_IpSetReferenceStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -888,6 +900,7 @@ func TestAccAwsWafv2RuleGroup_IpSetReferenceStatement_IPSetForwardedIPConfig(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -987,6 +1000,7 @@ func TestAccAwsWafv2RuleGroup_LogicalRuleStatements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1059,6 +1073,7 @@ func TestAccAwsWafv2RuleGroup_Minimal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1089,6 +1104,7 @@ func TestAccAwsWafv2RuleGroup_RegexPatternSetReferenceStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1126,6 +1142,7 @@ func TestAccAwsWafv2RuleGroup_RuleAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1195,6 +1212,7 @@ func TestAccAwsWafv2RuleGroup_RuleAction(t *testing.T) { }, }) } + func TestAccAwsWafv2RuleGroup_SizeConstraintStatement(t *testing.T) { var v wafv2.RuleGroup ruleGroupName := acctest.RandomWithPrefix("tf-acc-test") @@ -1202,6 +1220,7 @@ func TestAccAwsWafv2RuleGroup_SizeConstraintStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1248,6 +1267,7 @@ func TestAccAwsWafv2RuleGroup_SizeConstraintStatement(t *testing.T) { }, }) } + func TestAccAwsWafv2RuleGroup_SqliMatchStatement(t *testing.T) { var v wafv2.RuleGroup ruleGroupName := acctest.RandomWithPrefix("tf-acc-test") @@ -1255,6 +1275,7 @@ func TestAccAwsWafv2RuleGroup_SqliMatchStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1325,6 +1346,7 @@ func TestAccAwsWafv2RuleGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ @@ -1373,6 +1395,7 @@ func TestAccAwsWafv2RuleGroup_XssMatchStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2RuleGroupDestroy, Steps: []resource.TestStep{ From 181edc1f15bc83a8e92a5ec29bb6b473b9fcacc6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:13:15 -0400 Subject: [PATCH 0658/1252] tests/r/wafv2_web_acl: Add ErrorCheck --- aws/resource_aws_wafv2_web_acl_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aws/resource_aws_wafv2_web_acl_test.go b/aws/resource_aws_wafv2_web_acl_test.go index bd17f41650e..a8c29520c3c 100644 --- a/aws/resource_aws_wafv2_web_acl_test.go +++ b/aws/resource_aws_wafv2_web_acl_test.go @@ -81,6 +81,7 @@ func TestAccAwsWafv2WebACL_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -122,6 +123,7 @@ func TestAccAwsWafv2WebACL_updateRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -252,6 +254,7 @@ func TestAccAwsWafv2WebACL_UpdateRuleProperties(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -456,6 +459,7 @@ func TestAccAwsWafv2WebACL_ChangeNameForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -506,6 +510,7 @@ func TestAccAwsWafv2WebACL_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -528,6 +533,7 @@ func TestAccAwsWafv2WebACL_ManagedRuleGroupStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -592,6 +598,7 @@ func TestAccAwsWafv2WebACL_Minimal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -624,6 +631,7 @@ func TestAccAwsWafv2WebACL_RateBasedStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -694,6 +702,7 @@ func TestAccAwsWafv2WebACL_GeoMatchStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -783,6 +792,7 @@ func TestAccAwsWafv2WebACL_GeoMatchStatement_ForwardedIPConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -847,6 +857,7 @@ func TestAccAwsWafv2WebACL_IPSetReferenceStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -892,6 +903,7 @@ func TestAccAwsWafv2WebACL_IPSetReferenceStatement_IPSetForwardedIPConfig(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -995,6 +1007,7 @@ func TestAccAwsWafv2WebACL_RateBasedStatement_ForwardedIPConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -1063,6 +1076,7 @@ func TestAccAwsWafv2WebACL_RuleGroupReferenceStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -1127,6 +1141,7 @@ func TestAccAwsWafv2WebACL_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -1176,6 +1191,7 @@ func TestAccAwsWafv2WebACL_MaxNestedRateBasedStatements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ @@ -1218,6 +1234,7 @@ func TestAccAwsWafv2WebACL_MaxNestedOperatorStatements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLDestroy, Steps: []resource.TestStep{ From 4a38b4b6a6b2041461b34e9af3ad8a30c3d90372 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:13:29 -0400 Subject: [PATCH 0659/1252] tests/r/wafv2_web_acl_association: Add ErrorCheck --- aws/resource_aws_wafv2_web_acl_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_wafv2_web_acl_association_test.go b/aws/resource_aws_wafv2_web_acl_association_test.go index a9783658182..d8755d34ff4 100644 --- a/aws/resource_aws_wafv2_web_acl_association_test.go +++ b/aws/resource_aws_wafv2_web_acl_association_test.go @@ -22,6 +22,7 @@ func TestAccAwsWafv2WebACLAssociation_basic(t *testing.T) { testAccAPIGatewayTypeEDGEPreCheck(t) testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2WebACLAssociationDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAwsWafv2WebACLAssociation_Disappears(t *testing.T) { testAccAPIGatewayTypeEDGEPreCheck(t) testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWafv2WebACLAssociationDestroy, Steps: []resource.TestStep{ From c55194bae1f0512e2369fd628c731fc8590cb158 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:13:43 -0400 Subject: [PATCH 0660/1252] tests/r/wafv2_web_acl_logging_configuration: Add ErrorCheck --- ...e_aws_wafv2_web_acl_logging_configuration_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go index a9b16c2a7d4..87011dd82c9 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration_test.go @@ -19,6 +19,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateSingleHeaderRedactedField(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -105,6 +107,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMethodRedactedField(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -147,6 +150,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateQueryStringRedactedField(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -189,6 +193,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateUriPathRedactedField(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -231,6 +236,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateMultipleRedactedFields(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -297,6 +303,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_changeResourceARNForceNew(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -339,6 +346,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_changeLogDestinationConfigsForceN resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -378,6 +386,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -401,6 +410,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_emptyRedactedFields(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -430,6 +440,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_updateEmptyRedactedFields(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -471,6 +482,7 @@ func TestAccAwsWafv2WebACLLoggingConfiguration_disappears_WebAcl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWafv2WebACLLoggingConfigurationDestroy, Steps: []resource.TestStep{ From 6c780ac98f0d7a1e13c430f68eadc7e98ebaed9f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:14:09 -0400 Subject: [PATCH 0661/1252] tests/ds/wafv2_ip_set: Add ErrorCheck --- aws/data_source_aws_wafv2_ip_set_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafv2_ip_set_test.go b/aws/data_source_aws_wafv2_ip_set_test.go index 593de0250a8..5078f954865 100644 --- a/aws/data_source_aws_wafv2_ip_set_test.go +++ b/aws/data_source_aws_wafv2_ip_set_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsWafv2IPSet_basic(t *testing.T) { datasourceName := "data.aws_wafv2_ip_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafv2IPSet_NonExistent(name), From 7e6765937631572f3a8c2315614d7268bdd2ad09 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:14:22 -0400 Subject: [PATCH 0662/1252] tests/ds/wafv2_regex_pattern_set: Add ErrorCheck --- aws/data_source_aws_wafv2_regex_pattern_set_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafv2_regex_pattern_set_test.go b/aws/data_source_aws_wafv2_regex_pattern_set_test.go index 89f7ed917ca..0d2fb68921d 100644 --- a/aws/data_source_aws_wafv2_regex_pattern_set_test.go +++ b/aws/data_source_aws_wafv2_regex_pattern_set_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsWafv2RegexPatternSet_basic(t *testing.T) { datasourceName := "data.aws_wafv2_regex_pattern_set.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafv2RegexPatternSet_NonExistent(name), From 569e631f0805d3db90139f01f4906e8130f8102d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:14:35 -0400 Subject: [PATCH 0663/1252] tests/ds/wafv2_rule_group: Add ErrorCheck --- aws/data_source_aws_wafv2_rule_group_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafv2_rule_group_test.go b/aws/data_source_aws_wafv2_rule_group_test.go index 1a3756ca020..afcac7e1a68 100644 --- a/aws/data_source_aws_wafv2_rule_group_test.go +++ b/aws/data_source_aws_wafv2_rule_group_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsWafv2RuleGroup_basic(t *testing.T) { datasourceName := "data.aws_wafv2_rule_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafv2RuleGroup_NonExistent(name), From da682be6c3e938b4970f00c5abae560338dd03a9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:14:48 -0400 Subject: [PATCH 0664/1252] tests/ds/wafv2_web_acl: Add ErrorCheck --- aws/data_source_aws_wafv2_web_acl_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_wafv2_web_acl_test.go b/aws/data_source_aws_wafv2_web_acl_test.go index 90f3a74843f..adcb45528c0 100644 --- a/aws/data_source_aws_wafv2_web_acl_test.go +++ b/aws/data_source_aws_wafv2_web_acl_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsWafv2WebACL_basic(t *testing.T) { datasourceName := "data.aws_wafv2_web_acl.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWafv2ScopeRegional(t) }, + ErrorCheck: testAccErrorCheck(t, wafv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWafv2WebACL_NonExistent(name), From 232651b3c0c0cccf3f62fd91bcbbaffe05909846 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:15:27 -0400 Subject: [PATCH 0665/1252] tests/r/ecs_capacity_provider: Add ErrorCheck --- aws/resource_aws_ecs_capacity_provider_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ecs_capacity_provider_test.go b/aws/resource_aws_ecs_capacity_provider_test.go index 236c2144591..baea10c4027 100644 --- a/aws/resource_aws_ecs_capacity_provider_test.go +++ b/aws/resource_aws_ecs_capacity_provider_test.go @@ -104,6 +104,7 @@ func TestAccAWSEcsCapacityProvider_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, Steps: []resource.TestStep{ @@ -141,6 +142,7 @@ func TestAccAWSEcsCapacityProvider_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, Steps: []resource.TestStep{ @@ -163,6 +165,7 @@ func TestAccAWSEcsCapacityProvider_ManagedScaling(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, Steps: []resource.TestStep{ @@ -197,6 +200,7 @@ func TestAccAWSEcsCapacityProvider_ManagedScalingPartial(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, Steps: []resource.TestStep{ @@ -231,6 +235,7 @@ func TestAccAWSEcsCapacityProvider_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, Steps: []resource.TestStep{ From df33e998e5ebd2e55a08ca0ead9b630b2fd9fcac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:15:37 -0400 Subject: [PATCH 0666/1252] tests/r/ecs_cluster: Add ErrorCheck --- aws/resource_aws_ecs_cluster_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_ecs_cluster_test.go b/aws/resource_aws_ecs_cluster_test.go index d029a659389..b3182ce0481 100644 --- a/aws/resource_aws_ecs_cluster_test.go +++ b/aws/resource_aws_ecs_cluster_test.go @@ -68,6 +68,7 @@ func TestAccAWSEcsCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -97,6 +98,7 @@ func TestAccAWSEcsCluster_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -119,6 +121,7 @@ func TestAccAWSEcsCluster_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -165,6 +168,7 @@ func TestAccAWSEcsCluster_SingleCapacityProvider(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -191,6 +195,7 @@ func TestAccAWSEcsCluster_CapacityProviders(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -221,6 +226,7 @@ func TestAccAWSEcsCluster_CapacityProvidersUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -259,6 +265,7 @@ func TestAccAWSEcsCluster_CapacityProvidersNoStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ @@ -291,6 +298,7 @@ func TestAccAWSEcsCluster_containerInsights(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsClusterDestroy, Steps: []resource.TestStep{ From 6e5ba99636faa3ca2ff6c324fa0902eb51a1e950 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:15:48 -0400 Subject: [PATCH 0667/1252] tests/r/ecs_task_definition: Add ErrorCheck --- aws/resource_aws_ecs_task_definition_test.go | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/aws/resource_aws_ecs_task_definition_test.go b/aws/resource_aws_ecs_task_definition_test.go index bff2eb22de7..cbf27e9021b 100644 --- a/aws/resource_aws_ecs_task_definition_test.go +++ b/aws/resource_aws_ecs_task_definition_test.go @@ -73,6 +73,7 @@ func TestAccAWSEcsTaskDefinition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAWSEcsTaskDefinition_withScratchVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -136,6 +138,7 @@ func TestAccAWSEcsTaskDefinition_withDockerVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -164,6 +167,7 @@ func TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -192,6 +196,7 @@ func TestAccAWSEcsTaskDefinition_withEFSVolumeMinimal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -220,6 +225,7 @@ func TestAccAWSEcsTaskDefinition_withEFSVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -247,6 +253,7 @@ func TestAccAWSEcsTaskDefinition_withTransitEncryptionEFSVolume(t *testing.T) { resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -275,6 +282,7 @@ func TestAccAWSEcsTaskDefinition_withEFSAccessPoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -303,6 +311,7 @@ func TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -336,6 +345,7 @@ func TestAccAWSEcsTaskDefinition_withEcsService(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -373,6 +383,7 @@ func TestAccAWSEcsTaskDefinition_withTaskRoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -402,6 +413,7 @@ func TestAccAWSEcsTaskDefinition_withNetworkMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -432,6 +444,7 @@ func TestAccAWSEcsTaskDefinition_withIPCMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -462,6 +475,7 @@ func TestAccAWSEcsTaskDefinition_withPidMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -490,6 +504,7 @@ func TestAccAWSEcsTaskDefinition_constraint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -520,6 +535,7 @@ func TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -555,6 +571,7 @@ func TestAccAWSEcsTaskDefinition_arrays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -582,6 +599,7 @@ func TestAccAWSEcsTaskDefinition_Fargate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -619,6 +637,7 @@ func TestAccAWSEcsTaskDefinition_ExecutionRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -647,6 +666,7 @@ func TestAccAWSEcsTaskDefinition_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -673,6 +693,7 @@ func TestAccAWSEcsTaskDefinition_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -728,6 +749,7 @@ func TestAccAWSEcsTaskDefinition_ProxyConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -756,6 +778,7 @@ func TestAccAWSEcsTaskDefinition_inferenceAccelerator(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, Steps: []resource.TestStep{ @@ -891,6 +914,7 @@ func testAccCheckAWSTaskDefinitionConstraintsAttrs(def *ecs.TaskDefinition) reso return nil } } + func TestValidateAwsEcsTaskDefinitionContainerDefinitions(t *testing.T) { validDefinitions := []string{ testValidateAwsEcsTaskDefinitionValidContainerDefinitions, @@ -1634,6 +1658,7 @@ TASK_DEFINITION } `, tdName, useIam) } + func testAccAWSEcsTaskDefinitionWithTaskRoleArn(roleName, policyName, tdName string) string { return fmt.Sprintf(` resource "aws_iam_role" "test" { From f521d871b72052c671b76f867276eac6b6251960 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:16:16 -0400 Subject: [PATCH 0668/1252] tests/ds/ecs_cluster: Add ErrorCheck --- aws/data_source_aws_ecs_cluster_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ecs_cluster_test.go b/aws/data_source_aws_ecs_cluster_test.go index e65ddd4aab0..4ddc5450f1a 100644 --- a/aws/data_source_aws_ecs_cluster_test.go +++ b/aws/data_source_aws_ecs_cluster_test.go @@ -4,14 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcsClusterDataSourceConfig, @@ -29,8 +31,9 @@ func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) { func TestAccAWSEcsDataSource_ecsClusterContainerInsights(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcsClusterDataSourceConfigContainerInsights, From 25b90fbd089d45b30f0f930dd4171baad8eb5256 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:16:31 -0400 Subject: [PATCH 0669/1252] tests/ds/ecs_container_definition: Add ErrorCheck --- aws/data_source_aws_ecs_container_definition_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ecs_container_definition_test.go b/aws/data_source_aws_ecs_container_definition_test.go index d26183b14f6..34d7afc7f34 100644 --- a/aws/data_source_aws_ecs_container_definition_test.go +++ b/aws/data_source_aws_ecs_container_definition_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSEcsDataSource_ecsContainerDefinition(t *testing.T) { tdName := fmt.Sprintf("tf_acc_td_ds_ecs_containter_definition_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcsContainerDefinitionDataSourceConfig(clusterName, tdName, svcName), From 890f9bc42f4db3569219b3f0a0d1c79fd3cb86c2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:16:44 -0400 Subject: [PATCH 0670/1252] tests/ds/ecs_service: Add ErrorCheck --- aws/data_source_aws_ecs_service_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ecs_service_test.go b/aws/data_source_aws_ecs_service_test.go index a7516974ad3..54e57cb93ec 100644 --- a/aws/data_source_aws_ecs_service_test.go +++ b/aws/data_source_aws_ecs_service_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSEcsServiceDataSource_basic(t *testing.T) { resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcsServiceDataSourceConfig, From 86aba3bdd67424f18fe2e76631a1adb80e8aa56f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:16:57 -0400 Subject: [PATCH 0671/1252] tests/ds/ecs_task_definition: Add ErrorCheck --- aws/data_source_aws_ecs_task_definition_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ecs_task_definition_test.go b/aws/data_source_aws_ecs_task_definition_test.go index e6760b81e6e..2345ea6f7b9 100644 --- a/aws/data_source_aws_ecs_task_definition_test.go +++ b/aws/data_source_aws_ecs_task_definition_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSEcsDataSource_ecsTaskDefinition(t *testing.T) { rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcsTaskDefinitionDataSourceConfig(rName), From 074ae5b92f2a3ac970ce341a424289419c7bbb04 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:19:22 -0400 Subject: [PATCH 0672/1252] tests/r/ecs_service: Add ErrorCheck --- aws/resource_aws_ecs_service_test.go | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 291a4509d8a..32d9d0c5605 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -115,6 +115,7 @@ func TestAccAWSEcsService_withARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -152,6 +153,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -192,6 +194,7 @@ func TestAccAWSEcsService_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -217,6 +220,7 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -241,6 +245,7 @@ func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -271,6 +276,7 @@ func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -295,6 +301,7 @@ func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -327,6 +334,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -365,6 +373,7 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -418,6 +427,7 @@ func TestAccAWSEcsService_withIamRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -438,6 +448,7 @@ func TestAccAWSEcsService_withDeploymentController_Type_CodeDeploy(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -469,6 +480,7 @@ func TestAccAWSEcsService_withDeploymentController_Type_External(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -502,6 +514,7 @@ func TestAccAWSEcsService_withDeploymentValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -527,6 +540,7 @@ func TestAccAWSEcsService_withDeploymentMinimumZeroMaximumOneHundred(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -555,6 +569,7 @@ func TestAccAWSEcsService_withLbChanges(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -585,6 +600,7 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -613,6 +629,7 @@ func TestAccAWSEcsService_withAlb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -638,6 +655,7 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -663,6 +681,7 @@ func TestAccAWSEcsService_withForceNewDeployment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -697,6 +716,7 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -749,6 +769,7 @@ func TestAccAWSEcsService_withPlacementStrategy_Type_Missing(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -770,6 +791,7 @@ func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -802,6 +824,7 @@ func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -828,6 +851,7 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -872,6 +896,7 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -908,6 +933,7 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndWaitForSteadyState(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -942,6 +968,7 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndUpdateWaitForSteadyState(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -987,6 +1014,7 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1022,6 +1050,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1046,6 +1075,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1070,6 +1100,7 @@ func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1094,6 +1125,7 @@ func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1118,6 +1150,7 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1139,6 +1172,7 @@ func TestAccAWSEcsService_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1187,6 +1221,7 @@ func TestAccAWSEcsService_ManagedTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -1209,6 +1244,7 @@ func TestAccAWSEcsService_PropagateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ @@ -3126,6 +3162,7 @@ func testAccAWSEcsServiceWithNetworkConfiguration(sg1Name, sg2Name, clusterName, `"${aws_security_group.allow_all_a.id}", "${aws_security_group.allow_all_b.id}"`, ) } + func testAccAWSEcsServiceWithNetworkConfiguration_modified(sg1Name, sg2Name, clusterName, tdName, svcName string) string { return tpl_testAccAWSEcsServiceWithNetworkConfiguration( sg1Name, sg2Name, clusterName, tdName, svcName, From f765cbe6334d5fdbafa98c10fe7c30271ccb1508 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:20:38 -0400 Subject: [PATCH 0673/1252] tests/r/iot_certificate: Add ErrorCheck --- aws/resource_aws_iot_certificate_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iot_certificate_test.go b/aws/resource_aws_iot_certificate_test.go index ae4c946723c..345f2382153 100644 --- a/aws/resource_aws_iot_certificate_test.go +++ b/aws/resource_aws_iot_certificate_test.go @@ -14,6 +14,7 @@ import ( func TestAccAWSIoTCertificate_csr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTCertificateDestroy_basic, Steps: []resource.TestStep{ @@ -35,6 +36,7 @@ func TestAccAWSIoTCertificate_csr(t *testing.T) { func TestAccAWSIoTCertificate_keys_certificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTCertificateDestroy_basic, Steps: []resource.TestStep{ From 546a7ffc0825e26382c331e3121ac0a81be59668 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:20:48 -0400 Subject: [PATCH 0674/1252] tests/r/iot_policy: Add ErrorCheck --- aws/resource_aws_iot_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iot_policy_test.go b/aws/resource_aws_iot_policy_test.go index 094211d1550..555e9c21b31 100644 --- a/aws/resource_aws_iot_policy_test.go +++ b/aws/resource_aws_iot_policy_test.go @@ -19,6 +19,7 @@ func TestAccAWSIoTPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTPolicyDestroy_basic, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSIoTPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTPolicyDestroy_basic, Steps: []resource.TestStep{ From e47e04e9a7eaece6807c3cebf5b569522b3ee96a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:20:59 -0400 Subject: [PATCH 0675/1252] tests/r/iot_policy_attachment: Add ErrorCheck --- aws/resource_aws_iot_policy_attachment_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iot_policy_attachment_test.go b/aws/resource_aws_iot_policy_attachment_test.go index 6f28c4e0258..cd31999d257 100644 --- a/aws/resource_aws_iot_policy_attachment_test.go +++ b/aws/resource_aws_iot_policy_attachment_test.go @@ -17,6 +17,7 @@ func TestAccAWSIotPolicyAttachment_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotPolicyAttchmentDestroy, Steps: []resource.TestStep{ From 1e8612ede1408e2a1c286e4184ec59be52098929 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:21:19 -0400 Subject: [PATCH 0676/1252] tests/r/iot_role_alias: Add ErrorCheck --- aws/resource_aws_iot_role_alias_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iot_role_alias_test.go b/aws/resource_aws_iot_role_alias_test.go index a6e5770bc24..8a6da7eedee 100644 --- a/aws/resource_aws_iot_role_alias_test.go +++ b/aws/resource_aws_iot_role_alias_test.go @@ -20,6 +20,7 @@ func TestAccAWSIotRoleAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotRoleAliasDestroy, Steps: []resource.TestStep{ From f2dbbdd0c6306980b65d194781c8b98f19ef779d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:21:32 -0400 Subject: [PATCH 0677/1252] tests/r/iot_thing: Add ErrorCheck --- aws/resource_aws_iot_thing_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iot_thing_test.go b/aws/resource_aws_iot_thing_test.go index 43802770cea..5126f827476 100644 --- a/aws/resource_aws_iot_thing_test.go +++ b/aws/resource_aws_iot_thing_test.go @@ -19,6 +19,7 @@ func TestAccAWSIotThing_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotThingDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSIotThing_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotThingDestroy, Steps: []resource.TestStep{ From 916822efa7317f19bc0c2f26402aa244553faee8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:21:45 -0400 Subject: [PATCH 0678/1252] tests/r/iot_thing_principal_attachment: Add ErrorCheck --- aws/resource_aws_iot_thing_principal_attachment_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iot_thing_principal_attachment_test.go b/aws/resource_aws_iot_thing_principal_attachment_test.go index d28ce2f2b02..70764eb7019 100644 --- a/aws/resource_aws_iot_thing_principal_attachment_test.go +++ b/aws/resource_aws_iot_thing_principal_attachment_test.go @@ -17,6 +17,7 @@ func TestAccAWSIotThingPrincipalAttachment_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotThingPrincipalAttachmentDestroy, Steps: []resource.TestStep{ From aed1bb983f8c16f7f88dc43fa6a7f2fc2aada17e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:22:10 -0400 Subject: [PATCH 0679/1252] tests/r/iot_thing_type: Add ErrorCheck --- aws/resource_aws_iot_thing_type_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_iot_thing_type_test.go b/aws/resource_aws_iot_thing_type_test.go index 5310e6829fe..761db011f92 100644 --- a/aws/resource_aws_iot_thing_type_test.go +++ b/aws/resource_aws_iot_thing_type_test.go @@ -16,6 +16,7 @@ func TestAccAWSIotThingType_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotThingTypeDestroy, Steps: []resource.TestStep{ @@ -40,6 +41,7 @@ func TestAccAWSIotThingType_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIotThingTypeDestroy, Steps: []resource.TestStep{ From aee4368e24ae92a22eea401abde4df952eca6a79 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:22:22 -0400 Subject: [PATCH 0680/1252] tests/r/iot_topic_rule: Add ErrorCheck --- aws/resource_aws_iot_topic_rule_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aws/resource_aws_iot_topic_rule_test.go b/aws/resource_aws_iot_topic_rule_test.go index 9a596fe3730..061162aab9d 100644 --- a/aws/resource_aws_iot_topic_rule_test.go +++ b/aws/resource_aws_iot_topic_rule_test.go @@ -73,6 +73,7 @@ func TestAccAWSIoTTopicRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -103,6 +104,7 @@ func TestAccAWSIoTTopicRule_cloudwatchalarm(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -127,6 +129,7 @@ func TestAccAWSIoTTopicRule_cloudwatchmetric(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -151,6 +154,7 @@ func TestAccAWSIoTTopicRule_dynamodb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -180,6 +184,7 @@ func TestAccAWSIoTTopicRule_dynamoDbv2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -199,6 +204,7 @@ func TestAccAWSIoTTopicRule_elasticsearch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -223,6 +229,7 @@ func TestAccAWSIoTTopicRule_firehose(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -247,6 +254,7 @@ func TestAccAWSIoTTopicRule_firehose_separator(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -277,6 +285,7 @@ func TestAccAWSIoTTopicRule_kinesis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -301,6 +310,7 @@ func TestAccAWSIoTTopicRule_lambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -325,6 +335,7 @@ func TestAccAWSIoTTopicRule_republish(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -349,6 +360,7 @@ func TestAccAWSIoTTopicRule_republish_with_qos(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -373,6 +385,7 @@ func TestAccAWSIoTTopicRule_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -397,6 +410,7 @@ func TestAccAWSIoTTopicRule_sns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -421,6 +435,7 @@ func TestAccAWSIoTTopicRule_sqs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -445,6 +460,7 @@ func TestAccAWSIoTTopicRule_step_functions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -468,6 +484,7 @@ func TestAccAWSIoTTopicRule_iot_analytics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -486,6 +503,7 @@ func TestAccAWSIoTTopicRule_iot_events(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -505,6 +523,7 @@ func TestAccAWSIoTTopicRule_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ @@ -548,6 +567,7 @@ func TestAccAWSIoTTopicRule_errorAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSIoTTopicRuleDestroy, Steps: []resource.TestStep{ From 195b63b1e834bbadba68d36f9e0afbd312c9ff64 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:22:34 -0400 Subject: [PATCH 0681/1252] tests/ds/iot_endpoint: Add ErrorCheck --- aws/data_source_aws_iot_endpoint_test.go | 26 +++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/aws/data_source_aws_iot_endpoint_test.go b/aws/data_source_aws_iot_endpoint_test.go index e28dd814f51..d19d9ed8b52 100644 --- a/aws/data_source_aws_iot_endpoint_test.go +++ b/aws/data_source_aws_iot_endpoint_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/iot" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSIotEndpointDataSource_basic(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIotEndpointConfig, @@ -29,8 +31,9 @@ func TestAccAWSIotEndpointDataSource_EndpointType_IOTCredentialProvider(t *testi dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIotEndpointConfigEndpointType("iot:CredentialProvider"), @@ -46,8 +49,9 @@ func TestAccAWSIotEndpointDataSource_EndpointType_IOTData(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIotEndpointConfigEndpointType("iot:Data"), @@ -63,8 +67,9 @@ func TestAccAWSIotEndpointDataSource_EndpointType_IOTDataATS(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIotEndpointConfigEndpointType("iot:Data-ATS"), @@ -80,8 +85,9 @@ func TestAccAWSIotEndpointDataSource_EndpointType_IOTJobs(t *testing.T) { dataSourceName := "data.aws_iot_endpoint.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iot.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIotEndpointConfigEndpointType("iot:Jobs"), From 62d117889cdb4bd7fc20e4cd1db0e113094d341b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:23:24 -0400 Subject: [PATCH 0682/1252] tests/r/neptune_cluster: Add ErrorCheck --- aws/resource_aws_neptune_cluster_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_neptune_cluster_test.go b/aws/resource_aws_neptune_cluster_test.go index b7de72447ef..e9b5e3eda48 100644 --- a/aws/resource_aws_neptune_cluster_test.go +++ b/aws/resource_aws_neptune_cluster_test.go @@ -22,6 +22,7 @@ func TestAccAWSNeptuneCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSNeptuneCluster_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -95,6 +97,7 @@ func TestAccAWSNeptuneCluster_takeFinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterSnapshot(rName), Steps: []resource.TestStep{ @@ -126,6 +129,7 @@ func TestAccAWSNeptuneCluster_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -176,6 +180,7 @@ func TestAccAWSNeptuneCluster_updateIamRoles(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -222,6 +227,7 @@ func TestAccAWSNeptuneCluster_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -254,6 +260,7 @@ func TestAccAWSNeptuneCluster_encrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -286,6 +293,7 @@ func TestAccAWSNeptuneCluster_backupsUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -329,6 +337,7 @@ func TestAccAWSNeptuneCluster_iamAuth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -361,6 +370,7 @@ func TestAccAWSNeptuneCluster_updateCloudwatchLogsExports(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -408,6 +418,7 @@ func TestAccAWSNeptuneCluster_deleteProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ From 214deef7a538b8856b91ef4e2606587fdeaf45f6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:23:35 -0400 Subject: [PATCH 0683/1252] tests/r/neptune_cluster_instance: Add ErrorCheck --- aws/resource_aws_neptune_cluster_instance_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_neptune_cluster_instance_test.go b/aws/resource_aws_neptune_cluster_instance_test.go index 9f0c0d5f19a..fab377ee977 100644 --- a/aws/resource_aws_neptune_cluster_instance_test.go +++ b/aws/resource_aws_neptune_cluster_instance_test.go @@ -26,6 +26,7 @@ func TestAccAWSNeptuneClusterInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -77,6 +78,7 @@ func TestAccAWSNeptuneClusterInstance_withaz(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAWSNeptuneClusterInstance_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -127,6 +130,7 @@ func TestAccAWSNeptuneClusterInstance_withSubnetGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -150,6 +154,7 @@ func TestAccAWSNeptuneClusterInstance_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ @@ -174,6 +179,7 @@ func TestAccAWSNeptuneClusterInstance_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ From e2f2d1542a47ff4b4903919fbf3ce6eceb21d615 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:23:45 -0400 Subject: [PATCH 0684/1252] tests/r/neptune_cluster_parameter_group: Add ErrorCheck --- aws/resource_aws_neptune_cluster_parameter_group_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_neptune_cluster_parameter_group_test.go b/aws/resource_aws_neptune_cluster_parameter_group_test.go index f010dc4df17..58204f30731 100644 --- a/aws/resource_aws_neptune_cluster_parameter_group_test.go +++ b/aws/resource_aws_neptune_cluster_parameter_group_test.go @@ -22,6 +22,7 @@ func TestAccAWSNeptuneClusterParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSNeptuneClusterParameterGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccAWSNeptuneClusterParameterGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -108,6 +111,7 @@ func TestAccAWSNeptuneClusterParameterGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -137,6 +141,7 @@ func TestAccAWSNeptuneClusterParameterGroup_NamePrefix_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -183,6 +188,7 @@ func TestAccAWSNeptuneClusterParameterGroup_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -230,6 +236,7 @@ func TestAccAWSNeptuneClusterParameterGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterParameterGroupDestroy, Steps: []resource.TestStep{ From 0d58d5f72645ba08e71f8963523447447e8c9e0c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:23:57 -0400 Subject: [PATCH 0685/1252] tests/r/neptune_cluster_snapshot: Add ErrorCheck --- aws/resource_aws_neptune_cluster_snapshot_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_neptune_cluster_snapshot_test.go b/aws/resource_aws_neptune_cluster_snapshot_test.go index e64ab0582b6..bb0149cf248 100644 --- a/aws/resource_aws_neptune_cluster_snapshot_test.go +++ b/aws/resource_aws_neptune_cluster_snapshot_test.go @@ -19,6 +19,7 @@ func TestAccAWSNeptuneClusterSnapshot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNeptuneClusterSnapshotDestroy, Steps: []resource.TestStep{ From 0cece7b28b02b27c81e97a1a096762e15558826b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:24:23 -0400 Subject: [PATCH 0686/1252] tests/r/neptune_event_subscription: Add ErrorCheck --- aws/resource_aws_neptune_event_subscription_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_neptune_event_subscription_test.go b/aws/resource_aws_neptune_event_subscription_test.go index 4b56d30fcd1..7a1aac2d39f 100644 --- a/aws/resource_aws_neptune_event_subscription_test.go +++ b/aws/resource_aws_neptune_event_subscription_test.go @@ -86,6 +86,7 @@ func TestAccAWSNeptuneEventSubscription_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -129,6 +130,7 @@ func TestAccAWSNeptuneEventSubscription_withPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -157,6 +159,7 @@ func TestAccAWSNeptuneEventSubscription_withSourceIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -194,6 +197,7 @@ func TestAccAWSNeptuneEventSubscription_withCategories(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneEventSubscriptionDestroy, Steps: []resource.TestStep{ From 2a2d55f8cfe7f837734179610bf76f9df8a5d97b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:24:35 -0400 Subject: [PATCH 0687/1252] tests/r/neptune_parameter_group: Add ErrorCheck --- aws/resource_aws_neptune_parameter_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_neptune_parameter_group_test.go b/aws/resource_aws_neptune_parameter_group_test.go index a8b367becc7..4cccbfe94ce 100644 --- a/aws/resource_aws_neptune_parameter_group_test.go +++ b/aws/resource_aws_neptune_parameter_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSNeptuneParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneParameterGroupDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSNeptuneParameterGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneParameterGroupDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSNeptuneParameterGroup_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneParameterGroupDestroy, Steps: []resource.TestStep{ @@ -125,6 +128,7 @@ func TestAccAWSNeptuneParameterGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneParameterGroupDestroy, Steps: []resource.TestStep{ From 1229174b2771aaa1495c018e57ca387940b71303 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:24:48 -0400 Subject: [PATCH 0688/1252] tests/r/neptune_subnet_group: Add ErrorCheck --- aws/resource_aws_neptune_subnet_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_neptune_subnet_group_test.go b/aws/resource_aws_neptune_subnet_group_test.go index 492398e35d0..313751d6582 100644 --- a/aws/resource_aws_neptune_subnet_group_test.go +++ b/aws/resource_aws_neptune_subnet_group_test.go @@ -20,6 +20,7 @@ func TestAccAWSNeptuneSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNeptuneSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSNeptuneSubnetGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNeptuneSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -75,6 +77,7 @@ func TestAccAWSNeptuneSubnetGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNeptuneSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -100,6 +103,7 @@ func TestAccAWSNeptuneSubnetGroup_updateDescription(t *testing.T) { rName := fmt.Sprintf("tf-test-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckNeptuneSubnetGroupDestroy, Steps: []resource.TestStep{ From 460d771399bb4d122f3936bd46d73c4898c4395a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:25:01 -0400 Subject: [PATCH 0689/1252] tests/ds/neptune_engine_version: Add ErrorCheck --- aws/data_source_aws_neptune_engine_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_neptune_engine_version_test.go b/aws/data_source_aws_neptune_engine_version_test.go index fd3f3b46e6a..7c052a40383 100644 --- a/aws/data_source_aws_neptune_engine_version_test.go +++ b/aws/data_source_aws_neptune_engine_version_test.go @@ -16,6 +16,7 @@ func TestAccAWSNeptuneEngineVersionDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSNeptuneEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSNeptuneEngineVersionDataSource_preferred(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSNeptuneEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -62,6 +64,7 @@ func TestAccAWSNeptuneEngineVersionDataSource_defaultOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSNeptuneEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 7b533b20f14abd7bb9f3bb2d8222f0a8cc11dfa6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:25:13 -0400 Subject: [PATCH 0690/1252] tests/ds/neptune_orderable_db_instance: Add ErrorCheck --- aws/data_source_aws_neptune_orderable_db_instance_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_neptune_orderable_db_instance_test.go b/aws/data_source_aws_neptune_orderable_db_instance_test.go index aca11e22234..420bfae1a8a 100644 --- a/aws/data_source_aws_neptune_orderable_db_instance_test.go +++ b/aws/data_source_aws_neptune_orderable_db_instance_test.go @@ -18,6 +18,7 @@ func TestAccAWSNeptuneOrderableDbInstanceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSNeptuneOrderableDbInstance(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSNeptuneOrderableDbInstanceDataSource_preferred(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSNeptuneOrderableDbInstance(t) }, + ErrorCheck: testAccErrorCheck(t, neptune.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 843e34bf976bae4ae6bea8088fe871efb1ff41d1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:26:25 -0400 Subject: [PATCH 0691/1252] tests/r/efs_access_point: Add ErrorCheck --- aws/resource_aws_efs_access_point_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_efs_access_point_test.go b/aws/resource_aws_efs_access_point_test.go index 878b36a1154..c85f1bfc6a0 100644 --- a/aws/resource_aws_efs_access_point_test.go +++ b/aws/resource_aws_efs_access_point_test.go @@ -90,6 +90,7 @@ func TestAccAWSEFSAccessPoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -123,6 +124,7 @@ func TestAccAWSEFSAccessPoint_root_directory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -151,6 +153,7 @@ func TestAccAWSEFSAccessPoint_root_directory_creation_info(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -182,6 +185,7 @@ func TestAccAWSEFSAccessPoint_posix_user(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -211,6 +215,7 @@ func TestAccAWSEFSAccessPoint_posix_user_secondary_gids(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -239,6 +244,7 @@ func TestAccAWSEFSAccessPoint_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ @@ -283,6 +289,7 @@ func TestAccAWSEFSAccessPoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ From b96ccd6894f61645c1aa1ca3c095f526adb2f54f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:26:34 -0400 Subject: [PATCH 0692/1252] tests/r/efs_file_system: Add ErrorCheck --- aws/resource_aws_efs_file_system_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_efs_file_system_test.go b/aws/resource_aws_efs_file_system_test.go index 250fbe618ef..282287d6414 100644 --- a/aws/resource_aws_efs_file_system_test.go +++ b/aws/resource_aws_efs_file_system_test.go @@ -91,6 +91,7 @@ func TestAccAWSEFSFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSEFSFileSystem_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -185,6 +187,7 @@ func TestAccAWSEFSFileSystem_pagedTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -213,6 +216,7 @@ func TestAccAWSEFSFileSystem_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -239,6 +243,7 @@ func TestAccAWSEFSFileSystem_kmsConfigurationWithoutEncryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -256,6 +261,7 @@ func TestAccAWSEFSFileSystem_ProvisionedThroughputInMibps(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -291,6 +297,7 @@ func TestAccAWSEFSFileSystem_ThroughputMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -326,6 +333,7 @@ func TestAccAWSEFSFileSystem_lifecyclePolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -372,6 +380,7 @@ func TestAccAWSEFSFileSystem_lifecyclePolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -404,6 +413,7 @@ func TestAccAWSEFSFileSystem_lifecyclePolicy_removal(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -438,6 +448,7 @@ func TestAccAWSEFSFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ From 8decfaacb9111da942764441c7e52f5111eac356 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:26:44 -0400 Subject: [PATCH 0693/1252] tests/r/efs_file_system_policy: Add ErrorCheck --- aws/resource_aws_efs_file_system_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_efs_file_system_policy_test.go b/aws/resource_aws_efs_file_system_policy_test.go index 067c14dffa3..c0059481c4a 100644 --- a/aws/resource_aws_efs_file_system_policy_test.go +++ b/aws/resource_aws_efs_file_system_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSEFSFileSystemPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSEFSFileSystemPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsFileSystemPolicyDestroy, Steps: []resource.TestStep{ From ce9da6404567faa9af7b00199fbb481d6ff98e5b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:27:20 -0400 Subject: [PATCH 0694/1252] tests/ds/efs_access_point: Add ErrorCheck --- aws/data_source_aws_efs_access_point_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_efs_access_point_test.go b/aws/data_source_aws_efs_access_point_test.go index 97d13207a5e..7873610e6e4 100644 --- a/aws/data_source_aws_efs_access_point_test.go +++ b/aws/data_source_aws_efs_access_point_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccDataSourceAWSEFSAccessPoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ From 92dd45c4219971eacbebf518bf19d5bb49158273 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:27:33 -0400 Subject: [PATCH 0695/1252] tests/ds/efs_access_points: Add ErrorCheck --- aws/data_source_aws_efs_access_points_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_efs_access_points_test.go b/aws/data_source_aws_efs_access_points_test.go index b82b5781bc5..47f84e5c7c5 100644 --- a/aws/data_source_aws_efs_access_points_test.go +++ b/aws/data_source_aws_efs_access_points_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -11,6 +12,7 @@ func TestAccDataSourceAWSEFSAccessPoints_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEfsAccessPointDestroy, Steps: []resource.TestStep{ From 4344f455754a1eb40e780461ec3ee9fb4bd78eaf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:27:46 -0400 Subject: [PATCH 0696/1252] tests/ds/efs_file_system: Add ErrorCheck --- aws/data_source_aws_efs_file_system_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_efs_file_system_test.go b/aws/data_source_aws_efs_file_system_test.go index 767bc310495..f74639d7176 100644 --- a/aws/data_source_aws_efs_file_system_test.go +++ b/aws/data_source_aws_efs_file_system_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsEfsFileSystem_id(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEfsFileSystemIDConfig, @@ -43,8 +45,9 @@ func TestAccDataSourceAwsEfsFileSystem_name(t *testing.T) { resourceName := "aws_efs_file_system.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEfsFileSystemNameConfig, @@ -70,8 +73,9 @@ func TestAccDataSourceAwsEfsFileSystem_name(t *testing.T) { func TestAccDataSourceAwsEfsFileSystem_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEfsFileSystemIDConfig_NonExistent, From f61f762a9e75265b41e642342c78e45cb4ccdb4a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:27:59 -0400 Subject: [PATCH 0697/1252] tests/ds/efs_mount_target: Add ErrorCheck --- aws/data_source_aws_efs_mount_target_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_efs_mount_target_test.go b/aws/data_source_aws_efs_mount_target_test.go index b0345f9b070..ace766fe08a 100644 --- a/aws/data_source_aws_efs_mount_target_test.go +++ b/aws/data_source_aws_efs_mount_target_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsEfsMountTarget_basic(t *testing.T) { dataSourceName := "data.aws_efs_mount_target.test" resourceName := "aws_efs_mount_target.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, efs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsEfsMountTargetConfigByMountTargetId(rName), From ea1333f10d1758ada50972191723f5e7adca99dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:28:43 -0400 Subject: [PATCH 0698/1252] tests/r/appmesh_gateway_route: Add ErrorCheck --- aws/resource_aws_appmesh_gateway_route_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_appmesh_gateway_route_test.go b/aws/resource_aws_appmesh_gateway_route_test.go index 726370caa3c..ec09973f127 100644 --- a/aws/resource_aws_appmesh_gateway_route_test.go +++ b/aws/resource_aws_appmesh_gateway_route_test.go @@ -109,6 +109,7 @@ func testAccAwsAppmeshGatewayRoute_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -155,6 +156,7 @@ func testAccAwsAppmeshGatewayRoute_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -181,6 +183,7 @@ func testAccAwsAppmeshGatewayRoute_GrpcRoute(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -253,6 +256,7 @@ func testAccAwsAppmeshGatewayRoute_HttpRoute(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -325,6 +329,7 @@ func testAccAwsAppmeshGatewayRoute_Http2Route(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ @@ -395,6 +400,7 @@ func testAccAwsAppmeshGatewayRoute_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshGatewayRouteDestroy, Steps: []resource.TestStep{ From d37a10f5b73ce2ba04e97543a1038a9161a1ebd9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:28:53 -0400 Subject: [PATCH 0699/1252] tests/r/appmesh_mesh: Add ErrorCheck --- aws/resource_aws_appmesh_mesh_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_appmesh_mesh_test.go b/aws/resource_aws_appmesh_mesh_test.go index 565ac4d3630..5e48070cbcf 100644 --- a/aws/resource_aws_appmesh_mesh_test.go +++ b/aws/resource_aws_appmesh_mesh_test.go @@ -73,6 +73,7 @@ func testAccAwsAppmeshMesh_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshMeshDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func testAccAwsAppmeshMesh_egressFilter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshMeshDestroy, Steps: []resource.TestStep{ @@ -143,6 +145,7 @@ func testAccAwsAppmeshMesh_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshMeshDestroy, Steps: []resource.TestStep{ From c7d6eac030959475e427266c864f681f99ca2f69 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:29:04 -0400 Subject: [PATCH 0700/1252] tests/r/appmesh_route: Add ErrorCheck --- aws/resource_aws_appmesh_route_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_appmesh_route_test.go b/aws/resource_aws_appmesh_route_test.go index 19750749a3a..aa49282bfb2 100644 --- a/aws/resource_aws_appmesh_route_test.go +++ b/aws/resource_aws_appmesh_route_test.go @@ -110,6 +110,7 @@ func testAccAwsAppmeshRoute_grpcRoute(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -281,6 +282,7 @@ func testAccAwsAppmeshRoute_grpcRouteTimeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -379,6 +381,7 @@ func testAccAwsAppmeshRoute_grpcRouteEmptyMatch(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -431,6 +434,7 @@ func testAccAwsAppmeshRoute_http2Route(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -547,6 +551,7 @@ func testAccAwsAppmeshRoute_http2RouteTimeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -649,6 +654,7 @@ func testAccAwsAppmeshRoute_httpRoute(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -759,6 +765,7 @@ func testAccAwsAppmeshRoute_httpRouteTimeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -853,6 +860,7 @@ func testAccAwsAppmeshRoute_tcpRoute(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -946,6 +954,7 @@ func testAccAwsAppmeshRoute_tcpRouteTimeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -1024,6 +1033,7 @@ func testAccAwsAppmeshRoute_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -1073,6 +1083,7 @@ func testAccAwsAppmeshRoute_httpHeader(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -1173,6 +1184,7 @@ func testAccAwsAppmeshRoute_routePriority(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ @@ -1255,6 +1267,7 @@ func testAccAwsAppmeshRoute_httpRetryPolicy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshRouteDestroy, Steps: []resource.TestStep{ From dc93cbff5177625a250a1ec5af83d243250dbf3a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:29:16 -0400 Subject: [PATCH 0701/1252] tests/r/appmesh_virtual_router: Add ErrorCheck --- aws/resource_aws_appmesh_virtual_router_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_appmesh_virtual_router_test.go b/aws/resource_aws_appmesh_virtual_router_test.go index 78c5208cfa6..bf48c0eb6e7 100644 --- a/aws/resource_aws_appmesh_virtual_router_test.go +++ b/aws/resource_aws_appmesh_virtual_router_test.go @@ -89,6 +89,7 @@ func testAccAwsAppmeshVirtualRouter_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualRouterDestroy, Steps: []resource.TestStep{ @@ -142,6 +143,7 @@ func testAccAwsAppmeshVirtualRouter_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualRouterDestroy, Steps: []resource.TestStep{ From 514d8f939993567d6687b01b0203fde9d61ca4aa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:29:31 -0400 Subject: [PATCH 0702/1252] tests/r/appmesh_virtual_service: Add ErrorCheck --- aws/resource_aws_appmesh_virtual_service_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_appmesh_virtual_service_test.go b/aws/resource_aws_appmesh_virtual_service_test.go index e9828a5f135..93b17aa8fb4 100644 --- a/aws/resource_aws_appmesh_virtual_service_test.go +++ b/aws/resource_aws_appmesh_virtual_service_test.go @@ -88,6 +88,7 @@ func testAccAwsAppmeshVirtualService_virtualNode(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualServiceDestroy, Steps: []resource.TestStep{ @@ -141,6 +142,7 @@ func testAccAwsAppmeshVirtualService_virtualRouter(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualServiceDestroy, Steps: []resource.TestStep{ @@ -187,6 +189,7 @@ func testAccAwsAppmeshVirtualService_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualServiceDestroy, Steps: []resource.TestStep{ From ffbd4a43913fe4f3609237a81aace50478022585 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:31:09 -0400 Subject: [PATCH 0703/1252] tests/r/appmesh_virtual_gateway: Add ErrorCheck --- aws/resource_aws_appmesh_virtual_gateway_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_appmesh_virtual_gateway_test.go b/aws/resource_aws_appmesh_virtual_gateway_test.go index 7d54900b103..6fb95bf6e92 100644 --- a/aws/resource_aws_appmesh_virtual_gateway_test.go +++ b/aws/resource_aws_appmesh_virtual_gateway_test.go @@ -94,6 +94,7 @@ func testAccAwsAppmeshVirtualGateway_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -138,6 +139,7 @@ func testAccAwsAppmeshVirtualGateway_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -161,6 +163,7 @@ func testAccAwsAppmeshVirtualGateway_BackendDefaults(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -249,6 +252,7 @@ func testAccAwsAppmeshVirtualGateway_ListenerConnectionPool(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -325,6 +329,7 @@ func testAccAwsAppmeshVirtualGateway_ListenerHealthChecks(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -409,6 +414,7 @@ func testAccAwsAppmeshVirtualGateway_ListenerTls(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -508,6 +514,7 @@ func testAccAwsAppmeshVirtualGateway_Logging(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ @@ -579,6 +586,7 @@ func testAccAwsAppmeshVirtualGateway_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualGatewayDestroy, Steps: []resource.TestStep{ From 3e6a777b646b426e5576f2c196c0943c72d1a82a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:31:33 -0400 Subject: [PATCH 0704/1252] tests/r/appmesh_virtual_node: Add ErrorCheck --- aws/resource_aws_appmesh_virtual_node_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_appmesh_virtual_node_test.go b/aws/resource_aws_appmesh_virtual_node_test.go index 0fc1783a87b..3460e7ebcae 100644 --- a/aws/resource_aws_appmesh_virtual_node_test.go +++ b/aws/resource_aws_appmesh_virtual_node_test.go @@ -93,6 +93,7 @@ func testAccAwsAppmeshVirtualNode_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -133,6 +134,7 @@ func testAccAwsAppmeshVirtualNode_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -158,6 +160,7 @@ func testAccAwsAppmeshVirtualNode_backendClientPolicyAcm(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -237,6 +240,7 @@ func testAccAwsAppmeshVirtualNode_backendClientPolicyFile(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -343,6 +347,7 @@ func testAccAwsAppmeshVirtualNode_backendDefaults(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -426,6 +431,7 @@ func testAccAwsAppmeshVirtualNode_cloudMapServiceDiscovery(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -477,6 +483,7 @@ func testAccAwsAppmeshVirtualNode_listenerConnectionPool(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -565,6 +572,7 @@ func testAccAwsAppmeshVirtualNode_listenerHealthChecks(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -672,6 +680,7 @@ func testAccAwsAppmeshVirtualNode_listenerOutlierDetection(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -765,6 +774,7 @@ func testAccAwsAppmeshVirtualNode_listenerTimeout(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -862,6 +872,7 @@ func testAccAwsAppmeshVirtualNode_listenerTls(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -982,6 +993,7 @@ func testAccAwsAppmeshVirtualNode_logging(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ @@ -1030,6 +1042,7 @@ func testAccAwsAppmeshVirtualNode_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appmesh.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appmesh.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAppmeshVirtualNodeDestroy, Steps: []resource.TestStep{ From 05f717ee671054da065840c57ba2e6b51ea229e1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:32:23 -0400 Subject: [PATCH 0705/1252] tests/r/datasync_agent: Add ErrorCheck --- aws/resource_aws_datasync_agent_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_datasync_agent_test.go b/aws/resource_aws_datasync_agent_test.go index 0672d4e0c36..8ea50098033 100644 --- a/aws/resource_aws_datasync_agent_test.go +++ b/aws/resource_aws_datasync_agent_test.go @@ -81,6 +81,7 @@ func TestAccAWSDataSyncAgent_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncAgentDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAWSDataSyncAgent_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncAgentDestroy, Steps: []resource.TestStep{ @@ -132,6 +134,7 @@ func TestAccAWSDataSyncAgent_AgentName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncAgentDestroy, Steps: []resource.TestStep{ @@ -165,6 +168,7 @@ func TestAccAWSDataSyncAgent_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncAgentDestroy, Steps: []resource.TestStep{ From 15c12989c0762334fab11a1fb447221e035f1219 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:32:33 -0400 Subject: [PATCH 0706/1252] tests/r/datasync_location_efs: Add ErrorCheck --- aws/resource_aws_datasync_location_efs_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_datasync_location_efs_test.go b/aws/resource_aws_datasync_location_efs_test.go index 1f65592faee..750f65af240 100644 --- a/aws/resource_aws_datasync_location_efs_test.go +++ b/aws/resource_aws_datasync_location_efs_test.go @@ -86,6 +86,7 @@ func TestAccAWSDataSyncLocationEfs_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAWSDataSyncLocationEfs_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy, Steps: []resource.TestStep{ @@ -140,6 +142,7 @@ func TestAccAWSDataSyncLocationEfs_Subdirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy, Steps: []resource.TestStep{ @@ -166,6 +169,7 @@ func TestAccAWSDataSyncLocationEfs_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationEfsDestroy, Steps: []resource.TestStep{ From 5e516fb4a860ccb7e4459efe66939c9b45924d24 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:32:43 -0400 Subject: [PATCH 0707/1252] tests/r/datasync_location_nfs: Add ErrorCheck --- aws/resource_aws_datasync_location_nfs_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_datasync_location_nfs_test.go b/aws/resource_aws_datasync_location_nfs_test.go index 3c89be8cadd..008d6109670 100644 --- a/aws/resource_aws_datasync_location_nfs_test.go +++ b/aws/resource_aws_datasync_location_nfs_test.go @@ -86,6 +86,7 @@ func TestAccAWSDataSyncLocationNfs_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAWSDataSyncLocationNfs_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy, Steps: []resource.TestStep{ @@ -141,6 +143,7 @@ func TestAccAWSDataSyncLocationNfs_AgentARNs_Multple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy, Steps: []resource.TestStep{ @@ -169,6 +172,7 @@ func TestAccAWSDataSyncLocationNfs_Subdirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy, Steps: []resource.TestStep{ @@ -196,6 +200,7 @@ func TestAccAWSDataSyncLocationNfs_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationNfsDestroy, Steps: []resource.TestStep{ From 15d9fed899e93ccf87f0c2b01fefe89772d087ff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:32:54 -0400 Subject: [PATCH 0708/1252] tests/r/datasync_location_s3: Add ErrorCheck --- aws/resource_aws_datasync_location_s3_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_datasync_location_s3_test.go b/aws/resource_aws_datasync_location_s3_test.go index ddb77535d38..27a528b3205 100644 --- a/aws/resource_aws_datasync_location_s3_test.go +++ b/aws/resource_aws_datasync_location_s3_test.go @@ -88,6 +88,7 @@ func TestAccAWSDataSyncLocationS3_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSDataSyncLocationS3_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy, Steps: []resource.TestStep{ @@ -143,6 +145,7 @@ func TestAccAWSDataSyncLocationS3_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationS3Destroy, Steps: []resource.TestStep{ From 59901d5da98389eda0f470cb25a4072fb0fde8b4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:33:07 -0400 Subject: [PATCH 0709/1252] tests/r/datasync_location_smb: Add ErrorCheck --- aws/resource_aws_datasync_location_smb_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_datasync_location_smb_test.go b/aws/resource_aws_datasync_location_smb_test.go index afc33720142..6e56e2c9c61 100644 --- a/aws/resource_aws_datasync_location_smb_test.go +++ b/aws/resource_aws_datasync_location_smb_test.go @@ -87,6 +87,7 @@ func TestAccAWSDataSyncLocationSmb_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSDataSyncLocationSmb_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy, Steps: []resource.TestStep{ @@ -143,6 +145,7 @@ func TestAccAWSDataSyncLocationSmb_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationSmbDestroy, Steps: []resource.TestStep{ From 789a1c0234400103f62563744929a25fcd1d7521 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:33:20 -0400 Subject: [PATCH 0710/1252] tests/r/datasync_task: Add ErrorCheck --- aws/resource_aws_datasync_task_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_datasync_task_test.go b/aws/resource_aws_datasync_task_test.go index c18418539d9..e789c0c20cb 100644 --- a/aws/resource_aws_datasync_task_test.go +++ b/aws/resource_aws_datasync_task_test.go @@ -84,6 +84,7 @@ func TestAccAWSDataSyncTask_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -125,6 +126,7 @@ func TestAccAWSDataSyncTask_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -147,6 +149,7 @@ func TestAccAWSDataSyncTask_CloudWatchLogGroupARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_AtimeMtime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -211,6 +215,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_BytesPerSecond(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -247,6 +252,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_Gid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -283,6 +289,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PosixPermissions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -319,6 +326,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PreserveDeletedFiles(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -355,6 +363,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_PreserveDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -391,6 +400,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_Uid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -427,6 +437,7 @@ func TestAccAWSDataSyncTask_DefaultSyncOptions_VerifyMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ @@ -473,6 +484,7 @@ func TestAccAWSDataSyncTask_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncTaskDestroy, Steps: []resource.TestStep{ From eb7582a706e1351ad97047d4b05de2e6ed374736 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:34:52 -0400 Subject: [PATCH 0711/1252] tests/r/datasync_location_fsx_windows_file_system: Add ErrorCheck --- ...urce_aws_datasync_location_fsx_windows_file_system_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_datasync_location_fsx_windows_file_system_test.go b/aws/resource_aws_datasync_location_fsx_windows_file_system_test.go index 2b517e4379b..64e48bba911 100644 --- a/aws/resource_aws_datasync_location_fsx_windows_file_system_test.go +++ b/aws/resource_aws_datasync_location_fsx_windows_file_system_test.go @@ -89,6 +89,7 @@ func TestAccAWSDataSyncLocationFsxWindows_basic(t *testing.T) { testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy, Steps: []resource.TestStep{ @@ -125,6 +126,7 @@ func TestAccAWSDataSyncLocationFsxWindows_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSDataSyncLocationFsxWindows_subdirectory(t *testing.T) { testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy, Steps: []resource.TestStep{ @@ -181,6 +184,7 @@ func TestAccAWSDataSyncLocationFsxWindows_tags(t *testing.T) { testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) testAccPreCheckAWSDataSync(t) }, + ErrorCheck: testAccErrorCheck(t, datasync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataSyncLocationFsxWindowsDestroy, Steps: []resource.TestStep{ From 948b144e53af8aeb62e38f4b07a8949e8b0a99c2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:35:50 -0400 Subject: [PATCH 0712/1252] tests/r/docdb_cluster: Add ErrorCheck --- aws/resource_aws_docdb_cluster_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_docdb_cluster_test.go b/aws/resource_aws_docdb_cluster_test.go index 5b8eb89a74d..7e2b24147d6 100644 --- a/aws/resource_aws_docdb_cluster_test.go +++ b/aws/resource_aws_docdb_cluster_test.go @@ -23,6 +23,7 @@ func TestAccAWSDocDBCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -66,6 +67,7 @@ func TestAccAWSDocDBCluster_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func TestAccAWSDocDBCluster_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -131,6 +134,7 @@ func TestAccAWSDocDBCluster_takeFinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterSnapshot(rInt), Steps: []resource.TestStep{ @@ -161,6 +165,7 @@ func TestAccAWSDocDBCluster_takeFinalSnapshot(t *testing.T) { func TestAccAWSDocDBCluster_missingUserNameCausesError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -178,6 +183,7 @@ func TestAccAWSDocDBCluster_updateTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -219,6 +225,7 @@ func TestAccAWSDocDBCluster_updateCloudwatchLogsExports(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -257,6 +264,7 @@ func TestAccAWSDocDBCluster_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -288,6 +296,7 @@ func TestAccAWSDocDBCluster_encrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -323,6 +332,7 @@ func TestAccAWSDocDBCluster_backupsUpdate(t *testing.T) { ri := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -373,6 +383,7 @@ func TestAccAWSDocDBCluster_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -413,6 +424,7 @@ func TestAccAWSDocDBCluster_deleteProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ From a8ef04d2f6dd286221c14e7ffe4dbaa72117a554 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:36:00 -0400 Subject: [PATCH 0713/1252] tests/r/docdb_cluster_instance: Add ErrorCheck --- aws/resource_aws_docdb_cluster_instance_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_docdb_cluster_instance_test.go b/aws/resource_aws_docdb_cluster_instance_test.go index c3688900ffd..2372bb96fd9 100644 --- a/aws/resource_aws_docdb_cluster_instance_test.go +++ b/aws/resource_aws_docdb_cluster_instance_test.go @@ -22,6 +22,7 @@ func TestAccAWSDocDBClusterInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAWSDocDBClusterInstance_az(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAWSDocDBClusterInstance_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -136,6 +139,7 @@ func TestAccAWSDocDBClusterInstance_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -168,6 +172,7 @@ func TestAccAWSDocDBClusterInstance_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ @@ -200,6 +205,7 @@ func TestAccAWSDocDBClusterInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterDestroy, Steps: []resource.TestStep{ From ce726b574ef2a4a4a60e55aa1be74950b1e73140 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:36:10 -0400 Subject: [PATCH 0714/1252] tests/r/docdb_cluster_parameter_group: Add ErrorCheck --- aws/resource_aws_docdb_cluster_parameter_group_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_docdb_cluster_parameter_group_test.go b/aws/resource_aws_docdb_cluster_parameter_group_test.go index 3b4b0f13d86..3c597472c25 100644 --- a/aws/resource_aws_docdb_cluster_parameter_group_test.go +++ b/aws/resource_aws_docdb_cluster_parameter_group_test.go @@ -21,6 +21,7 @@ func TestAccAWSDocDBClusterParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSDocDBClusterParameterGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSDocDBClusterParameterGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -102,6 +105,7 @@ func TestAccAWSDocDBClusterParameterGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -130,6 +134,7 @@ func TestAccAWSDocDBClusterParameterGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -153,6 +158,7 @@ func TestAccAWSDocDBClusterParameterGroup_Parameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ @@ -199,6 +205,7 @@ func TestAccAWSDocDBClusterParameterGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDocDBClusterParameterGroupDestroy, Steps: []resource.TestStep{ From ca0e770219da87fd9596f88527002c74d7328888 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:36:20 -0400 Subject: [PATCH 0715/1252] tests/r/docdb_cluster_snapshot: Add ErrorCheck --- aws/resource_aws_docdb_cluster_snapshot_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_docdb_cluster_snapshot_test.go b/aws/resource_aws_docdb_cluster_snapshot_test.go index c2d4241c5f7..9816dff1915 100644 --- a/aws/resource_aws_docdb_cluster_snapshot_test.go +++ b/aws/resource_aws_docdb_cluster_snapshot_test.go @@ -19,6 +19,7 @@ func TestAccAWSDocDBClusterSnapshot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBClusterSnapshotDestroy, Steps: []resource.TestStep{ From 95413447039b4faadec7f38938ece6058dbf4a95 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:36:41 -0400 Subject: [PATCH 0716/1252] tests/r/docdb_subnet_group: Add ErrorCheck --- aws/resource_aws_docdb_subnet_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_docdb_subnet_group_test.go b/aws/resource_aws_docdb_subnet_group_test.go index e76712840c0..cc76b0b8ae5 100644 --- a/aws/resource_aws_docdb_subnet_group_test.go +++ b/aws/resource_aws_docdb_subnet_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSDocDBSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSDocDBSubnetGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -70,6 +72,7 @@ func TestAccAWSDocDBSubnetGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -97,6 +100,7 @@ func TestAccAWSDocDBSubnetGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -123,6 +127,7 @@ func TestAccAWSDocDBSubnetGroup_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDocDBSubnetGroupDestroy, Steps: []resource.TestStep{ From 8b3822073f9a6793c513a80a958ef878bc37c381 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:36:53 -0400 Subject: [PATCH 0717/1252] tests/ds/docdb_engine_version: Add ErrorCheck --- aws/data_source_aws_docdb_engine_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_docdb_engine_version_test.go b/aws/data_source_aws_docdb_engine_version_test.go index a0bdb8111c7..b5e0e9b22ab 100644 --- a/aws/data_source_aws_docdb_engine_version_test.go +++ b/aws/data_source_aws_docdb_engine_version_test.go @@ -17,6 +17,7 @@ func TestAccAWSDocDBEngineVersionDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSDocDBEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSDocDBEngineVersionDataSource_preferred(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSDocDBEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -60,6 +62,7 @@ func TestAccAWSDocDBEngineVersionDataSource_defaultOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAWSDocDBEngineVersionPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 1820f8b0e0c9399b5cd15b379c586539fa76263c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:37:06 -0400 Subject: [PATCH 0718/1252] tests/ds/docdb_orderable_db_instance: Add ErrorCheck --- aws/data_source_aws_docdb_orderable_db_instance_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_docdb_orderable_db_instance_test.go b/aws/data_source_aws_docdb_orderable_db_instance_test.go index c581f95083f..54565acaf77 100644 --- a/aws/data_source_aws_docdb_orderable_db_instance_test.go +++ b/aws/data_source_aws_docdb_orderable_db_instance_test.go @@ -18,6 +18,7 @@ func TestAccAWSDocdbOrderableDbInstanceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDocdbOrderableDbInstance(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSDocdbOrderableDbInstanceDataSource_preferred(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDocdbOrderableDbInstance(t) }, + ErrorCheck: testAccErrorCheck(t, docdb.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 09c8e72d48a435e03ddca4b6aa71eb5b58299bf5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:37:50 -0400 Subject: [PATCH 0719/1252] tests/r/elasticache_cluster: Add ErrorCheck --- aws/resource_aws_elasticache_cluster_test.go | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/aws/resource_aws_elasticache_cluster_test.go b/aws/resource_aws_elasticache_cluster_test.go index 03090efdb1b..f106c1ef370 100644 --- a/aws/resource_aws_elasticache_cluster_test.go +++ b/aws/resource_aws_elasticache_cluster_test.go @@ -83,6 +83,7 @@ func TestAccAWSElasticacheCluster_Engine_Memcached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSElasticacheCluster_Engine_Redis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -144,6 +146,7 @@ func TestAccAWSElasticacheCluster_Port_Redis_Default(t *testing.T) { var ec elasticache.CacheCluster resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -166,6 +169,7 @@ func TestAccAWSElasticacheCluster_ParameterGroupName_Default(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -198,6 +202,7 @@ func TestAccAWSElasticacheCluster_Port(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -232,6 +237,7 @@ func TestAccAWSElasticacheCluster_SecurityGroup_Ec2Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -255,6 +261,7 @@ func TestAccAWSElasticacheCluster_snapshotsWithUpdates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -285,6 +292,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Decrease(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -313,6 +321,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Increase(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -341,6 +350,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilit resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -369,6 +379,7 @@ func TestAccAWSElasticacheCluster_vpc(t *testing.T) { var ec elasticache.CacheCluster resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -389,6 +400,7 @@ func TestAccAWSElasticacheCluster_multiAZInVpc(t *testing.T) { var ec elasticache.CacheCluster resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -411,6 +423,7 @@ func TestAccAWSElasticacheCluster_AZMode_Memcached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -444,6 +457,7 @@ func TestAccAWSElasticacheCluster_AZMode_Redis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -473,6 +487,7 @@ func TestAccAWSElasticacheCluster_EngineVersion_Memcached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -510,6 +525,7 @@ func TestAccAWSElasticacheCluster_EngineVersion_Redis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -547,6 +563,7 @@ func TestAccAWSElasticacheCluster_NodeTypeResize_Memcached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -576,6 +593,7 @@ func TestAccAWSElasticacheCluster_NodeTypeResize_Redis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -603,6 +621,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Redis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -623,6 +642,7 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -647,6 +667,7 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -675,6 +696,7 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -705,6 +727,7 @@ func TestAccAWSElasticacheCluster_Memcached_FinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -723,6 +746,7 @@ func TestAccAWSElasticacheCluster_Redis_FinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ From 01fb6bc9d904d1b4d035717e4ad616df06d3bc27 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:01 -0400 Subject: [PATCH 0720/1252] tests/r/elasticache_global_replication_group: Add ErrorCheck --- ...resource_aws_elasticache_global_replication_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_elasticache_global_replication_group_test.go b/aws/resource_aws_elasticache_global_replication_group_test.go index 304343cd981..2265971cb0c 100644 --- a/aws/resource_aws_elasticache_global_replication_group_test.go +++ b/aws/resource_aws_elasticache_global_replication_group_test.go @@ -81,6 +81,7 @@ func TestAccAWSElasticacheGlobalReplicationGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticacheGlobalReplicationGroup(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheGlobalReplicationGroupDestroy, Steps: []resource.TestStep{ @@ -122,6 +123,7 @@ func TestAccAWSElasticacheGlobalReplicationGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticacheGlobalReplicationGroup(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheGlobalReplicationGroupDestroy, Steps: []resource.TestStep{ @@ -156,6 +158,7 @@ func TestAccAWSElasticacheGlobalReplicationGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticacheGlobalReplicationGroup(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheGlobalReplicationGroupDestroy, Steps: []resource.TestStep{ @@ -182,6 +185,7 @@ func TestAccAWSElasticacheGlobalReplicationGroup_MultipleSecondaries(t *testing. testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 3) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 3), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -206,6 +210,7 @@ func TestAccAWSElasticacheGlobalReplicationGroup_ReplaceSecondary_DifferentRegio testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 3) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 3), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ From af162590a1e1ffbb7953309c8c4852cc2005e6a4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:11 -0400 Subject: [PATCH 0721/1252] tests/r/elasticache_parameter_group: Add ErrorCheck --- aws/resource_aws_elasticache_parameter_group_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_elasticache_parameter_group_test.go b/aws/resource_aws_elasticache_parameter_group_test.go index afd9d60d3b5..c498d8d929c 100644 --- a/aws/resource_aws_elasticache_parameter_group_test.go +++ b/aws/resource_aws_elasticache_parameter_group_test.go @@ -75,6 +75,7 @@ func TestAccAWSElasticacheParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSElasticacheParameterGroup_addParameter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSElasticacheParameterGroup_removeAllParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -188,6 +191,7 @@ func TestAccAWSElasticacheParameterGroup_removeReservedMemoryParameter_AllParame resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -227,6 +231,7 @@ func TestAccAWSElasticacheParameterGroup_removeReservedMemoryParameter_Remaining resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -274,6 +279,7 @@ func TestAccAWSElasticacheParameterGroup_switchReservedMemoryParameter(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -317,6 +323,7 @@ func TestAccAWSElasticacheParameterGroup_updateReservedMemoryParameter(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -359,6 +366,7 @@ func TestAccAWSElasticacheParameterGroup_UppercaseName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ @@ -385,6 +393,7 @@ func TestAccAWSElasticacheParameterGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheParameterGroupDestroy, Steps: []resource.TestStep{ From ceb863060eed115ef2d7e9857f5e4e4f4d618299 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:22 -0400 Subject: [PATCH 0722/1252] tests/r/elasticache_replication_group: Add ErrorCheck --- ..._aws_elasticache_replication_group_test.go | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/aws/resource_aws_elasticache_replication_group_test.go b/aws/resource_aws_elasticache_replication_group_test.go index b855ae7dd62..a373bf927cb 100644 --- a/aws/resource_aws_elasticache_replication_group_test.go +++ b/aws/resource_aws_elasticache_replication_group_test.go @@ -71,6 +71,7 @@ func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -109,6 +110,7 @@ func TestAccAWSElasticacheReplicationGroup_Uppercase(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -137,6 +139,7 @@ func TestAccAWSElasticacheReplicationGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -159,6 +162,7 @@ func TestAccAWSElasticacheReplicationGroup_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -203,6 +207,7 @@ func TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -239,6 +244,7 @@ func TestAccAWSElasticacheReplicationGroup_updateNodeSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -282,6 +288,7 @@ func TestAccAWSElasticacheReplicationGroup_updateParameterGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -315,6 +322,7 @@ func TestAccAWSElasticacheReplicationGroup_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -343,6 +351,7 @@ func TestAccAWSElasticacheReplicationGroup_multiAzNotInVpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -390,6 +399,7 @@ func TestAccAWSElasticacheReplicationGroup_multiAzInVpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -427,6 +437,7 @@ func TestAccAWSElasticacheReplicationGroup_multiAz_NoAutomaticFailover(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -443,6 +454,7 @@ func TestAccAWSElasticacheReplicationGroup_AutomaticFailover_OneCacheCluster(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -465,6 +477,7 @@ func TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -500,6 +513,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -537,6 +551,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_NonClusteredParameterGrou resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -572,6 +587,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroups_Scale resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -611,6 +627,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroups_Scale resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -651,6 +668,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateReplicasPerNodeGrou resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -704,6 +722,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroupsAndRep resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -744,6 +763,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_UpdateNumNodeGroupsAndRep resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -783,6 +803,7 @@ func TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -801,6 +822,7 @@ func TestAccAWSElasticacheReplicationGroup_enableSnapshotting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -834,6 +856,7 @@ func TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -861,6 +884,7 @@ func TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -885,6 +909,7 @@ func TestAccAWSElasticacheReplicationGroup_useCmkKmsKeyId(t *testing.T) { var rg elasticache.ReplicationGroup resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -906,6 +931,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Basic(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -959,6 +985,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFail resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1011,6 +1038,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFail resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1068,6 +1096,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MultiAZEnabled(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1122,6 +1151,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1167,6 +1197,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1212,6 +1243,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1257,6 +1289,7 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_MemberClusterDisa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1302,6 +1335,7 @@ func TestAccAWSElasticacheReplicationGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1347,6 +1381,7 @@ func TestAccAWSElasticacheReplicationGroup_FinalSnapshot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1370,6 +1405,7 @@ func TestAccAWSElasticacheReplicationGroup_Validation_NoNodeType(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1390,6 +1426,7 @@ func TestAccAWSElasticacheReplicationGroup_Validation_GlobalReplicationGroupIdAn testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1412,6 +1449,7 @@ func TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Basic(t *tes testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ @@ -1450,6 +1488,7 @@ func TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_disappears(t testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, Steps: []resource.TestStep{ From e15990a20dee97909ff83bb2ed9ba5f21a3e8659 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:35 -0400 Subject: [PATCH 0723/1252] tests/r/elasticache_security_group: Add ErrorCheck --- aws/resource_aws_elasticache_security_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_elasticache_security_group_test.go b/aws/resource_aws_elasticache_security_group_test.go index 27cc09cd8b6..323245c9634 100644 --- a/aws/resource_aws_elasticache_security_group_test.go +++ b/aws/resource_aws_elasticache_security_group_test.go @@ -71,6 +71,7 @@ func TestAccAWSElasticacheSecurityGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSElasticacheSecurityGroupDestroy, Steps: []resource.TestStep{ From fe869ac409f39b45b8143f92fd285a58b000dae9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:47 -0400 Subject: [PATCH 0724/1252] tests/r/elasticache_subnet_group: Add ErrorCheck --- aws/resource_aws_elasticache_subnet_group_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_elasticache_subnet_group_test.go b/aws/resource_aws_elasticache_subnet_group_test.go index adc874995bd..fed6b5ba1bb 100644 --- a/aws/resource_aws_elasticache_subnet_group_test.go +++ b/aws/resource_aws_elasticache_subnet_group_test.go @@ -66,6 +66,7 @@ func TestAccAWSElasticacheSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheSubnetGroupDestroy, Steps: []resource.TestStep{ @@ -95,6 +96,7 @@ func TestAccAWSElasticacheSubnetGroup_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheSubnetGroupDestroy, Steps: []resource.TestStep{ From 9e90a14e41f510d116b0d975384c3dfc4edb3b3e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:38:59 -0400 Subject: [PATCH 0725/1252] tests/ds/elasticache_replication_group: Add ErrorCheck --- ..._aws_elasticache_replication_group_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_elasticache_replication_group_test.go b/aws/data_source_aws_elasticache_replication_group_test.go index ff4d5b9797e..ae8c679dee1 100644 --- a/aws/data_source_aws_elasticache_replication_group_test.go +++ b/aws/data_source_aws_elasticache_replication_group_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_basic(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_basic(rName), @@ -46,8 +48,9 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_ClusterMode(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_ClusterMode(rName), @@ -72,8 +75,9 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_MultiAZ(t *testing.T) { dataSourceName := "data.aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_MultiAZ(rName), @@ -89,8 +93,9 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_MultiAZ(t *testing.T) { func TestAccDataSourceAwsElasticacheReplicationGroup_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_NonExistent, From 1bd1e230cfe5e663e6f661f2b4e7c2331a502e46 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:47:32 -0400 Subject: [PATCH 0726/1252] tests/r/sns_platform_application: Add ErrorCheck --- aws/resource_aws_sns_platform_application_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sns_platform_application_test.go b/aws/resource_aws_sns_platform_application_test.go index 4b26a78f04a..6b899d99858 100644 --- a/aws/resource_aws_sns_platform_application_test.go +++ b/aws/resource_aws_sns_platform_application_test.go @@ -211,6 +211,7 @@ func TestAccAWSSnsPlatformApplication_basic(t *testing.T) { t.Run(platform.Name, func(*testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSPlatformApplicationDestroy, Steps: []resource.TestStep{ @@ -277,6 +278,7 @@ func TestAccAWSSnsPlatformApplication_basicAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSPlatformApplicationDestroy, Steps: []resource.TestStep{ @@ -327,6 +329,7 @@ func TestAccAWSSnsPlatformApplication_iamRoleAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSPlatformApplicationDestroy, Steps: []resource.TestStep{ @@ -379,6 +382,7 @@ func TestAccAWSSnsPlatformApplication_snsTopicAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSPlatformApplicationDestroy, Steps: []resource.TestStep{ From b518469eee56a93ca7394b733a303ce30ff75bcf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:47:42 -0400 Subject: [PATCH 0727/1252] tests/r/sns_sms_preferences: Add ErrorCheck --- aws/resource_aws_sns_sms_preferences_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sns_sms_preferences_test.go b/aws/resource_aws_sns_sms_preferences_test.go index bdd4f777e26..2a79c5dbafa 100644 --- a/aws/resource_aws_sns_sms_preferences_test.go +++ b/aws/resource_aws_sns_sms_preferences_test.go @@ -33,6 +33,7 @@ func testAccAWSSNSSMSPreferences_empty(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSSMSPrefsDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func testAccAWSSNSSMSPreferences_defaultSMSType(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSSMSPrefsDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func testAccAWSSNSSMSPreferences_almostAll(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSSMSPrefsDestroy, Steps: []resource.TestStep{ @@ -100,6 +103,7 @@ func testAccAWSSNSSMSPreferences_deliveryRole(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSSMSPrefsDestroy, Steps: []resource.TestStep{ From 6ae9bab969522d8a3b7135d8189a75ba7320b239 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:47:52 -0400 Subject: [PATCH 0728/1252] tests/r/sns_topic: Add ErrorCheck --- aws/resource_aws_sns_topic_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_sns_topic_test.go b/aws/resource_aws_sns_topic_test.go index 63bbb78f809..1fa7f5cfb27 100644 --- a/aws/resource_aws_sns_topic_test.go +++ b/aws/resource_aws_sns_topic_test.go @@ -92,6 +92,7 @@ func TestAccAWSSNSTopic_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -118,6 +119,7 @@ func TestAccAWSSNSTopic_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -144,6 +146,7 @@ func TestAccAWSSNSTopic_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -173,6 +176,7 @@ func TestAccAWSSNSTopic_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -200,6 +204,7 @@ func TestAccAWSSNSTopic_withIAMRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -218,6 +223,7 @@ func TestAccAWSSNSTopic_withFakeIAMRole(t *testing.T) { rName := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: "aws_sns_topic.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -238,6 +244,7 @@ func TestAccAWSSNSTopic_withDeliveryPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -267,6 +274,7 @@ func TestAccAWSSNSTopic_deliveryStatus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -300,6 +308,7 @@ func TestAccAWSSNSTopic_encryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, @@ -334,6 +343,7 @@ func TestAccAWSSNSTopic_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, From e8bdceed57dc57f045fe78d2f5e901eda67cc312 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:48:03 -0400 Subject: [PATCH 0729/1252] tests/r/sns_topic_policy: Add ErrorCheck --- aws/resource_aws_sns_topic_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_sns_topic_policy_test.go b/aws/resource_aws_sns_topic_policy_test.go index ab7aa708143..4c9460f45d8 100644 --- a/aws/resource_aws_sns_topic_policy_test.go +++ b/aws/resource_aws_sns_topic_policy_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/sns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,6 +14,7 @@ func TestAccAWSSNSTopicPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ From 4627d4e27e9afd5c9f239d170c16adb27efefe84 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:48:13 -0400 Subject: [PATCH 0730/1252] tests/r/sns_topic_subscription: Add ErrorCheck --- aws/resource_aws_sns_topic_subscription_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_sns_topic_subscription_test.go b/aws/resource_aws_sns_topic_subscription_test.go index 95fe10e4cdf..afc2f08a5f0 100644 --- a/aws/resource_aws_sns_topic_subscription_test.go +++ b/aws/resource_aws_sns_topic_subscription_test.go @@ -72,6 +72,7 @@ func TestAccAWSSNSTopicSubscription_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSSNSTopicSubscription_filterPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -158,6 +160,7 @@ func TestAccAWSSNSTopicSubscription_deliveryPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -218,6 +221,7 @@ func TestAccAWSSNSTopicSubscription_redrivePolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -273,6 +277,7 @@ func TestAccAWSSNSTopicSubscription_rawMessageDelivery(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -319,6 +324,7 @@ func TestAccAWSSNSTopicSubscription_autoConfirmingEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -348,6 +354,7 @@ func TestAccAWSSNSTopicSubscription_autoConfirmingSecuredEndpoint(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -377,6 +384,7 @@ func TestAccAWSSNSTopicSubscription_email(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ From b07a3784daacd13437e054a829344e33251ca6d7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:48:34 -0400 Subject: [PATCH 0731/1252] tests/ds/sns: Add ErrorCheck --- aws/data_source_aws_sns_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_sns_test.go b/aws/data_source_aws_sns_test.go index 00ccb8f6ae2..b8ed1d3c828 100644 --- a/aws/data_source_aws_sns_test.go +++ b/aws/data_source_aws_sns_test.go @@ -4,14 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/sns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccDataSourceAwsSnsTopic_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSnsTopicConfig, From ffda63c9a0308682c5ef85fe6ed35b0e27bb0728 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:49:51 -0400 Subject: [PATCH 0732/1252] tests/r/ssoadmin_account_assignment: Add ErrorCheck --- aws/resource_aws_ssoadmin_account_assignment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ssoadmin_account_assignment_test.go b/aws/resource_aws_ssoadmin_account_assignment_test.go index 360dd829360..91e73f32d22 100644 --- a/aws/resource_aws_ssoadmin_account_assignment_test.go +++ b/aws/resource_aws_ssoadmin_account_assignment_test.go @@ -143,6 +143,7 @@ func TestAccAWSSSOAdminAccountAssignment_Basic_Group(t *testing.T) { testAccPreCheckAWSSSOAdminInstances(t) testAccPreCheckAWSIdentityStoreGroupName(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminAccountAssignmentDestroy, Steps: []resource.TestStep{ @@ -175,6 +176,7 @@ func TestAccAWSSSOAdminAccountAssignment_Basic_User(t *testing.T) { testAccPreCheckAWSSSOAdminInstances(t) testAccPreCheckAWSIdentityStoreUserName(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminAccountAssignmentDestroy, Steps: []resource.TestStep{ @@ -207,6 +209,7 @@ func TestAccAWSSSOAdminAccountAssignment_Disappears(t *testing.T) { testAccPreCheckAWSSSOAdminInstances(t) testAccPreCheckAWSIdentityStoreGroupName(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminAccountAssignmentDestroy, Steps: []resource.TestStep{ From c35473336883c16a730226162cd03c836ac020b1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:50:01 -0400 Subject: [PATCH 0733/1252] tests/r/ssoadmin_managed_policy_attachment: Add ErrorCheck --- aws/resource_aws_ssoadmin_managed_policy_attachment_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_ssoadmin_managed_policy_attachment_test.go b/aws/resource_aws_ssoadmin_managed_policy_attachment_test.go index 6f933c780b9..1397b21698d 100644 --- a/aws/resource_aws_ssoadmin_managed_policy_attachment_test.go +++ b/aws/resource_aws_ssoadmin_managed_policy_attachment_test.go @@ -20,6 +20,7 @@ func TestAccAWSSSOAdminManagedPolicyAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminManagedPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSSSOAdminManagedPolicyAttachment_forceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminManagedPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -85,6 +87,7 @@ func TestAccAWSSSOAdminManagedPolicyAttachment_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminManagedPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -107,6 +110,7 @@ func TestAccAWSSSOAdminManagedPolicyAttachment_disappears_permissionSet(t *testi resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminManagedPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -130,6 +134,7 @@ func TestAccAWSSSOAdminManagedPolicyAttachment_multipleManagedPolicies(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminManagedPolicyAttachmentDestroy, Steps: []resource.TestStep{ From 7bfa6549d9ca86bfd136e2ac5a4cac92cdb664c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:50:11 -0400 Subject: [PATCH 0734/1252] tests/r/ssoadmin_permission_set: Add ErrorCheck --- aws/resource_aws_ssoadmin_permission_set_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_ssoadmin_permission_set_test.go b/aws/resource_aws_ssoadmin_permission_set_test.go index 5ed652c5907..7d4d601f5a1 100644 --- a/aws/resource_aws_ssoadmin_permission_set_test.go +++ b/aws/resource_aws_ssoadmin_permission_set_test.go @@ -104,6 +104,7 @@ func TestAccAWSSSOAdminPermissionSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSSSOAdminPermissionSet_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -183,6 +185,7 @@ func TestAccAWSSSOAdminPermissionSet_updateDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -215,6 +218,7 @@ func TestAccAWSSSOAdminPermissionSet_updateRelayState(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -247,6 +251,7 @@ func TestAccAWSSSOAdminPermissionSet_updateSessionDuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -281,6 +286,7 @@ func TestAccAWSSSOAdminPermissionSet_relayState_updateSessionDuration(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ @@ -319,6 +325,7 @@ func TestAccAWSSSOAdminPermissionSet_mixedPolicyAttachments(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetDestroy, Steps: []resource.TestStep{ From 4933a4a0d365324d3455d351dacd8398d85a0839 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:50:21 -0400 Subject: [PATCH 0735/1252] tests/r/ssoadmin_permission_set_inline_policy: Add ErrorCheck --- ...resource_aws_ssoadmin_permission_set_inline_policy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ssoadmin_permission_set_inline_policy_test.go b/aws/resource_aws_ssoadmin_permission_set_inline_policy_test.go index 6d2637af690..ee884adefc6 100644 --- a/aws/resource_aws_ssoadmin_permission_set_inline_policy_test.go +++ b/aws/resource_aws_ssoadmin_permission_set_inline_policy_test.go @@ -20,6 +20,7 @@ func TestAccAWSSSOAdminPermissionSetInlinePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetInlinePolicyDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSSSOAdminPermissionSetInlinePolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetInlinePolicyDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSSSOAdminPermissionSetInlinePolicy_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetInlinePolicyDestroy, Steps: []resource.TestStep{ @@ -101,6 +104,7 @@ func TestAccAWSSSOAdminPermissionSetInlinePolicy_disappears_permissionSet(t *tes resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSSOAdminPermissionSetInlinePolicyDestroy, Steps: []resource.TestStep{ From ed8c97b0b8d032e4551f3dfb56e39be743604a73 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:50:44 -0400 Subject: [PATCH 0736/1252] tests/ds/ssoadmin_instances: Add ErrorCheck --- aws/data_source_aws_ssoadmin_instances_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ssoadmin_instances_test.go b/aws/data_source_aws_ssoadmin_instances_test.go index a4c4eb48fb9..f2c2a915896 100644 --- a/aws/data_source_aws_ssoadmin_instances_test.go +++ b/aws/data_source_aws_ssoadmin_instances_test.go @@ -39,8 +39,9 @@ func TestAccDataSourceAWSSSOAdminInstances_basic(t *testing.T) { dataSourceName := "data.aws_ssoadmin_instances.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSSOAdminInstancesConfigBasic, From df2404131b4647d3320d0c4a118cce7fb9066b99 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:50:56 -0400 Subject: [PATCH 0737/1252] tests/ds/ssoadmin_permission_set: Add ErrorCheck --- ...ta_source_aws_ssoadmin_permission_set_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ssoadmin_permission_set_test.go b/aws/data_source_aws_ssoadmin_permission_set_test.go index d83cfc94930..c11864d0379 100644 --- a/aws/data_source_aws_ssoadmin_permission_set_test.go +++ b/aws/data_source_aws_ssoadmin_permission_set_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ssoadmin" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSSSOAdminPermissionSet_arn(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSSOPermissionSetByArnConfig(rName), @@ -39,8 +41,9 @@ func TestAccDataSourceAWSSSOAdminPermissionSet_name(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSSOPermissionSetByNameConfig(rName), @@ -60,8 +63,9 @@ func TestAccDataSourceAWSSSOAdminPermissionSet_name(t *testing.T) { func TestAccDataSourceAWSSSOAdminPermissionSet_nonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, ssoadmin.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSSOPermissionSetByNameConfig_nonExistent, From 0d5170e5a5491f12de9592dd30657fb73d67e059 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:52:26 -0400 Subject: [PATCH 0738/1252] tests/r/sfn_activity: Add ErrorCheck --- aws/resource_aws_sfn_activity_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_sfn_activity_test.go b/aws/resource_aws_sfn_activity_test.go index ed1064de688..302baf1cb46 100644 --- a/aws/resource_aws_sfn_activity_test.go +++ b/aws/resource_aws_sfn_activity_test.go @@ -19,6 +19,7 @@ func TestAccAWSSfnActivity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnActivityDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSSfnActivity_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnActivityDestroy, Steps: []resource.TestStep{ From a38e23b509aea634cc2fc66bc9f0ba0cea882968 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:52:37 -0400 Subject: [PATCH 0739/1252] tests/r/sfn_state_machine: Add ErrorCheck --- aws/resource_aws_sfn_state_machine_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_sfn_state_machine_test.go b/aws/resource_aws_sfn_state_machine_test.go index 6aeb6a3beda..a17715e1c84 100644 --- a/aws/resource_aws_sfn_state_machine_test.go +++ b/aws/resource_aws_sfn_state_machine_test.go @@ -20,6 +20,7 @@ func TestAccAWSSfnStateMachine_createUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSSfnStateMachine_expressUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ @@ -101,6 +103,7 @@ func TestAccAWSSfnStateMachine_standardUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ @@ -140,6 +143,7 @@ func TestAccAWSSfnStateMachine_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ @@ -184,6 +188,7 @@ func TestAccAWSSfnStateMachine_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ @@ -205,6 +210,7 @@ func TestAccAWSSfnStateMachine_expressLoggingConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSfnStateMachineDestroy, Steps: []resource.TestStep{ From 45e2e360414e5ebfd0e0a640f3566dcc6b2f7837 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:52:47 -0400 Subject: [PATCH 0740/1252] tests/ds/sfn_activity: Add ErrorCheck --- aws/data_source_aws_sfn_activity_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_sfn_activity_test.go b/aws/data_source_aws_sfn_activity_test.go index 4d107a0b9de..b7a002ec173 100644 --- a/aws/data_source_aws_sfn_activity_test.go +++ b/aws/data_source_aws_sfn_activity_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/sfn" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSStepFunctionsActivityDataSource_basic(t *testing.T) { dataName := "data.aws_sfn_activity.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityArn(rName), From e6aab1ab48c3fc73dbb95d7425505e5f727d42c8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:52:57 -0400 Subject: [PATCH 0741/1252] tests/ds/sfn_state_machine: Add ErrorCheck --- aws/data_source_aws_sfn_state_machine_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_sfn_state_machine_test.go b/aws/data_source_aws_sfn_state_machine_test.go index 6d5913461bf..b4c0cb17d19 100644 --- a/aws/data_source_aws_sfn_state_machine_test.go +++ b/aws/data_source_aws_sfn_state_machine_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/sfn" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsSfnStateMachine_basic(t *testing.T) { resourceName := "aws_sfn_state_machine.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sfn.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSfnStateMachineConfig(rName), From e9b70d76b06314873018cde13ff87f31cbc9c287 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:54:05 -0400 Subject: [PATCH 0742/1252] tests/r/sqs_queue: Add ErrorCheck --- aws/resource_aws_sqs_queue_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_sqs_queue_test.go b/aws/resource_aws_sqs_queue_test.go index 3eb37f1d378..18877a225bc 100644 --- a/aws/resource_aws_sqs_queue_test.go +++ b/aws/resource_aws_sqs_queue_test.go @@ -79,6 +79,7 @@ func TestAccAWSSQSQueue_basic(t *testing.T) { queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -122,6 +123,7 @@ func TestAccAWSSQSQueue_tags(t *testing.T) { queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -170,6 +172,7 @@ func TestAccAWSSQSQueue_namePrefix(t *testing.T) { prefix := "acctest-sqs-queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -200,6 +203,7 @@ func TestAccAWSSQSQueue_namePrefix_fifo(t *testing.T) { prefix := "acctest-sqs-queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -231,6 +235,7 @@ func TestAccAWSSQSQueue_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -260,6 +265,7 @@ func TestAccAWSSQSQueue_queueDeletedRecently(t *testing.T) { queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -287,6 +293,7 @@ func TestAccAWSSQSQueue_redrivePolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -317,6 +324,7 @@ func TestAccAWSSQSQueue_Policybasic(t *testing.T) { topicName := fmt.Sprintf("sns-topic-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -345,6 +353,7 @@ func TestAccAWSSQSQueue_FIFO(t *testing.T) { resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -370,6 +379,7 @@ func TestAccAWSSQSQueue_FIFO(t *testing.T) { func TestAccAWSSQSQueue_FIFOExpectNameError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -387,6 +397,7 @@ func TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication(t *testing.T) { resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -413,6 +424,7 @@ func TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication(t *testing.T) { func TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -430,6 +442,7 @@ func TestAccAWSSQSQueue_Encryption(t *testing.T) { resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -481,6 +494,7 @@ func testAccCheckAWSSQSQueueDestroy(s *terraform.State) error { return nil } + func testAccCheckAWSSQSQueuePolicyAttribute(queueAttributes *map[string]*string, topicName, queueName string) resource.TestCheckFunc { return func(s *terraform.State) error { accountID := testAccProvider.Meta().(*AWSClient).accountid From 9b0b377fee9e9da3c13bfc9746ad2b6bb7c5f860 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:54:14 -0400 Subject: [PATCH 0743/1252] tests/r/sqs_queue_policy: Add ErrorCheck --- aws/resource_aws_sqs_queue_policy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_sqs_queue_policy_test.go b/aws/resource_aws_sqs_queue_policy_test.go index 4d226ac2d98..a75bb561994 100644 --- a/aws/resource_aws_sqs_queue_policy_test.go +++ b/aws/resource_aws_sqs_queue_policy_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/sqs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSSQSQueuePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -51,6 +53,7 @@ func TestAccAWSSQSQueuePolicy_disappears_queue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ @@ -74,6 +77,7 @@ func TestAccAWSSQSQueuePolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSQSQueueDestroy, Steps: []resource.TestStep{ From fbf30dfccbc97bdb2bb4c3e2cbe83cfaf79540c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:54:35 -0400 Subject: [PATCH 0744/1252] tests/ds/sqs_queue: Add ErrorCheck --- aws/data_source_aws_sqs_queue_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_sqs_queue_test.go b/aws/data_source_aws_sqs_queue_test.go index eb710cca0a4..602671d943c 100644 --- a/aws/data_source_aws_sqs_queue_test.go +++ b/aws/data_source_aws_sqs_queue_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/sqs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -15,8 +16,9 @@ func TestAccDataSourceAwsSqsQueue_basic(t *testing.T) { datasourceName := "data.aws_sqs_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSqsQueueConfig(rName), @@ -35,8 +37,9 @@ func TestAccDataSourceAwsSqsQueue_tags(t *testing.T) { datasourceName := "data.aws_sqs_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sqs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSqsQueueConfigTags(rName), From 11dbf2b98dea00986490828cceaaf113d48fa74e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:55:18 -0400 Subject: [PATCH 0745/1252] tests/r/organizations_account: Add ErrorCheck --- aws/resource_aws_organizations_account_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_organizations_account_test.go b/aws/resource_aws_organizations_account_test.go index 2d129268e82..3941fb7f716 100644 --- a/aws/resource_aws_organizations_account_test.go +++ b/aws/resource_aws_organizations_account_test.go @@ -28,6 +28,7 @@ func testAccAwsOrganizationsAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsAccountDestroy, Steps: []resource.TestStep{ @@ -74,6 +75,7 @@ func testAccAwsOrganizationsAccount_ParentId(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsAccountDestroy, Steps: []resource.TestStep{ @@ -118,6 +120,7 @@ func testAccAwsOrganizationsAccount_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsAccountDestroy, Steps: []resource.TestStep{ From c3801f4573796d2fc50cca66288d48828c97288f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:55:28 -0400 Subject: [PATCH 0746/1252] tests/r/organizations_organization: Add ErrorCheck --- aws/resource_aws_organizations_organization_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_organizations_organization_test.go b/aws/resource_aws_organizations_organization_test.go index 6fba3045169..59dcae6129e 100644 --- a/aws/resource_aws_organizations_organization_test.go +++ b/aws/resource_aws_organizations_organization_test.go @@ -17,6 +17,7 @@ func testAccAwsOrganizationsOrganization_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func testAccAwsOrganizationsOrganization_AwsServiceAccessPrincipals(t *testing.T resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ @@ -100,6 +102,7 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ @@ -184,6 +187,7 @@ func testAccAwsOrganizationsOrganization_FeatureSet(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ @@ -209,6 +213,7 @@ func testAccAwsOrganizationsOrganization_FeatureSetForcesNew(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ @@ -242,6 +247,7 @@ func testAccAwsOrganizationsOrganization_FeatureSetUpdate(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationDestroy, Steps: []resource.TestStep{ From bc57bf55705c8ef9cd85229f5620a48f53b61ef6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:55:38 -0400 Subject: [PATCH 0747/1252] tests/r/organizations_organizational_unit: Add ErrorCheck --- aws/resource_aws_organizations_organizational_unit_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_organizations_organizational_unit_test.go b/aws/resource_aws_organizations_organizational_unit_test.go index 2d6f35afee6..d4ff09f8596 100644 --- a/aws/resource_aws_organizations_organizational_unit_test.go +++ b/aws/resource_aws_organizations_organizational_unit_test.go @@ -20,6 +20,7 @@ func testAccAwsOrganizationsOrganizationalUnit_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationalUnitDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func testAccAwsOrganizationsOrganizationalUnit_Name(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsOrganizationalUnitDestroy, Steps: []resource.TestStep{ From 7f3e1ca386cf275b53ab2d213ec4e0714dc8ff6b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:55:51 -0400 Subject: [PATCH 0748/1252] tests/r/organizations_policy: Add ErrorCheck --- aws/resource_aws_organizations_policy_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_organizations_policy_test.go b/aws/resource_aws_organizations_policy_test.go index 08c24544e35..fb6b5eba525 100644 --- a/aws/resource_aws_organizations_policy_test.go +++ b/aws/resource_aws_organizations_policy_test.go @@ -21,6 +21,7 @@ func testAccAwsOrganizationsPolicy_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func testAccAwsOrganizationsPolicy_concurrent(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func testAccAwsOrganizationsPolicy_description(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -120,6 +123,7 @@ func testAccAwsOrganizationsPolicy_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -172,6 +176,7 @@ func testAccAwsOrganizationsPolicy_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -196,6 +201,7 @@ func testAccAwsOrganizationsPolicy_type_AI_OPT_OUT(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -292,6 +298,7 @@ func testAccAwsOrganizationsPolicy_type_Backup(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -319,6 +326,7 @@ func testAccAwsOrganizationsPolicy_type_SCP(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -353,6 +361,7 @@ func testAccAwsOrganizationsPolicy_type_Tag(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ @@ -379,6 +388,7 @@ func testAccAwsOrganizationsPolicy_ImportAwsManagedPolicy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, Steps: []resource.TestStep{ From 4088f70fc721dfb7e1fe6c7ba76a4799347d3445 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:56:05 -0400 Subject: [PATCH 0749/1252] tests/r/organizations_policy_attachment: Add ErrorCheck --- aws/resource_aws_organizations_policy_attachment_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_organizations_policy_attachment_test.go b/aws/resource_aws_organizations_policy_attachment_test.go index bf0fa8db515..df9b82f126d 100644 --- a/aws/resource_aws_organizations_policy_attachment_test.go +++ b/aws/resource_aws_organizations_policy_attachment_test.go @@ -24,6 +24,7 @@ func testAccAwsOrganizationsPolicyAttachment_Account(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func testAccAwsOrganizationsPolicyAttachment_OrganizationalUnit(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyAttachmentDestroy, Steps: []resource.TestStep{ @@ -88,6 +90,7 @@ func testAccAwsOrganizationsPolicyAttachment_Root(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyAttachmentDestroy, Steps: []resource.TestStep{ From 81a155673823d0132147af08ee34cf24b27f33d2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:56:29 -0400 Subject: [PATCH 0750/1252] tests/ds/organizations_organization: Add ErrorCheck --- aws/data_source_aws_organizations_organization_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_organizations_organization_test.go b/aws/data_source_aws_organizations_organization_test.go index ee6258b56a9..725fb60a733 100644 --- a/aws/data_source_aws_organizations_organization_test.go +++ b/aws/data_source_aws_organizations_organization_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,7 +16,8 @@ func testAccDataSourceAwsOrganizationsOrganization_basic(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsOrganizationResourceOnlyConfig, From f4ee5c724491c28ea261baf28741af07fb9df801 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:56:42 -0400 Subject: [PATCH 0751/1252] tests/ds/organizations_organizational_units: Add ErrorCheck --- ...data_source_aws_organizations_organizational_units_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_organizations_organizational_units_test.go b/aws/data_source_aws_organizations_organizational_units_test.go index 9301852dcb8..f1640d4003c 100644 --- a/aws/data_source_aws_organizations_organizational_units_test.go +++ b/aws/data_source_aws_organizations_organizational_units_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/organizations" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,7 +15,8 @@ func testAccDataSourceAwsOrganizationsOrganizationalUnits_basic(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, organizations.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsOrganizationsOrganizationalUnitsConfig, From c4c02872e24ce4a02e364a3a44ca8c7749fa57c9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:57:30 -0400 Subject: [PATCH 0752/1252] tests/r/secretsmanager_secret: Add ErrorCheck --- aws/resource_aws_secretsmanager_secret_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_secretsmanager_secret_test.go b/aws/resource_aws_secretsmanager_secret_test.go index 24506ebb616..6f4067058a3 100644 --- a/aws/resource_aws_secretsmanager_secret_test.go +++ b/aws/resource_aws_secretsmanager_secret_test.go @@ -71,6 +71,7 @@ func TestAccAwsSecretsManagerSecret_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAwsSecretsManagerSecret_withNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -134,6 +136,7 @@ func TestAccAwsSecretsManagerSecret_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -168,6 +171,7 @@ func TestAccAwsSecretsManagerSecret_KmsKeyID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -202,6 +206,7 @@ func TestAccAwsSecretsManagerSecret_RecoveryWindowInDays_Recreate(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -238,6 +243,7 @@ func TestAccAwsSecretsManagerSecret_RotationLambdaARN(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -289,6 +295,7 @@ func TestAccAwsSecretsManagerSecret_RotationRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -342,6 +349,7 @@ func TestAccAwsSecretsManagerSecret_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ @@ -395,6 +403,7 @@ func TestAccAwsSecretsManagerSecret_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretDestroy, Steps: []resource.TestStep{ From 8d1b2471f4b43266e1a9ffa44677e9b8aeac4d71 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:57:40 -0400 Subject: [PATCH 0753/1252] tests/r/secretsmanager_secret_policy: Add ErrorCheck --- aws/resource_aws_secretsmanager_secret_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_secretsmanager_secret_policy_test.go b/aws/resource_aws_secretsmanager_secret_policy_test.go index b6dfaa06f08..305cad4d0c6 100644 --- a/aws/resource_aws_secretsmanager_secret_policy_test.go +++ b/aws/resource_aws_secretsmanager_secret_policy_test.go @@ -70,6 +70,7 @@ func TestAccAwsSecretsManagerSecretPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretPolicyDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAwsSecretsManagerSecretPolicy_blockPublicPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretPolicyDestroy, Steps: []resource.TestStep{ @@ -147,6 +149,7 @@ func TestAccAwsSecretsManagerSecretPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretPolicyDestroy, Steps: []resource.TestStep{ From 88d95f8239f4fdb6c78db0f3228787c94da829af Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:57:50 -0400 Subject: [PATCH 0754/1252] tests/r/secretsmanager_secret_rotation: Add ErrorCheck --- aws/resource_aws_secretsmanager_secret_rotation_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_secretsmanager_secret_rotation_test.go b/aws/resource_aws_secretsmanager_secret_rotation_test.go index df5f8892c68..d41f5532994 100644 --- a/aws/resource_aws_secretsmanager_secret_rotation_test.go +++ b/aws/resource_aws_secretsmanager_secret_rotation_test.go @@ -19,6 +19,7 @@ func TestAccAwsSecretsManagerSecretRotation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretRotationDestroy, Steps: []resource.TestStep{ From 37a77087f958ba6b24290f50a8b0649ea46ba7ca Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:58:15 -0400 Subject: [PATCH 0755/1252] tests/r/secretsmanager_secret_version: Add ErrorCheck --- aws/resource_aws_secretsmanager_secret_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_secretsmanager_secret_version_test.go b/aws/resource_aws_secretsmanager_secret_version_test.go index 99a91646379..233364f0541 100644 --- a/aws/resource_aws_secretsmanager_secret_version_test.go +++ b/aws/resource_aws_secretsmanager_secret_version_test.go @@ -19,6 +19,7 @@ func TestAccAwsSecretsManagerSecretVersion_BasicString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretVersionDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAwsSecretsManagerSecretVersion_Base64Binary(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretVersionDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAwsSecretsManagerSecretVersion_VersionStages(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecretsManagerSecretVersionDestroy, Steps: []resource.TestStep{ From ce74a62b3cc9739d32b1bce9ef424ede8699298a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:58:27 -0400 Subject: [PATCH 0756/1252] tests/ds/secretsmanager_secret: Add ErrorCheck --- ...a_source_aws_secretsmanager_secret_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_secretsmanager_secret_test.go b/aws/data_source_aws_secretsmanager_secret_test.go index cf48bcce885..6038dbb9fff 100644 --- a/aws/data_source_aws_secretsmanager_secret_test.go +++ b/aws/data_source_aws_secretsmanager_secret_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -12,8 +13,9 @@ import ( func TestAccDataSourceAwsSecretsManagerSecret_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretConfig_MissingRequired, @@ -37,8 +39,9 @@ func TestAccDataSourceAwsSecretsManagerSecret_ARN(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretConfig_ARN(rName), @@ -56,8 +59,9 @@ func TestAccDataSourceAwsSecretsManagerSecret_Name(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretConfig_Name(rName), @@ -75,8 +79,9 @@ func TestAccDataSourceAwsSecretsManagerSecret_Policy(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretConfig_Policy(rName), From 0c1fe6ea79c12d4c5d85d34578c4731636b937dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:58:40 -0400 Subject: [PATCH 0757/1252] tests/ds/secretsmanager_secret_rotation: Add ErrorCheck --- aws/data_source_aws_secretsmanager_secret_rotation_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_secretsmanager_secret_rotation_test.go b/aws/data_source_aws_secretsmanager_secret_rotation_test.go index d1b35731d88..aff33bd113c 100644 --- a/aws/data_source_aws_secretsmanager_secret_rotation_test.go +++ b/aws/data_source_aws_secretsmanager_secret_rotation_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsSecretsManagerSecretRotation_basic(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_rotation.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretRotationConfig_NonExistent, From b17b50efe310fb28e037d7baf783a04ab50fe819 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:58:52 -0400 Subject: [PATCH 0758/1252] tests/ds/secretsmanager_secret_version: Add ErrorCheck --- ...rce_aws_secretsmanager_secret_version_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_secretsmanager_secret_version_test.go b/aws/data_source_aws_secretsmanager_secret_version_test.go index 83862ed4105..6b9ecb921fa 100644 --- a/aws/data_source_aws_secretsmanager_secret_version_test.go +++ b/aws/data_source_aws_secretsmanager_secret_version_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -16,8 +17,9 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_basic(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretVersionConfig_NonExistent, @@ -39,8 +41,9 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_VersionID(t *testing.T) { datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretVersionConfig_VersionID(rName), @@ -58,8 +61,9 @@ func TestAccDataSourceAwsSecretsManagerSecretVersion_VersionStage(t *testing.T) datasourceName := "data.aws_secretsmanager_secret_version.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSecretsManager(t) }, + ErrorCheck: testAccErrorCheck(t, secretsmanager.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsSecretsManagerSecretVersionConfig_VersionStage_Custom(rName), From 5ad5aae29ffca9b81794beab6d70ba1f5d41d771 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:59:31 -0400 Subject: [PATCH 0759/1252] tests/r/securityhub_account: Add ErrorCheck --- aws/resource_aws_securityhub_account_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_securityhub_account_test.go b/aws/resource_aws_securityhub_account_test.go index 70eb39b3cc3..dc6e621deda 100644 --- a/aws/resource_aws_securityhub_account_test.go +++ b/aws/resource_aws_securityhub_account_test.go @@ -12,6 +12,7 @@ import ( func testAccAWSSecurityHubAccount_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityHubAccountDestroy, Steps: []resource.TestStep{ From 526626cf9adf4c273e328554443f15d390534bc5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:59:41 -0400 Subject: [PATCH 0760/1252] tests/r/securityhub_action_target: Add ErrorCheck --- aws/resource_aws_securityhub_action_target_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_securityhub_action_target_test.go b/aws/resource_aws_securityhub_action_target_test.go index bf6b21c0cb9..47f45b28499 100644 --- a/aws/resource_aws_securityhub_action_target_test.go +++ b/aws/resource_aws_securityhub_action_target_test.go @@ -15,6 +15,7 @@ func testAccAwsSecurityHubActionTarget_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubActionTargetDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func testAccAwsSecurityHubActionTarget_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubActionTargetDestroy, Steps: []resource.TestStep{ @@ -62,6 +64,7 @@ func testAccAwsSecurityHubActionTarget_Description(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubActionTargetDestroy, Steps: []resource.TestStep{ @@ -93,6 +96,7 @@ func testAccAwsSecurityHubActionTarget_Name(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubActionTargetDestroy, Steps: []resource.TestStep{ From 9e6a5a0198ab933de9f54cd84d10d35b432d1605 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 20:59:52 -0400 Subject: [PATCH 0761/1252] tests/r/securityhub_invite_accepter: Add ErrorCheck --- aws/resource_aws_securityhub_invite_accepter_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_securityhub_invite_accepter_test.go b/aws/resource_aws_securityhub_invite_accepter_test.go index a0015867bc8..e564f8889ff 100644 --- a/aws/resource_aws_securityhub_invite_accepter_test.go +++ b/aws/resource_aws_securityhub_invite_accepter_test.go @@ -21,6 +21,7 @@ func testAccAWSSecurityHubInviteAccepter_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSSecurityHubInviteAccepterDestroy, Steps: []resource.TestStep{ From af4db40e567f7b37c6c01eaac5ffb96804cea6df Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:00:05 -0400 Subject: [PATCH 0762/1252] tests/r/securityhub_member: Add ErrorCheck --- aws/resource_aws_securityhub_member_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_securityhub_member_test.go b/aws/resource_aws_securityhub_member_test.go index 6995d6bdf13..23862a53ca4 100644 --- a/aws/resource_aws_securityhub_member_test.go +++ b/aws/resource_aws_securityhub_member_test.go @@ -18,6 +18,7 @@ func testAccAWSSecurityHubMember_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityHubMemberDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func testAccAWSSecurityHubMember_invite(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityHubMemberDestroy, Steps: []resource.TestStep{ From d407080f6a9c8f67ea7e52a9858fc32700dd0443 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:00:18 -0400 Subject: [PATCH 0763/1252] tests/r/securityhub_organization_admin_account: Add ErrorCheck --- aws/resource_aws_securityhub_organization_admin_account_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_securityhub_organization_admin_account_test.go b/aws/resource_aws_securityhub_organization_admin_account_test.go index 165d0e0cc14..84ae639ea33 100644 --- a/aws/resource_aws_securityhub_organization_admin_account_test.go +++ b/aws/resource_aws_securityhub_organization_admin_account_test.go @@ -19,6 +19,7 @@ func testAccAwsSecurityHubOrganizationAdminAccount_basic(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubOrganizationAdminAccountDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func testAccAwsSecurityHubOrganizationAdminAccount_disappears(t *testing.T) { testAccPreCheck(t) testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSecurityHubOrganizationAdminAccountDestroy, Steps: []resource.TestStep{ From d80cc978f674b3ab947fdadb037a5989ecca7626 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:00:32 -0400 Subject: [PATCH 0764/1252] tests/r/securityhub_product_subscription: Add ErrorCheck --- aws/resource_aws_securityhub_product_subscription_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_securityhub_product_subscription_test.go b/aws/resource_aws_securityhub_product_subscription_test.go index 9f0d35c20e7..e167e63d8a8 100644 --- a/aws/resource_aws_securityhub_product_subscription_test.go +++ b/aws/resource_aws_securityhub_product_subscription_test.go @@ -14,6 +14,7 @@ import ( func testAccAWSSecurityHubProductSubscription_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityHubAccountDestroy, Steps: []resource.TestStep{ From d2e9c491b6d7f574cc18ec7c9d1c12ba5123567f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:00:45 -0400 Subject: [PATCH 0765/1252] tests/r/securityhub_standards_subscription: Add ErrorCheck --- aws/resource_aws_securityhub_standards_subscription_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_securityhub_standards_subscription_test.go b/aws/resource_aws_securityhub_standards_subscription_test.go index b3a5e9bde3b..f05b8f5a679 100644 --- a/aws/resource_aws_securityhub_standards_subscription_test.go +++ b/aws/resource_aws_securityhub_standards_subscription_test.go @@ -15,6 +15,7 @@ func testAccAWSSecurityHubStandardsSubscription_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityHubAccountDestroy, Steps: []resource.TestStep{ From 8b2bc93cf3672e0f3bd9287b59ec27e400663183 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:01:26 -0400 Subject: [PATCH 0766/1252] tests/r/workspaces_ip_group: Add ErrorCheck --- aws/resource_aws_workspaces_ip_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_workspaces_ip_group_test.go b/aws/resource_aws_workspaces_ip_group_test.go index acb4ac5bab1..8ce5cc6c584 100644 --- a/aws/resource_aws_workspaces_ip_group_test.go +++ b/aws/resource_aws_workspaces_ip_group_test.go @@ -21,6 +21,7 @@ func TestAccAwsWorkspacesIpGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesIpGroupDestroy, Steps: []resource.TestStep{ @@ -64,6 +65,7 @@ func TestAccAwsWorkspacesIpGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesIpGroupDestroy, Steps: []resource.TestStep{ @@ -109,6 +111,7 @@ func TestAccAwsWorkspacesIpGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesIpGroupDestroy, Steps: []resource.TestStep{ @@ -136,6 +139,7 @@ func TestAccAwsWorkspacesIpGroup_MultipleDirectories(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesIpGroupDestroy, Steps: []resource.TestStep{ From ee7cbdee6512aeed29d4c75abd86d102e6850aa7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:01:37 -0400 Subject: [PATCH 0767/1252] tests/r/workspaces_workspace: Add ErrorCheck --- aws/resource_aws_workspaces_workspace_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_workspaces_workspace_test.go b/aws/resource_aws_workspaces_workspace_test.go index 50a99fcc226..466eb148eee 100644 --- a/aws/resource_aws_workspaces_workspace_test.go +++ b/aws/resource_aws_workspaces_workspace_test.go @@ -68,6 +68,7 @@ func TestAccAwsWorkspacesWorkspace_basic(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -115,6 +116,7 @@ func TestAccAwsWorkspacesWorkspace_tags(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAwsWorkspacesWorkspace_workspaceProperties(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -230,6 +233,7 @@ func TestAccAwsWorkspacesWorkspace_workspaceProperties_runningModeAlwaysOn(t *te testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -259,6 +263,7 @@ func TestAccAwsWorkspacesWorkspace_validateRootVolumeSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -275,6 +280,7 @@ func TestAccAwsWorkspacesWorkspace_validateUserVolumeSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -299,6 +305,7 @@ func TestAccAwsWorkspacesWorkspace_recreate(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ @@ -332,6 +339,7 @@ func TestAccAwsWorkspacesWorkspace_timeout(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesWorkspaceDestroy, Steps: []resource.TestStep{ From 0966cec6c5358da88f5d61991e0e4d0695e6c2c5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:01:48 -0400 Subject: [PATCH 0768/1252] tests/ds/workspaces_bundle: Add ErrorCheck --- aws/data_source_aws_workspaces_bundle_test.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/aws/data_source_aws_workspaces_bundle_test.go b/aws/data_source_aws_workspaces_bundle_test.go index 8fd09e92b27..3b98b166888 100644 --- a/aws/data_source_aws_workspaces_bundle_test.go +++ b/aws/data_source_aws_workspaces_bundle_test.go @@ -6,6 +6,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/workspaces" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsWorkspaceBundle_basic(t *testing.T) { dataSourceName := "data.aws_workspaces_bundle.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspaceBundleConfig("wsb-b0s22j3d7"), @@ -39,8 +41,9 @@ func TestAccDataSourceAwsWorkspaceBundle_byOwnerName(t *testing.T) { dataSourceName := "data.aws_workspaces_bundle.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspaceBundleConfig_byOwnerName("AMAZON", "Value with Windows 10 and Office 2016"), @@ -63,8 +66,9 @@ func TestAccDataSourceAwsWorkspaceBundle_byOwnerName(t *testing.T) { func TestAccDataSourceAwsWorkspaceBundle_bundleIDAndNameConflict(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspaceBundleConfig_bundleIDAndOwnerNameConflict("wsb-df76rqys9", "AMAZON", "Value with Windows 10 and Office 2016"), @@ -83,7 +87,8 @@ func TestAccDataSourceAwsWorkspaceBundle_privateOwner(t *testing.T) { testAccPreCheck(t) testAccWorkspacesBundlePreCheck(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspaceBundleConfig_privateOwner(bundleName), From 6bf892a95338b0ca2df8267f4a81f9eda587f001 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:02:02 -0400 Subject: [PATCH 0769/1252] tests/ds/workspaces_directory: Add ErrorCheck --- aws/data_source_aws_workspaces_directory_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_workspaces_directory_test.go b/aws/data_source_aws_workspaces_directory_test.go index 68eb7e95d12..6de831f4b1d 100644 --- a/aws/data_source_aws_workspaces_directory_test.go +++ b/aws/data_source_aws_workspaces_directory_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/workspaces" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -21,7 +22,8 @@ func TestAccDataSourceAwsWorkspacesDirectory_basic(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspacesDirectoryConfig(rName), From f287492424df4ce07c929ab12dd35356b2cee521 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:02:16 -0400 Subject: [PATCH 0770/1252] tests/ds/workspaces_image: Add ErrorCheck --- aws/data_source_aws_workspaces_image_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aws/data_source_aws_workspaces_image_test.go b/aws/data_source_aws_workspaces_image_test.go index cd176d8ac79..446720c78f9 100644 --- a/aws/data_source_aws_workspaces_image_test.go +++ b/aws/data_source_aws_workspaces_image_test.go @@ -21,7 +21,8 @@ func TestAccDataSourceAwsWorkspacesImage_basic(t *testing.T) { testAccPreCheck(t) testAccWorkspacesImagePreCheck(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspacesImageConfig(imageID), From 479f5e1eb12796d33411eed21206e8d8364e1d91 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:02:31 -0400 Subject: [PATCH 0771/1252] tests/ds/workspaces_workspace: Add ErrorCheck --- aws/data_source_aws_workspaces_workspace_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_workspaces_workspace_test.go b/aws/data_source_aws_workspaces_workspace_test.go index f60a85e8b18..fdd13bd6938 100644 --- a/aws/data_source_aws_workspaces_workspace_test.go +++ b/aws/data_source_aws_workspaces_workspace_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/workspaces" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsWorkspacesWorkspace_byWorkspaceID(t *testing.T) { resourceName := "aws_workspaces_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceWorkspacesWorkspaceConfig_byWorkspaceID(rName), @@ -46,8 +48,9 @@ func TestAccDataSourceAwsWorkspacesWorkspace_byDirectoryID_userName(t *testing.T resourceName := "aws_workspaces_workspace.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceWorkspacesWorkspaceConfig_byDirectoryID_userName(rName), @@ -74,8 +77,9 @@ func TestAccDataSourceAwsWorkspacesWorkspace_byDirectoryID_userName(t *testing.T func TestAccDataSourceAwsWorkspacesWorkspace_workspaceIDAndDirectoryIDConflict(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsWorkspacesWorkspaceConfig_workspaceIDAndDirectoryIDConflict(), From 0aad175ce54f6d7efb3d4c2f6c7c1f9541a09f16 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:03:05 -0400 Subject: [PATCH 0772/1252] tests/r/workspaces_directory: Add ErrorCheck --- aws/resource_aws_workspaces_directory_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_workspaces_directory_test.go b/aws/resource_aws_workspaces_directory_test.go index 5cee0b8f538..1d728e48876 100644 --- a/aws/resource_aws_workspaces_directory_test.go +++ b/aws/resource_aws_workspaces_directory_test.go @@ -67,6 +67,7 @@ func TestAccAwsWorkspacesDirectory_basic(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAwsWorkspacesDirectory_disappears(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -158,6 +160,7 @@ func TestAccAwsWorkspacesDirectory_subnetIds(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAwsWorkspacesDirectory_tags(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -240,6 +244,7 @@ func TestAccAwsWorkspacesDirectory_selfServicePermissions(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -272,6 +277,7 @@ func TestAccAwsWorkspacesDirectory_workspaceAccessProperties(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -307,6 +313,7 @@ func TestAccAwsWorkspacesDirectory_workspaceCreationProperties(t *testing.T) { testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -340,6 +347,7 @@ func TestAccAwsWorkspacesDirectory_workspaceCreationProperties_customSecurityGro testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ @@ -383,6 +391,7 @@ func TestAccAwsWorkspacesDirectory_ipGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckHasIAMRole(t, "workspaces_DefaultRole") }, + ErrorCheck: testAccErrorCheck(t, workspaces.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, Steps: []resource.TestStep{ From cdc7f9701734be360eef1df081628f23d3a8f4a2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:03:46 -0400 Subject: [PATCH 0773/1252] tests/r/cloudformation_stack: Add ErrorCheck --- aws/resource_aws_cloudformation_stack_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_cloudformation_stack_test.go b/aws/resource_aws_cloudformation_stack_test.go index d94ae940605..e967b8ca8d2 100644 --- a/aws/resource_aws_cloudformation_stack_test.go +++ b/aws/resource_aws_cloudformation_stack_test.go @@ -82,6 +82,7 @@ func TestAccAWSCloudFormationStack_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSCloudFormationStack_CreationFailure_DoNothing(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -123,6 +125,7 @@ func TestAccAWSCloudFormationStack_CreationFailure_Delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -139,6 +142,7 @@ func TestAccAWSCloudFormationStack_CreationFailure_Rollback(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -160,6 +164,7 @@ func TestAccAWSCloudFormationStack_UpdateFailure(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -184,6 +189,7 @@ func TestAccAWSCloudFormationStack_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -206,6 +212,7 @@ func TestAccAWSCloudFormationStack_yaml(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -231,6 +238,7 @@ func TestAccAWSCloudFormationStack_defaultParams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -258,6 +266,7 @@ func TestAccAWSCloudFormationStack_allAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -318,6 +327,7 @@ func TestAccAWSCloudFormationStack_withParams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -355,6 +365,7 @@ func TestAccAWSCloudFormationStack_withUrl_withParams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -387,6 +398,7 @@ func TestAccAWSCloudFormationStack_withUrl_withParams_withYaml(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -414,6 +426,7 @@ func TestAccAWSCloudFormationStack_withUrl_withParams_noUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -445,6 +458,7 @@ func TestAccAWSCloudFormationStack_withTransform(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ From 1de7dc67150d52c12c6d09ee88761c742f605c4b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:03:55 -0400 Subject: [PATCH 0774/1252] tests/r/cloudformation_stack_set: Add ErrorCheck --- aws/resource_aws_cloudformation_stack_set_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_cloudformation_stack_set_test.go b/aws/resource_aws_cloudformation_stack_set_test.go index 3264ce8b418..bcdfc59ffd0 100644 --- a/aws/resource_aws_cloudformation_stack_set_test.go +++ b/aws/resource_aws_cloudformation_stack_set_test.go @@ -77,6 +77,7 @@ func TestAccAWSCloudFormationStackSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSCloudFormationStackSet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -140,6 +142,7 @@ func TestAccAWSCloudFormationStackSet_AdministrationRoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -177,6 +180,7 @@ func TestAccAWSCloudFormationStackSet_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -214,6 +218,7 @@ func TestAccAWSCloudFormationStackSet_ExecutionRoleName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -252,6 +257,7 @@ func TestAccAWSCloudFormationStackSet_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -305,6 +311,7 @@ func TestAccAWSCloudFormationStackSet_Parameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -364,6 +371,7 @@ func TestAccAWSCloudFormationStackSet_Parameters_Default(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -415,6 +423,7 @@ func TestAccAWSCloudFormationStackSet_Parameters_NoEcho(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -454,6 +463,7 @@ func TestAccAWSCloudFormationStackSet_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -509,6 +519,7 @@ func TestAccAWSCloudFormationStackSet_TemplateBody(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ @@ -546,6 +557,7 @@ func TestAccAWSCloudFormationStackSet_TemplateUrl(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetDestroy, Steps: []resource.TestStep{ From 58ab767248e5e32f7c646e38c43143140964a422 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:04:07 -0400 Subject: [PATCH 0775/1252] tests/r/cloudformation_stack_set_instance: Add ErrorCheck --- aws/resource_aws_cloudformation_stack_set_instance_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_cloudformation_stack_set_instance_test.go b/aws/resource_aws_cloudformation_stack_set_instance_test.go index 928dc49d710..3bbb9f6bafc 100644 --- a/aws/resource_aws_cloudformation_stack_set_instance_test.go +++ b/aws/resource_aws_cloudformation_stack_set_instance_test.go @@ -105,6 +105,7 @@ func TestAccAWSCloudFormationStackSetInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetInstanceDestroy, Steps: []resource.TestStep{ @@ -139,6 +140,7 @@ func TestAccAWSCloudFormationStackSetInstance_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetInstanceDestroy, Steps: []resource.TestStep{ @@ -163,6 +165,7 @@ func TestAccAWSCloudFormationStackSetInstance_disappears_StackSet(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetInstanceDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSCloudFormationStackSetInstance_ParameterOverrides(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetInstanceDestroy, Steps: []resource.TestStep{ @@ -250,6 +254,7 @@ func TestAccAWSCloudFormationStackSetInstance_RetainStack(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCloudFormationStackSet(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationStackSetInstanceDestroy, Steps: []resource.TestStep{ From 8372185ff82d81aaf0ea7440785a109a6f1badbd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:04:50 -0400 Subject: [PATCH 0776/1252] tests/ds/cloudformation_export: Add ErrorCheck --- aws/data_source_aws_cloudformation_export_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_cloudformation_export_test.go b/aws/data_source_aws_cloudformation_export_test.go index c5844f89e3e..92573f4550d 100644 --- a/aws/data_source_aws_cloudformation_export_test.go +++ b/aws/data_source_aws_cloudformation_export_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSCloudformationExportDataSource_basic(t *testing.T) { dataSourceName := "data.aws_cloudformation_export.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudformationExportConfigStaticValue(rName), @@ -33,8 +35,9 @@ func TestAccAWSCloudformationExportDataSource_ResourceReference(t *testing.T) { resourceName := "aws_cloudformation_stack.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudformationExportConfigResourceReference(rName), From 9ba9f4b1cfadc353e289cab4dad905513a1b4dfd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:05:04 -0400 Subject: [PATCH 0777/1252] tests/ds/cloudformation_stack: Add ErrorCheck --- aws/data_source_aws_cloudformation_stack_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_cloudformation_stack_test.go b/aws/data_source_aws_cloudformation_stack_test.go index 843b6903c44..447065ec1f2 100644 --- a/aws/data_source_aws_cloudformation_stack_test.go +++ b/aws/data_source_aws_cloudformation_stack_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSCloudFormationStack_dataSource_basic(t *testing.T) { resourceName := "data.aws_cloudformation_stack.network" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudFormationStackDataSourceConfig_basic(stackName), @@ -99,8 +101,9 @@ func TestAccAWSCloudFormationStack_dataSource_yaml(t *testing.T) { resourceName := "data.aws_cloudformation_stack.yaml" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudformation.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudFormationStackDataSourceConfig_yaml(stackName), From 8425f462a21f47d51e54ccec6177ec58023839a6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:09:10 -0400 Subject: [PATCH 0778/1252] tests/r/ecr_lifecycle_policy: Add ErrorCheck --- aws/resource_aws_ecr_lifecycle_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ecr_lifecycle_policy_test.go b/aws/resource_aws_ecr_lifecycle_policy_test.go index f76efb10e80..30301a23659 100644 --- a/aws/resource_aws_ecr_lifecycle_policy_test.go +++ b/aws/resource_aws_ecr_lifecycle_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSEcrLifecyclePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrLifecyclePolicyDestroy, Steps: []resource.TestStep{ From 59fb0dcffe615b160ab4c7dae69e80c055cb4857 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:09:20 -0400 Subject: [PATCH 0779/1252] tests/r/ecr_repository: Add ErrorCheck --- aws/resource_aws_ecr_repository_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_ecr_repository_test.go b/aws/resource_aws_ecr_repository_test.go index cddaabc1fb2..f471634e162 100644 --- a/aws/resource_aws_ecr_repository_test.go +++ b/aws/resource_aws_ecr_repository_test.go @@ -74,6 +74,7 @@ func TestAccAWSEcrRepository_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAWSEcrRepository_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ @@ -138,6 +140,7 @@ func TestAccAWSEcrRepository_immutability(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ @@ -165,6 +168,7 @@ func TestAccAWSEcrRepository_image_scanning_configuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ @@ -215,6 +219,7 @@ func TestAccAWSEcrRepository_encryption_kms(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ @@ -259,6 +264,7 @@ func TestAccAWSEcrRepository_encryption_aes256(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, Steps: []resource.TestStep{ From 411d6976245cad3846d80f4f09b5324430875efe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:09:30 -0400 Subject: [PATCH 0780/1252] tests/r/ecr_repository_policy: Add ErrorCheck --- aws/resource_aws_ecr_repository_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ecr_repository_policy_test.go b/aws/resource_aws_ecr_repository_policy_test.go index 4bbff0651e7..d2ee93e38d8 100644 --- a/aws/resource_aws_ecr_repository_policy_test.go +++ b/aws/resource_aws_ecr_repository_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSEcrRepositoryPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSEcrRepositoryPolicy_iam(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ From 2ec741912f76091e806dad9411eed19192d8ccd0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:09:54 -0400 Subject: [PATCH 0781/1252] tests/ds/ecr_authorization_token: Add ErrorCheck --- aws/data_source_aws_ecr_authorization_token_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ecr_authorization_token_test.go b/aws/data_source_aws_ecr_authorization_token_test.go index 2994d1a6dba..40a93519686 100644 --- a/aws/data_source_aws_ecr_authorization_token_test.go +++ b/aws/data_source_aws_ecr_authorization_token_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSEcrAuthorizationTokenDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecr_authorization_token.repo" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcrAuthorizationTokenDataSourceBasicConfig, From 350e2fb6603bbe18ac33ec1937349090923ed751 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:10:08 -0400 Subject: [PATCH 0782/1252] tests/ds/ecr_image: Add ErrorCheck --- aws/data_source_aws_ecr_image_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_ecr_image_test.go b/aws/data_source_aws_ecr_image_test.go index 1d9c1712eb7..e2eb89a6648 100644 --- a/aws/data_source_aws_ecr_image_test.go +++ b/aws/data_source_aws_ecr_image_test.go @@ -5,6 +5,7 @@ import ( "strconv" "testing" + "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -15,8 +16,9 @@ func TestAccAWSEcrDataSource_ecrImage(t *testing.T) { resourceByDigest := "data.aws_ecr_image.by_digest" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcrImageDataSourceConfig(registry, repo, tag), From 18cac5abd45b9403a1e53ace4d982d750f363be2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:10:21 -0400 Subject: [PATCH 0783/1252] tests/ds/ecr_repository: Add ErrorCheck --- aws/data_source_aws_ecr_repository_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_ecr_repository_test.go b/aws/data_source_aws_ecr_repository_test.go index 34114e7f2ad..abf0f80343c 100644 --- a/aws/data_source_aws_ecr_repository_test.go +++ b/aws/data_source_aws_ecr_repository_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccAWSEcrRepositoryDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcrRepositoryDataSourceConfig(rName), @@ -40,8 +42,9 @@ func TestAccAWSEcrRepositoryDataSource_encryption(t *testing.T) { dataSourceName := "data.aws_ecr_repository.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcrRepositoryDataSourceConfig_encryption(rName), @@ -64,8 +67,9 @@ func TestAccAWSEcrRepositoryDataSource_encryption(t *testing.T) { func TestAccAWSEcrRepositoryDataSource_nonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEcrRepositoryDataSourceConfig_NonExistent, From 3e744b41ba4c17f3e9187b02743d3f5166ee770c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:07:15 -0400 Subject: [PATCH 0784/1252] tests/r/codeartifact_domain: Add ErrorCheck --- aws/resource_aws_codeartifact_domain_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_codeartifact_domain_test.go b/aws/resource_aws_codeartifact_domain_test.go index 2ef97e4a645..6deacf0c0b3 100644 --- a/aws/resource_aws_codeartifact_domain_test.go +++ b/aws/resource_aws_codeartifact_domain_test.go @@ -73,6 +73,7 @@ func TestAccAWSCodeArtifactDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainDestroy, Steps: []resource.TestStep{ @@ -105,6 +106,7 @@ func TestAccAWSCodeArtifactDomain_defaultencryptionkey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("codeartifact", t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainDestroy, Steps: []resource.TestStep{ @@ -136,6 +138,7 @@ func TestAccAWSCodeArtifactDomain_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("codeartifact", t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainDestroy, Steps: []resource.TestStep{ @@ -178,6 +181,7 @@ func TestAccAWSCodeArtifactDomain_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainDestroy, Steps: []resource.TestStep{ From 045a21b8147f0b4b4abf6032d776076646e6540c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:07:27 -0400 Subject: [PATCH 0785/1252] tests/r/codeartifact_domain_permissions_policy: Add ErrorCheck --- ...esource_aws_codeartifact_domain_permissions_policy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_codeartifact_domain_permissions_policy_test.go b/aws/resource_aws_codeartifact_domain_permissions_policy_test.go index a156f6c7bea..d325a16737c 100644 --- a/aws/resource_aws_codeartifact_domain_permissions_policy_test.go +++ b/aws/resource_aws_codeartifact_domain_permissions_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSCodeArtifactDomainPermissionsPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainPermissionsDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSCodeArtifactDomainPermissionsPolicy_owner(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainPermissionsDestroy, Steps: []resource.TestStep{ @@ -85,6 +87,7 @@ func TestAccAWSCodeArtifactDomainPermissionsPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainPermissionsDestroy, Steps: []resource.TestStep{ @@ -106,6 +109,7 @@ func TestAccAWSCodeArtifactDomainPermissionsPolicy_disappears_domain(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactDomainPermissionsDestroy, Steps: []resource.TestStep{ From 5c662bdf138e15d65413012f4214a784fb802f67 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:07:48 -0400 Subject: [PATCH 0786/1252] tests/r/codeartifact_repository: Add ErrorCheck --- aws/resource_aws_codeartifact_repository_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_codeartifact_repository_test.go b/aws/resource_aws_codeartifact_repository_test.go index be24628e9d7..29f5fcfec1d 100644 --- a/aws/resource_aws_codeartifact_repository_test.go +++ b/aws/resource_aws_codeartifact_repository_test.go @@ -74,6 +74,7 @@ func TestAccAWSCodeArtifactRepository_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSCodeArtifactRepository_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("codeartifact", t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSCodeArtifactRepository_owner(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -182,6 +185,7 @@ func TestAccAWSCodeArtifactRepository_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -214,6 +218,7 @@ func TestAccAWSCodeArtifactRepository_upstreams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -257,6 +262,7 @@ func TestAccAWSCodeArtifactRepository_externalConnection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ @@ -295,12 +301,14 @@ func TestAccAWSCodeArtifactRepository_externalConnection(t *testing.T) { }, }) } + func TestAccAWSCodeArtifactRepository_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_codeartifact_repository.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryDestroy, Steps: []resource.TestStep{ From 1d9437bbab511031acc0fb736a86f63816c8a1c4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:08:04 -0400 Subject: [PATCH 0787/1252] tests/r/codeartifact_repository_permissions_policy: Add ErrorCheck --- ...rce_aws_codeartifact_repository_permissions_policy_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_codeartifact_repository_permissions_policy_test.go b/aws/resource_aws_codeartifact_repository_permissions_policy_test.go index 75f4fb233f4..ea0f6de39ea 100644 --- a/aws/resource_aws_codeartifact_repository_permissions_policy_test.go +++ b/aws/resource_aws_codeartifact_repository_permissions_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSCodeArtifactRepositoryPermissionsPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryPermissionsDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSCodeArtifactRepositoryPermissionsPolicy_owner(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryPermissionsDestroy, Steps: []resource.TestStep{ @@ -85,6 +87,7 @@ func TestAccAWSCodeArtifactRepositoryPermissionsPolicy_disappears(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryPermissionsDestroy, Steps: []resource.TestStep{ @@ -106,6 +109,7 @@ func TestAccAWSCodeArtifactRepositoryPermissionsPolicy_disappears_domain(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeArtifactRepositoryPermissionsDestroy, Steps: []resource.TestStep{ From 831daf3f104143ee8596a0c4581b883ea3b13a1f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:08:18 -0400 Subject: [PATCH 0788/1252] tests/ds/codeartifact_authorization_token: Add ErrorCheck --- ...e_aws_codeartifact_authorization_token_test.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_codeartifact_authorization_token_test.go b/aws/data_source_aws_codeartifact_authorization_token_test.go index 9c42f339a7e..8026a7564a5 100644 --- a/aws/data_source_aws_codeartifact_authorization_token_test.go +++ b/aws/data_source_aws_codeartifact_authorization_token_test.go @@ -14,8 +14,9 @@ func TestAccAWSCodeArtifactAuthorizationTokenDataSource_basic(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCodeArtifactAuthorizationTokenBasicConfig(rName), @@ -34,8 +35,9 @@ func TestAccAWSCodeArtifactAuthorizationTokenDataSource_owner(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCodeArtifactAuthorizationTokenOwnerConfig(rName), @@ -54,8 +56,9 @@ func TestAccAWSCodeArtifactAuthorizationTokenDataSource_duration(t *testing.T) { dataSourceName := "data.aws_codeartifact_authorization_token.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCodeArtifactAuthorizationTokenDurationConfig(rName), From cc3053d204b0e5fffc86fd4c6b84860337284585 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:08:19 -0400 Subject: [PATCH 0789/1252] tests/ds/codeartifact_repository_endpoint: Add ErrorCheck --- ...source_aws_codeartifact_repository_endpoint_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_codeartifact_repository_endpoint_test.go b/aws/data_source_aws_codeartifact_repository_endpoint_test.go index 6e7e0ed6d24..d35716b6a8f 100644 --- a/aws/data_source_aws_codeartifact_repository_endpoint_test.go +++ b/aws/data_source_aws_codeartifact_repository_endpoint_test.go @@ -14,8 +14,9 @@ func TestAccAWSCodeArtifactRepositoryEndpointDataSource_basic(t *testing.T) { dataSourceName := "data.aws_codeartifact_repository_endpoint.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCodeArtifactRepositoryEndpointBasicConfig(rName, "npm"), @@ -54,8 +55,9 @@ func TestAccAWSCodeArtifactRepositoryEndpointDataSource_owner(t *testing.T) { dataSourceName := "data.aws_codeartifact_repository_endpoint.test" resource.Test(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codeartifact.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codeartifact.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCodeArtifactRepositoryEndpointOwnerConfig(rName), From aa02d4efab1a100aa24230e1cde616bd72e92ffc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:21:48 -0400 Subject: [PATCH 0790/1252] tests/r/cognito_identity_provider: Add ErrorCheck --- aws/resource_aws_cognito_identity_provider_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_cognito_identity_provider_test.go b/aws/resource_aws_cognito_identity_provider_test.go index 1c7b1ad326b..599f58824bf 100644 --- a/aws/resource_aws_cognito_identity_provider_test.go +++ b/aws/resource_aws_cognito_identity_provider_test.go @@ -18,6 +18,7 @@ func TestAccAWSCognitoIdentityProvider_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityProviderDestroy, Steps: []resource.TestStep{ From 5ad07420696137ad7b37262933edf757f2c3c5f4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:21:58 -0400 Subject: [PATCH 0791/1252] tests/r/cognito_resource_server: Add ErrorCheck --- aws/resource_aws_cognito_resource_server_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cognito_resource_server_test.go b/aws/resource_aws_cognito_resource_server_test.go index 0cc3312a576..b52813634ca 100644 --- a/aws/resource_aws_cognito_resource_server_test.go +++ b/aws/resource_aws_cognito_resource_server_test.go @@ -22,6 +22,7 @@ func TestAccAWSCognitoResourceServer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoResourceServerDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSCognitoResourceServer_scope(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoResourceServerDestroy, Steps: []resource.TestStep{ From ec7c59b7ff2288b5760618e613291fc02f8be129 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:22:09 -0400 Subject: [PATCH 0792/1252] tests/r/cognito_user_group: Add ErrorCheck --- aws/resource_aws_cognito_user_group_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cognito_user_group_test.go b/aws/resource_aws_cognito_user_group_test.go index 545d19a071b..140496f4135 100644 --- a/aws/resource_aws_cognito_user_group_test.go +++ b/aws/resource_aws_cognito_user_group_test.go @@ -21,6 +21,7 @@ func TestAccAWSCognitoUserGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserGroupDestroy, Steps: []resource.TestStep{ @@ -55,6 +56,7 @@ func TestAccAWSCognitoUserGroup_complex(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserGroupDestroy, Steps: []resource.TestStep{ @@ -93,6 +95,7 @@ func TestAccAWSCognitoUserGroup_RoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserGroupDestroy, Steps: []resource.TestStep{ From f5a36e7dff2b660210bcead284f45f7024b2645e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:22:20 -0400 Subject: [PATCH 0793/1252] tests/r/cognito_user_pool: Add ErrorCheck --- aws/resource_aws_cognito_user_pool_test.go | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/aws/resource_aws_cognito_user_pool_test.go b/aws/resource_aws_cognito_user_pool_test.go index 1b0aa2d6097..ef0f3f728cf 100644 --- a/aws/resource_aws_cognito_user_pool_test.go +++ b/aws/resource_aws_cognito_user_pool_test.go @@ -74,6 +74,7 @@ func TestAccAWSCognitoUserPool_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSCognitoUserPool_recovery(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -152,6 +154,7 @@ func TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -190,6 +193,7 @@ func TestAccAWSCognitoUserPool_withAdminCreateUserConfigurationAndPasswordPolicy resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -254,6 +258,7 @@ func TestAccAWSCognitoUserPool_withDeviceConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -291,6 +296,7 @@ func TestAccAWSCognitoUserPool_withEmailVerificationMessage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -325,6 +331,7 @@ func TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -372,6 +379,7 @@ func TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfigurationAndSoftwareToken resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -421,6 +429,7 @@ func TestAccAWSCognitoUserPool_MfaConfiguration_SmsConfigurationToSoftwareTokenM resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -458,6 +467,7 @@ func TestAccAWSCognitoUserPool_MfaConfiguration_SoftwareTokenMfaConfiguration(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -503,6 +513,7 @@ func TestAccAWSCognitoUserPool_MfaConfiguration_SoftwareTokenMfaConfigurationToS resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -542,6 +553,7 @@ func TestAccAWSCognitoUserPool_SmsAuthenticationMessage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -575,6 +587,7 @@ func TestAccAWSCognitoUserPool_SmsConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -619,6 +632,7 @@ func TestAccAWSCognitoUserPool_SmsConfiguration_ExternalId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -656,6 +670,7 @@ func TestAccAWSCognitoUserPool_SmsConfiguration_SnsCallerArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -694,6 +709,7 @@ func TestAccAWSCognitoUserPool_SmsVerificationMessage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -726,6 +742,7 @@ func TestAccAWSCognitoUserPool_withEmailConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -761,6 +778,7 @@ func TestAccAWSCognitoUserPool_withEmailConfigurationSource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -785,6 +803,7 @@ func TestAccAWSCognitoUserPool_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -827,6 +846,7 @@ func TestAccAWSCognitoUserPool_withAliasAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -864,6 +884,7 @@ func TestAccAWSCognitoUserPool_withPasswordPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -907,6 +928,7 @@ func TestAccAWSCognitoUserPool_withUsernameConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -941,6 +963,7 @@ func TestAccAWSCognitoUserPool_withLambdaConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -992,6 +1015,7 @@ func TestAccAWSCognitoUserPool_withSchemaAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -1081,6 +1105,7 @@ func TestAccAWSCognitoUserPool_withVerificationMessageTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -1138,6 +1163,7 @@ func TestAccAWSCognitoUserPool_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ @@ -1222,6 +1248,7 @@ func TestAccAWSCognitoUserPool_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ From ebbc7696e8a3756b55ab44966bff0db18d20593e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:22:36 -0400 Subject: [PATCH 0794/1252] tests/r/cognito_user_pool_client: Add ErrorCheck --- aws/resource_aws_cognito_user_pool_client_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_cognito_user_pool_client_test.go b/aws/resource_aws_cognito_user_pool_client_test.go index c6f90a14c5a..20b0d914838 100644 --- a/aws/resource_aws_cognito_user_pool_client_test.go +++ b/aws/resource_aws_cognito_user_pool_client_test.go @@ -20,6 +20,7 @@ func TestAccAWSCognitoUserPoolClient_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSCognitoUserPoolClient_refreshTokenValidity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -85,6 +87,7 @@ func TestAccAWSCognitoUserPoolClient_accessTokenValidity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -119,6 +122,7 @@ func TestAccAWSCognitoUserPoolClient_idTokenValidity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -153,6 +157,7 @@ func TestAccAWSCognitoUserPoolClient_tokenValidityUnits(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -193,6 +198,7 @@ func TestAccAWSCognitoUserPoolClient_tokenValidityUnitsWTokenValidity(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -235,6 +241,7 @@ func TestAccAWSCognitoUserPoolClient_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -270,6 +277,7 @@ func TestAccAWSCognitoUserPoolClient_allFields(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -326,6 +334,7 @@ func TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -475,6 +484,7 @@ func TestAccAWSCognitoUserPoolClient_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ @@ -498,6 +508,7 @@ func TestAccAWSCognitoUserPoolClient_disappears_userPool(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolClientDestroy, Steps: []resource.TestStep{ From 3ed4dca7fac82c1a311a29b0385e033ed6b31187 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:22:49 -0400 Subject: [PATCH 0795/1252] tests/r/cognito_user_pool_domain: Add ErrorCheck --- aws/resource_aws_cognito_user_pool_domain_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cognito_user_pool_domain_test.go b/aws/resource_aws_cognito_user_pool_domain_test.go index 11c4d6149eb..b8251e280b8 100644 --- a/aws/resource_aws_cognito_user_pool_domain_test.go +++ b/aws/resource_aws_cognito_user_pool_domain_test.go @@ -79,6 +79,7 @@ func TestAccAWSCognitoUserPoolDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDomainDestroy, Steps: []resource.TestStep{ @@ -114,6 +115,7 @@ func TestAccAWSCognitoUserPoolDomain_custom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCognitoUserPoolCustomDomain(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSCognitoUserPoolDomainDestroy, Steps: []resource.TestStep{ @@ -147,6 +149,7 @@ func TestAccAWSCognitoUserPoolDomain_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolDomainDestroy, Steps: []resource.TestStep{ From d55b9b7352e20e9be9075c24d155ad0e7553b88c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:23:14 -0400 Subject: [PATCH 0796/1252] tests/r/cognito_user_pool_ui_customization: Add ErrorCheck --- ...urce_aws_cognito_user_pool_ui_customization_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_cognito_user_pool_ui_customization_test.go b/aws/resource_aws_cognito_user_pool_ui_customization_test.go index 03c5611633a..fb4ca1fea75 100644 --- a/aws/resource_aws_cognito_user_pool_ui_customization_test.go +++ b/aws/resource_aws_cognito_user_pool_ui_customization_test.go @@ -23,6 +23,7 @@ func TestAccAWSCognitoUserPoolUICustomization_AllClients_CSS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -72,6 +73,7 @@ func TestAccAWSCognitoUserPoolUICustomization_AllClients_Disappears(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSCognitoUserPoolUICustomization_AllClients_ImageFile(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -149,6 +152,7 @@ func TestAccAWSCognitoUserPoolUICustomization_AllClients_CSSAndImageFile(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -215,6 +219,7 @@ func TestAccAWSCognitoUserPoolUICustomization_Client_CSS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -264,6 +269,7 @@ func TestAccAWSCognitoUserPoolUICustomization_Client_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -290,6 +296,7 @@ func TestAccAWSCognitoUserPoolUICustomization_Client_Image(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -344,6 +351,7 @@ func TestAccAWSCognitoUserPoolUICustomization_ClientAndAll_CSS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -415,6 +423,7 @@ func TestAccAWSCognitoUserPoolUICustomization_UpdateClientToAll_CSS(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ @@ -453,6 +462,7 @@ func TestAccAWSCognitoUserPoolUICustomization_UpdateAllToClient_CSS(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoUserPoolUICustomizationDestroy, Steps: []resource.TestStep{ From 73991dcb4faf940be92e8a77baa1862294b20828 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:23:26 -0400 Subject: [PATCH 0797/1252] tests/ds/cognito_user_pools: Add ErrorCheck --- aws/data_source_aws_cognito_user_pools_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_cognito_user_pools_test.go b/aws/data_source_aws_cognito_user_pools_test.go index da850d68f56..3b940f26f03 100644 --- a/aws/data_source_aws_cognito_user_pools_test.go +++ b/aws/data_source_aws_cognito_user_pools_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ import ( func TestAccDataSourceAwsCognitoUserPools_basic(t *testing.T) { rName := fmt.Sprintf("tf_acc_ds_cognito_user_pools_%s", acctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentityprovider.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsCognitoUserPoolsConfig_basic(rName), From 24655bf297b71b856a7a405638f2ae8eac23acdd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:42:41 -0400 Subject: [PATCH 0798/1252] tests/ds/route53_resolver: Add ErrorCheck --- ...ata_source_aws_route53_resolver_endpoint_test.go | 5 +++-- aws/data_source_aws_route53_resolver_rule_test.go | 13 +++++++++---- aws/data_source_aws_route53_resolver_rules_test.go | 5 +++-- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_route53_resolver_endpoint_test.go b/aws/data_source_aws_route53_resolver_endpoint_test.go index 8c7cccbb016..bbcb9ddc621 100644 --- a/aws/data_source_aws_route53_resolver_endpoint_test.go +++ b/aws/data_source_aws_route53_resolver_endpoint_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/route53resolver" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -18,7 +19,7 @@ func TestAccAWSRoute53ResolverEndpointDataSource_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -47,7 +48,7 @@ func TestAccAWSRoute53ResolverEndpointDataSource_Filter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/aws/data_source_aws_route53_resolver_rule_test.go b/aws/data_source_aws_route53_resolver_rule_test.go index adc1324a045..5774911ad25 100644 --- a/aws/data_source_aws_route53_resolver_rule_test.go +++ b/aws/data_source_aws_route53_resolver_rule_test.go @@ -4,11 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/route53resolver" "github.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" ) +func init() { + RegisterServiceErrorCheckFunc(route53resolver.EndpointsID, testAccErrorCheckSkipRoute53) +} + func TestAccAWSRoute53ResolverRuleDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_route53_resolver_rule.example" @@ -18,7 +23,7 @@ func TestAccAWSRoute53ResolverRuleDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -69,7 +74,7 @@ func TestAccAWSRoute53ResolverRuleDataSource_ResolverEndpointIdWithTags(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -106,7 +111,7 @@ func TestAccAWSRoute53ResolverRuleDataSource_SharedByMe(t *testing.T) { testAccAlternateAccountPreCheck(t) testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), Steps: []resource.TestStep{ { @@ -144,7 +149,7 @@ func TestAccAWSRoute53ResolverRuleDataSource_SharedWithMe(t *testing.T) { testAccAlternateAccountPreCheck(t) testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), Steps: []resource.TestStep{ { diff --git a/aws/data_source_aws_route53_resolver_rules_test.go b/aws/data_source_aws_route53_resolver_rules_test.go index e22287e880b..213a82d046d 100644 --- a/aws/data_source_aws_route53_resolver_rules_test.go +++ b/aws/data_source_aws_route53_resolver_rules_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/route53resolver" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,7 +14,7 @@ func TestAccAWSRoute53ResolverRulesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -36,7 +37,7 @@ func TestAccAWSRoute53ResolverRulesDataSource_ResolverEndpointId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { From 0661aab7040122e99ea3bdd37f237afe76b456f7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:43:28 -0400 Subject: [PATCH 0799/1252] tests/r/route53_resolver: Add ErrorCheck --- ...urce_aws_route53_resolver_dnssec_config_test.go | 4 ++-- aws/resource_aws_route53_resolver_endpoint_test.go | 4 ++-- ...3_resolver_query_log_config_association_test.go | 4 ++-- ...e_aws_route53_resolver_query_log_config_test.go | 6 +++--- ...e_aws_route53_resolver_rule_association_test.go | 2 +- aws/resource_aws_route53_resolver_rule_test.go | 14 +++++++------- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/aws/resource_aws_route53_resolver_dnssec_config_test.go b/aws/resource_aws_route53_resolver_dnssec_config_test.go index 2ba046421ff..44653751b7e 100644 --- a/aws/resource_aws_route53_resolver_dnssec_config_test.go +++ b/aws/resource_aws_route53_resolver_dnssec_config_test.go @@ -82,7 +82,7 @@ func TestAccAWSRoute53ResolverDnssecConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverDnssecConfigDestroy, Steps: []resource.TestStep{ @@ -112,7 +112,7 @@ func TestAccAWSRoute53ResolverDnssecConfig_disappear(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverDnssecConfigDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_resolver_endpoint_test.go b/aws/resource_aws_route53_resolver_endpoint_test.go index 1b6e222276b..2e8113e902c 100644 --- a/aws/resource_aws_route53_resolver_endpoint_test.go +++ b/aws/resource_aws_route53_resolver_endpoint_test.go @@ -82,7 +82,7 @@ func TestAccAWSRoute53ResolverEndpoint_basicInbound(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverEndpointDestroy, Steps: []resource.TestStep{ @@ -115,7 +115,7 @@ func TestAccAWSRoute53ResolverEndpoint_updateOutbound(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverEndpointDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_resolver_query_log_config_association_test.go b/aws/resource_aws_route53_resolver_query_log_config_association_test.go index 3a4b7a94422..39188623ad5 100644 --- a/aws/resource_aws_route53_resolver_query_log_config_association_test.go +++ b/aws/resource_aws_route53_resolver_query_log_config_association_test.go @@ -72,7 +72,7 @@ func TestAccAWSRoute53ResolverQueryLogConfigAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverQueryLogConfigAssociationDestroy, Steps: []resource.TestStep{ @@ -100,7 +100,7 @@ func TestAccAWSRoute53ResolverQueryLogConfigAssociation_disappears(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverQueryLogConfigAssociationDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_resolver_query_log_config_test.go b/aws/resource_aws_route53_resolver_query_log_config_test.go index fa54bb3da4d..566bb1d12a5 100644 --- a/aws/resource_aws_route53_resolver_query_log_config_test.go +++ b/aws/resource_aws_route53_resolver_query_log_config_test.go @@ -74,7 +74,7 @@ func TestAccAWSRoute53ResolverQueryLogConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverQueryLogConfigDestroy, Steps: []resource.TestStep{ @@ -105,7 +105,7 @@ func TestAccAWSRoute53ResolverQueryLogConfig_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverQueryLogConfigDestroy, Steps: []resource.TestStep{ @@ -129,7 +129,7 @@ func TestAccAWSRoute53ResolverQueryLogConfig_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverQueryLogConfigDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_resolver_rule_association_test.go b/aws/resource_aws_route53_resolver_rule_association_test.go index ee06b851a3b..71abfd8bb90 100644 --- a/aws/resource_aws_route53_resolver_rule_association_test.go +++ b/aws/resource_aws_route53_resolver_rule_association_test.go @@ -85,7 +85,7 @@ func TestAccAWSRoute53ResolverRuleAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleAssociationDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_resolver_rule_test.go b/aws/resource_aws_route53_resolver_rule_test.go index 1cf1723d0ff..7172f9043f4 100644 --- a/aws/resource_aws_route53_resolver_rule_test.go +++ b/aws/resource_aws_route53_resolver_rule_test.go @@ -86,7 +86,7 @@ func TestAccAWSRoute53ResolverRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -116,7 +116,7 @@ func TestAccAWSRoute53ResolverRule_justDotDomainName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -146,7 +146,7 @@ func TestAccAWSRoute53ResolverRule_trailingDotDomainName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -176,7 +176,7 @@ func TestAccAWSRoute53ResolverRule_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -229,7 +229,7 @@ func TestAccAWSRoute53ResolverRule_updateName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -270,7 +270,7 @@ func TestAccAWSRoute53ResolverRule_forward(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ @@ -346,7 +346,7 @@ func TestAccAWSRoute53ResolverRule_forwardEndpointRecreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRoute53Resolver(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53resolver.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ResolverRuleDestroy, Steps: []resource.TestStep{ From 6103deede283dccde52342baba4f9a4e29699c10 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:55:22 -0400 Subject: [PATCH 0800/1252] tests/ds/route53: Add ErrorCheck --- aws/data_source_aws_route53_delegation_set_test.go | 3 ++- aws/data_source_aws_route53_zone_test.go | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_route53_delegation_set_test.go b/aws/data_source_aws_route53_delegation_set_test.go index 337118822d7..0f69e70e305 100644 --- a/aws/data_source_aws_route53_delegation_set_test.go +++ b/aws/data_source_aws_route53_delegation_set_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,7 +14,7 @@ func TestAccAWSRoute53DelegationSetDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { diff --git a/aws/data_source_aws_route53_zone_test.go b/aws/data_source_aws_route53_zone_test.go index 5e504e8418a..dcdcc606313 100644 --- a/aws/data_source_aws_route53_zone_test.go +++ b/aws/data_source_aws_route53_zone_test.go @@ -4,7 +4,7 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/servicediscovery" + "github.com/aws/aws-sdk-go/service/route53" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,7 +16,7 @@ func TestAccAWSRoute53ZoneDataSource_id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -40,7 +40,7 @@ func TestAccAWSRoute53ZoneDataSource_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -64,7 +64,7 @@ func TestAccAWSRoute53ZoneDataSource_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -88,7 +88,7 @@ func TestAccAWSRoute53ZoneDataSource_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -111,8 +111,8 @@ func TestAccAWSRoute53ZoneDataSource_serviceDiscovery(t *testing.T) { dataSourceName := "data.aws_route53_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("servicediscovery", t) }, + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ From 60536018dcc099b705a5a8dcad11241fe6869e36 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 21:55:42 -0400 Subject: [PATCH 0801/1252] tests/r/route53: Add ErrorCheck --- ...esource_aws_route53_delegation_set_test.go | 4 ++-- aws/resource_aws_route53_health_check_test.go | 22 +++++++++---------- ...rce_aws_route53_hosted_zone_dnssec_test.go | 6 ++--- ...source_aws_route53_key_signing_key_test.go | 6 ++--- aws/resource_aws_route53_query_log_test.go | 2 +- ...te53_vpc_association_authorization_test.go | 4 ++-- ...ource_aws_route53_zone_association_test.go | 13 ++++++----- aws/resource_aws_route53_zone_test.go | 22 +++++++++---------- aws/resource_aws_shield_protection_test.go | 2 +- 9 files changed, 41 insertions(+), 40 deletions(-) diff --git a/aws/resource_aws_route53_delegation_set_test.go b/aws/resource_aws_route53_delegation_set_test.go index 07d4f568a4e..a5072caeab2 100644 --- a/aws/resource_aws_route53_delegation_set_test.go +++ b/aws/resource_aws_route53_delegation_set_test.go @@ -19,7 +19,7 @@ func TestAccAWSRoute53DelegationSet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"reference_name"}, Providers: testAccProviders, @@ -52,7 +52,7 @@ func TestAccAWSRoute53DelegationSet_withZones(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"reference_name"}, Providers: testAccProviders, diff --git a/aws/resource_aws_route53_health_check_test.go b/aws/resource_aws_route53_health_check_test.go index 84238eacd73..9a5af313ed6 100644 --- a/aws/resource_aws_route53_health_check_test.go +++ b/aws/resource_aws_route53_health_check_test.go @@ -17,7 +17,7 @@ func TestAccAWSRoute53HealthCheck_basic(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, @@ -54,7 +54,7 @@ func TestAccAWSRoute53HealthCheck_tags(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, @@ -98,7 +98,7 @@ func TestAccAWSRoute53HealthCheck_withSearchString(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, @@ -133,7 +133,7 @@ func TestAccAWSRoute53HealthCheck_withChildHealthChecks(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -157,7 +157,7 @@ func TestAccAWSRoute53HealthCheck_withHealthCheckRegions(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionPreCheck("aws", t) }, // GovCloud has 2 regions, test requires 3 - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -182,7 +182,7 @@ func TestAccAWSRoute53HealthCheck_IpConfig(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -207,7 +207,7 @@ func TestAccAWSRoute53HealthCheck_Ipv6Config(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -236,7 +236,7 @@ func TestAccAWSRoute53HealthCheck_CloudWatchAlarmCheck(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -261,7 +261,7 @@ func TestAccAWSRoute53HealthCheck_withSNI(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, @@ -302,7 +302,7 @@ func TestAccAWSRoute53HealthCheck_Disabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ @@ -341,7 +341,7 @@ func TestAccAWSRoute53HealthCheck_disappears(t *testing.T) { resourceName := "aws_route53_health_check.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53HealthCheckDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_hosted_zone_dnssec_test.go b/aws/resource_aws_route53_hosted_zone_dnssec_test.go index 88b51282a68..98864244204 100644 --- a/aws/resource_aws_route53_hosted_zone_dnssec_test.go +++ b/aws/resource_aws_route53_hosted_zone_dnssec_test.go @@ -21,7 +21,7 @@ func TestAccAwsRoute53HostedZoneDnssec_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53HostedZoneDnssecDestroy, Steps: []resource.TestStep{ @@ -48,7 +48,7 @@ func TestAccAwsRoute53HostedZoneDnssec_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53HostedZoneDnssecDestroy, Steps: []resource.TestStep{ @@ -70,7 +70,7 @@ func TestAccAwsRoute53HostedZoneDnssec_SigningStatus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53HostedZoneDnssecDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_key_signing_key_test.go b/aws/resource_aws_route53_key_signing_key_test.go index fdfc60b2ab1..2917e698056 100644 --- a/aws/resource_aws_route53_key_signing_key_test.go +++ b/aws/resource_aws_route53_key_signing_key_test.go @@ -22,7 +22,7 @@ func TestAccAwsRoute53KeySigningKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53KeySigningKeyDestroy, Steps: []resource.TestStep{ @@ -61,7 +61,7 @@ func TestAccAwsRoute53KeySigningKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53KeySigningKeyDestroy, Steps: []resource.TestStep{ @@ -83,7 +83,7 @@ func TestAccAwsRoute53KeySigningKey_Status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53KeySigningKey(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsRoute53KeySigningKeyDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_query_log_test.go b/aws/resource_aws_route53_query_log_test.go index 4e1c67f4796..efd55f410b6 100644 --- a/aws/resource_aws_route53_query_log_test.go +++ b/aws/resource_aws_route53_query_log_test.go @@ -76,7 +76,7 @@ func TestAccAWSRoute53QueryLog_basic(t *testing.T) { var queryLoggingConfig route53.QueryLoggingConfig resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckRoute53QueryLog(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckRoute53QueryLogDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_vpc_association_authorization_test.go b/aws/resource_aws_route53_vpc_association_authorization_test.go index 878047d8c3e..31aeb667c93 100644 --- a/aws/resource_aws_route53_vpc_association_authorization_test.go +++ b/aws/resource_aws_route53_vpc_association_authorization_test.go @@ -20,7 +20,7 @@ func TestAccAWSRoute53VpcAssociationAuthorization_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckRoute53VPCAssociationAuthorizationDestroy, Steps: []resource.TestStep{ @@ -49,7 +49,7 @@ func TestAccAWSRoute53VpcAssociationAuthorization_disappears(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckRoute53VPCAssociationAuthorizationDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_zone_association_test.go b/aws/resource_aws_route53_zone_association_test.go index fb95f54ac6d..9271b6f4b75 100644 --- a/aws/resource_aws_route53_zone_association_test.go +++ b/aws/resource_aws_route53_zone_association_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/route53" "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" @@ -14,7 +15,7 @@ func TestAccAWSRoute53ZoneAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ @@ -38,7 +39,7 @@ func TestAccAWSRoute53ZoneAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ @@ -60,7 +61,7 @@ func TestAccAWSRoute53ZoneAssociation_disappears_VPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ @@ -82,7 +83,7 @@ func TestAccAWSRoute53ZoneAssociation_disappears_Zone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ @@ -110,7 +111,7 @@ func TestAccAWSRoute53ZoneAssociation_CrossAccount(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ @@ -142,7 +143,7 @@ func TestAccAWSRoute53ZoneAssociation_CrossRegion(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckRoute53ZoneAssociationDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route53_zone_test.go b/aws/resource_aws_route53_zone_test.go index f2b648b248f..406c477de56 100644 --- a/aws/resource_aws_route53_zone_test.go +++ b/aws/resource_aws_route53_zone_test.go @@ -82,7 +82,7 @@ func TestAccAWSRoute53Zone_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -115,7 +115,7 @@ func TestAccAWSRoute53Zone_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -136,7 +136,7 @@ func TestAccAWSRoute53Zone_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -168,7 +168,7 @@ func TestAccAWSRoute53Zone_Comment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -206,7 +206,7 @@ func TestAccAWSRoute53Zone_DelegationSetID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -236,7 +236,7 @@ func TestAccAWSRoute53Zone_ForceDestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -262,7 +262,7 @@ func TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -288,7 +288,7 @@ func TestAccAWSRoute53Zone_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -337,7 +337,7 @@ func TestAccAWSRoute53Zone_VPC_Single(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -370,7 +370,7 @@ func TestAccAWSRoute53Zone_VPC_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ @@ -404,7 +404,7 @@ func TestAccAWSRoute53Zone_VPC_Updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, route53.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_shield_protection_test.go b/aws/resource_aws_shield_protection_test.go index f6e9ca1012a..22e75f99828 100644 --- a/aws/resource_aws_shield_protection_test.go +++ b/aws/resource_aws_shield_protection_test.go @@ -164,7 +164,7 @@ func TestAccAWSShieldProtection_Route53(t *testing.T) { testAccPartitionHasServicePreCheck(shield.EndpointsID, t) testAccPreCheckAWSShield(t) }, - ErrorCheck: testAccErrorCheckSkipRoute53(t), + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID, "route53"), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ From b7a1756eda431dad925f57bb02f8399c187927ba Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:18:35 -0400 Subject: [PATCH 0802/1252] tests/r/appsync_api_key: Add ErrorCheck --- aws/resource_aws_appsync_api_key_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_appsync_api_key_test.go b/aws/resource_aws_appsync_api_key_test.go index e571323db29..b2594f1e15e 100644 --- a/aws/resource_aws_appsync_api_key_test.go +++ b/aws/resource_aws_appsync_api_key_test.go @@ -21,6 +21,7 @@ func TestAccAWSAppsyncApiKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncApiKeyDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSAppsyncApiKey_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncApiKeyDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAWSAppsyncApiKey_Expires(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncApiKeyDestroy, Steps: []resource.TestStep{ From 859eb5685d4790bb00abd1ff5a46185d7193619a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:18:44 -0400 Subject: [PATCH 0803/1252] tests/r/appsync_datasource: Add ErrorCheck --- aws/resource_aws_appsync_datasource_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_appsync_datasource_test.go b/aws/resource_aws_appsync_datasource_test.go index a10eb4f6663..ac28cec1a20 100644 --- a/aws/resource_aws_appsync_datasource_test.go +++ b/aws/resource_aws_appsync_datasource_test.go @@ -18,6 +18,7 @@ func TestAccAwsAppsyncDatasource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAwsAppsyncDatasource_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -82,6 +84,7 @@ func TestAccAwsAppsyncDatasource_DynamoDBConfig_Region(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func TestAccAwsAppsyncDatasource_DynamoDBConfig_UseCallerCredentials(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -150,6 +154,7 @@ func TestAccAwsAppsyncDatasource_ElasticsearchConfig_Region(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -184,6 +189,7 @@ func TestAccAwsAppsyncDatasource_HTTPConfig_Endpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -220,6 +226,7 @@ func TestAccAwsAppsyncDatasource_Type(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -249,6 +256,7 @@ func TestAccAwsAppsyncDatasource_Type_DynamoDB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -279,6 +287,7 @@ func TestAccAwsAppsyncDatasource_Type_Elasticsearch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -308,6 +317,7 @@ func TestAccAwsAppsyncDatasource_Type_HTTP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -337,6 +347,7 @@ func TestAccAwsAppsyncDatasource_Type_Lambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ @@ -365,6 +376,7 @@ func TestAccAwsAppsyncDatasource_Type_None(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncDatasourceDestroy, Steps: []resource.TestStep{ From 1565405cf618a750db00863c712122dd60d2de31 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:18:54 -0400 Subject: [PATCH 0804/1252] tests/r/appsync_function: Add ErrorCheck --- aws/resource_aws_appsync_function_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_appsync_function_test.go b/aws/resource_aws_appsync_function_test.go index 3a34bc2f27a..6ef84803fab 100644 --- a/aws/resource_aws_appsync_function_test.go +++ b/aws/resource_aws_appsync_function_test.go @@ -21,6 +21,7 @@ func TestAccAwsAppsyncFunction_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncFunctionDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAwsAppsyncFunction_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncFunctionDestroy, Steps: []resource.TestStep{ @@ -93,6 +95,7 @@ func TestAccAwsAppsyncFunction_responseMappingTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncFunctionDestroy, Steps: []resource.TestStep{ @@ -119,6 +122,7 @@ func TestAccAwsAppsyncFunction_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncFunctionDestroy, Steps: []resource.TestStep{ From 302e56913e4b6033dcb54a186838976a3f0b5339 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:19:04 -0400 Subject: [PATCH 0805/1252] tests/r/appsync_graphql_api: Add ErrorCheck --- aws/resource_aws_appsync_graphql_api_test.go | 25 ++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/aws/resource_aws_appsync_graphql_api_test.go b/aws/resource_aws_appsync_graphql_api_test.go index d3fc44785f3..dfb5bb44312 100644 --- a/aws/resource_aws_appsync_graphql_api_test.go +++ b/aws/resource_aws_appsync_graphql_api_test.go @@ -71,6 +71,7 @@ func TestAccAWSAppsyncGraphqlApi_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -107,6 +108,7 @@ func TestAccAWSAppsyncGraphqlApi_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -129,6 +131,7 @@ func TestAccAWSAppsyncGraphqlApi_Schema(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -173,6 +176,7 @@ func TestAccAWSAppsyncGraphqlApi_AuthenticationType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -206,6 +210,7 @@ func TestAccAWSAppsyncGraphqlApi_AuthenticationType_APIKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -234,6 +239,7 @@ func TestAccAWSAppsyncGraphqlApi_AuthenticationType_AWSIAM(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -263,6 +269,7 @@ func TestAccAWSAppsyncGraphqlApi_AuthenticationType_AmazonCognitoUserPools(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -293,6 +300,7 @@ func TestAccAWSAppsyncGraphqlApi_AuthenticationType_OpenIDConnect(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -322,6 +330,7 @@ func TestAccAWSAppsyncGraphqlApi_LogConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -352,6 +361,7 @@ func TestAccAWSAppsyncGraphqlApi_LogConfig_FieldLogLevel(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -402,6 +412,7 @@ func TestAccAWSAppsyncGraphqlApi_LogConfig_ExcludeVerboseContent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -442,6 +453,7 @@ func TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_AuthTTL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -481,6 +493,7 @@ func TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_ClientID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -520,6 +533,7 @@ func TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_IatTTL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -559,6 +573,7 @@ func TestAccAWSAppsyncGraphqlApi_OpenIDConnectConfig_Issuer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -597,6 +612,7 @@ func TestAccAWSAppsyncGraphqlApi_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -626,6 +642,7 @@ func TestAccAWSAppsyncGraphqlApi_UserPoolConfig_AwsRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -668,6 +685,7 @@ func TestAccAWSAppsyncGraphqlApi_UserPoolConfig_DefaultAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -709,6 +727,7 @@ func TestAccAWSAppsyncGraphqlApi_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -749,6 +768,7 @@ func TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_APIKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -781,6 +801,7 @@ func TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_AWSIAM(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -814,6 +835,7 @@ func TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_CognitoUserPools(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -847,6 +869,7 @@ func TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_OpenIDConnect(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -881,6 +904,7 @@ func TestAccAWSAppsyncGraphqlApi_AdditionalAuthentication_Multiple(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ @@ -921,6 +945,7 @@ func TestAccAWSAppsyncGraphqlApi_XrayEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncGraphqlApiDestroy, Steps: []resource.TestStep{ From 089168bf3fe61255f8afc626506a2a0bd7dae731 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:19:14 -0400 Subject: [PATCH 0806/1252] tests/r/appsync_resolver: Add ErrorCheck --- aws/resource_aws_appsync_resolver_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_appsync_resolver_test.go b/aws/resource_aws_appsync_resolver_test.go index cff425f1a61..55b57c934a4 100644 --- a/aws/resource_aws_appsync_resolver_test.go +++ b/aws/resource_aws_appsync_resolver_test.go @@ -19,6 +19,7 @@ func TestAccAwsAppsyncResolver_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAwsAppsyncResolver_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -72,6 +74,7 @@ func TestAccAwsAppsyncResolver_DataSource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -105,6 +108,7 @@ func TestAccAwsAppsyncResolver_RequestTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -138,6 +142,7 @@ func TestAccAwsAppsyncResolver_ResponseTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -171,6 +176,7 @@ func TestAccAwsAppsyncResolver_multipleResolvers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -200,6 +206,7 @@ func TestAccAwsAppsyncResolver_PipelineConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ @@ -227,6 +234,7 @@ func TestAccAwsAppsyncResolver_CachingConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(appsync.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, appsync.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppsyncResolverDestroy, Steps: []resource.TestStep{ From 1ec48f1c8851e44da754f222b3642e51ad4f9404 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:19:55 -0400 Subject: [PATCH 0807/1252] tests/r/lakeformation_data_lake_settings: Add ErrorCheck --- aws/resource_aws_lakeformation_data_lake_settings_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_lakeformation_data_lake_settings_test.go b/aws/resource_aws_lakeformation_data_lake_settings_test.go index a644f92a1d3..3c3ec5375ae 100644 --- a/aws/resource_aws_lakeformation_data_lake_settings_test.go +++ b/aws/resource_aws_lakeformation_data_lake_settings_test.go @@ -17,6 +17,7 @@ func testAccAWSLakeFormationDataLakeSettings_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationDataLakeSettingsDestroy, Steps: []resource.TestStep{ @@ -38,6 +39,7 @@ func testAccAWSLakeFormationDataLakeSettings_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationDataLakeSettingsDestroy, Steps: []resource.TestStep{ @@ -59,6 +61,7 @@ func testAccAWSLakeFormationDataLakeSettings_withoutCatalogId(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationDataLakeSettingsDestroy, Steps: []resource.TestStep{ From a9935455590f23acd2595df0b963656310363833 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:05 -0400 Subject: [PATCH 0808/1252] tests/r/lakeformation_permissions: Add ErrorCheck --- aws/resource_aws_lakeformation_permissions_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_lakeformation_permissions_test.go b/aws/resource_aws_lakeformation_permissions_test.go index 4d77a297c2f..f52288d56ec 100644 --- a/aws/resource_aws_lakeformation_permissions_test.go +++ b/aws/resource_aws_lakeformation_permissions_test.go @@ -19,6 +19,7 @@ func testAccAWSLakeFormationPermissions_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func testAccAWSLakeFormationPermissions_dataLocation(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -71,6 +73,7 @@ func testAccAWSLakeFormationPermissions_database(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -103,6 +106,7 @@ func testAccAWSLakeFormationPermissions_table_name(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -131,6 +135,7 @@ func testAccAWSLakeFormationPermissions_table_wildcard(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -155,6 +160,7 @@ func testAccAWSLakeFormationPermissions_tableWithColumns(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -185,6 +191,7 @@ func testAccAWSLakeFormationPermissions_tableWithColumnsAndTable(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -214,6 +221,7 @@ func testAccAWSLakeFormationPermissions_selectPermissions(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ From b1b194a9e7c6a2fc37116838051134ea5b1142ec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:14 -0400 Subject: [PATCH 0809/1252] tests/r/lakeformation_resource: Add ErrorCheck --- aws/resource_aws_lakeformation_resource_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_lakeformation_resource_test.go b/aws/resource_aws_lakeformation_resource_test.go index 19671f5198f..21aea70f0f6 100644 --- a/aws/resource_aws_lakeformation_resource_test.go +++ b/aws/resource_aws_lakeformation_resource_test.go @@ -20,6 +20,7 @@ func TestAccAWSLakeFormationResource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ @@ -41,6 +42,7 @@ func TestAccAWSLakeFormationResource_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSLakeFormationResource_serviceLinkedRole(t *testing.T) { testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) testAccPreCheckIamServiceLinkedRole(t, "/aws-service-role/lakeformation.amazonaws.com") }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ @@ -92,6 +95,7 @@ func TestAccAWSLakeFormationResource_updateRoleToRole(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ @@ -128,6 +132,7 @@ func TestAccAWSLakeFormationResource_updateSLRToRole(t *testing.T) { testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) testAccPreCheckIamServiceLinkedRole(t, "/aws-service-role/lakeformation.amazonaws.com") }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ From 40889910cf6d9e593864435d47df04a7d1722d78 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:14 -0400 Subject: [PATCH 0810/1252] tests/ds/lakeformation_data_lake_settings: Add ErrorCheck --- aws/data_source_aws_lakeformation_data_lake_settings_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_lakeformation_data_lake_settings_test.go b/aws/data_source_aws_lakeformation_data_lake_settings_test.go index e0ae83a99b4..fa1fe4ab7d4 100644 --- a/aws/data_source_aws_lakeformation_data_lake_settings_test.go +++ b/aws/data_source_aws_lakeformation_data_lake_settings_test.go @@ -13,6 +13,7 @@ func testAccAWSLakeFormationDataLakeSettingsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationDataLakeSettingsDestroy, Steps: []resource.TestStep{ From 23e60b0e2a97dab84344c0c469f5366889cd0330 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:14 -0400 Subject: [PATCH 0811/1252] tests/ds/lakeformation_permissions: Add ErrorCheck --- aws/data_source_aws_lakeformation_permissions_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/data_source_aws_lakeformation_permissions_test.go b/aws/data_source_aws_lakeformation_permissions_test.go index c6299c985c3..479f8f25032 100644 --- a/aws/data_source_aws_lakeformation_permissions_test.go +++ b/aws/data_source_aws_lakeformation_permissions_test.go @@ -16,6 +16,7 @@ func testAccAWSLakeFormationPermissionsDataSource_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -39,6 +40,7 @@ func testAccAWSLakeFormationPermissionsDataSource_dataLocation(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -63,6 +65,7 @@ func testAccAWSLakeFormationPermissionsDataSource_database(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -91,6 +94,7 @@ func testAccAWSLakeFormationPermissionsDataSource_table(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ @@ -116,6 +120,7 @@ func testAccAWSLakeFormationPermissionsDataSource_tableWithColumns(t *testing.T) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLakeFormationPermissionsDestroy, Steps: []resource.TestStep{ From 8cab303ffafc224b6246ec38087bb603e948e621 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:15 -0400 Subject: [PATCH 0812/1252] tests/ds/lakeformation_resource: Add ErrorCheck --- aws/data_source_aws_lakeformation_resource_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_lakeformation_resource_test.go b/aws/data_source_aws_lakeformation_resource_test.go index 902d8af75d9..cc53b6e211d 100644 --- a/aws/data_source_aws_lakeformation_resource_test.go +++ b/aws/data_source_aws_lakeformation_resource_test.go @@ -16,6 +16,7 @@ func TestAccAWSLakeFormationResourceDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lakeformation.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lakeformation.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLakeFormationResourceDestroy, Steps: []resource.TestStep{ From ee14482fd67e81095e26922a0882eba4d2c8dda4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:20:57 -0400 Subject: [PATCH 0813/1252] tests/ds/outposts_outpost: Add ErrorCheck --- aws/data_source_aws_outposts_outpost_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_outposts_outpost_test.go b/aws/data_source_aws_outposts_outpost_test.go index c4bc6899ac4..4651a7a7599 100644 --- a/aws/data_source_aws_outposts_outpost_test.go +++ b/aws/data_source_aws_outposts_outpost_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSOutpostsOutpostDataSource_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -37,6 +39,7 @@ func TestAccAWSOutpostsOutpostDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -62,6 +65,7 @@ func TestAccAWSOutpostsOutpostDataSource_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 4b1319559129f6f14245e56d01892c488884ebff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:21:07 -0400 Subject: [PATCH 0814/1252] tests/ds/outposts_outpost_instance_type: Add ErrorCheck --- aws/data_source_aws_outposts_outpost_instance_type_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_outposts_outpost_instance_type_test.go b/aws/data_source_aws_outposts_outpost_instance_type_test.go index 5b01b6a9645..e2a0fec6a6a 100644 --- a/aws/data_source_aws_outposts_outpost_instance_type_test.go +++ b/aws/data_source_aws_outposts_outpost_instance_type_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSOutpostsOutpostInstanceTypeDataSource_InstanceType(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -30,6 +32,7 @@ func TestAccAWSOutpostsOutpostInstanceTypeDataSource_PreferredInstanceTypes(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 8b7ee7300158b8d36bad40327a44d7f9bed7904e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:21:17 -0400 Subject: [PATCH 0815/1252] tests/ds/outposts_outpost_instance_types: Add ErrorCheck --- aws/data_source_aws_outposts_outpost_instance_types_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_outposts_outpost_instance_types_test.go b/aws/data_source_aws_outposts_outpost_instance_types_test.go index be5e3b1cd82..eaed60144e1 100644 --- a/aws/data_source_aws_outposts_outpost_instance_types_test.go +++ b/aws/data_source_aws_outposts_outpost_instance_types_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -13,6 +14,7 @@ func TestAccAWSOutpostsOutpostInstanceTypesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From fbbccf50550da01366922fa1daf2990c1bbb9534 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:21:28 -0400 Subject: [PATCH 0816/1252] tests/ds/outposts_outposts: Add ErrorCheck --- aws/data_source_aws_outposts_outposts_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_outposts_outposts_test.go b/aws/data_source_aws_outposts_outposts_test.go index 8c64f4dd36e..cb2da8da7d2 100644 --- a/aws/data_source_aws_outposts_outposts_test.go +++ b/aws/data_source_aws_outposts_outposts_test.go @@ -14,6 +14,7 @@ func TestAccAWSOutpostsOutpostsDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 8deb5c2cecda28dd1511767d4282cb9fabded93e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:21:40 -0400 Subject: [PATCH 0817/1252] tests/ds/outposts_site: Add ErrorCheck --- aws/data_source_aws_outposts_site_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_outposts_site_test.go b/aws/data_source_aws_outposts_site_test.go index 491e015b1da..ec8778c82f8 100644 --- a/aws/data_source_aws_outposts_site_test.go +++ b/aws/data_source_aws_outposts_site_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +13,7 @@ func TestAccAWSOutpostsSiteDataSource_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsSites(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -34,6 +36,7 @@ func TestAccAWSOutpostsSiteDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsSites(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From ffe185ab924d1282f148ab67ebb4130b210c34da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:21:51 -0400 Subject: [PATCH 0818/1252] tests/ds/outposts_sites: Add ErrorCheck --- aws/data_source_aws_outposts_sites_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_outposts_sites_test.go b/aws/data_source_aws_outposts_sites_test.go index e5a2dbce1da..ec52762b696 100644 --- a/aws/data_source_aws_outposts_sites_test.go +++ b/aws/data_source_aws_outposts_sites_test.go @@ -14,6 +14,7 @@ func TestAccAWSOutpostsSitesDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsSites(t) }, + ErrorCheck: testAccErrorCheck(t, outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From bb88b76367239e45e4e1950c8d90ecf5b961f8df Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:22:21 -0400 Subject: [PATCH 0819/1252] tests/r/qldb_ledger: Add ErrorCheck --- aws/resource_aws_qldb_ledger_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_qldb_ledger_test.go b/aws/resource_aws_qldb_ledger_test.go index 5fff6d4a935..c931f4f344c 100644 --- a/aws/resource_aws_qldb_ledger_test.go +++ b/aws/resource_aws_qldb_ledger_test.go @@ -69,6 +69,7 @@ func TestAccAWSQLDBLedger_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(qldb.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, qldb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSQLDBLedgerDestroy, Steps: []resource.TestStep{ @@ -174,6 +175,7 @@ func TestAccAWSQLDBLedger_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(qldb.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, qldb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSQLDBLedgerDestroy, Steps: []resource.TestStep{ From 36c8ab8e34e7f4a852d964f7db598cad24b236b3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:22:22 -0400 Subject: [PATCH 0820/1252] tests/ds/qldb_ledger: Add ErrorCheck --- aws/data_source_aws_qldb_ledger_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_qldb_ledger_test.go b/aws/data_source_aws_qldb_ledger_test.go index e2b1b0a8fd0..8abfa6173bc 100644 --- a/aws/data_source_aws_qldb_ledger_test.go +++ b/aws/data_source_aws_qldb_ledger_test.go @@ -13,8 +13,9 @@ func TestAccDataSourceAwsQLDBLedger_basic(t *testing.T) { rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(7)) // QLDB name cannot be longer than 32 characters resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(qldb.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(qldb.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, qldb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsQLDBLedgerConfig(rName), From fbac29c9b3ff1d8839ad125f1f3fe5f9a6495ae9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:24:17 -0400 Subject: [PATCH 0821/1252] tests/r/acmpca_certificate: Add ErrorCheck --- aws/resource_aws_acmpca_certificate_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_acmpca_certificate_test.go b/aws/resource_aws_acmpca_certificate_test.go index 516502483cc..68e2de1400d 100644 --- a/aws/resource_aws_acmpca_certificate_test.go +++ b/aws/resource_aws_acmpca_certificate_test.go @@ -22,6 +22,7 @@ func TestAccAwsAcmpcaCertificate_RootCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAwsAcmpcaCertificate_SubordinateCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAwsAcmpcaCertificate_EndEntityCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateDestroy, Steps: []resource.TestStep{ @@ -143,6 +146,7 @@ func TestAccAwsAcmpcaCertificate_Validity_EndDate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateDestroy, Steps: []resource.TestStep{ @@ -183,6 +187,7 @@ func TestAccAwsAcmpcaCertificate_Validity_Absolute(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateDestroy, Steps: []resource.TestStep{ From 47c838356310fc10ca8d30f1a488cba71e6da057 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:24:26 -0400 Subject: [PATCH 0822/1252] tests/r/acmpca_certificate_authority: Add ErrorCheck --- aws/resource_aws_acmpca_certificate_authority_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_acmpca_certificate_authority_test.go b/aws/resource_aws_acmpca_certificate_authority_test.go index 031d2a974ee..f2543d6ce26 100644 --- a/aws/resource_aws_acmpca_certificate_authority_test.go +++ b/aws/resource_aws_acmpca_certificate_authority_test.go @@ -88,6 +88,7 @@ func TestAccAwsAcmpcaCertificateAuthority_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -132,6 +133,7 @@ func TestAccAwsAcmpcaCertificateAuthority_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAwsAcmpcaCertificateAuthority_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -203,6 +206,7 @@ func TestAccAwsAcmpcaCertificateAuthority_DeleteFromActiveState(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -228,6 +232,7 @@ func TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfigurati resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -313,6 +318,7 @@ func TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfigurati resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -382,6 +388,7 @@ func TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfigurati resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ @@ -439,6 +446,7 @@ func TestAccAwsAcmpcaCertificateAuthority_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAcmpcaCertificateAuthorityDestroy, Steps: []resource.TestStep{ From d3d4fd5dd0d6462d7500911bf756f2128ddc664d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:24:36 -0400 Subject: [PATCH 0823/1252] tests/r/acmpca_certificate_authority_certificate: Add ErrorCheck --- ...source_aws_acmpca_certificate_authority_certificate_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_acmpca_certificate_authority_certificate_test.go b/aws/resource_aws_acmpca_certificate_authority_certificate_test.go index bd4231c4506..bea2c761e1c 100644 --- a/aws/resource_aws_acmpca_certificate_authority_certificate_test.go +++ b/aws/resource_aws_acmpca_certificate_authority_certificate_test.go @@ -19,6 +19,7 @@ func TestAccAwsAcmpcaCertificateAuthorityCertificate_RootCA(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, // Certificate authority certificates cannot be deleted Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAwsAcmpcaCertificateAuthorityCertificate_UpdateRootCA(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, // Certificate authority certificates cannot be deleted Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAwsAcmpcaCertificateAuthorityCertificate_SubordinateCA(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, // Certificate authority certificates cannot be deleted Steps: []resource.TestStep{ From 739a41255ee81e63832e93f3ba43d52ebd09488e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:25:08 -0400 Subject: [PATCH 0824/1252] tests/ds/acmpca_certificate: Add ErrorCheck --- aws/data_source_aws_acmpca_certificate_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_acmpca_certificate_test.go b/aws/data_source_aws_acmpca_certificate_test.go index e910995ddf3..91f29a069a5 100644 --- a/aws/data_source_aws_acmpca_certificate_test.go +++ b/aws/data_source_aws_acmpca_certificate_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsAcmpcaCertificate_Basic(t *testing.T) { dataSourceName := "data.aws_acmpca_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAcmpcaCertificateConfig_NonExistent, From a869072de94efb93bc32186171cc05be3d5da6b1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:25:21 -0400 Subject: [PATCH 0825/1252] tests/ds/acmpca_certificate_authority: Add ErrorCheck --- aws/data_source_aws_acmpca_certificate_authority_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_acmpca_certificate_authority_test.go b/aws/data_source_aws_acmpca_certificate_authority_test.go index 617146b4d9d..f57803c9c89 100644 --- a/aws/data_source_aws_acmpca_certificate_authority_test.go +++ b/aws/data_source_aws_acmpca_certificate_authority_test.go @@ -4,6 +4,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccDataSourceAwsAcmpcaCertificateAuthority_basic(t *testing.T) { datasourceName := "data.aws_acmpca_certificate_authority.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acmpca.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsAcmpcaCertificateAuthorityConfig_NonExistent, From 2e050e4883485b754511d3e01db913c188af0910 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:26:59 -0400 Subject: [PATCH 0826/1252] tests/r/batch_job_definition: Add ErrorCheck --- aws/resource_aws_batch_job_definition_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_batch_job_definition_test.go b/aws/resource_aws_batch_job_definition_test.go index 4ee8e200d9f..9bbe5eb1a12 100644 --- a/aws/resource_aws_batch_job_definition_test.go +++ b/aws/resource_aws_batch_job_definition_test.go @@ -75,6 +75,7 @@ func TestAccAWSBatchJobDefinition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ @@ -136,6 +137,7 @@ func TestAccAWSBatchJobDefinition_ContainerProperties_Advanced(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ @@ -162,6 +164,7 @@ func TestAccAWSBatchJobDefinition_updateForcesNewResource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSBatchJobDefinition_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ From f88ba7e47428dadad78495a47251b6fa4ff57168 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:27:08 -0400 Subject: [PATCH 0827/1252] tests/r/batch_job_queue: Add ErrorCheck --- aws/resource_aws_batch_job_queue_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_batch_job_queue_test.go b/aws/resource_aws_batch_job_queue_test.go index e6b0eaec4e3..31d39a2783c 100644 --- a/aws/resource_aws_batch_job_queue_test.go +++ b/aws/resource_aws_batch_job_queue_test.go @@ -61,6 +61,7 @@ func TestAccAWSBatchJobQueue_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobQueueDestroy, Steps: []resource.TestStep{ @@ -92,6 +93,7 @@ func TestAccAWSBatchJobQueue_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, Steps: []resource.TestStep{ @@ -115,6 +117,7 @@ func TestAccAWSBatchJobQueue_ComputeEnvironments_ExternalOrderUpdate(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobQueueDestroy, Steps: []resource.TestStep{ @@ -141,6 +144,7 @@ func TestAccAWSBatchJobQueue_Priority(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobQueueDestroy, Steps: []resource.TestStep{ @@ -174,6 +178,7 @@ func TestAccAWSBatchJobQueue_State(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobQueueDestroy, Steps: []resource.TestStep{ @@ -207,6 +212,7 @@ func TestAccAWSBatchJobQueue_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobQueueDestroy, Steps: []resource.TestStep{ From f9c76a0d29b37975b2895a4b5446f10144710562 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:27:09 -0400 Subject: [PATCH 0828/1252] tests/ds/batch_compute_environment: Add ErrorCheck --- aws/data_source_aws_batch_compute_environment_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_batch_compute_environment_test.go b/aws/data_source_aws_batch_compute_environment_test.go index 29ada47ad3a..cf87cf289a7 100644 --- a/aws/data_source_aws_batch_compute_environment_test.go +++ b/aws/data_source_aws_batch_compute_environment_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/batch" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsBatchComputeEnvironment_basic(t *testing.T) { datasourceName := "data.aws_batch_compute_environment.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsBatchComputeEnvironmentConfig(rName), From 510e7da8075c4c6f74be07ef77b6d9e190431066 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:27:10 -0400 Subject: [PATCH 0829/1252] tests/ds/batch_job_queue: Add ErrorCheck --- aws/data_source_aws_batch_job_queue_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_batch_job_queue_test.go b/aws/data_source_aws_batch_job_queue_test.go index ffdf63bddf9..ee1744933d1 100644 --- a/aws/data_source_aws_batch_job_queue_test.go +++ b/aws/data_source_aws_batch_job_queue_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/batch" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsBatchJobQueue_basic(t *testing.T) { datasourceName := "data.aws_batch_job_queue.by_name" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsBatchJobQueueConfig(rName), From 350f196defd9a0816489989b29029863e2ca5e84 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:27:42 -0400 Subject: [PATCH 0830/1252] tests/r/batch_compute_environment: Add ErrorCheck --- ...urce_aws_batch_compute_environment_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/aws/resource_aws_batch_compute_environment_test.go b/aws/resource_aws_batch_compute_environment_test.go index 7c2aeb156c7..e133af5641b 100644 --- a/aws/resource_aws_batch_compute_environment_test.go +++ b/aws/resource_aws_batch_compute_environment_test.go @@ -157,6 +157,7 @@ func TestAccAWSBatchComputeEnvironment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -178,6 +179,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -197,6 +199,7 @@ func TestAccAWSBatchComputeEnvironment_createWithNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -218,6 +221,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2WithTags(t *testing.T) { resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -243,6 +247,7 @@ func TestAccAWSBatchComputeEnvironment_createSpot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -261,6 +266,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanaged(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -280,6 +286,7 @@ func TestAccAWSBatchComputeEnvironment_ComputeResources_DesiredVcpus_Computed(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -316,6 +323,7 @@ func TestAccAWSBatchComputeEnvironment_ComputeResources_MinVcpus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -355,6 +363,7 @@ func TestAccAWSBatchComputeEnvironment_ComputeResources_MaxVcpus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -394,6 +403,7 @@ func TestAccAWSBatchComputeEnvironment_updateInstanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -428,6 +438,7 @@ func TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -459,6 +470,7 @@ func TestAccAWSBatchComputeEnvironment_createEc2WithoutComputeResources(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -475,6 +487,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -495,6 +508,7 @@ func TestAccAWSBatchComputeEnvironment_launchTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -525,6 +539,7 @@ func TestAccAWSBatchComputeEnvironment_UpdateLaunchTemplate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -556,6 +571,7 @@ func TestAccAWSBatchComputeEnvironment_createSpotWithAllocationStrategy(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -575,6 +591,7 @@ func TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -592,6 +609,7 @@ func TestAccAWSBatchComputeEnvironment_updateState(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ @@ -624,6 +642,7 @@ func TestAccAWSBatchComputeEnvironment_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + ErrorCheck: testAccErrorCheck(t, batch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, Steps: []resource.TestStep{ From ad176389c36e926c9ec147ab1c2092c72d02a3ef Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:28:38 -0400 Subject: [PATCH 0831/1252] tests/r/dynamodb_global_table: Add ErrorCheck --- aws/resource_aws_dynamodb_global_table_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_dynamodb_global_table_test.go b/aws/resource_aws_dynamodb_global_table_test.go index 0ae6d12ba51..23289043031 100644 --- a/aws/resource_aws_dynamodb_global_table_test.go +++ b/aws/resource_aws_dynamodb_global_table_test.go @@ -25,6 +25,7 @@ func TestAccAWSDynamoDbGlobalTable_basic(t *testing.T) { testAccPreCheckAWSDynamodbGlobalTable(t) testAccDynamoDBGlobalTablePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsDynamoDbGlobalTableDestroy, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAWSDynamoDbGlobalTable_multipleRegions(t *testing.T) { testAccMultipleRegionPreCheck(t, 2) testAccDynamoDBGlobalTablePreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsDynamoDbGlobalTableDestroy, Steps: []resource.TestStep{ From f8cba2af3502fcfd186c272cc8fb5f438e379b27 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:28:48 -0400 Subject: [PATCH 0832/1252] tests/r/dynamodb_table: Add ErrorCheck --- aws/resource_aws_dynamodb_table_test.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/aws/resource_aws_dynamodb_table_test.go b/aws/resource_aws_dynamodb_table_test.go index 18999a85354..cbe5f335255 100644 --- a/aws/resource_aws_dynamodb_table_test.go +++ b/aws/resource_aws_dynamodb_table_test.go @@ -349,6 +349,7 @@ func TestAccAWSDynamoDbTable_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -383,6 +384,7 @@ func TestAccAWSDynamoDbTable_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -405,6 +407,7 @@ func TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -438,6 +441,7 @@ func TestAccAWSDynamoDbTable_extended(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -511,6 +515,7 @@ func TestAccAWSDynamoDbTable_enablePitr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -545,6 +550,7 @@ func TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -578,6 +584,7 @@ func TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -611,6 +618,7 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -644,6 +652,7 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -677,6 +686,7 @@ func TestAccAWSDynamoDbTable_streamSpecification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -712,6 +722,7 @@ func TestAccAWSDynamoDbTable_streamSpecification(t *testing.T) { func TestAccAWSDynamoDbTable_streamSpecificationValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -729,6 +740,7 @@ func TestAccAWSDynamoDbTable_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -757,6 +769,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -820,6 +833,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -909,6 +923,7 @@ func TestAccAWSDynamoDbTable_lsiNonKeyAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -943,6 +958,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1035,6 +1051,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes_emptyPlan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1078,6 +1095,7 @@ func TestAccAWSDynamoDbTable_Ttl_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1107,6 +1125,7 @@ func TestAccAWSDynamoDbTable_Ttl_Disabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1142,6 +1161,7 @@ func TestAccAWSDynamoDbTable_attributeUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1185,6 +1205,7 @@ func TestAccAWSDynamoDbTable_lsiUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1214,6 +1235,7 @@ func TestAccAWSDynamoDbTable_attributeUpdateValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1242,6 +1264,7 @@ func TestAccAWSDynamoDbTable_encryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1405,6 +1428,7 @@ func TestAccAWSDynamoDbTable_Replica_Multiple(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 3) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 3), CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ @@ -1450,6 +1474,7 @@ func TestAccAWSDynamoDbTable_Replica_Single(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 3), // 3 due to shared test configuration CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ From 4a071b7f5654b851dc4872c1924f2f8e992a19c0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:28:58 -0400 Subject: [PATCH 0833/1252] tests/r/dynamodb_table_item: Add ErrorCheck --- aws/resource_aws_dynamodb_table_item_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_dynamodb_table_item_test.go b/aws/resource_aws_dynamodb_table_item_test.go index a9454385cbd..4a49779f1e3 100644 --- a/aws/resource_aws_dynamodb_table_item_test.go +++ b/aws/resource_aws_dynamodb_table_item_test.go @@ -26,6 +26,7 @@ func TestAccAWSDynamoDbTableItem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbItemDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSDynamoDbTableItem_rangeKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbItemDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAWSDynamoDbTableItem_withMultipleItems(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbItemDestroy, Steps: []resource.TestStep{ @@ -150,6 +153,7 @@ func TestAccAWSDynamoDbTableItem_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbItemDestroy, Steps: []resource.TestStep{ @@ -197,6 +201,7 @@ func TestAccAWSDynamoDbTableItem_updateWithRangeKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDynamoDbItemDestroy, Steps: []resource.TestStep{ From 081c9cb6574cab4c87f2e53866eb76fe29065fce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:29:29 -0400 Subject: [PATCH 0834/1252] tests/ds/dynamodb_table: Add ErrorCheck --- aws/data_source_aws_dynamodb_table_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_dynamodb_table_test.go b/aws/data_source_aws_dynamodb_table_test.go index 03a3d66c4a6..9177af369ae 100644 --- a/aws/data_source_aws_dynamodb_table_test.go +++ b/aws/data_source_aws_dynamodb_table_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsDynamoDbTable_basic(t *testing.T) { tableName := fmt.Sprintf("testaccawsdynamodbtable-basic-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dynamodb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsDynamoDbTableConfigBasic(tableName), From e8cad4324b34fb7463fdf296084e1bee48b488ef Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:30:45 -0400 Subject: [PATCH 0835/1252] tests/r/emr_instance_fleet: Add ErrorCheck --- aws/resource_aws_emr_instance_fleet_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_emr_instance_fleet_test.go b/aws/resource_aws_emr_instance_fleet_test.go index 086cbde4696..dc047aeb25c 100644 --- a/aws/resource_aws_emr_instance_fleet_test.go +++ b/aws/resource_aws_emr_instance_fleet_test.go @@ -19,6 +19,7 @@ func TestAccAWSEMRInstanceFleet_basic(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceFleetDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSEMRInstanceFleet_zero_count(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceFleetDestroy, Steps: []resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccAWSEMRInstanceFleet_ebsBasic(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceFleetDestroy, Steps: []resource.TestStep{ @@ -108,6 +111,7 @@ func TestAccAWSEMRInstanceFleet_full(t *testing.T) { resourceName := "aws_emr_instance_fleet.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceFleetDestroy, Steps: []resource.TestStep{ @@ -137,6 +141,7 @@ func TestAccAWSEMRInstanceFleet_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceFleetDestroy, Steps: []resource.TestStep{ From 20c269dc0fea2bcc119144834a9f1109c1caade7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:30:56 -0400 Subject: [PATCH 0836/1252] tests/r/emr_instance_group: Add ErrorCheck --- aws/resource_aws_emr_instance_group_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_emr_instance_group_test.go b/aws/resource_aws_emr_instance_group_test.go index 821f7196d49..c1bb305075c 100644 --- a/aws/resource_aws_emr_instance_group_test.go +++ b/aws/resource_aws_emr_instance_group_test.go @@ -20,6 +20,7 @@ func TestAccAWSEMRInstanceGroup_basic(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSEMRInstanceGroup_BidPrice(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -101,6 +103,7 @@ func TestAccAWSEMRInstanceGroup_ConfigurationsJson(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -143,6 +146,7 @@ func TestAccAWSEMRInstanceGroup_AutoScalingPolicy(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -187,6 +191,7 @@ func TestAccAWSEMRInstanceGroup_InstanceCount(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -219,6 +224,7 @@ func TestAccAWSEMRInstanceGroup_disappears_EmrCluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ @@ -242,6 +248,7 @@ func TestAccAWSEMRInstanceGroup_EbsConfig_EbsOptimized(t *testing.T) { resourceName := "aws_emr_instance_group.task" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, Steps: []resource.TestStep{ From 3567bdc5014c3fc57eaf60374f7b7490907b8a60 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:31:15 -0400 Subject: [PATCH 0837/1252] tests/r/emr_security_configuration: Add ErrorCheck --- aws/resource_aws_emr_security_configuration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_emr_security_configuration_test.go b/aws/resource_aws_emr_security_configuration_test.go index 64dc5fba14a..f294cbf0d64 100644 --- a/aws/resource_aws_emr_security_configuration_test.go +++ b/aws/resource_aws_emr_security_configuration_test.go @@ -15,6 +15,7 @@ func TestAccAWSEmrSecurityConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEmrSecurityConfigurationDestroy, Steps: []resource.TestStep{ From 11f9e32cc488ebe1fa66223fe3e372b03b520098 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:31:50 -0400 Subject: [PATCH 0838/1252] tests/r/emr_cluster_test_new.go: Add ErrorCheck --- aws/resource_aws_emr_cluster_test_new.go | 3635 ++++++++++++++++++++++ 1 file changed, 3635 insertions(+) create mode 100644 aws/resource_aws_emr_cluster_test_new.go diff --git a/aws/resource_aws_emr_cluster_test_new.go b/aws/resource_aws_emr_cluster_test_new.go new file mode 100644 index 00000000000..9e63cc0db40 --- /dev/null +++ b/aws/resource_aws_emr_cluster_test_new.go @@ -0,0 +1,3635 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/emr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func init() { + resource.AddTestSweepers("aws_emr_cluster", &resource.Sweeper{ + Name: "aws_emr_cluster", + F: testSweepEmrClusters, + }) +} + +func testSweepEmrClusters(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).emrconn + + input := &emr.ListClustersInput{ + ClusterStates: []*string{ + aws.String(emr.ClusterStateBootstrapping), + aws.String(emr.ClusterStateRunning), + aws.String(emr.ClusterStateStarting), + aws.String(emr.ClusterStateWaiting), + }, + } + err = conn.ListClustersPages(input, func(page *emr.ListClustersOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, cluster := range page.Clusters { + describeClusterInput := &emr.DescribeClusterInput{ + ClusterId: cluster.Id, + } + terminateJobFlowsInput := &emr.TerminateJobFlowsInput{ + JobFlowIds: []*string{cluster.Id}, + } + id := aws.StringValue(cluster.Id) + + log.Printf("[INFO] Deleting EMR Cluster: %s", id) + _, err = conn.TerminateJobFlows(terminateJobFlowsInput) + + if err != nil { + log.Printf("[ERROR] Error terminating EMR Cluster (%s): %s", id, err) + } + + if err := conn.WaitUntilClusterTerminated(describeClusterInput); err != nil { + log.Printf("[ERROR] Error waiting for EMR Cluster (%s) termination: %s", id, err) + } + } + + return !isLast + }) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EMR Cluster sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("error retrieving EMR Clusters: %s", err) + } + + return nil +} + +func TestAccAWSEMRCluster_basic(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "scale_down_behavior", "TERMINATE_AT_TASK_COMPLETION"), + resource.TestCheckResourceAttr(resourceName, "step.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckNoResourceAttr(resourceName, "additional_info"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_additionalInfo(t *testing.T) { + var cluster emr.Cluster + expectedJSON := ` +{ + "instanceAwsClientConfiguration": { + "proxyPort": 8099, + "proxyHost": "myproxy.example.com" + } +}` + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigAdditionalInfo(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "scale_down_behavior", "TERMINATE_AT_TASK_COMPLETION"), + resource.TestCheckResourceAttr(resourceName, "step.#", "0"), + testAccCheckResourceAttrEquivalentJSON(resourceName, "additional_info", expectedJSON), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "additional_info", + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_disappears(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + testAccCheckAWSEmrClusterDisappears(&cluster), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSEMRCluster_configurationsJson(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigConfigurationsJson(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestMatchResourceAttr(resourceName, "configurations_json", + regexp.MustCompile("{\"JAVA_HOME\":\"/usr/lib/jvm/java-1.8.0\".+")), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy(t *testing.T) { + var cluster1, cluster2, cluster3 emr.Cluster + autoscalingPolicy1 := ` +{ + "Constraints": { + "MinCapacity": 1, + "MaxCapacity": 2 + }, + "Rules": [ + { + "Name": "ScaleOutMemoryPercentage", + "Description": "Scale out if YARNMemoryAvailablePercentage is less than 15", + "Action": { + "SimpleScalingPolicyConfiguration": { + "AdjustmentType": "CHANGE_IN_CAPACITY", + "ScalingAdjustment": 1, + "CoolDown": 300 + } + }, + "Trigger": { + "CloudWatchAlarmDefinition": { + "ComparisonOperator": "LESS_THAN", + "EvaluationPeriods": 1, + "MetricName": "YARNMemoryAvailablePercentage", + "Namespace": "AWS/ElasticMapReduce", + "Period": 300, + "Statistic": "AVERAGE", + "Threshold": 15.0, + "Unit": "PERCENT" + } + } + } + ] +} +` + autoscalingPolicy2 := ` +{ + "Constraints": { + "MinCapacity": 1, + "MaxCapacity": 3 + }, + "Rules": [ + { + "Name": "ScaleOutMemoryPercentage", + "Description": "Scale out if YARNMemoryAvailablePercentage is less than 15", + "Action": { + "SimpleScalingPolicyConfiguration": { + "AdjustmentType": "CHANGE_IN_CAPACITY", + "ScalingAdjustment": 1, + "CoolDown": 300 + } + }, + "Trigger": { + "CloudWatchAlarmDefinition": { + "ComparisonOperator": "LESS_THAN", + "EvaluationPeriods": 1, + "MetricName": "YARNMemoryAvailablePercentage", + "Namespace": "AWS/ElasticMapReduce", + "Period": 300, + "Statistic": "AVERAGE", + "Threshold": 15.0, + "Unit": "PERCENT" + } + } + } + ] +} +` + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicy(rName, autoscalingPolicy1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + testAccCheckResourceAttrEquivalentJSON(resourceName, "core_instance_group.0.autoscaling_policy", autoscalingPolicy1), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicy(rName, autoscalingPolicy2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterNotRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + testAccCheckResourceAttrEquivalentJSON(resourceName, "core_instance_group.0.autoscaling_policy", autoscalingPolicy2), + ), + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicyRemoved(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster3), + testAccCheckAWSEmrClusterNotRecreated(&cluster2, &cluster3), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.autoscaling_policy", ""), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupBidPrice(rName, "0.50"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.bid_price", "0.50"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupBidPrice(rName, "0.51"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.bid_price", "0.51"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount(t *testing.T) { + var cluster1, cluster2, cluster3 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterNotRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "1"), + ), + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster3), + testAccCheckAWSEmrClusterNotRecreated(&cluster2, &cluster3), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "2"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceType(rName, "m4.large"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_type", "m4.large"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceType(rName, "m4.xlarge"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_type", "m4.xlarge"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_CoreInstanceGroup_Name(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupName(rName, "name1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.name", "name1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigCoreInstanceGroupName(rName, "name2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.name", "name2"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups(t *testing.T) { + var cluster emr.Cluster + var vpc ec2.Vpc + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.tf-test-cluster" + vpcResourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + testAccCheckVpcExists(vpcResourceName, &vpc), + ), + }, + { + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Destroy: true, + ExpectError: regexp.MustCompile(`DependencyViolation`), + }, + { + PreConfig: func() { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + err := testAccEmrDeleteManagedSecurityGroups(conn, &vpc) + + if err != nil { + t.Fatal(err) + } + }, + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Destroy: true, + }, + }, + }) +} + +func TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + password := fmt.Sprintf("NeverKeepPasswordsInPlainText%s!", rName) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_Kerberos_ClusterDedicatedKdc(rName, password), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.0.kdc_admin_password", password), + resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.0.realm", "EC2.INTERNAL"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + "kerberos_attributes.0.kdc_admin_password", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupBidPrice(rName, "0.50"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.bid_price", "0.50"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupBidPrice(rName, "0.51"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.bid_price", "0.51"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceCount(rName, 3), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_count", "3"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceCount(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_count", "1"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceType(rName, "m4.large"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_type", "m4.large"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceType(rName, "m4.xlarge"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_type", "m4.xlarge"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_MasterInstanceGroup_Name(t *testing.T) { + var cluster1, cluster2 emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupName(rName, "name1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.name", "name1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigMasterInstanceGroupName(rName, "name2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.name", "name2"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_security_config(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_SecurityConfiguration(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttrPair(resourceName, "security_configuration", "aws_emr_security_configuration.foo", "name"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_Step_Basic(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_Step_Single(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step.#", "1"), + resource.TestCheckResourceAttr(resourceName, "step.0.action_on_failure", "TERMINATE_CLUSTER"), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.args.0", "state-pusher-script"), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.jar", "command-runner.jar"), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.main_class", ""), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.properties.%", "0"), + resource.TestCheckResourceAttr(resourceName, "step.0.name", "Setup Hadoop Debugging"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_Step_ConfigMode(t *testing.T) { + var cluster1, cluster2, cluster3 emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_Step_Single(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "step.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfig_Step_NoBlocks(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster2), + resource.TestCheckResourceAttr(resourceName, "step.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfig_Step_Zeroed(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster3), + resource.TestCheckResourceAttr(resourceName, "step.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_Step_Multiple(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_Step_Multiple(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step.#", "2"), + resource.TestCheckResourceAttr(resourceName, "step.0.action_on_failure", "TERMINATE_CLUSTER"), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.args.0", "state-pusher-script"), + resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.jar", "command-runner.jar"), + resource.TestCheckResourceAttr(resourceName, "step.0.name", "Setup Hadoop Debugging"), + resource.TestCheckResourceAttr(resourceName, "step.1.action_on_failure", "CONTINUE"), + resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.0", "spark-example"), + resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.1", "SparkPi"), + resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.2", "10"), + resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.jar", "command-runner.jar"), + resource.TestCheckResourceAttr(resourceName, "step.1.name", "Spark Step"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_bootstrap_ordering(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.test" + rName := acctest.RandomWithPrefix("tf-emr-bootstrap") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_bootstrap(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "test"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "10"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfig_bootstrapAdd(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "3"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "test"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "10"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.name", "runif-2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.0", "instance.isMaster=true"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.1", "echo also running on master node"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfig_bootstrapReorder(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "3"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.name", "test"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.#", "10"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "runif-2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "2"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.0", "instance.isMaster=true"), + resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.1", "echo also running on master node"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_terminationProtected(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "false"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "termination_protection", "false"), + ), + }, + { + Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "true"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "termination_protection", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + //Need to turn off termination_protection to allow the job to be deleted + Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "false"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "termination_protection", "false"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_keepJob(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig_keepJob(rName, "false"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "keep_job_flow_alive_when_no_steps", "false"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_visibleToAllUsers(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + { + Config: testAccAWSEmrClusterConfigVisibleToAllUsersUpdated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", "false"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_s3Logging(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + bucketName := fmt.Sprintf("s3n://%s/", rName) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigS3Logging(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "log_uri", bucketName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_tags(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), + resource.TestCheckResourceAttr(resourceName, "tags.role", "rolename"), + resource.TestCheckResourceAttr(resourceName, "tags.dns_zone", "env_zone"), + resource.TestCheckResourceAttr(resourceName, "tags.env", "env"), + resource.TestCheckResourceAttr(resourceName, "tags.name", "name-env")), + }, + { + Config: testAccAWSEmrClusterConfigUpdatedTags(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.dns_zone", "new_zone"), + resource.TestCheckResourceAttr(resourceName, "tags.Env", "production"), + resource.TestCheckResourceAttr(resourceName, "tags.name", "name-env"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_root_volume_size(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "ebs_root_volume_size", "21"), + ), + }, + { + Config: testAccAWSEmrClusterConfigUpdatedRootVolumeSize(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "ebs_root_volume_size", "48"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_step_concurrency_level(t *testing.T) { + var cluster emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.tf-test-cluster" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "2"), + ), + }, + { + Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_ebs_config(t *testing.T) { + var cluster emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.tf-test-cluster" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrEbsConfig(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.ebs_config.0.volumes_per_instance", "2"), + resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.ebs_config.0.volumes_per_instance", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_custom_ami_id(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigCustomAmiID(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttrSet(resourceName, "custom_ami_id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "cluster_state", // Ignore RUNNING versus WAITING changes + "configurations", + "keep_job_flow_alive_when_no_steps", + }, + }, + }, + }) +} + +func TestAccAWSEMRCluster_instance_fleet(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigInstanceFleets(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "master_instance_fleet.#", "1"), + resource.TestCheckResourceAttr(resourceName, "core_instance_fleet.#", "1"), + ), + }, + }, + }) +} + +func TestAccAWSEMRCluster_instance_fleet_master_only(t *testing.T) { + var cluster emr.Cluster + + resourceName := "aws_emr_cluster.tf-test-cluster" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigInstanceFleetsMasterOnly(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "master_instance_fleet.#", "1"), + ), + }, + }, + }) +} + +func testAccCheckAWSEmrDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).emrconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_emr_cluster" { + continue + } + + params := &emr.DescribeClusterInput{ + ClusterId: aws.String(rs.Primary.ID), + } + + describe, err := conn.DescribeCluster(params) + + if err == nil { + if describe.Cluster != nil && + *describe.Cluster.Status.State == "WAITING" { + return fmt.Errorf("EMR Cluster still exists") + } + } + + providerErr, ok := err.(awserr.Error) + if !ok { + return err + } + + log.Printf("[ERROR] %v", providerErr) + } + + return nil +} + +func testAccCheckAWSEmrClusterExists(n string, v *emr.Cluster) 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 cluster id set") + } + conn := testAccProvider.Meta().(*AWSClient).emrconn + describe, err := conn.DescribeCluster(&emr.DescribeClusterInput{ + ClusterId: aws.String(rs.Primary.ID), + }) + if err != nil { + return fmt.Errorf("EMR error: %v", err) + } + + if describe.Cluster == nil || *describe.Cluster.Id != rs.Primary.ID { + return fmt.Errorf("EMR cluster %q not found", rs.Primary.ID) + } + + *v = *describe.Cluster + + if describe.Cluster.Status != nil { + state := aws.StringValue(describe.Cluster.Status.State) + if state != emr.ClusterStateRunning && state != emr.ClusterStateWaiting { + return fmt.Errorf("EMR cluster %q is not RUNNING or WAITING, currently: %s", rs.Primary.ID, state) + } + } + + return nil + } +} + +func testAccCheckAWSEmrClusterDisappears(cluster *emr.Cluster) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).emrconn + id := aws.StringValue(cluster.Id) + + terminateJobFlowsInput := &emr.TerminateJobFlowsInput{ + JobFlowIds: []*string{cluster.Id}, + } + + _, err := conn.TerminateJobFlows(terminateJobFlowsInput) + + if err != nil { + return err + } + + input := &emr.ListInstancesInput{ + ClusterId: cluster.Id, + } + var output *emr.ListInstancesOutput + var instanceCount int + + err = resource.Retry(20*time.Minute, func() *resource.RetryError { + var err error + output, err = conn.ListInstances(input) + + if err != nil { + return resource.NonRetryableError(err) + } + + instanceCount = countEMRRemainingInstances(output, id) + + if instanceCount != 0 { + return resource.RetryableError(fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount)) + } + + return nil + }) + + if isResourceTimeoutError(err) { + output, err = conn.ListInstances(input) + + if err == nil { + instanceCount = countEMRRemainingInstances(output, id) + } + } + + if instanceCount != 0 { + return fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount) + } + + if err != nil { + return fmt.Errorf("error waiting for EMR Cluster (%s) Instances to drain: %s", id, err) + } + + return nil + } +} + +func testAccCheckAWSEmrClusterNotRecreated(i, j *emr.Cluster) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(i.Id) != aws.StringValue(j.Id) { + return fmt.Errorf("EMR Cluster recreated: %s -> %s", aws.StringValue(i.Id), aws.StringValue(j.Id)) + } + + return nil + } +} + +func testAccCheckAWSEmrClusterRecreated(i, j *emr.Cluster) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(i.Id) == aws.StringValue(j.Id) { + return fmt.Errorf("EMR Cluster not recreated: %s", aws.StringValue(i.Id)) + } + + return nil + } +} + +func testAccEmrDeleteManagedSecurityGroups(conn *ec2.EC2, vpc *ec2.Vpc) error { + // Reference: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-man-sec-groups.html + managedSecurityGroups := map[string]*ec2.SecurityGroup{ + "ElasticMapReduce-master": nil, + "ElasticMapReduce-slave": nil, + } + + for groupName := range managedSecurityGroups { + securityGroup, err := testAccEmrDescribeManagedSecurityGroup(conn, vpc, groupName) + + if err != nil { + return fmt.Errorf("error describing EMR Managed Security Group (%s): %s", groupName, err) + } + + managedSecurityGroups[groupName] = securityGroup + } + + // EMR Managed Security Groups rules reference each other, so rules from all + // groups must be revoked first. + for groupName, securityGroup := range managedSecurityGroups { + if securityGroup == nil { + continue + } + + err := testAccEmrRevokeManagedSecurityGroup(conn, securityGroup) + + if err != nil { + return fmt.Errorf("error revoking EMR Managed Security Group (%s): %s", groupName, err) + } + } + + for groupName, securityGroup := range managedSecurityGroups { + if securityGroup == nil { + continue + } + + err := testAccEmrDeleteManagedSecurityGroup(conn, securityGroup) + + if err != nil { + return fmt.Errorf("error deleting EMR Managed Security Group (%s): %s", groupName, err) + } + } + + return nil +} + +func testAccEmrDescribeManagedSecurityGroup(conn *ec2.EC2, vpc *ec2.Vpc, securityGroupName string) (*ec2.SecurityGroup, error) { + input := &ec2.DescribeSecurityGroupsInput{ + Filters: []*ec2.Filter{ + { + Name: aws.String("group-name"), + Values: aws.StringSlice([]string{securityGroupName}), + }, + { + Name: aws.String("vpc-id"), + Values: []*string{vpc.VpcId}, + }, + }, + } + + output, err := conn.DescribeSecurityGroups(input) + + if err != nil { + return nil, err + } + + if output == nil || len(output.SecurityGroups) != 1 { + return nil, nil + } + + return output.SecurityGroups[0], nil +} + +func testAccEmrRevokeManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { + input := &ec2.RevokeSecurityGroupIngressInput{ + GroupId: securityGroup.GroupId, + IpPermissions: securityGroup.IpPermissions, + } + + _, err := conn.RevokeSecurityGroupIngress(input) + + return err +} + +func testAccEmrDeleteManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { + input := &ec2.DeleteSecurityGroupInput{ + GroupId: securityGroup.GroupId, + } + + _, err := conn.DeleteSecurityGroup(input) + + return err +} + +func testAccAWSEmrComposeConfig(mapPublicIPOnLaunch bool, config ...string) string { + return composeConfig(append(config, testAccAWSEmrClusterConfigBaseVpc(mapPublicIPOnLaunch))...) +} + +func testAccAWSEmrClusterConfigCurrentPartition() string { + return ` +data "aws_partition" "current" {} +` +} + +func testAccAWSEmrClusterConfig_bootstrap(r string) string { + return testAccAWSEmrComposeConfig(false, + testAccAWSEmrClusterConfigCurrentPartition(), + testAccAWSEmrClusterConfigIAMServiceRoleBase(r), + testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), + testAccAWSEmrClusterConfigBootstrapActionBucket(r), + fmt.Sprintf(` +resource "aws_emr_cluster" "test" { + name = "%[1]s" + release_label = "emr-5.0.0" + applications = ["Hadoop", "Hive"] + log_uri = "s3n://terraform/testlog/" + + master_instance_group { + instance_type = "c4.large" + } + + core_instance_group { + instance_count = 1 + instance_type = "c4.large" + } + + service_role = aws_iam_role.emr_service.arn + depends_on = [ + aws_route_table_association.test, + aws_iam_role_policy_attachment.emr_service, + aws_iam_role_policy_attachment.emr_instance_profile, + ] + + ec2_attributes { + subnet_id = aws_subnet.test.id + emr_managed_master_security_group = aws_security_group.test.id + emr_managed_slave_security_group = aws_security_group.test.id + instance_profile = aws_iam_instance_profile.emr_instance_profile.arn + } + + bootstrap_action { + path = "s3://elasticmapreduce/bootstrap-actions/run-if" + name = "runif" + args = ["instance.isMaster=true", "echo running on master node"] + } + + bootstrap_action { + path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" + name = "test" + + args = ["1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + ] + } +} +`, r), + ) +} + +func testAccAWSEmrClusterConfig_bootstrapAdd(r string) string { + return testAccAWSEmrComposeConfig(false, + testAccAWSEmrClusterConfigCurrentPartition(), + testAccAWSEmrClusterConfigIAMServiceRoleBase(r), + testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), + testAccAWSEmrClusterConfigBootstrapActionBucket(r), + fmt.Sprintf(` +resource "aws_emr_cluster" "test" { + name = "%[1]s" + release_label = "emr-5.0.0" + applications = ["Hadoop", "Hive"] + log_uri = "s3n://terraform/testlog/" + + master_instance_group { + instance_type = "c4.large" + } + + core_instance_group { + instance_count = 1 + instance_type = "c4.large" + } + + service_role = aws_iam_role.emr_service.arn + depends_on = [ + aws_route_table_association.test, + aws_iam_role_policy_attachment.emr_service, + aws_iam_role_policy_attachment.emr_instance_profile, + ] + + ec2_attributes { + subnet_id = aws_subnet.test.id + emr_managed_master_security_group = aws_security_group.test.id + emr_managed_slave_security_group = aws_security_group.test.id + instance_profile = aws_iam_instance_profile.emr_instance_profile.arn + } + + bootstrap_action { + path = "s3://elasticmapreduce/bootstrap-actions/run-if" + name = "runif" + args = ["instance.isMaster=true", "echo running on master node"] + } + + bootstrap_action { + path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" + name = "test" + + args = ["1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + ] + } + + bootstrap_action { + path = "s3://elasticmapreduce/bootstrap-actions/run-if" + name = "runif-2" + args = ["instance.isMaster=true", "echo also running on master node"] + } +} +`, r), + ) +} + +func testAccAWSEmrClusterConfig_bootstrapReorder(r string) string { + return testAccAWSEmrComposeConfig(false, + testAccAWSEmrClusterConfigCurrentPartition(), + testAccAWSEmrClusterConfigIAMServiceRoleBase(r), + testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), + testAccAWSEmrClusterConfigBootstrapActionBucket(r), + fmt.Sprintf(` +resource "aws_emr_cluster" "test" { + name = "%[1]s" + release_label = "emr-5.0.0" + applications = ["Hadoop", "Hive"] + log_uri = "s3n://terraform/testlog/" + + master_instance_group { + instance_type = "c4.large" + } + + core_instance_group { + instance_count = 1 + instance_type = "c4.large" + } + + service_role = aws_iam_role.emr_service.arn + depends_on = [ + aws_route_table_association.test, + aws_iam_role_policy_attachment.emr_service, + aws_iam_role_policy_attachment.emr_instance_profile, + ] + + ec2_attributes { + subnet_id = aws_subnet.test.id + emr_managed_master_security_group = aws_security_group.test.id + emr_managed_slave_security_group = aws_security_group.test.id + instance_profile = aws_iam_instance_profile.emr_instance_profile.arn + } + + bootstrap_action { + path = "s3://elasticmapreduce/bootstrap-actions/run-if" + name = "runif" + args = ["instance.isMaster=true", "echo running on master node"] + } + + bootstrap_action { + path = "s3://elasticmapreduce/bootstrap-actions/run-if" + name = "runif-2" + args = ["instance.isMaster=true", "echo also running on master node"] + } + + bootstrap_action { + path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" + name = "test" + + args = ["1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "10", + ] + } +} +`, r), + ) +} + +func testAccAWSEmrClusterConfig(r string) string { + return testAccAWSEmrComposeConfig(false, + testAccAWSEmrClusterConfigCurrentPartition(), + testAccAWSEmrClusterConfigIAMServiceRoleBase(r), + testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), + testAccAWSEmrClusterConfigIAMAutoscalingRole(r), + fmt.Sprintf(` +resource "aws_emr_cluster" "tf-test-cluster" { + name = "%[1]s" + release_label = "emr-4.6.0" + applications = ["Spark"] + + ec2_attributes { + subnet_id = aws_subnet.test.id + emr_managed_master_security_group = aws_security_group.test.id + emr_managed_slave_security_group = aws_security_group.test.id + instance_profile = aws_iam_instance_profile.emr_instance_profile.arn + } + + master_instance_group { + instance_type = "c4.large" + } + + core_instance_group { + instance_count = 1 + instance_type = "c4.large" + } + + tags = { + role = "rolename" + dns_zone = "env_zone" + env = "env" + name = "name-env" + } + + keep_job_flow_alive_when_no_steps = true + termination_protection = false + + scale_down_behavior = "TERMINATE_AT_TASK_COMPLETION" + + configurations = "test-fixtures/emr_configurations.json" + + depends_on = [ + aws_route_table_association.test, + aws_iam_role_policy_attachment.emr_service, + aws_iam_role_policy_attachment.emr_instance_profile, + aws_iam_role_policy_attachment.emr_autoscaling_role, + ] + + service_role = aws_iam_role.emr_service.arn + autoscaling_role = aws_iam_role.emr_autoscaling_role.arn + ebs_root_volume_size = 21 +} +`, r), + ) +} + +func testAccAWSEmrClusterConfigAdditionalInfo(r string) string { + return testAccAWSEmrComposeConfig(false, + testAccAWSEmrClusterConfigCurrentPartition(), + testAccAWSEmrClusterConfigIAMServiceRoleBase(r), + testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), + testAccAWSEmrClusterConfigIAMAutoscalingRole(r), + fmt.Sprintf(` +resource "aws_emr_cluster" "tf-test-cluster" { + name = "%[1]s" + release_label = "emr-4.6.0" + applications = ["Spark"] + + additional_info = < Date: Thu, 18 Mar 2021 22:32:57 -0400 Subject: [PATCH 0839/1252] tests/r/emr_cluster: Add ErrorCheck --- aws/resource_aws_emr_cluster_test.go | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/aws/resource_aws_emr_cluster_test.go b/aws/resource_aws_emr_cluster_test.go index 44392bbf04a..9e63cc0db40 100644 --- a/aws/resource_aws_emr_cluster_test.go +++ b/aws/resource_aws_emr_cluster_test.go @@ -84,6 +84,7 @@ func TestAccAWSEMRCluster_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -126,6 +127,7 @@ func TestAccAWSEMRCluster_additionalInfo(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -160,6 +162,7 @@ func TestAccAWSEMRCluster_disappears(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -182,6 +185,7 @@ func TestAccAWSEMRCluster_configurationsJson(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -280,6 +284,7 @@ func TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -330,6 +335,7 @@ func TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -371,6 +377,7 @@ func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -421,6 +428,7 @@ func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -462,6 +470,7 @@ func TestAccAWSEMRCluster_CoreInstanceGroup_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -506,6 +515,7 @@ func TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -546,6 +556,7 @@ func TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc(t *testing.T) { password := fmt.Sprintf("NeverKeepPasswordsInPlainText%s!", rName) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -580,6 +591,7 @@ func TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -621,6 +633,7 @@ func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -662,6 +675,7 @@ func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -703,6 +717,7 @@ func TestAccAWSEMRCluster_MasterInstanceGroup_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -744,6 +759,7 @@ func TestAccAWSEMRCluster_security_config(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -775,6 +791,7 @@ func TestAccAWSEMRCluster_Step_Basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -812,6 +829,7 @@ func TestAccAWSEMRCluster_Step_ConfigMode(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -877,6 +895,7 @@ func TestAccAWSEMRCluster_Step_Multiple(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -918,6 +937,7 @@ func TestAccAWSEMRCluster_bootstrap_ordering(t *testing.T) { rName := acctest.RandomWithPrefix("tf-emr-bootstrap") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1017,6 +1037,7 @@ func TestAccAWSEMRCluster_terminationProtected(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1073,6 +1094,7 @@ func TestAccAWSEMRCluster_keepJob(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1104,6 +1126,7 @@ func TestAccAWSEMRCluster_visibleToAllUsers(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1153,6 +1176,7 @@ func TestAccAWSEMRCluster_s3Logging(t *testing.T) { bucketName := fmt.Sprintf("s3n://%s/", rName) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1184,6 +1208,7 @@ func TestAccAWSEMRCluster_tags(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1228,6 +1253,7 @@ func TestAccAWSEMRCluster_root_volume_size(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1265,6 +1291,7 @@ func TestAccAWSEMRCluster_step_concurrency_level(t *testing.T) { resourceName := "aws_emr_cluster.tf-test-cluster" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1302,6 +1329,7 @@ func TestAccAWSEMRCluster_ebs_config(t *testing.T) { resourceName := "aws_emr_cluster.tf-test-cluster" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1334,6 +1362,7 @@ func TestAccAWSEMRCluster_custom_ami_id(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1365,6 +1394,7 @@ func TestAccAWSEMRCluster_instance_fleet(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ @@ -1387,6 +1417,7 @@ func TestAccAWSEMRCluster_instance_fleet_master_only(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEmrDestroy, Steps: []resource.TestStep{ From db4a9b856764817a55086698b7798973e82adcd4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:33:34 -0400 Subject: [PATCH 0840/1252] tests/r/emr: Remove extra file --- aws/resource_aws_emr_cluster_test_new.go | 3635 ---------------------- 1 file changed, 3635 deletions(-) delete mode 100644 aws/resource_aws_emr_cluster_test_new.go diff --git a/aws/resource_aws_emr_cluster_test_new.go b/aws/resource_aws_emr_cluster_test_new.go deleted file mode 100644 index 9e63cc0db40..00000000000 --- a/aws/resource_aws_emr_cluster_test_new.go +++ /dev/null @@ -1,3635 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - "testing" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/ec2" - "github.com/aws/aws-sdk-go/service/emr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" -) - -func init() { - resource.AddTestSweepers("aws_emr_cluster", &resource.Sweeper{ - Name: "aws_emr_cluster", - F: testSweepEmrClusters, - }) -} - -func testSweepEmrClusters(region string) error { - client, err := sharedClientForRegion(region) - if err != nil { - return fmt.Errorf("error getting client: %s", err) - } - conn := client.(*AWSClient).emrconn - - input := &emr.ListClustersInput{ - ClusterStates: []*string{ - aws.String(emr.ClusterStateBootstrapping), - aws.String(emr.ClusterStateRunning), - aws.String(emr.ClusterStateStarting), - aws.String(emr.ClusterStateWaiting), - }, - } - err = conn.ListClustersPages(input, func(page *emr.ListClustersOutput, isLast bool) bool { - if page == nil { - return !isLast - } - - for _, cluster := range page.Clusters { - describeClusterInput := &emr.DescribeClusterInput{ - ClusterId: cluster.Id, - } - terminateJobFlowsInput := &emr.TerminateJobFlowsInput{ - JobFlowIds: []*string{cluster.Id}, - } - id := aws.StringValue(cluster.Id) - - log.Printf("[INFO] Deleting EMR Cluster: %s", id) - _, err = conn.TerminateJobFlows(terminateJobFlowsInput) - - if err != nil { - log.Printf("[ERROR] Error terminating EMR Cluster (%s): %s", id, err) - } - - if err := conn.WaitUntilClusterTerminated(describeClusterInput); err != nil { - log.Printf("[ERROR] Error waiting for EMR Cluster (%s) termination: %s", id, err) - } - } - - return !isLast - }) - if err != nil { - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping EMR Cluster sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("error retrieving EMR Clusters: %s", err) - } - - return nil -} - -func TestAccAWSEMRCluster_basic(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "scale_down_behavior", "TERMINATE_AT_TASK_COMPLETION"), - resource.TestCheckResourceAttr(resourceName, "step.#", "0"), - resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckNoResourceAttr(resourceName, "additional_info"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "0"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_additionalInfo(t *testing.T) { - var cluster emr.Cluster - expectedJSON := ` -{ - "instanceAwsClientConfiguration": { - "proxyPort": 8099, - "proxyHost": "myproxy.example.com" - } -}` - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigAdditionalInfo(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "scale_down_behavior", "TERMINATE_AT_TASK_COMPLETION"), - resource.TestCheckResourceAttr(resourceName, "step.#", "0"), - testAccCheckResourceAttrEquivalentJSON(resourceName, "additional_info", expectedJSON), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "additional_info", - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_disappears(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - testAccCheckAWSEmrClusterDisappears(&cluster), - ), - ExpectNonEmptyPlan: true, - }, - }, - }) -} - -func TestAccAWSEMRCluster_configurationsJson(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigConfigurationsJson(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestMatchResourceAttr(resourceName, "configurations_json", - regexp.MustCompile("{\"JAVA_HOME\":\"/usr/lib/jvm/java-1.8.0\".+")), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_CoreInstanceGroup_AutoscalingPolicy(t *testing.T) { - var cluster1, cluster2, cluster3 emr.Cluster - autoscalingPolicy1 := ` -{ - "Constraints": { - "MinCapacity": 1, - "MaxCapacity": 2 - }, - "Rules": [ - { - "Name": "ScaleOutMemoryPercentage", - "Description": "Scale out if YARNMemoryAvailablePercentage is less than 15", - "Action": { - "SimpleScalingPolicyConfiguration": { - "AdjustmentType": "CHANGE_IN_CAPACITY", - "ScalingAdjustment": 1, - "CoolDown": 300 - } - }, - "Trigger": { - "CloudWatchAlarmDefinition": { - "ComparisonOperator": "LESS_THAN", - "EvaluationPeriods": 1, - "MetricName": "YARNMemoryAvailablePercentage", - "Namespace": "AWS/ElasticMapReduce", - "Period": 300, - "Statistic": "AVERAGE", - "Threshold": 15.0, - "Unit": "PERCENT" - } - } - } - ] -} -` - autoscalingPolicy2 := ` -{ - "Constraints": { - "MinCapacity": 1, - "MaxCapacity": 3 - }, - "Rules": [ - { - "Name": "ScaleOutMemoryPercentage", - "Description": "Scale out if YARNMemoryAvailablePercentage is less than 15", - "Action": { - "SimpleScalingPolicyConfiguration": { - "AdjustmentType": "CHANGE_IN_CAPACITY", - "ScalingAdjustment": 1, - "CoolDown": 300 - } - }, - "Trigger": { - "CloudWatchAlarmDefinition": { - "ComparisonOperator": "LESS_THAN", - "EvaluationPeriods": 1, - "MetricName": "YARNMemoryAvailablePercentage", - "Namespace": "AWS/ElasticMapReduce", - "Period": 300, - "Statistic": "AVERAGE", - "Threshold": 15.0, - "Unit": "PERCENT" - } - } - } - ] -} -` - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicy(rName, autoscalingPolicy1), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - testAccCheckResourceAttrEquivalentJSON(resourceName, "core_instance_group.0.autoscaling_policy", autoscalingPolicy1), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicy(rName, autoscalingPolicy2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterNotRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - testAccCheckResourceAttrEquivalentJSON(resourceName, "core_instance_group.0.autoscaling_policy", autoscalingPolicy2), - ), - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupAutoscalingPolicyRemoved(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster3), - testAccCheckAWSEmrClusterNotRecreated(&cluster2, &cluster3), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.autoscaling_policy", ""), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_CoreInstanceGroup_BidPrice(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupBidPrice(rName, "0.50"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.bid_price", "0.50"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupBidPrice(rName, "0.51"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.bid_price", "0.51"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceCount(t *testing.T) { - var cluster1, cluster2, cluster3 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "2"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 1), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterNotRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "1"), - ), - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceCount(rName, 2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster3), - testAccCheckAWSEmrClusterNotRecreated(&cluster2, &cluster3), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_count", "2"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_CoreInstanceGroup_InstanceType(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceType(rName, "m4.large"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_type", "m4.large"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupInstanceType(rName, "m4.xlarge"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.instance_type", "m4.xlarge"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_CoreInstanceGroup_Name(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupName(rName, "name1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.name", "name1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigCoreInstanceGroupName(rName, "name2"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.name", "name2"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups(t *testing.T) { - var cluster emr.Cluster - var vpc ec2.Vpc - - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.tf-test-cluster" - vpcResourceName := "aws_vpc.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - testAccCheckVpcExists(vpcResourceName, &vpc), - ), - }, - { - Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), - Destroy: true, - ExpectError: regexp.MustCompile(`DependencyViolation`), - }, - { - PreConfig: func() { - conn := testAccProvider.Meta().(*AWSClient).ec2conn - - err := testAccEmrDeleteManagedSecurityGroups(conn, &vpc) - - if err != nil { - t.Fatal(err) - } - }, - Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), - Destroy: true, - }, - }, - }) -} - -func TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - password := fmt.Sprintf("NeverKeepPasswordsInPlainText%s!", rName) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_Kerberos_ClusterDedicatedKdc(rName, password), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.#", "1"), - resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.0.kdc_admin_password", password), - resource.TestCheckResourceAttr(resourceName, "kerberos_attributes.0.realm", "EC2.INTERNAL"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - "kerberos_attributes.0.kdc_admin_password", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_MasterInstanceGroup_BidPrice(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupBidPrice(rName, "0.50"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.bid_price", "0.50"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupBidPrice(rName, "0.51"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.bid_price", "0.51"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceCount(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceCount(rName, 3), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_count", "3"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceCount(rName, 1), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_count", "1"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_MasterInstanceGroup_InstanceType(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceType(rName, "m4.large"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_type", "m4.large"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupInstanceType(rName, "m4.xlarge"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.instance_type", "m4.xlarge"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_MasterInstanceGroup_Name(t *testing.T) { - var cluster1, cluster2 emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupName(rName, "name1"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.name", "name1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigMasterInstanceGroupName(rName, "name2"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - testAccCheckAWSEmrClusterRecreated(&cluster1, &cluster2), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.#", "1"), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.name", "name2"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_security_config(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_SecurityConfiguration(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttrPair(resourceName, "security_configuration", "aws_emr_security_configuration.foo", "name"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_Step_Basic(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_Step_Single(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "step.#", "1"), - resource.TestCheckResourceAttr(resourceName, "step.0.action_on_failure", "TERMINATE_CLUSTER"), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.args.0", "state-pusher-script"), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.jar", "command-runner.jar"), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.main_class", ""), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.properties.%", "0"), - resource.TestCheckResourceAttr(resourceName, "step.0.name", "Setup Hadoop Debugging"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_Step_ConfigMode(t *testing.T) { - var cluster1, cluster2, cluster3 emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_Step_Single(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster1), - resource.TestCheckResourceAttr(resourceName, "step.#", "1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfig_Step_NoBlocks(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster2), - resource.TestCheckResourceAttr(resourceName, "step.#", "1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfig_Step_Zeroed(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster3), - resource.TestCheckResourceAttr(resourceName, "step.#", "0"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_Step_Multiple(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_Step_Multiple(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "step.#", "2"), - resource.TestCheckResourceAttr(resourceName, "step.0.action_on_failure", "TERMINATE_CLUSTER"), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.args.0", "state-pusher-script"), - resource.TestCheckResourceAttr(resourceName, "step.0.hadoop_jar_step.0.jar", "command-runner.jar"), - resource.TestCheckResourceAttr(resourceName, "step.0.name", "Setup Hadoop Debugging"), - resource.TestCheckResourceAttr(resourceName, "step.1.action_on_failure", "CONTINUE"), - resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.0", "spark-example"), - resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.1", "SparkPi"), - resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.args.2", "10"), - resource.TestCheckResourceAttr(resourceName, "step.1.hadoop_jar_step.0.jar", "command-runner.jar"), - resource.TestCheckResourceAttr(resourceName, "step.1.name", "Spark Step"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_bootstrap_ordering(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.test" - rName := acctest.RandomWithPrefix("tf-emr-bootstrap") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_bootstrap(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "test"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "10"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfig_bootstrapAdd(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "3"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "test"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "10"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.name", "runif-2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.0", "instance.isMaster=true"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.1", "echo also running on master node"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfig_bootstrapReorder(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.#", "3"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.name", "runif"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.0", "instance.isMaster=true"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.0.args.1", "echo running on master node"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.name", "test"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.path", fmt.Sprintf("s3://%s/testscript.sh", rName)), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.2.args.#", "10"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.name", "runif-2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.path", "s3://elasticmapreduce/bootstrap-actions/run-if"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.#", "2"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.0", "instance.isMaster=true"), - resource.TestCheckResourceAttr(resourceName, "bootstrap_action.1.args.1", "echo also running on master node"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_terminationProtected(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "false"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "termination_protection", "false"), - ), - }, - { - Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "true"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "termination_protection", "true"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - //Need to turn off termination_protection to allow the job to be deleted - Config: testAccAWSEmrClusterConfigTerminationPolicy(rName, "false"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "termination_protection", "false"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_keepJob(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig_keepJob(rName, "false"), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "keep_job_flow_alive_when_no_steps", "false"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_visibleToAllUsers(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", "true"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - { - Config: testAccAWSEmrClusterConfigVisibleToAllUsersUpdated(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "visible_to_all_users", "false"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_s3Logging(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - bucketName := fmt.Sprintf("s3n://%s/", rName) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigS3Logging(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "log_uri", bucketName), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_tags(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), - resource.TestCheckResourceAttr(resourceName, "tags.role", "rolename"), - resource.TestCheckResourceAttr(resourceName, "tags.dns_zone", "env_zone"), - resource.TestCheckResourceAttr(resourceName, "tags.env", "env"), - resource.TestCheckResourceAttr(resourceName, "tags.name", "name-env")), - }, - { - Config: testAccAWSEmrClusterConfigUpdatedTags(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.dns_zone", "new_zone"), - resource.TestCheckResourceAttr(resourceName, "tags.Env", "production"), - resource.TestCheckResourceAttr(resourceName, "tags.name", "name-env"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_root_volume_size(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "ebs_root_volume_size", "21"), - ), - }, - { - Config: testAccAWSEmrClusterConfigUpdatedRootVolumeSize(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "ebs_root_volume_size", "48"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_step_concurrency_level(t *testing.T) { - var cluster emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.tf-test-cluster" - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "2"), - ), - }, - { - Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 1), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "1"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_ebs_config(t *testing.T) { - var cluster emr.Cluster - rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_emr_cluster.tf-test-cluster" - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrEbsConfig(rName, 2), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "master_instance_group.0.ebs_config.0.volumes_per_instance", "2"), - resource.TestCheckResourceAttr(resourceName, "core_instance_group.0.ebs_config.0.volumes_per_instance", "2"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_custom_ami_id(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigCustomAmiID(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttrSet(resourceName, "custom_ami_id"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "cluster_state", // Ignore RUNNING versus WAITING changes - "configurations", - "keep_job_flow_alive_when_no_steps", - }, - }, - }, - }) -} - -func TestAccAWSEMRCluster_instance_fleet(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigInstanceFleets(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "master_instance_fleet.#", "1"), - resource.TestCheckResourceAttr(resourceName, "core_instance_fleet.#", "1"), - ), - }, - }, - }) -} - -func TestAccAWSEMRCluster_instance_fleet_master_only(t *testing.T) { - var cluster emr.Cluster - - resourceName := "aws_emr_cluster.tf-test-cluster" - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, emr.EndpointsID), - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEmrDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEmrClusterConfigInstanceFleetsMasterOnly(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEmrClusterExists(resourceName, &cluster), - resource.TestCheckResourceAttr(resourceName, "master_instance_fleet.#", "1"), - ), - }, - }, - }) -} - -func testAccCheckAWSEmrDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).emrconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_emr_cluster" { - continue - } - - params := &emr.DescribeClusterInput{ - ClusterId: aws.String(rs.Primary.ID), - } - - describe, err := conn.DescribeCluster(params) - - if err == nil { - if describe.Cluster != nil && - *describe.Cluster.Status.State == "WAITING" { - return fmt.Errorf("EMR Cluster still exists") - } - } - - providerErr, ok := err.(awserr.Error) - if !ok { - return err - } - - log.Printf("[ERROR] %v", providerErr) - } - - return nil -} - -func testAccCheckAWSEmrClusterExists(n string, v *emr.Cluster) 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 cluster id set") - } - conn := testAccProvider.Meta().(*AWSClient).emrconn - describe, err := conn.DescribeCluster(&emr.DescribeClusterInput{ - ClusterId: aws.String(rs.Primary.ID), - }) - if err != nil { - return fmt.Errorf("EMR error: %v", err) - } - - if describe.Cluster == nil || *describe.Cluster.Id != rs.Primary.ID { - return fmt.Errorf("EMR cluster %q not found", rs.Primary.ID) - } - - *v = *describe.Cluster - - if describe.Cluster.Status != nil { - state := aws.StringValue(describe.Cluster.Status.State) - if state != emr.ClusterStateRunning && state != emr.ClusterStateWaiting { - return fmt.Errorf("EMR cluster %q is not RUNNING or WAITING, currently: %s", rs.Primary.ID, state) - } - } - - return nil - } -} - -func testAccCheckAWSEmrClusterDisappears(cluster *emr.Cluster) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).emrconn - id := aws.StringValue(cluster.Id) - - terminateJobFlowsInput := &emr.TerminateJobFlowsInput{ - JobFlowIds: []*string{cluster.Id}, - } - - _, err := conn.TerminateJobFlows(terminateJobFlowsInput) - - if err != nil { - return err - } - - input := &emr.ListInstancesInput{ - ClusterId: cluster.Id, - } - var output *emr.ListInstancesOutput - var instanceCount int - - err = resource.Retry(20*time.Minute, func() *resource.RetryError { - var err error - output, err = conn.ListInstances(input) - - if err != nil { - return resource.NonRetryableError(err) - } - - instanceCount = countEMRRemainingInstances(output, id) - - if instanceCount != 0 { - return resource.RetryableError(fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount)) - } - - return nil - }) - - if isResourceTimeoutError(err) { - output, err = conn.ListInstances(input) - - if err == nil { - instanceCount = countEMRRemainingInstances(output, id) - } - } - - if instanceCount != 0 { - return fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount) - } - - if err != nil { - return fmt.Errorf("error waiting for EMR Cluster (%s) Instances to drain: %s", id, err) - } - - return nil - } -} - -func testAccCheckAWSEmrClusterNotRecreated(i, j *emr.Cluster) resource.TestCheckFunc { - return func(s *terraform.State) error { - if aws.StringValue(i.Id) != aws.StringValue(j.Id) { - return fmt.Errorf("EMR Cluster recreated: %s -> %s", aws.StringValue(i.Id), aws.StringValue(j.Id)) - } - - return nil - } -} - -func testAccCheckAWSEmrClusterRecreated(i, j *emr.Cluster) resource.TestCheckFunc { - return func(s *terraform.State) error { - if aws.StringValue(i.Id) == aws.StringValue(j.Id) { - return fmt.Errorf("EMR Cluster not recreated: %s", aws.StringValue(i.Id)) - } - - return nil - } -} - -func testAccEmrDeleteManagedSecurityGroups(conn *ec2.EC2, vpc *ec2.Vpc) error { - // Reference: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-man-sec-groups.html - managedSecurityGroups := map[string]*ec2.SecurityGroup{ - "ElasticMapReduce-master": nil, - "ElasticMapReduce-slave": nil, - } - - for groupName := range managedSecurityGroups { - securityGroup, err := testAccEmrDescribeManagedSecurityGroup(conn, vpc, groupName) - - if err != nil { - return fmt.Errorf("error describing EMR Managed Security Group (%s): %s", groupName, err) - } - - managedSecurityGroups[groupName] = securityGroup - } - - // EMR Managed Security Groups rules reference each other, so rules from all - // groups must be revoked first. - for groupName, securityGroup := range managedSecurityGroups { - if securityGroup == nil { - continue - } - - err := testAccEmrRevokeManagedSecurityGroup(conn, securityGroup) - - if err != nil { - return fmt.Errorf("error revoking EMR Managed Security Group (%s): %s", groupName, err) - } - } - - for groupName, securityGroup := range managedSecurityGroups { - if securityGroup == nil { - continue - } - - err := testAccEmrDeleteManagedSecurityGroup(conn, securityGroup) - - if err != nil { - return fmt.Errorf("error deleting EMR Managed Security Group (%s): %s", groupName, err) - } - } - - return nil -} - -func testAccEmrDescribeManagedSecurityGroup(conn *ec2.EC2, vpc *ec2.Vpc, securityGroupName string) (*ec2.SecurityGroup, error) { - input := &ec2.DescribeSecurityGroupsInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("group-name"), - Values: aws.StringSlice([]string{securityGroupName}), - }, - { - Name: aws.String("vpc-id"), - Values: []*string{vpc.VpcId}, - }, - }, - } - - output, err := conn.DescribeSecurityGroups(input) - - if err != nil { - return nil, err - } - - if output == nil || len(output.SecurityGroups) != 1 { - return nil, nil - } - - return output.SecurityGroups[0], nil -} - -func testAccEmrRevokeManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { - input := &ec2.RevokeSecurityGroupIngressInput{ - GroupId: securityGroup.GroupId, - IpPermissions: securityGroup.IpPermissions, - } - - _, err := conn.RevokeSecurityGroupIngress(input) - - return err -} - -func testAccEmrDeleteManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { - input := &ec2.DeleteSecurityGroupInput{ - GroupId: securityGroup.GroupId, - } - - _, err := conn.DeleteSecurityGroup(input) - - return err -} - -func testAccAWSEmrComposeConfig(mapPublicIPOnLaunch bool, config ...string) string { - return composeConfig(append(config, testAccAWSEmrClusterConfigBaseVpc(mapPublicIPOnLaunch))...) -} - -func testAccAWSEmrClusterConfigCurrentPartition() string { - return ` -data "aws_partition" "current" {} -` -} - -func testAccAWSEmrClusterConfig_bootstrap(r string) string { - return testAccAWSEmrComposeConfig(false, - testAccAWSEmrClusterConfigCurrentPartition(), - testAccAWSEmrClusterConfigIAMServiceRoleBase(r), - testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), - testAccAWSEmrClusterConfigBootstrapActionBucket(r), - fmt.Sprintf(` -resource "aws_emr_cluster" "test" { - name = "%[1]s" - release_label = "emr-5.0.0" - applications = ["Hadoop", "Hive"] - log_uri = "s3n://terraform/testlog/" - - master_instance_group { - instance_type = "c4.large" - } - - core_instance_group { - instance_count = 1 - instance_type = "c4.large" - } - - service_role = aws_iam_role.emr_service.arn - depends_on = [ - aws_route_table_association.test, - aws_iam_role_policy_attachment.emr_service, - aws_iam_role_policy_attachment.emr_instance_profile, - ] - - ec2_attributes { - subnet_id = aws_subnet.test.id - emr_managed_master_security_group = aws_security_group.test.id - emr_managed_slave_security_group = aws_security_group.test.id - instance_profile = aws_iam_instance_profile.emr_instance_profile.arn - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif" - args = ["instance.isMaster=true", "echo running on master node"] - } - - bootstrap_action { - path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" - name = "test" - - args = ["1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - ] - } -} -`, r), - ) -} - -func testAccAWSEmrClusterConfig_bootstrapAdd(r string) string { - return testAccAWSEmrComposeConfig(false, - testAccAWSEmrClusterConfigCurrentPartition(), - testAccAWSEmrClusterConfigIAMServiceRoleBase(r), - testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), - testAccAWSEmrClusterConfigBootstrapActionBucket(r), - fmt.Sprintf(` -resource "aws_emr_cluster" "test" { - name = "%[1]s" - release_label = "emr-5.0.0" - applications = ["Hadoop", "Hive"] - log_uri = "s3n://terraform/testlog/" - - master_instance_group { - instance_type = "c4.large" - } - - core_instance_group { - instance_count = 1 - instance_type = "c4.large" - } - - service_role = aws_iam_role.emr_service.arn - depends_on = [ - aws_route_table_association.test, - aws_iam_role_policy_attachment.emr_service, - aws_iam_role_policy_attachment.emr_instance_profile, - ] - - ec2_attributes { - subnet_id = aws_subnet.test.id - emr_managed_master_security_group = aws_security_group.test.id - emr_managed_slave_security_group = aws_security_group.test.id - instance_profile = aws_iam_instance_profile.emr_instance_profile.arn - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif" - args = ["instance.isMaster=true", "echo running on master node"] - } - - bootstrap_action { - path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" - name = "test" - - args = ["1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - ] - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif-2" - args = ["instance.isMaster=true", "echo also running on master node"] - } -} -`, r), - ) -} - -func testAccAWSEmrClusterConfig_bootstrapReorder(r string) string { - return testAccAWSEmrComposeConfig(false, - testAccAWSEmrClusterConfigCurrentPartition(), - testAccAWSEmrClusterConfigIAMServiceRoleBase(r), - testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), - testAccAWSEmrClusterConfigBootstrapActionBucket(r), - fmt.Sprintf(` -resource "aws_emr_cluster" "test" { - name = "%[1]s" - release_label = "emr-5.0.0" - applications = ["Hadoop", "Hive"] - log_uri = "s3n://terraform/testlog/" - - master_instance_group { - instance_type = "c4.large" - } - - core_instance_group { - instance_count = 1 - instance_type = "c4.large" - } - - service_role = aws_iam_role.emr_service.arn - depends_on = [ - aws_route_table_association.test, - aws_iam_role_policy_attachment.emr_service, - aws_iam_role_policy_attachment.emr_instance_profile, - ] - - ec2_attributes { - subnet_id = aws_subnet.test.id - emr_managed_master_security_group = aws_security_group.test.id - emr_managed_slave_security_group = aws_security_group.test.id - instance_profile = aws_iam_instance_profile.emr_instance_profile.arn - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif" - args = ["instance.isMaster=true", "echo running on master node"] - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif-2" - args = ["instance.isMaster=true", "echo also running on master node"] - } - - bootstrap_action { - path = "s3://${aws_s3_bucket_object.testobject.bucket}/${aws_s3_bucket_object.testobject.key}" - name = "test" - - args = ["1", - "2", - "3", - "4", - "5", - "6", - "7", - "8", - "9", - "10", - ] - } -} -`, r), - ) -} - -func testAccAWSEmrClusterConfig(r string) string { - return testAccAWSEmrComposeConfig(false, - testAccAWSEmrClusterConfigCurrentPartition(), - testAccAWSEmrClusterConfigIAMServiceRoleBase(r), - testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), - testAccAWSEmrClusterConfigIAMAutoscalingRole(r), - fmt.Sprintf(` -resource "aws_emr_cluster" "tf-test-cluster" { - name = "%[1]s" - release_label = "emr-4.6.0" - applications = ["Spark"] - - ec2_attributes { - subnet_id = aws_subnet.test.id - emr_managed_master_security_group = aws_security_group.test.id - emr_managed_slave_security_group = aws_security_group.test.id - instance_profile = aws_iam_instance_profile.emr_instance_profile.arn - } - - master_instance_group { - instance_type = "c4.large" - } - - core_instance_group { - instance_count = 1 - instance_type = "c4.large" - } - - tags = { - role = "rolename" - dns_zone = "env_zone" - env = "env" - name = "name-env" - } - - keep_job_flow_alive_when_no_steps = true - termination_protection = false - - scale_down_behavior = "TERMINATE_AT_TASK_COMPLETION" - - configurations = "test-fixtures/emr_configurations.json" - - depends_on = [ - aws_route_table_association.test, - aws_iam_role_policy_attachment.emr_service, - aws_iam_role_policy_attachment.emr_instance_profile, - aws_iam_role_policy_attachment.emr_autoscaling_role, - ] - - service_role = aws_iam_role.emr_service.arn - autoscaling_role = aws_iam_role.emr_autoscaling_role.arn - ebs_root_volume_size = 21 -} -`, r), - ) -} - -func testAccAWSEmrClusterConfigAdditionalInfo(r string) string { - return testAccAWSEmrComposeConfig(false, - testAccAWSEmrClusterConfigCurrentPartition(), - testAccAWSEmrClusterConfigIAMServiceRoleBase(r), - testAccAWSEmrClusterConfigIAMInstanceProfileBase(r), - testAccAWSEmrClusterConfigIAMAutoscalingRole(r), - fmt.Sprintf(` -resource "aws_emr_cluster" "tf-test-cluster" { - name = "%[1]s" - release_label = "emr-4.6.0" - applications = ["Spark"] - - additional_info = < Date: Thu, 18 Mar 2021 22:36:07 -0400 Subject: [PATCH 0841/1252] tests/r/msk_cluster: Add ErrorCheck --- aws/resource_aws_msk_cluster_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aws/resource_aws_msk_cluster_test.go b/aws/resource_aws_msk_cluster_test.go index 98419019ff0..b1aac5672ee 100644 --- a/aws/resource_aws_msk_cluster_test.go +++ b/aws/resource_aws_msk_cluster_test.go @@ -82,6 +82,7 @@ func TestAccAWSMskCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -141,6 +142,7 @@ func TestAccAWSMskCluster_BrokerNodeGroupInfo_EbsVolumeSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -178,6 +180,7 @@ func TestAccAWSMskCluster_ClientAuthentication_Sasl_Scram(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -238,6 +241,7 @@ func TestAccAWSMskCluster_ClientAuthentication_Tls_CertificateAuthorityArns(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -269,6 +273,7 @@ func TestAccAWSMskCluster_ConfigurationInfo_Revision(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -307,6 +312,7 @@ func TestAccAWSMskCluster_EncryptionInfo_EncryptionAtRestKmsKeyArn(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -336,6 +342,7 @@ func TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_ClientBroker(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -370,6 +377,7 @@ func TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_InCluster(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -398,6 +406,7 @@ func TestAccAWSMskCluster_EnhancedMonitoring(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -432,6 +441,7 @@ func TestAccAWSMskCluster_NumberOfBrokerNodes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -489,6 +499,7 @@ func TestAccAWSMskCluster_OpenMonitoring(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -536,6 +547,7 @@ func TestAccAWSMskCluster_LoggingInfo(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -584,6 +596,7 @@ func TestAccAWSMskCluster_KafkaVersionUpgrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -618,6 +631,7 @@ func TestAccAWSMskCluster_KafkaVersionDowngrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -668,6 +682,7 @@ func TestAccAWSMskCluster_KafkaVersionUpgradeWithConfigurationInfo(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -709,6 +724,7 @@ func TestAccAWSMskCluster_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ @@ -911,6 +927,7 @@ resource "aws_security_group" "example_sg" { } ` } + func testAccMskClusterConfig_basic(rName string) string { return testAccMskClusterBaseConfig() + fmt.Sprintf(` resource "aws_msk_cluster" "test" { From 7944e3458986a239780b1f4793214ef0e38c79ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:36:17 -0400 Subject: [PATCH 0842/1252] tests/r/msk_configuration: Add ErrorCheck --- aws/resource_aws_msk_configuration_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_msk_configuration_test.go b/aws/resource_aws_msk_configuration_test.go index 398af256ee7..0313ccad7af 100644 --- a/aws/resource_aws_msk_configuration_test.go +++ b/aws/resource_aws_msk_configuration_test.go @@ -82,6 +82,7 @@ func TestAccAWSMskConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ @@ -113,6 +114,7 @@ func TestAccAWSMskConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ @@ -135,6 +137,7 @@ func TestAccAWSMskConfiguration_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ @@ -169,6 +172,7 @@ func TestAccAWSMskConfiguration_KafkaVersions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ @@ -197,6 +201,7 @@ func TestAccAWSMskConfiguration_ServerProperties(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ From 7901abbff99e526553a0e7f0e26d23df60276545 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:36:27 -0400 Subject: [PATCH 0843/1252] tests/r/msk_scram_secret_association: Add ErrorCheck --- aws/resource_aws_msk_scram_secret_association_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_msk_scram_secret_association_test.go b/aws/resource_aws_msk_scram_secret_association_test.go index 0847e305a2e..6b5641a1edb 100644 --- a/aws/resource_aws_msk_scram_secret_association_test.go +++ b/aws/resource_aws_msk_scram_secret_association_test.go @@ -21,6 +21,7 @@ func TestAccAwsMskScramSecretAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskScramSecretAssociationDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAwsMskScramSecretAssociation_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskScramSecretAssociationDestroy, Steps: []resource.TestStep{ @@ -94,6 +96,7 @@ func TestAccAwsMskScramSecretAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskScramSecretAssociationDestroy, Steps: []resource.TestStep{ @@ -116,6 +119,7 @@ func TestAccAwsMskScramSecretAssociation_disappears_Cluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskScramSecretAssociationDestroy, Steps: []resource.TestStep{ From f8cfa0beca754f6119d2913f980428a3b56e0e5c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:36:37 -0400 Subject: [PATCH 0844/1252] tests/ds/msk_cluster: Add ErrorCheck --- aws/data_source_aws_msk_cluster_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_msk_cluster_test.go b/aws/data_source_aws_msk_cluster_test.go index 850d703a753..4ddfe159bc2 100644 --- a/aws/data_source_aws_msk_cluster_test.go +++ b/aws/data_source_aws_msk_cluster_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/kafka" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAWSMskClusterDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ From ea1e042b4da64d4095d3409fb5afa7b1c0e9c066 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:36:46 -0400 Subject: [PATCH 0845/1252] tests/ds/msk_configuration: Add ErrorCheck --- aws/data_source_aws_msk_configuration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_msk_configuration_test.go b/aws/data_source_aws_msk_configuration_test.go index 7211f6ea51f..cd9fbcb0576 100644 --- a/aws/data_source_aws_msk_configuration_test.go +++ b/aws/data_source_aws_msk_configuration_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/kafka" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAWSMskConfigurationDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kafka.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckMskConfigurationDestroy, Steps: []resource.TestStep{ From 8601c5c5f67e6e4c1100956242754ecbe6d2742e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:38:48 -0400 Subject: [PATCH 0846/1252] tests/r/acm_certificate: Add ErrorCheck --- aws/resource_aws_acm_certificate_test.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/aws/resource_aws_acm_certificate_test.go b/aws/resource_aws_acm_certificate_test.go index 399a5d83b90..c9bf26df4b1 100644 --- a/aws/resource_aws_acm_certificate_test.go +++ b/aws/resource_aws_acm_certificate_test.go @@ -122,6 +122,7 @@ func TestAccAWSAcmCertificate_emailValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -154,6 +155,7 @@ func TestAccAWSAcmCertificate_dnsValidation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -188,6 +190,7 @@ func TestAccAWSAcmCertificate_root(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -223,6 +226,7 @@ func TestAccAWSAcmCertificate_privateCert(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -256,6 +260,7 @@ func TestAccAWSAcmCertificate_root_TrailingPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -274,6 +279,7 @@ func TestAccAWSAcmCertificate_rootAndWildcardSan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -313,6 +319,7 @@ func TestAccAWSAcmCertificate_SubjectAlternativeNames_EmptyString(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -332,6 +339,7 @@ func TestAccAWSAcmCertificate_san_single(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -374,6 +382,7 @@ func TestAccAWSAcmCertificate_san_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -420,6 +429,7 @@ func TestAccAWSAcmCertificate_san_TrailingPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -460,6 +470,7 @@ func TestAccAWSAcmCertificate_wildcard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -495,6 +506,7 @@ func TestAccAWSAcmCertificate_wildcardAndRootSan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -534,6 +546,7 @@ func TestAccAWSAcmCertificate_disableCTLogging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -571,6 +584,7 @@ func TestAccAWSAcmCertificate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -628,6 +642,7 @@ func TestAccAWSAcmCertificate_imported_DomainName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -671,6 +686,7 @@ func TestAccAWSAcmCertificate_imported_IpAddress(t *testing.T) { // Reference: h resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -699,6 +715,7 @@ func TestAccAWSAcmCertificate_PrivateKey_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ From ae839cf4881393645cc9ceafe35f0a11f65a3063 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:38:58 -0400 Subject: [PATCH 0847/1252] tests/r/acm_certificate_validation: Add ErrorCheck --- aws/resource_aws_acm_certificate_validation_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_acm_certificate_validation_test.go b/aws/resource_aws_acm_certificate_validation_test.go index cb9d001435a..e541f762a0e 100644 --- a/aws/resource_aws_acm_certificate_validation_test.go +++ b/aws/resource_aws_acm_certificate_validation_test.go @@ -6,6 +6,7 @@ import ( "strconv" "testing" + "github.com/aws/aws-sdk-go/service/acm" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -17,6 +18,7 @@ func TestAccAWSAcmCertificateValidation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -37,6 +39,7 @@ func TestAccAWSAcmCertificateValidation_timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -56,6 +59,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -81,6 +85,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsEmail(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -99,6 +104,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsRoot(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -120,6 +126,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsRootAndWildcard(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -142,6 +149,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsSan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -163,6 +171,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcard(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ @@ -184,6 +193,7 @@ func TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcardAndRoot(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ From 036d9e4374a95ae7ea46098ee43e68f7677f7804 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:38:58 -0400 Subject: [PATCH 0848/1252] tests/ds/acm_certificate: Add ErrorCheck --- aws/data_source_aws_acm_certificate_test.go | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_acm_certificate_test.go b/aws/data_source_aws_acm_certificate_test.go index c9ebf50697c..b4a7134c818 100644 --- a/aws/data_source_aws_acm_certificate_test.go +++ b/aws/data_source_aws_acm_certificate_test.go @@ -36,8 +36,9 @@ func TestAccAWSAcmCertificateDataSource_singleIssued(t *testing.T) { resourceName := "data.aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAcmCertificateDataSourceConfig(domain), @@ -108,8 +109,9 @@ func TestAccAWSAcmCertificateDataSource_multipleIssued(t *testing.T) { resourceName := "data.aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAcmCertificateDataSourceConfig(domain), @@ -156,8 +158,9 @@ func TestAccAWSAcmCertificateDataSource_noMatchReturnsError(t *testing.T) { domain := fmt.Sprintf("tf-acc-nonexistent.%s", os.Getenv("ACM_CERTIFICATE_ROOT_DOMAIN")) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsAcmCertificateDataSourceConfig(domain), @@ -195,8 +198,9 @@ func TestAccAWSAcmCertificateDataSource_KeyTypes(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, acm.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsAcmCertificateDataSourceConfigKeyTypes(tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), rName), From acaf6b84fe70db7901dc9215d8921e0998156974 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:40:08 -0400 Subject: [PATCH 0849/1252] tests/r/lightsail_domain: Add ErrorCheck --- aws/resource_aws_lightsail_domain_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_lightsail_domain_test.go b/aws/resource_aws_lightsail_domain_test.go index d152cb72989..a19edbcaf2b 100644 --- a/aws/resource_aws_lightsail_domain_test.go +++ b/aws/resource_aws_lightsail_domain_test.go @@ -20,6 +20,7 @@ func TestAccAWSLightsailDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckLightsailDomain(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLightsailDomainDestroy, Steps: []resource.TestStep{ @@ -40,6 +41,7 @@ func TestAccAWSLightsailDomain_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckLightsailDomain(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAWSLightsailDomainDestroy, Steps: []resource.TestStep{ From cd71aa2931d2aa8195bfaac825dff43c240dfbdf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:40:18 -0400 Subject: [PATCH 0850/1252] tests/r/lightsail_instance: Add ErrorCheck --- aws/resource_aws_lightsail_instance_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_lightsail_instance_test.go b/aws/resource_aws_lightsail_instance_test.go index a4dce503afe..6a20036d7bd 100644 --- a/aws/resource_aws_lightsail_instance_test.go +++ b/aws/resource_aws_lightsail_instance_test.go @@ -82,6 +82,7 @@ func TestAccAWSLightsailInstance_basic(t *testing.T) { testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), IDRefreshName: "aws_lightsail_instance.lightsail_instance_test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailInstanceDestroy, @@ -117,6 +118,7 @@ func TestAccAWSLightsailInstance_Name(t *testing.T) { testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), IDRefreshName: "aws_lightsail_instance.lightsail_instance_test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailInstanceDestroy, @@ -163,6 +165,7 @@ func TestAccAWSLightsailInstance_Tags(t *testing.T) { testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), IDRefreshName: "aws_lightsail_instance.lightsail_instance_test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailInstanceDestroy, @@ -220,6 +223,7 @@ func TestAccAWSLightsailInstance_disapear(t *testing.T) { testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailInstanceDestroy, Steps: []resource.TestStep{ From d52fe330d283a990fccb1cb8342d893fdfe021cd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:40:28 -0400 Subject: [PATCH 0851/1252] tests/r/lightsail_key_pair: Add ErrorCheck --- aws/resource_aws_lightsail_key_pair_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_lightsail_key_pair_test.go b/aws/resource_aws_lightsail_key_pair_test.go index e1a6a534da6..fe003123aa3 100644 --- a/aws/resource_aws_lightsail_key_pair_test.go +++ b/aws/resource_aws_lightsail_key_pair_test.go @@ -19,6 +19,7 @@ func TestAccAWSLightsailKeyPair_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailKeyPairDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSLightsailKeyPair_publicKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailKeyPairDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSLightsailKeyPair_encrypted(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailKeyPairDestroy, Steps: []resource.TestStep{ @@ -91,6 +94,7 @@ func TestAccAWSLightsailKeyPair_nameprefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailKeyPairDestroy, Steps: []resource.TestStep{ From e15f8368937000732c17e21c166ac341968e4ea0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:40:37 -0400 Subject: [PATCH 0852/1252] tests/r/lightsail_static_ip: Add ErrorCheck --- aws/resource_aws_lightsail_static_ip_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_lightsail_static_ip_test.go b/aws/resource_aws_lightsail_static_ip_test.go index b44f0927ecd..c288f560251 100644 --- a/aws/resource_aws_lightsail_static_ip_test.go +++ b/aws/resource_aws_lightsail_static_ip_test.go @@ -72,6 +72,7 @@ func TestAccAWSLightsailStaticIp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailStaticIpDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSLightsailStaticIp_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailStaticIpDestroy, Steps: []resource.TestStep{ From 54dfac5a2095b4cae8944b680d5ba32289aa03c1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:40:47 -0400 Subject: [PATCH 0853/1252] tests/r/lightsail_static_ip_attachment: Add ErrorCheck --- aws/resource_aws_lightsail_static_ip_attachment_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_lightsail_static_ip_attachment_test.go b/aws/resource_aws_lightsail_static_ip_attachment_test.go index 3044174be0e..9201ee1a41a 100644 --- a/aws/resource_aws_lightsail_static_ip_attachment_test.go +++ b/aws/resource_aws_lightsail_static_ip_attachment_test.go @@ -21,6 +21,7 @@ func TestAccAWSLightsailStaticIpAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailStaticIpAttachmentDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSLightsailStaticIpAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSLightsail(t) }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSLightsailStaticIpAttachmentDestroy, Steps: []resource.TestStep{ From cf6674554866be5f6e1d32c3d55f92df8d5bfe3f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:42:36 -0400 Subject: [PATCH 0854/1252] tests/r/athena_named_query: Add ErrorCheck --- aws/resource_aws_athena_named_query_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_athena_named_query_test.go b/aws/resource_aws_athena_named_query_test.go index 44d86ca50bf..208439bac1d 100644 --- a/aws/resource_aws_athena_named_query_test.go +++ b/aws/resource_aws_athena_named_query_test.go @@ -16,6 +16,7 @@ func TestAccAWSAthenaNamedQuery_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaNamedQueryDestroy, Steps: []resource.TestStep{ @@ -39,6 +40,7 @@ func TestAccAWSAthenaNamedQuery_withWorkGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaNamedQueryDestroy, Steps: []resource.TestStep{ From ee75077e5b97990bac392fba94445fce98324a55 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:42:46 -0400 Subject: [PATCH 0855/1252] tests/r/athena_workgroup: Add ErrorCheck --- aws/resource_aws_athena_workgroup_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_athena_workgroup_test.go b/aws/resource_aws_athena_workgroup_test.go index d6128fd5fd9..7a9f6c2c7aa 100644 --- a/aws/resource_aws_athena_workgroup_test.go +++ b/aws/resource_aws_athena_workgroup_test.go @@ -18,6 +18,7 @@ func TestAccAWSAthenaWorkGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSAthenaWorkGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_BytesScannedCutoffPerQuery(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -110,6 +113,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_EnforceWorkgroupConfiguration(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -146,6 +150,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_PublishCloudWatchMetricsEnabled(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -182,6 +187,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_ResultConfiguration_EncryptionConfi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -214,6 +220,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_ResultConfiguration_EncryptionConfi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -256,6 +263,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_ResultConfiguration_OutputLocation( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -296,6 +304,7 @@ func TestAccAWSAthenaWorkGroup_Configuration_ResultConfiguration_OutputLocation_ resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -336,6 +345,7 @@ func TestAccAWSAthenaWorkGroup_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -370,6 +380,7 @@ func TestAccAWSAthenaWorkGroup_State(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -414,6 +425,7 @@ func TestAccAWSAthenaWorkGroup_ForceDestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ @@ -442,6 +454,7 @@ func TestAccAWSAthenaWorkGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaWorkGroupDestroy, Steps: []resource.TestStep{ From 4d49799a41545f9f6adae645c0e4da052a0765f7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:43:23 -0400 Subject: [PATCH 0856/1252] tests/r/athena_database: Add ErrorCheck --- aws/resource_aws_athena_database_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_athena_database_test.go b/aws/resource_aws_athena_database_test.go index fc945bbdfb1..13cde42b0bf 100644 --- a/aws/resource_aws_athena_database_test.go +++ b/aws/resource_aws_athena_database_test.go @@ -18,6 +18,7 @@ func TestAccAWSAthenaDatabase_basic(t *testing.T) { dbName := acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ @@ -36,6 +37,7 @@ func TestAccAWSAthenaDatabase_encryption(t *testing.T) { dbName := acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ @@ -55,6 +57,7 @@ func TestAccAWSAthenaDatabase_nameStartsWithUnderscore(t *testing.T) { dbName := "_" + acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ @@ -74,6 +77,7 @@ func TestAccAWSAthenaDatabase_nameCantHaveUppercase(t *testing.T) { dbName := "A" + acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ @@ -90,6 +94,7 @@ func TestAccAWSAthenaDatabase_destroyFailsIfTablesExist(t *testing.T) { dbName := acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ @@ -111,6 +116,7 @@ func TestAccAWSAthenaDatabase_forceDestroyAlwaysSucceeds(t *testing.T) { dbName := acctest.RandString(8) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, athena.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAthenaDatabaseDestroy, Steps: []resource.TestStep{ From e21d5a8a2959ff5d7007c00653f1d0ee8e0b0943 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:45:22 -0400 Subject: [PATCH 0857/1252] tests/r/cloudwatch_composite_alarm: Add ErrorCheck --- aws/resource_aws_cloudwatch_composite_alarm_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_cloudwatch_composite_alarm_test.go b/aws/resource_aws_cloudwatch_composite_alarm_test.go index baf9bd788ad..dd9e508f157 100644 --- a/aws/resource_aws_cloudwatch_composite_alarm_test.go +++ b/aws/resource_aws_cloudwatch_composite_alarm_test.go @@ -89,6 +89,7 @@ func TestAccAwsCloudWatchCompositeAlarm_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -122,6 +123,7 @@ func TestAccAwsCloudWatchCompositeAlarm_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -143,6 +145,7 @@ func TestAccAwsCloudWatchCompositeAlarm_actionsEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -180,6 +183,7 @@ func TestAccAwsCloudWatchCompositeAlarm_alarmActions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -229,6 +233,7 @@ func TestAccAwsCloudWatchCompositeAlarm_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -266,6 +271,7 @@ func TestAccAwsCloudWatchCompositeAlarm_insufficientDataActions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -315,6 +321,7 @@ func TestAccAwsCloudWatchCompositeAlarm_okActions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -364,6 +371,7 @@ func TestAccAwsCloudWatchCompositeAlarm_allActions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ @@ -405,6 +413,7 @@ func TestAccAwsCloudWatchCompositeAlarm_updateAlarmRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy, Steps: []resource.TestStep{ From 9a1d6cffbb221c4b657d8df5e398b25027481ddc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:45:32 -0400 Subject: [PATCH 0858/1252] tests/r/cloudwatch_dashboard: Add ErrorCheck --- aws/resource_aws_cloudwatch_dashboard_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudwatch_dashboard_test.go b/aws/resource_aws_cloudwatch_dashboard_test.go index 5aff6e6d411..7380e35335d 100644 --- a/aws/resource_aws_cloudwatch_dashboard_test.go +++ b/aws/resource_aws_cloudwatch_dashboard_test.go @@ -21,6 +21,7 @@ func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSCloudWatchDashboard_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, Steps: []resource.TestStep{ @@ -82,6 +84,7 @@ func TestAccAWSCloudWatchDashboard_updateName(t *testing.T) { rInt2 := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, Steps: []resource.TestStep{ From fed6232678578f705e25ed65629a81437327036c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:45:42 -0400 Subject: [PATCH 0859/1252] tests/r/cloudwatch_metric_alarm: Add ErrorCheck --- aws/resource_aws_cloudwatch_metric_alarm_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_cloudwatch_metric_alarm_test.go b/aws/resource_aws_cloudwatch_metric_alarm_test.go index 8874be19457..e706a43b02f 100644 --- a/aws/resource_aws_cloudwatch_metric_alarm_test.go +++ b/aws/resource_aws_cloudwatch_metric_alarm_test.go @@ -19,6 +19,7 @@ func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -96,6 +98,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -122,6 +125,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -148,6 +152,7 @@ func TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -169,6 +174,7 @@ func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -197,6 +203,7 @@ func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -225,6 +232,7 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -246,6 +254,7 @@ func TestAccAWSCloudWatchMetricAlarm_expression(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -301,6 +310,7 @@ func TestAccAWSCloudWatchMetricAlarm_missingStatistic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -319,6 +329,7 @@ func TestAccAWSCloudWatchMetricAlarm_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ @@ -363,6 +374,7 @@ func TestAccAWSCloudWatchMetricAlarm_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ From c8b2f56c7b1fe78274e0bcc3203c84f040ea46d9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:46:25 -0400 Subject: [PATCH 0860/1252] tests/r/codebuild_project: Add ErrorCheck --- aws/resource_aws_codebuild_project_test.go | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/aws/resource_aws_codebuild_project_test.go b/aws/resource_aws_codebuild_project_test.go index a764044159a..384bb416f81 100644 --- a/aws/resource_aws_codebuild_project_test.go +++ b/aws/resource_aws_codebuild_project_test.go @@ -46,6 +46,7 @@ func TestAccAWSCodeBuildProject_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -99,6 +100,7 @@ func TestAccAWSCodeBuildProject_BadgeEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -126,6 +128,7 @@ func TestAccAWSCodeBuildProject_BuildTimeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -159,6 +162,7 @@ func TestAccAWSCodeBuildProject_QueuedTimeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -192,6 +196,7 @@ func TestAccAWSCodeBuildProject_Cache(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -266,6 +271,7 @@ func TestAccAWSCodeBuildProject_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -299,6 +305,7 @@ func TestAccAWSCodeBuildProject_SourceVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -320,6 +327,7 @@ func TestAccAWSCodeBuildProject_EncryptionKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -346,6 +354,7 @@ func TestAccAWSCodeBuildProject_Environment_EnvironmentVariable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -394,6 +403,7 @@ func TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -437,6 +447,7 @@ func TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Value(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -486,6 +497,7 @@ func TestAccAWSCodeBuildProject_Environment_Certificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -512,6 +524,7 @@ func TestAccAWSCodeBuildProject_LogsConfig_CloudWatchLogs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -557,6 +570,7 @@ func TestAccAWSCodeBuildProject_LogsConfig_S3Logs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -601,6 +615,7 @@ func TestAccAWSCodeBuildProject_Source_GitCloneDepth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -634,6 +649,7 @@ func TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_CodeCommit(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -669,6 +685,7 @@ func TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_GitHub(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -700,6 +717,7 @@ func TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig_GitHubEnterprise(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -731,6 +749,7 @@ func TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_CodeCommit( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -782,6 +801,7 @@ func TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_GitHub(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -813,6 +833,7 @@ func TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig_GitHubEnter resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -844,6 +865,7 @@ func TestAccAWSCodeBuildProject_Source_InsecureSSL(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -877,6 +899,7 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -910,6 +933,7 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -943,6 +967,7 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -976,6 +1001,7 @@ func TestAccAWSCodeBuildProject_Source_Type_Bitbucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1002,6 +1028,7 @@ func TestAccAWSCodeBuildProject_Source_Type_CodeCommit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1028,6 +1055,7 @@ func TestAccAWSCodeBuildProject_Source_Type_CodePipeline(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1054,6 +1082,7 @@ func TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1080,6 +1109,7 @@ func TestAccAWSCodeBuildProject_Source_Type_S3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1112,6 +1142,7 @@ phases: resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1143,6 +1174,7 @@ phases: resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1165,6 +1197,7 @@ func TestAccAWSCodeBuildProject_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1202,6 +1235,7 @@ func TestAccAWSCodeBuildProject_VpcConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1248,6 +1282,7 @@ func TestAccAWSCodeBuildProject_WindowsServer2019Container(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1280,6 +1315,7 @@ func TestAccAWSCodeBuildProject_ARMContainer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1309,6 +1345,7 @@ func TestAccAWSCodeBuildProject_Artifacts_ArtifactIdentifier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1345,6 +1382,7 @@ func TestAccAWSCodeBuildProject_Artifacts_EncryptionDisabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1382,6 +1420,7 @@ func TestAccAWSCodeBuildProject_Artifacts_Location(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1421,6 +1460,7 @@ func TestAccAWSCodeBuildProject_Artifacts_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1456,6 +1496,7 @@ func TestAccAWSCodeBuildProject_Artifacts_NamespaceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1492,6 +1533,7 @@ func TestAccAWSCodeBuildProject_Artifacts_OverrideArtifactName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1527,6 +1569,7 @@ func TestAccAWSCodeBuildProject_Artifacts_Packaging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1562,6 +1605,7 @@ func TestAccAWSCodeBuildProject_Artifacts_Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1601,6 +1645,7 @@ func TestAccAWSCodeBuildProject_Artifacts_Type(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1637,6 +1682,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1667,6 +1713,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_ArtifactIdentifier(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1707,6 +1754,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_OverrideArtifactName(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1747,6 +1795,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_EncryptionDisabled(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1788,6 +1837,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_Location(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1833,6 +1883,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1872,6 +1923,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_NamespaceType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1911,6 +1963,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_Packaging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1953,6 +2006,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_Path(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -1993,6 +2047,7 @@ func TestAccAWSCodeBuildProject_SecondaryArtifacts_Type(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -2022,6 +2077,7 @@ func TestAccAWSCodeBuildProject_SecondarySources_CodeCommit(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ @@ -2075,6 +2131,7 @@ func TestAccAWSCodeBuildProject_Environment_RegistryCredential(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, Steps: []resource.TestStep{ From 1d730937d8144357e83ff8ab48b661d7baf921b0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:46:34 -0400 Subject: [PATCH 0861/1252] tests/r/codebuild_report_group: Add ErrorCheck --- aws/resource_aws_codebuild_report_group_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codebuild_report_group_test.go b/aws/resource_aws_codebuild_report_group_test.go index 625eb14ab4c..4568b615dd1 100644 --- a/aws/resource_aws_codebuild_report_group_test.go +++ b/aws/resource_aws_codebuild_report_group_test.go @@ -75,6 +75,7 @@ func TestAccAWSCodeBuildReportGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuildReportGroup(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildReportGroupDestroy, Steps: []resource.TestStep{ @@ -106,6 +107,7 @@ func TestAccAWSCodeBuildReportGroup_export_s3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuildReportGroup(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildReportGroupDestroy, Steps: []resource.TestStep{ @@ -155,6 +157,7 @@ func TestAccAWSCodeBuildReportGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuildReportGroup(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildReportGroupDestroy, Steps: []resource.TestStep{ @@ -200,6 +203,7 @@ func TestAccAWSCodeBuildReportGroup_deleteReports(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuildReportGroup(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildReportGroupDestroy, Steps: []resource.TestStep{ @@ -227,6 +231,7 @@ func TestAccAWSCodeBuildReportGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuildReportGroup(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildReportGroupDestroy, Steps: []resource.TestStep{ From 7e5711ed1c0bb20e64acd0b3256cd7ac1ae85b2b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:46:44 -0400 Subject: [PATCH 0862/1252] tests/r/codebuild_source_credential: Add ErrorCheck --- aws/resource_aws_codebuild_source_credential_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_codebuild_source_credential_test.go b/aws/resource_aws_codebuild_source_credential_test.go index 21acacb66ba..c2ff3856c68 100644 --- a/aws/resource_aws_codebuild_source_credential_test.go +++ b/aws/resource_aws_codebuild_source_credential_test.go @@ -19,6 +19,7 @@ func TestAccAWSCodeBuildSourceCredential_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildSourceCredentialDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSCodeBuildSourceCredential_BasicAuth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildSourceCredentialDestroy, Steps: []resource.TestStep{ From 6180ed1c11b98f30d005a2e6f642ba7b5fdf75d5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:46:54 -0400 Subject: [PATCH 0863/1252] tests/r/codebuild_webhook: Add ErrorCheck --- aws/resource_aws_codebuild_webhook_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codebuild_webhook_test.go b/aws/resource_aws_codebuild_webhook_test.go index 43183e663b0..df0f89a6383 100644 --- a/aws/resource_aws_codebuild_webhook_test.go +++ b/aws/resource_aws_codebuild_webhook_test.go @@ -20,6 +20,7 @@ func TestAccAWSCodeBuildWebhook_Bitbucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildWebhookDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSCodeBuildWebhook_GitHub(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildWebhookDestroy, Steps: []resource.TestStep{ @@ -82,6 +84,7 @@ func TestAccAWSCodeBuildWebhook_GitHubEnterprise(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildWebhookDestroy, Steps: []resource.TestStep{ @@ -130,6 +133,7 @@ func TestAccAWSCodeBuildWebhook_BranchFilter(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildWebhookDestroy, Steps: []resource.TestStep{ @@ -164,6 +168,7 @@ func TestAccAWSCodeBuildWebhook_FilterGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + ErrorCheck: testAccErrorCheck(t, codebuild.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeBuildWebhookDestroy, Steps: []resource.TestStep{ From 71006649e57cdc4d2a204ee50887544b55de3aaf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:47:35 -0400 Subject: [PATCH 0864/1252] tests/r/cloud9_environment_ec2: Add ErrorCheck --- aws/resource_aws_cloud9_environment_ec2_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_cloud9_environment_ec2_test.go b/aws/resource_aws_cloud9_environment_ec2_test.go index 2d60717ebec..de8e3d6c532 100644 --- a/aws/resource_aws_cloud9_environment_ec2_test.go +++ b/aws/resource_aws_cloud9_environment_ec2_test.go @@ -22,6 +22,7 @@ func TestAccAWSCloud9EnvironmentEc2_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloud9.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloud9.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloud9EnvironmentEc2Destroy, Steps: []resource.TestStep{ @@ -69,6 +70,7 @@ func TestAccAWSCloud9EnvironmentEc2_allFields(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloud9.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloud9.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloud9EnvironmentEc2Destroy, Steps: []resource.TestStep{ @@ -112,6 +114,7 @@ func TestAccAWSCloud9EnvironmentEc2_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloud9.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloud9.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloud9EnvironmentEc2Destroy, Steps: []resource.TestStep{ @@ -158,6 +161,7 @@ func TestAccAWSCloud9EnvironmentEc2_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloud9.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloud9.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloud9EnvironmentEc2Destroy, Steps: []resource.TestStep{ From a6e66368c04926e8b93b0a95c102ee330227d9e1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:48:13 -0400 Subject: [PATCH 0865/1252] tests/r/cloudtrail: Add ErrorCheck --- aws/resource_aws_cloudtrail_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_cloudtrail_test.go b/aws/resource_aws_cloudtrail_test.go index b1aadab0d9f..08fdc51353c 100644 --- a/aws/resource_aws_cloudtrail_test.go +++ b/aws/resource_aws_cloudtrail_test.go @@ -127,6 +127,7 @@ func testAccAWSCloudTrail_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -166,6 +167,7 @@ func testAccAWSCloudTrail_cloudwatch(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -201,6 +203,7 @@ func testAccAWSCloudTrail_enable_logging(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -249,6 +252,7 @@ func testAccAWSCloudTrail_is_multi_region(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -295,6 +299,7 @@ func testAccAWSCloudTrail_is_organization(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -332,6 +337,7 @@ func testAccAWSCloudTrail_logValidation(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -373,6 +379,7 @@ func testAccAWSCloudTrail_kmsKey(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -404,6 +411,7 @@ func testAccAWSCloudTrail_tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -458,6 +466,7 @@ func testAccAWSCloudTrail_include_global_service_events(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -483,6 +492,7 @@ func testAccAWSCloudTrail_event_selector(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ @@ -551,6 +561,7 @@ func testAccAWSCloudTrail_insight_selector(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudtrail.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudTrailDestroy, Steps: []resource.TestStep{ From 9f9a5e122641a59ecb19d0558a7874bffe601e80 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:49:11 -0400 Subject: [PATCH 0866/1252] tests/r/accessanalyzer_analyzer: Add ErrorCheck --- aws/resource_aws_accessanalyzer_analyzer_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_accessanalyzer_analyzer_test.go b/aws/resource_aws_accessanalyzer_analyzer_test.go index a0b94018a15..2ae070d7173 100644 --- a/aws/resource_aws_accessanalyzer_analyzer_test.go +++ b/aws/resource_aws_accessanalyzer_analyzer_test.go @@ -20,6 +20,7 @@ func testAccAWSAccessAnalyzerAnalyzer_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + ErrorCheck: testAccErrorCheck(t, accessanalyzer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func testAccAWSAccessAnalyzerAnalyzer_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + ErrorCheck: testAccErrorCheck(t, accessanalyzer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, Steps: []resource.TestStep{ @@ -75,6 +77,7 @@ func testAccAWSAccessAnalyzerAnalyzer_Tags(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + ErrorCheck: testAccErrorCheck(t, accessanalyzer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, Steps: []resource.TestStep{ @@ -125,6 +128,7 @@ func testAccAWSAccessAnalyzerAnalyzer_Type_Organization(t *testing.T) { testAccPreCheckAWSAccessAnalyzer(t) testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, accessanalyzer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, Steps: []resource.TestStep{ From 982bdae9c95148a543388f08da9874608b7606c5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:50:07 -0400 Subject: [PATCH 0867/1252] tests/r/codecommit_repository: Add ErrorCheck --- aws/resource_aws_codecommit_repository_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codecommit_repository_test.go b/aws/resource_aws_codecommit_repository_test.go index e7f73ea4390..5c10c7fa05f 100644 --- a/aws/resource_aws_codecommit_repository_test.go +++ b/aws/resource_aws_codecommit_repository_test.go @@ -18,6 +18,7 @@ func TestAccAWSCodeCommitRepository_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, Steps: []resource.TestStep{ @@ -42,6 +43,7 @@ func TestAccAWSCodeCommitRepository_withChanges(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSCodeCommitRepository_create_default_branch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, Steps: []resource.TestStep{ @@ -103,6 +106,7 @@ func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, Steps: []resource.TestStep{ @@ -137,6 +141,7 @@ func TestAccAWSCodeCommitRepository_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, From 120c31a4a45d6059128afefdd6beef6532cfcd71 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:50:18 -0400 Subject: [PATCH 0868/1252] tests/r/codecommit_trigger: Add ErrorCheck --- aws/resource_aws_codecommit_trigger_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_codecommit_trigger_test.go b/aws/resource_aws_codecommit_trigger_test.go index f43d30fefb8..a0085d77d54 100644 --- a/aws/resource_aws_codecommit_trigger_test.go +++ b/aws/resource_aws_codecommit_trigger_test.go @@ -18,6 +18,7 @@ func TestAccAWSCodeCommitTrigger_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitTriggerDestroy, Steps: []resource.TestStep{ From 51703252d16af822812ffba56e84fbe47217d921 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:50:28 -0400 Subject: [PATCH 0869/1252] tests/ds/codecommit_repository: Add ErrorCheck --- aws/data_source_aws_codecommit_repository_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_codecommit_repository_test.go b/aws/data_source_aws_codecommit_repository_test.go index e1a6ce85ea8..c33b8fb5871 100644 --- a/aws/data_source_aws_codecommit_repository_test.go +++ b/aws/data_source_aws_codecommit_repository_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/codecommit" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSCodeCommitRepositoryDataSource_basic(t *testing.T) { datasourceName := "data.aws_codecommit_repository.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codecommit.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCodeCommitRepositoryDataSourceConfig(rName), From 2438f012613c228bf6555db7e0ec23bb3a8e0549 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:51:09 -0400 Subject: [PATCH 0870/1252] tests/r/codedeploy_app: Add ErrorCheck --- aws/resource_aws_codedeploy_app_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codedeploy_app_test.go b/aws/resource_aws_codedeploy_app_test.go index 2d635f84ba8..61db3b4c141 100644 --- a/aws/resource_aws_codedeploy_app_test.go +++ b/aws/resource_aws_codedeploy_app_test.go @@ -19,6 +19,7 @@ func TestAccAWSCodeDeployApp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployAppDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSCodeDeployApp_computePlatform(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployAppDestroy, Steps: []resource.TestStep{ @@ -83,6 +85,7 @@ func TestAccAWSCodeDeployApp_computePlatform_ECS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployAppDestroy, Steps: []resource.TestStep{ @@ -109,6 +112,7 @@ func TestAccAWSCodeDeployApp_computePlatform_Lambda(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployAppDestroy, Steps: []resource.TestStep{ @@ -136,6 +140,7 @@ func TestAccAWSCodeDeployApp_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployAppDestroy, Steps: []resource.TestStep{ From 78e8f2a05322c2f79497566e28730f77ebb6d86e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:51:19 -0400 Subject: [PATCH 0871/1252] tests/r/codedeploy_deployment_config: Add ErrorCheck --- aws/resource_aws_codedeploy_deployment_config_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codedeploy_deployment_config_test.go b/aws/resource_aws_codedeploy_deployment_config_test.go index 3221eaecf98..6ea846fbf90 100644 --- a/aws/resource_aws_codedeploy_deployment_config_test.go +++ b/aws/resource_aws_codedeploy_deployment_config_test.go @@ -19,6 +19,7 @@ func TestAccAWSCodeDeployDeploymentConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentConfigDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSCodeDeployDeploymentConfig_fleetPercent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentConfigDestroy, Steps: []resource.TestStep{ @@ -89,6 +91,7 @@ func TestAccAWSCodeDeployDeploymentConfig_hostCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentConfigDestroy, Steps: []resource.TestStep{ @@ -131,6 +134,7 @@ func TestAccAWSCodeDeployDeploymentConfig_trafficCanary(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentConfigDestroy, Steps: []resource.TestStep{ @@ -179,6 +183,7 @@ func TestAccAWSCodeDeployDeploymentConfig_trafficLinear(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentConfigDestroy, Steps: []resource.TestStep{ From 6b1e5f998fcaf1b985ddd5bb89bb9c0ec88f73b7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:51:28 -0400 Subject: [PATCH 0872/1252] tests/r/codedeploy_deployment_group: Add ErrorCheck --- ...ce_aws_codedeploy_deployment_group_test.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/aws/resource_aws_codedeploy_deployment_group_test.go b/aws/resource_aws_codedeploy_deployment_group_test.go index d5bae308bdb..e91633029db 100644 --- a/aws/resource_aws_codedeploy_deployment_group_test.go +++ b/aws/resource_aws_codedeploy_deployment_group_test.go @@ -25,6 +25,7 @@ func TestAccAWSCodeDeployDeploymentGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -92,6 +93,7 @@ func TestAccAWSCodeDeployDeploymentGroup_basic_tagSet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -162,6 +164,7 @@ func TestAccAWSCodeDeployDeploymentGroup_onPremiseTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -201,6 +204,7 @@ func TestAccAWSCodeDeployDeploymentGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -223,6 +227,7 @@ func TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_basic(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -270,6 +275,7 @@ func TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_multiple(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -329,6 +335,7 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_create(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -362,6 +369,7 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_update(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -409,6 +417,7 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_delete(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -450,6 +459,7 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_disable(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -496,6 +506,7 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_create(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -531,6 +542,7 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_update(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -582,6 +594,7 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_delete(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -625,6 +638,7 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_disable(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -676,6 +690,7 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_default(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -708,6 +723,7 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_create(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -748,6 +764,7 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -793,6 +810,7 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -837,6 +855,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_create(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -870,6 +889,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -916,6 +936,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -957,6 +978,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_create resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -991,6 +1013,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_update resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1037,6 +1060,7 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_delete resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1078,6 +1102,7 @@ func TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_cre resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1118,6 +1143,7 @@ func TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_upd resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1192,6 +1218,7 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_create resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1246,6 +1273,7 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1312,6 +1340,7 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1392,6 +1421,7 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_delete resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1458,6 +1488,7 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeployment_complete(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ @@ -1564,6 +1595,7 @@ func TestAccAWSCodeDeployDeploymentGroup_ECS_BlueGreen(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, codedeploy.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ From 5a0d523f77d170bfbd80bb54b98705decbbf5be1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:52:03 -0400 Subject: [PATCH 0873/1252] tests/r/codepipeline_webhook: Add ErrorCheck --- aws/resource_aws_codepipeline_webhook_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codepipeline_webhook_test.go b/aws/resource_aws_codepipeline_webhook_test.go index 07de47ac9a0..6358fa7874f 100644 --- a/aws/resource_aws_codepipeline_webhook_test.go +++ b/aws/resource_aws_codepipeline_webhook_test.go @@ -26,6 +26,7 @@ func TestAccAWSCodePipelineWebhook_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAWSCodePipelineWebhook_ipAuth(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -94,6 +96,7 @@ func TestAccAWSCodePipelineWebhook_unauthenticated(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -126,6 +129,7 @@ func TestAccAWSCodePipelineWebhook_tags(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -189,6 +193,7 @@ func TestAccAWSCodePipelineWebhook_UpdateAuthenticationConfiguration_SecretToken testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ From f639d9e8106e0e3ee9a866c521f75fd6aa9a20ac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:52:33 -0400 Subject: [PATCH 0874/1252] tests/r/codepipeline: Add ErrorCheck --- aws/resource_aws_codepipeline_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_codepipeline_test.go b/aws/resource_aws_codepipeline_test.go index 70f61c09c13..c94b89af3db 100644 --- a/aws/resource_aws_codepipeline_test.go +++ b/aws/resource_aws_codepipeline_test.go @@ -27,6 +27,7 @@ func TestAccAWSCodePipeline_basic(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -131,6 +132,7 @@ func TestAccAWSCodePipeline_disappears(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -157,6 +159,7 @@ func TestAccAWSCodePipeline_emptyStageArtifacts(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -198,6 +201,7 @@ func TestAccAWSCodePipeline_deployWithServiceRole(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -230,6 +234,7 @@ func TestAccAWSCodePipeline_tags(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -288,6 +293,7 @@ func TestAccAWSCodePipeline_multiregion_basic(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t, testAccGetAlternateRegion()) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -329,6 +335,7 @@ func TestAccAWSCodePipeline_multiregion_Update(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t, testAccGetAlternateRegion()) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -384,6 +391,7 @@ func TestAccAWSCodePipeline_multiregion_ConvertSingleRegion(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t, testAccGetAlternateRegion()) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -446,6 +454,7 @@ func TestAccAWSCodePipeline_WithNamespace(t *testing.T) { testAccPreCheckAWSCodePipelineSupported(t) testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ @@ -478,6 +487,7 @@ func TestAccAWSCodePipeline_WithGitHubv1SourceAction(t *testing.T) { testAccPreCheck(t) testAccPreCheckAWSCodePipelineSupported(t) }, + ErrorCheck: testAccErrorCheck(t, codepipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodePipelineDestroy, Steps: []resource.TestStep{ From c870d6b4339be34fe60756147369875fc429faaa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:53:17 -0400 Subject: [PATCH 0875/1252] tests/r/cloudhsm2_cluster: Add ErrorCheck --- aws/resource_aws_cloudhsm2_cluster_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cloudhsm2_cluster_test.go b/aws/resource_aws_cloudhsm2_cluster_test.go index 9f4c257d647..4621e71c478 100644 --- a/aws/resource_aws_cloudhsm2_cluster_test.go +++ b/aws/resource_aws_cloudhsm2_cluster_test.go @@ -88,6 +88,7 @@ func TestAccAWSCloudHsmV2Cluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudhsmv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudHsmV2ClusterDestroy, Steps: []resource.TestStep{ @@ -117,6 +118,7 @@ func TestAccAWSCloudHsmV2Cluster_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudhsmv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudHsmV2ClusterDestroy, Steps: []resource.TestStep{ From 04f1588188e63482929477b643fbed11ef841581 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:53:28 -0400 Subject: [PATCH 0876/1252] tests/r/cloudhsm2_hsm: Add ErrorCheck --- aws/resource_aws_cloudhsm2_hsm_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cloudhsm2_hsm_test.go b/aws/resource_aws_cloudhsm2_hsm_test.go index 83e1a18ecb1..6302fd19835 100644 --- a/aws/resource_aws_cloudhsm2_hsm_test.go +++ b/aws/resource_aws_cloudhsm2_hsm_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudhsmv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -13,6 +14,7 @@ import ( func TestAccAWSCloudHsmV2Hsm_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudhsmv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudHsmV2HsmDestroy, Steps: []resource.TestStep{ From 8d149ccc8b33995886443a01ca770b42b96a268d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:53:38 -0400 Subject: [PATCH 0877/1252] tests/ds/cloudhsm2_cluster: Add ErrorCheck --- aws/data_source_aws_cloudhsm2_cluster_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_cloudhsm2_cluster_test.go b/aws/data_source_aws_cloudhsm2_cluster_test.go index 6063e6f9121..9f57ab50905 100644 --- a/aws/data_source_aws_cloudhsm2_cluster_test.go +++ b/aws/data_source_aws_cloudhsm2_cluster_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/cloudhsmv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceCloudHsmV2Cluster_basic(t *testing.T) { dataSourceName := "data.aws_cloudhsm_v2_cluster.default" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudhsmv2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckCloudHsmV2ClusterDataSourceConfig, From c213ca6d4567d1a3ae1e2b2ca3508c7fd4a6a61f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:54:18 -0400 Subject: [PATCH 0878/1252] tests/r/dax_cluster: Add ErrorCheck --- aws/resource_aws_dax_cluster_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_dax_cluster_test.go b/aws/resource_aws_dax_cluster_test.go index 44f8969d238..0b67a671382 100644 --- a/aws/resource_aws_dax_cluster_test.go +++ b/aws/resource_aws_dax_cluster_test.go @@ -66,6 +66,7 @@ func TestAccAWSDAXCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDAXClusterDestroy, Steps: []resource.TestStep{ @@ -119,6 +120,7 @@ func TestAccAWSDAXCluster_resize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDAXClusterDestroy, Steps: []resource.TestStep{ @@ -162,6 +164,7 @@ func TestAccAWSDAXCluster_encryption_disabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDAXClusterDestroy, Steps: []resource.TestStep{ @@ -195,6 +198,7 @@ func TestAccAWSDAXCluster_encryption_enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDAXClusterDestroy, Steps: []resource.TestStep{ From 8e44fb531ac5b3418f12850edf63bca7fddea0c9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:54:28 -0400 Subject: [PATCH 0879/1252] tests/r/dax_parameter_group: Add ErrorCheck --- aws/resource_aws_dax_parameter_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_dax_parameter_group_test.go b/aws/resource_aws_dax_parameter_group_test.go index 3b91cc66295..772f50dc7e0 100644 --- a/aws/resource_aws_dax_parameter_group_test.go +++ b/aws/resource_aws_dax_parameter_group_test.go @@ -17,6 +17,7 @@ func TestAccAwsDaxParameterGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDaxParameterGroupDestroy, Steps: []resource.TestStep{ From 99d53dfe0cc1ab7a298106f158237958cc6ca3c9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:54:38 -0400 Subject: [PATCH 0880/1252] tests/r/dax_subnet_group: Add ErrorCheck --- aws/resource_aws_dax_subnet_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_dax_subnet_group_test.go b/aws/resource_aws_dax_subnet_group_test.go index 488efe70ad1..e6cf65ffe01 100644 --- a/aws/resource_aws_dax_subnet_group_test.go +++ b/aws/resource_aws_dax_subnet_group_test.go @@ -17,6 +17,7 @@ func TestAccAwsDaxSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, + ErrorCheck: testAccErrorCheck(t, dax.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDaxSubnetGroupDestroy, Steps: []resource.TestStep{ From e87afa5a3e5fb9b4b0c78fa9f9da79489801eb8b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:55:25 -0400 Subject: [PATCH 0881/1252] tests/r/devicefarm_project: Add ErrorCheck --- aws/resource_aws_devicefarm_project_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_devicefarm_project_test.go b/aws/resource_aws_devicefarm_project_test.go index e6f5e1bd14e..41844b75407 100644 --- a/aws/resource_aws_devicefarm_project_test.go +++ b/aws/resource_aws_devicefarm_project_test.go @@ -26,6 +26,7 @@ func TestAccAWSDeviceFarmProject_basic(t *testing.T) { // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html testAccRegionPreCheck(t, endpoints.UsWest2RegionID) }, + ErrorCheck: testAccErrorCheck(t, devicefarm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDeviceFarmProjectDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAWSDeviceFarmProject_disappears(t *testing.T) { // https://docs.aws.amazon.com/general/latest/gr/devicefarm.html testAccRegionPreCheck(t, endpoints.UsWest2RegionID) }, + ErrorCheck: testAccErrorCheck(t, devicefarm.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDeviceFarmProjectDestroy, Steps: []resource.TestStep{ From e2e9ae5f5ec868cf3b0ee575d6fd2ff6605e0694 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 22:56:15 -0400 Subject: [PATCH 0882/1252] tests/r/ecrpublic_repository: Add ErrorCheck --- aws/resource_aws_ecrpublic_repository_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_ecrpublic_repository_test.go b/aws/resource_aws_ecrpublic_repository_test.go index 7aa8e108c81..d417dd9f682 100644 --- a/aws/resource_aws_ecrpublic_repository_test.go +++ b/aws/resource_aws_ecrpublic_repository_test.go @@ -73,6 +73,7 @@ func TestAccAWSEcrPublicRepository_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -101,6 +102,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_abouttext(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -136,6 +138,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_architectures(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -171,6 +174,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -206,6 +210,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_operatingsystems(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -241,6 +246,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_usagetext(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -276,6 +282,7 @@ func TestAccAWSEcrPublicRepository_catalogdata_logoimageblob(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -304,6 +311,7 @@ func TestAccAWSEcrPublicRepository_basic_forcedestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ @@ -333,6 +341,7 @@ func TestAccAWSEcrPublicRepository_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsEcrPublic(t) }, + ErrorCheck: testAccErrorCheck(t, ecrpublic.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrPublicRepositoryDestroy, Steps: []resource.TestStep{ From 2ef5c39c56c2dab62051503a9830f6d5b4b41466 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 23:05:54 -0400 Subject: [PATCH 0883/1252] tests/r/signer_signing_job: Add ErrorCheck --- aws/resource_aws_signer_signing_job_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_signer_signing_job_test.go b/aws/resource_aws_signer_signing_job_test.go index cff59f40edc..0b732a08abb 100644 --- a/aws/resource_aws_signer_signing_job_test.go +++ b/aws/resource_aws_signer_signing_job_test.go @@ -21,6 +21,7 @@ func TestAccAWSSignerSigningJob_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 2765ba4077fcdc901b55bd0fedba239c3fc4594f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 23:06:03 -0400 Subject: [PATCH 0884/1252] tests/r/signer_signing_profile: Add ErrorCheck --- aws/resource_aws_signer_signing_profile_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_signer_signing_profile_test.go b/aws/resource_aws_signer_signing_profile_test.go index cac5db06eed..9b1a3ea3df0 100644 --- a/aws/resource_aws_signer_signing_profile_test.go +++ b/aws/resource_aws_signer_signing_profile_test.go @@ -22,6 +22,7 @@ func TestAccAWSSignerSigningProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSSignerSigningProfile_GenerateNameWithNamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSSignerSigningProfile_GenerateName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -95,6 +98,7 @@ func TestAccAWSSignerSigningProfile_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -125,6 +129,7 @@ func TestAccAWSSignerSigningProfile_SignatureValidityPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ From 4858a657695507ffa72f93e215a3d2b44b62dbbd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 23:06:13 -0400 Subject: [PATCH 0885/1252] tests/r/signer_signing_profile_permission: Add ErrorCheck --- aws/resource_aws_signer_signing_profile_permission_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_signer_signing_profile_permission_test.go b/aws/resource_aws_signer_signing_profile_permission_test.go index bdf705cb991..efdf1a7611b 100644 --- a/aws/resource_aws_signer_signing_profile_permission_test.go +++ b/aws/resource_aws_signer_signing_profile_permission_test.go @@ -23,6 +23,7 @@ func TestAccAWSSignerSigningProfilePermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSSignerSigningProfilePermission_GetSigningProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSSignerSigningProfilePermission_StartSigningJob_GetSP(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ @@ -130,6 +133,7 @@ func TestAccAWSSignerSigningProfilePermission_StatementPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSignerSigningProfileDestroy, Steps: []resource.TestStep{ From f8897644d623313d41ab9f6a45a28b2707693450 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 23:06:34 -0400 Subject: [PATCH 0886/1252] tests/ds/signer_signing_job: Add ErrorCheck --- aws/data_source_aws_signer_signing_job_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_signer_signing_job_test.go b/aws/data_source_aws_signer_signing_job_test.go index 522a40ab2e5..27929e150af 100644 --- a/aws/data_source_aws_signer_signing_job_test.go +++ b/aws/data_source_aws_signer_signing_job_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/signer" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAWSSignerSigningJob_basic(t *testing.T) { resourceName := "aws_signer_signing_job.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSignerSigningJobConfigBasic(rName), From d423dc7c2d81a35e063bfdf2491ac733e1f66658 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 18 Mar 2021 23:06:45 -0400 Subject: [PATCH 0887/1252] tests/ds/signer_signing_profile: Add ErrorCheck --- aws/data_source_aws_signer_signing_profile_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_signer_signing_profile_test.go b/aws/data_source_aws_signer_signing_profile_test.go index c8f96b41d98..c4a8c9707bc 100644 --- a/aws/data_source_aws_signer_signing_profile_test.go +++ b/aws/data_source_aws_signer_signing_profile_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/signer" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAWSSignerSigningProfile_basic(t *testing.T) { profileName := fmt.Sprintf("tf_acc_sp_basic_%s", rString) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckSingerSigningProfile(t, "AWSLambda-SHA384-ECDSA") }, + ErrorCheck: testAccErrorCheck(t, signer.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAWSSignerSigningProfileConfigBasic(profileName), From a652d4a81fbaf920334064c8d44339431442e468 Mon Sep 17 00:00:00 2001 From: Shuhei Kitagawa Date: Fri, 19 Mar 2021 22:17:16 +0900 Subject: [PATCH 0888/1252] New Data Source: aws_codestarconnections_connection (#18129) Output from acceptance testing: ``` --- PASS: TestAccDataSourceAwsCodeStarConnectionsConnection_basic (19.66s) --- PASS: TestAccDataSourceAwsCodeStarConnectionsConnection_tags (19.69s) --- PASS: TestAccAWSCodeStarConnectionsConnection_disappears (12.08s) --- PASS: TestAccAWSCodeStarConnectionsConnection_Basic (16.27s) --- PASS: TestAccAWSCodeStarConnectionsConnection_Tags (35.69s) ``` --- ...urce_aws_codestarconnections_connection.go | 70 +++++++++++++++ ...aws_codestarconnections_connection_test.go | 86 +++++++++++++++++++ .../codestarconnections/finder/finder.go | 22 +++++ aws/provider.go | 1 + ...urce_aws_codestarconnections_connection.go | 17 ++-- ...destarconnections_connection.html.markdown | 35 ++++++++ 6 files changed, 222 insertions(+), 9 deletions(-) create mode 100644 aws/data_source_aws_codestarconnections_connection.go create mode 100644 aws/data_source_aws_codestarconnections_connection_test.go create mode 100644 aws/internal/service/codestarconnections/finder/finder.go create mode 100644 website/docs/d/codestarconnections_connection.html.markdown diff --git a/aws/data_source_aws_codestarconnections_connection.go b/aws/data_source_aws_codestarconnections_connection.go new file mode 100644 index 00000000000..5834c74c51f --- /dev/null +++ b/aws/data_source_aws_codestarconnections_connection.go @@ -0,0 +1,70 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/codestarconnections/finder" +) + +func dataSourceAwsCodeStarConnectionsConnection() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsCodeStarConnectionsConnectionRead, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Required: true, + }, + + "connection_status": { + Type: schema.TypeString, + Computed: true, + }, + + "name": { + Type: schema.TypeString, + Computed: true, + }, + + "provider_type": { + Type: schema.TypeString, + Computed: true, + }, + + "tags": tagsSchemaComputed(), + }, + } +} + +func dataSourceAwsCodeStarConnectionsConnectionRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).codestarconnectionsconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig + + arn := d.Get("arn").(string) + + log.Printf("[DEBUG] Getting CodeStar Connection") + connection, err := finder.ConnectionByArn(conn, arn) + if err != nil { + return fmt.Errorf("error getting CodeStar Connection (%s): %w", arn, err) + } + log.Printf("[DEBUG] CodeStar Connection: %#v", connection) + + d.SetId(arn) + d.Set("connection_status", connection.ConnectionStatus) + d.Set("name", connection.ConnectionName) + d.Set("provider_type", connection.ProviderType) + + tags, err := keyvaluetags.CodestarconnectionsListTags(conn, arn) + if err != nil { + return fmt.Errorf("error listing tags for CodeStar Connection (%s): %w", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags for CodeStar Connection (%s): %w", arn, err) + } + + return nil +} diff --git a/aws/data_source_aws_codestarconnections_connection_test.go b/aws/data_source_aws_codestarconnections_connection_test.go new file mode 100644 index 00000000000..4c817aa39cb --- /dev/null +++ b/aws/data_source_aws_codestarconnections_connection_test.go @@ -0,0 +1,86 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/service/codestarconnections" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" +) + +func TestAccDataSourceAwsCodeStarConnectionsConnection_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_codestarconnections_connection.test" + resourceName := "aws_codestarconnections_connection.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarconnections.EndpointsID), + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAWSCodeStarConnectionsConnectionConfigBasic(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "arn", dataSourceName, "arn"), + resource.TestCheckResourceAttrPair(resourceName, "provider_type", dataSourceName, "provider_type"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "connection_status", dataSourceName, "connection_status"), + resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), + ), + }, + }, + }) +} + +func TestAccDataSourceAwsCodeStarConnectionsConnection_tags(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_codestarconnections_connection.test" + resourceName := "aws_codestarconnections_connection.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarconnections.EndpointsID), + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAWSCodeStarConnectionsConnectionConfigTags(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceName, "tags.%"), + ), + }, + }, + }) +} + +func testAccDataSourceAWSCodeStarConnectionsConnectionConfigBasic(rName string) string { + return fmt.Sprintf(` +resource "aws_codestarconnections_connection" "test" { + name = %[1]q + provider_type = "Bitbucket" +} + +data "aws_codestarconnections_connection" "test" { + arn = aws_codestarconnections_connection.test.arn +} +`, rName) +} + +func testAccDataSourceAWSCodeStarConnectionsConnectionConfigTags(rName string) string { + return fmt.Sprintf(` +resource "aws_codestarconnections_connection" "test" { + name = %[1]q + provider_type = "Bitbucket" + + tags = { + "key1" = "value1" + "key2" = "value2" + } +} + +data "aws_codestarconnections_connection" "test" { + arn = aws_codestarconnections_connection.test.arn +} +`, rName) +} diff --git a/aws/internal/service/codestarconnections/finder/finder.go b/aws/internal/service/codestarconnections/finder/finder.go new file mode 100644 index 00000000000..f0ae5bc1f0d --- /dev/null +++ b/aws/internal/service/codestarconnections/finder/finder.go @@ -0,0 +1,22 @@ +package finder + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/codestarconnections" +) + +// ConnectionByArn returns the Connection corresponding to the specified Arn. +func ConnectionByArn(conn *codestarconnections.CodeStarConnections, arn string) (*codestarconnections.Connection, error) { + output, err := conn.GetConnection(&codestarconnections.GetConnectionInput{ + ConnectionArn: aws.String(arn), + }) + if err != nil { + return nil, err + } + + if output == nil || output.Connection == nil { + return nil, nil + } + + return output.Connection, nil +} diff --git a/aws/provider.go b/aws/provider.go index f55bbf90da7..5e652ec39ba 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -221,6 +221,7 @@ func Provider() *schema.Provider { "aws_codeartifact_repository_endpoint": dataSourceAwsCodeArtifactRepositoryEndpoint(), "aws_cognito_user_pools": dataSourceAwsCognitoUserPools(), "aws_codecommit_repository": dataSourceAwsCodeCommitRepository(), + "aws_codestarconnections_connection": dataSourceAwsCodeStarConnectionsConnection(), "aws_cur_report_definition": dataSourceAwsCurReportDefinition(), "aws_db_cluster_snapshot": dataSourceAwsDbClusterSnapshot(), "aws_db_event_categories": dataSourceAwsDbEventCategories(), diff --git a/aws/resource_aws_codestarconnections_connection.go b/aws/resource_aws_codestarconnections_connection.go index ce2fe09db25..1d58920cc97 100644 --- a/aws/resource_aws_codestarconnections_connection.go +++ b/aws/resource_aws_codestarconnections_connection.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/codestarconnections/finder" ) func resourceAwsCodeStarConnectionsConnection() *schema.Resource { @@ -77,9 +78,7 @@ func resourceAwsCodeStarConnectionsConnectionRead(d *schema.ResourceData, meta i conn := meta.(*AWSClient).codestarconnectionsconn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - resp, err := conn.GetConnection(&codestarconnections.GetConnectionInput{ - ConnectionArn: aws.String(d.Id()), - }) + connection, err := finder.ConnectionByArn(conn, d.Id()) if tfawserr.ErrCodeEquals(err, codestarconnections.ErrCodeResourceNotFoundException) { log.Printf("[WARN] CodeStar connection (%s) not found, removing from state", d.Id()) d.SetId("") @@ -89,16 +88,16 @@ func resourceAwsCodeStarConnectionsConnectionRead(d *schema.ResourceData, meta i return fmt.Errorf("error reading CodeStar connection: %w", err) } - if resp == nil || resp.Connection == nil { + if connection == nil { return fmt.Errorf("error reading CodeStar connection (%s): empty response", d.Id()) } - arn := aws.StringValue(resp.Connection.ConnectionArn) + arn := aws.StringValue(connection.ConnectionArn) d.SetId(arn) - d.Set("arn", resp.Connection.ConnectionArn) - d.Set("name", resp.Connection.ConnectionName) - d.Set("connection_status", resp.Connection.ConnectionStatus) - d.Set("provider_type", resp.Connection.ProviderType) + d.Set("arn", connection.ConnectionArn) + d.Set("connection_status", connection.ConnectionStatus) + d.Set("name", connection.ConnectionName) + d.Set("provider_type", connection.ProviderType) tags, err := keyvaluetags.CodestarconnectionsListTags(conn, arn) diff --git a/website/docs/d/codestarconnections_connection.html.markdown b/website/docs/d/codestarconnections_connection.html.markdown new file mode 100644 index 00000000000..fea4e18f77a --- /dev/null +++ b/website/docs/d/codestarconnections_connection.html.markdown @@ -0,0 +1,35 @@ +--- +subcategory: "CodeStar Connections" +layout: "aws" +page_title: "AWS: aws_codestarconnections_connection" +description: |- + Provides details about CodeStar Connection +--- + +# Data Source: aws_codestarconnections_connection + +Provides details about CodeStar Connection. + +## Example Usage + +```hcl +data "aws_codestarconnections_connection" "example" { + arn = aws_codestarconnections_connection.example.arn +} +``` + +## Argument Reference + +The following arguments are supported: + +* `arn` - (Required) The CodeStar Connection ARN. + +## Attributes Reference + +In addition to all arguments above, the following attributes are exported: + +* `connection_status` - The CodeStar Connection status. Possible values are `PENDING`, `AVAILABLE` and `ERROR`. +* `id` - The CodeStar Connection ARN. +* `name` - The name of the CodeStar Connection. The name is unique in the calling AWS account. +* `provider_type` - The name of the external provider where your third-party code repository is configured. Possible values are `Bitbucket`, `GitHub`, or `GitHubEnterpriseServer`. +* `tags` - Map of key-value resource tags to associate with the resource. From 162101518a0a027fb62d9a8e5d63b0004f2bc47f Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 09:18:41 -0400 Subject: [PATCH 0889/1252] Update CHANGELOG for #18129 --- .changelog/18129.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18129.txt diff --git a/.changelog/18129.txt b/.changelog/18129.txt new file mode 100644 index 00000000000..2c5d15a2e64 --- /dev/null +++ b/.changelog/18129.txt @@ -0,0 +1,3 @@ +```release-note:new-data-source +aws_codestarconnections_connection +``` From d0ae4e1640e0ca9025a544bdcc95369240dee7d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:19:40 -0400 Subject: [PATCH 0890/1252] build(deps): bump github.com/aws/aws-sdk-go from 1.37.24 to 1.38.0 (#18274) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.37.24 to 1.38.0. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.37.24...v1.38.0) 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 537f5a6a804..ee38bfb2ba6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws go 1.16 require ( - github.com/aws/aws-sdk-go v1.37.24 + github.com/aws/aws-sdk-go v1.38.0 github.com/beevik/etree v1.1.0 github.com/fatih/color v1.9.0 // indirect github.com/hashicorp/aws-sdk-go-base v0.7.0 diff --git a/go.sum b/go.sum index 3839426bf4b..31bd96aa0df 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,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.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.37.24 h1:UmdPwGITvz//eFxNyuPlkq8KLlu4ZGvowsCQs+uFIp4= -github.com/aws/aws-sdk-go v1.37.24/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.38.0 h1:mqnmtdW8rGIQmp2d0WRFLua0zW0Pel0P6/vd3gJuViY= +github.com/aws/aws-sdk-go v1.38.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= From f3d0420a5d41e405bc0e707ef455c5f99c5d413b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 19 Mar 2021 13:21:37 +0000 Subject: [PATCH 0891/1252] Update CHANGELOG.md for #18274 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c0374df7c75..847558c2965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 3.34.0 (Unreleased) +FEATURES: + +* **New Data Source:** `aws_codestarconnections_connection` ([#18129](https://github.com/hashicorp/terraform-provider-aws/issues/18129)) + ## 3.33.0 (March 18, 2021) NOTES: From 14bef4bbd1ca35bac867bed23f569ca3aa3e7412 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Fri, 19 Mar 2021 15:27:05 +0200 Subject: [PATCH 0892/1252] resource/aws_pinpoint_sms_channel: Fix no setting params on update (#18281) Output from acceptance testing: ``` --- PASS: TestAccAWSPinpointSMSChannel_disappears (15.43s) --- PASS: TestAccAWSPinpointSMSChannel_full (31.57s) --- PASS: TestAccAWSPinpointSMSChannel_basic (32.19s) ``` --- .changelog/18281.txt | 3 ++ aws/resource_aws_pinpoint_sms_channel.go | 33 ++++++++++--------- aws/resource_aws_pinpoint_sms_channel_test.go | 31 ++++++++++++++--- 3 files changed, 47 insertions(+), 20 deletions(-) create mode 100644 .changelog/18281.txt diff --git a/.changelog/18281.txt b/.changelog/18281.txt new file mode 100644 index 00000000000..d119487f700 --- /dev/null +++ b/.changelog/18281.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_pinpoint_sms_channel: Set all params on update +``` \ No newline at end of file diff --git a/aws/resource_aws_pinpoint_sms_channel.go b/aws/resource_aws_pinpoint_sms_channel.go index 3838e110ab3..e781c6e68aa 100644 --- a/aws/resource_aws_pinpoint_sms_channel.go +++ b/aws/resource_aws_pinpoint_sms_channel.go @@ -55,16 +55,16 @@ func resourceAwsPinpointSMSChannelUpsert(d *schema.ResourceData, meta interface{ applicationId := d.Get("application_id").(string) - params := &pinpoint.SMSChannelRequest{} - - params.Enabled = aws.Bool(d.Get("enabled").(bool)) + params := &pinpoint.SMSChannelRequest{ + Enabled: aws.Bool(d.Get("enabled").(bool)), + } - if d.HasChange("sender_id") { - params.SenderId = aws.String(d.Get("sender_id").(string)) + if v, ok := d.GetOk("sender_id"); ok { + params.SenderId = aws.String(v.(string)) } - if d.HasChange("short_code") { - params.ShortCode = aws.String(d.Get("short_code").(string)) + if v, ok := d.GetOk("short_code"); ok { + params.ShortCode = aws.String(v.(string)) } req := pinpoint.UpdateSmsChannelInput{ @@ -74,7 +74,7 @@ func resourceAwsPinpointSMSChannelUpsert(d *schema.ResourceData, meta interface{ _, err := conn.UpdateSmsChannel(&req) if err != nil { - return fmt.Errorf("error putting Pinpoint SMS Channel for application %s: %s", applicationId, err) + return fmt.Errorf("error putting Pinpoint SMS Channel for application %s: %w", applicationId, err) } d.SetId(applicationId) @@ -97,15 +97,16 @@ func resourceAwsPinpointSMSChannelRead(d *schema.ResourceData, meta interface{}) return nil } - return fmt.Errorf("error getting Pinpoint SMS Channel for application %s: %s", d.Id(), err) + return fmt.Errorf("error getting Pinpoint SMS Channel for application %s: %w", d.Id(), err) } - d.Set("application_id", output.SMSChannelResponse.ApplicationId) - d.Set("enabled", output.SMSChannelResponse.Enabled) - d.Set("sender_id", output.SMSChannelResponse.SenderId) - d.Set("short_code", output.SMSChannelResponse.ShortCode) - d.Set("promotional_messages_per_second", aws.Int64Value(output.SMSChannelResponse.PromotionalMessagesPerSecond)) - d.Set("transactional_messages_per_second", aws.Int64Value(output.SMSChannelResponse.TransactionalMessagesPerSecond)) + res := output.SMSChannelResponse + d.Set("application_id", res.ApplicationId) + d.Set("enabled", res.Enabled) + d.Set("sender_id", res.SenderId) + d.Set("short_code", res.ShortCode) + d.Set("promotional_messages_per_second", aws.Int64Value(res.PromotionalMessagesPerSecond)) + d.Set("transactional_messages_per_second", aws.Int64Value(res.TransactionalMessagesPerSecond)) return nil } @@ -122,7 +123,7 @@ func resourceAwsPinpointSMSChannelDelete(d *schema.ResourceData, meta interface{ } if err != nil { - return fmt.Errorf("error deleting Pinpoint SMS Channel for application %s: %s", d.Id(), err) + return fmt.Errorf("error deleting Pinpoint SMS Channel for application %s: %w", d.Id(), err) } return nil } diff --git a/aws/resource_aws_pinpoint_sms_channel_test.go b/aws/resource_aws_pinpoint_sms_channel_test.go index 8ece762ec0e..d59fa711087 100644 --- a/aws/resource_aws_pinpoint_sms_channel_test.go +++ b/aws/resource_aws_pinpoint_sms_channel_test.go @@ -12,7 +12,7 @@ import ( func TestAccAWSPinpointSMSChannel_basic(t *testing.T) { var channel pinpoint.SMSChannelResponse - resourceName := "aws_pinpoint_sms_channel.test_sms_channel" + resourceName := "aws_pinpoint_sms_channel.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, @@ -55,7 +55,7 @@ func TestAccAWSPinpointSMSChannel_basic(t *testing.T) { func TestAccAWSPinpointSMSChannel_full(t *testing.T) { var channel pinpoint.SMSChannelResponse - resourceName := "aws_pinpoint_sms_channel.test_sms_channel" + resourceName := "aws_pinpoint_sms_channel.test" senderId := "1234" shortCode := "5678" newShortCode := "7890" @@ -107,6 +107,29 @@ func TestAccAWSPinpointSMSChannel_full(t *testing.T) { }) } +func TestAccAWSPinpointSMSChannel_disappears(t *testing.T) { + var channel pinpoint.SMSChannelResponse + resourceName := "aws_pinpoint_sms_channel.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + IDRefreshName: resourceName, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPinpointSMSChannelDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPinpointSMSChannelConfig_basic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPinpointSMSChannelExists(resourceName, &channel), + testAccCheckResourceDisappears(testAccProvider, resourceAwsPinpointSMSChannel(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSPinpointSMSChannelExists(n string, channel *pinpoint.SMSChannelResponse) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -139,7 +162,7 @@ func testAccCheckAWSPinpointSMSChannelExists(n string, channel *pinpoint.SMSChan const testAccAWSPinpointSMSChannelConfig_basic = ` resource "aws_pinpoint_app" "test_app" {} -resource "aws_pinpoint_sms_channel" "test_sms_channel" { +resource "aws_pinpoint_sms_channel" "test" { application_id = aws_pinpoint_app.test_app.application_id } ` @@ -148,7 +171,7 @@ func testAccAWSPinpointSMSChannelConfig_full(senderId, shortCode string) string return fmt.Sprintf(` resource "aws_pinpoint_app" "test_app" {} -resource "aws_pinpoint_sms_channel" "test_sms_channel" { +resource "aws_pinpoint_sms_channel" "test" { application_id = aws_pinpoint_app.test_app.application_id enabled = "false" sender_id = "%s" From dbf03a8c1b929ebfb4efceada7377e18e9eafd19 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 19 Mar 2021 13:46:15 +0000 Subject: [PATCH 0893/1252] Update CHANGELOG.md for #18233 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 847558c2965..e0cff9e6be8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ FEATURES: * **New Data Source:** `aws_codestarconnections_connection` ([#18129](https://github.com/hashicorp/terraform-provider-aws/issues/18129)) +BUG FIXES: + +* resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) + ## 3.33.0 (March 18, 2021) NOTES: From 87a9d6f3a1430c44aebc12368532ff0d3d869462 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 09:50:16 -0400 Subject: [PATCH 0894/1252] build(deps): bump github.com/aws/aws-sdk-go from 1.37.4 to 1.38.0 in /awsproviderlint (#18275) * build(deps): bump github.com/aws/aws-sdk-go in /awsproviderlint Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.37.4 to 1.38.0. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.37.4...v1.38.0) Signed-off-by: dependabot[bot] * provider: Use new endpoints.ApNortheast3RegionID Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian Flad --- ...a_source_aws_cloudtrail_service_account.go | 2 +- ...ource_aws_elastic_beanstalk_hosted_zone.go | 2 +- aws/data_source_aws_elb_hosted_zone_id.go | 2 +- aws/data_source_aws_elb_service_account.go | 2 +- ...ata_source_aws_redshift_service_account.go | 2 +- aws/hosted_zones.go | 2 +- awsproviderlint/go.mod | 2 +- awsproviderlint/go.sum | 4 +- .../aws/aws-sdk-go/aws/client/client.go | 4 - .../aws/aws-sdk-go/aws/client/logger.go | 8 + .../stscreds/assume_role_provider.go | 2 +- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 255 ++- .../aws/aws-sdk-go/aws/signer/v4/v4.go | 5 +- .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws-sdk-go/internal/s3shared/arn/arn.go | 18 +- .../s3shared/arn/s3_object_lambda_arn.go | 15 + .../aws/aws-sdk-go/service/s3/api.go | 1890 +++++++++++------ .../aws-sdk-go/service/s3/customizations.go | 2 + .../aws/aws-sdk-go/service/s3/endpoint.go | 102 +- .../aws-sdk-go/service/s3/endpoint_builder.go | 98 +- .../aws/aws-sdk-go/service/s3/errors.go | 6 +- awsproviderlint/vendor/modules.txt | 2 +- 22 files changed, 1752 insertions(+), 675 deletions(-) create mode 100644 awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go diff --git a/aws/data_source_aws_cloudtrail_service_account.go b/aws/data_source_aws_cloudtrail_service_account.go index 6c4498d6921..9e2a90ffb45 100644 --- a/aws/data_source_aws_cloudtrail_service_account.go +++ b/aws/data_source_aws_cloudtrail_service_account.go @@ -16,7 +16,7 @@ var cloudTrailServiceAccountPerRegionMap = map[string]string{ endpoints.ApEast1RegionID: "119688915426", endpoints.ApNortheast1RegionID: "216624486486", endpoints.ApNortheast2RegionID: "492519147666", - "ap-northeast-3": "765225791966", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "765225791966", endpoints.ApSouth1RegionID: "977081816279", endpoints.ApSoutheast1RegionID: "903692715234", endpoints.ApSoutheast2RegionID: "284668455005", diff --git a/aws/data_source_aws_elastic_beanstalk_hosted_zone.go b/aws/data_source_aws_elastic_beanstalk_hosted_zone.go index 627ce4fc33a..f9a2f7026e1 100644 --- a/aws/data_source_aws_elastic_beanstalk_hosted_zone.go +++ b/aws/data_source_aws_elastic_beanstalk_hosted_zone.go @@ -15,7 +15,7 @@ var elasticBeanstalkHostedZoneIds = map[string]string{ endpoints.ApEast1RegionID: "ZPWYUBWRU171A", endpoints.ApNortheast1RegionID: "Z1R25G3KIG2GBW", endpoints.ApNortheast2RegionID: "Z3JE5OI70TWKCP", - "ap-northeast-3": "ZNE5GEY1TIAGY", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "ZNE5GEY1TIAGY", endpoints.ApSouth1RegionID: "Z18NTBI3Y7N9TZ", endpoints.CaCentral1RegionID: "ZJFCZL7SSZB5I", endpoints.EuCentral1RegionID: "Z1FRNW7UH4DEZJ", diff --git a/aws/data_source_aws_elb_hosted_zone_id.go b/aws/data_source_aws_elb_hosted_zone_id.go index e21767ee043..f17ee59ab21 100644 --- a/aws/data_source_aws_elb_hosted_zone_id.go +++ b/aws/data_source_aws_elb_hosted_zone_id.go @@ -14,7 +14,7 @@ var elbHostedZoneIdPerRegionMap = map[string]string{ endpoints.ApEast1RegionID: "Z3DQVH9N71FHZ0", endpoints.ApNortheast1RegionID: "Z14GRHDCWA56QT", endpoints.ApNortheast2RegionID: "ZWKZPGTI48KDX", - "ap-northeast-3": "Z5LXEXXYW11ES", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "Z5LXEXXYW11ES", endpoints.ApSouth1RegionID: "ZP97RAFLXTNZK", endpoints.ApSoutheast1RegionID: "Z1LMS91P8CMLE5", endpoints.ApSoutheast2RegionID: "Z1GM3OXH4ZPM65", diff --git a/aws/data_source_aws_elb_service_account.go b/aws/data_source_aws_elb_service_account.go index a8328697dc6..1251ab0bd5d 100644 --- a/aws/data_source_aws_elb_service_account.go +++ b/aws/data_source_aws_elb_service_account.go @@ -14,7 +14,7 @@ var elbAccountIdPerRegionMap = map[string]string{ endpoints.ApEast1RegionID: "754344448648", endpoints.ApNortheast1RegionID: "582318560864", endpoints.ApNortheast2RegionID: "600734575887", - "ap-northeast-3": "383597477331", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "383597477331", endpoints.ApSouth1RegionID: "718504428378", endpoints.ApSoutheast1RegionID: "114774131450", endpoints.ApSoutheast2RegionID: "783225319266", diff --git a/aws/data_source_aws_redshift_service_account.go b/aws/data_source_aws_redshift_service_account.go index bcd877cbeac..efd2c731a18 100644 --- a/aws/data_source_aws_redshift_service_account.go +++ b/aws/data_source_aws_redshift_service_account.go @@ -16,7 +16,7 @@ var redshiftServiceAccountPerRegionMap = map[string]string{ endpoints.ApEast1RegionID: "313564881002", endpoints.ApNortheast1RegionID: "404641285394", endpoints.ApNortheast2RegionID: "760740231472", - "ap-northeast-3": "090321488786", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "090321488786", endpoints.ApSouth1RegionID: "865932855811", endpoints.ApSoutheast1RegionID: "361669875840", endpoints.ApSoutheast2RegionID: "762762565011", diff --git a/aws/hosted_zones.go b/aws/hosted_zones.go index a45ae249dcc..722f22f747f 100644 --- a/aws/hosted_zones.go +++ b/aws/hosted_zones.go @@ -17,7 +17,7 @@ var hostedZoneIDsMap = map[string]string{ endpoints.ApEast1RegionID: "ZNB98KWMFR0R6", endpoints.ApNortheast1RegionID: "Z2M4EHUR26P7ZW", endpoints.ApNortheast2RegionID: "Z3W03O7B5YMIYP", - "ap-northeast-3": "Z2YQB5RD63NC85", //lintignore:AWSAT003 // https://github.com/aws/aws-sdk-go/issues/1863 + endpoints.ApNortheast3RegionID: "Z2YQB5RD63NC85", endpoints.ApSouth1RegionID: "Z11RGJOFQNVJUP", endpoints.ApSoutheast1RegionID: "Z3O0J2DXBE1FTB", endpoints.ApSoutheast2RegionID: "Z1WCIGYICN2BYD", diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index f8b2754a25d..ab28968475b 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws/awsproviderlint go 1.16 require ( - github.com/aws/aws-sdk-go v1.37.4 + github.com/aws/aws-sdk-go v1.38.0 github.com/bflad/tfproviderlint v0.23.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index ce29a272b6d..03b7ac4aa61 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -58,8 +58,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.37.4 h1:tWxrpMK/oRSXVnjUzhGeCWLR00fW0WF4V4sycYPPrJ8= -github.com/aws/aws-sdk-go v1.37.4/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.38.0 h1:mqnmtdW8rGIQmp2d0WRFLua0zW0Pel0P6/vd3gJuViY= +github.com/aws/aws-sdk-go v1.38.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= 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.23.0 h1:Hj024L2wjqqsI0ISJIfWua14r4VlBkLoZDQFmpOTEn4= diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/client.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/client.go index 03334d69207..74f35ccf0cd 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/client.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/client.go @@ -88,10 +88,6 @@ func (c *Client) NewRequest(operation *request.Operation, params interface{}, da // AddDebugHandlers injects debug logging handlers into the service to log request // debug information. func (c *Client) AddDebugHandlers() { - if !c.Config.LogLevel.AtLeast(aws.LogDebug) { - return - } - c.Handlers.Send.PushFrontNamed(LogHTTPRequestHandler) c.Handlers.Send.PushBackNamed(LogHTTPResponseHandler) } diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go index 8958c32d4e9..1d774cfa251 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/client/logger.go @@ -53,6 +53,10 @@ var LogHTTPRequestHandler = request.NamedHandler{ } func logRequest(r *request.Request) { + if !r.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + logBody := r.Config.LogLevel.Matches(aws.LogDebugWithHTTPBody) bodySeekable := aws.IsReaderSeekable(r.Body) @@ -120,6 +124,10 @@ var LogHTTPResponseHandler = request.NamedHandler{ } func logResponse(r *request.Request) { + if !r.Config.LogLevel.AtLeast(aws.LogDebug) { + return + } + lw := &logWriter{r.Config.Logger, bytes.NewBuffer(nil)} if r.HTTPResponse == nil { diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go index e42c5cdbb2e..260a37cbbab 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -95,7 +95,7 @@ import ( // StdinTokenProvider will prompt on stderr and read from stdin for a string value. // An error is returned if reading from stdin fails. // -// Use this function go read MFA tokens from stdin. The function makes no attempt +// Use this function to read MFA tokens from stdin. The function makes no attempt // to make atomic prompts from stdin across multiple gorouties. // // Using StdinTokenProvider with multiple AssumeRoleProviders, or Credentials will diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 6ee1adc08ae..05cbff6294e 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -21,6 +21,7 @@ const ( ApEast1RegionID = "ap-east-1" // Asia Pacific (Hong Kong). ApNortheast1RegionID = "ap-northeast-1" // Asia Pacific (Tokyo). ApNortheast2RegionID = "ap-northeast-2" // Asia Pacific (Seoul). + ApNortheast3RegionID = "ap-northeast-3" // Asia Pacific (Osaka). ApSouth1RegionID = "ap-south-1" // Asia Pacific (Mumbai). ApSoutheast1RegionID = "ap-southeast-1" // Asia Pacific (Singapore). ApSoutheast2RegionID = "ap-southeast-2" // Asia Pacific (Sydney). @@ -121,6 +122,9 @@ var awsPartition = partition{ "ap-northeast-2": region{ Description: "Asia Pacific (Seoul)", }, + "ap-northeast-3": region{ + Description: "Asia Pacific (Osaka)", + }, "ap-south-1": region{ Description: "Asia Pacific (Mumbai)", }, @@ -184,6 +188,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -239,6 +244,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -358,6 +364,23 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "amplifybackend": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "api.detective": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -436,6 +459,12 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-northeast-3": endpoint{ + Hostname: "api.ecr.ap-northeast-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "ap-south-1": endpoint{ Hostname: "api.ecr.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ @@ -690,6 +719,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -749,6 +779,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -899,6 +930,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -972,9 +1004,11 @@ var awsPartition = partition{ "batch": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1104,6 +1138,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1369,6 +1404,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1583,6 +1619,12 @@ var awsPartition = partition{ Region: "us-east-2", }, }, + "fips-us-west-1": endpoint{ + Hostname: "cognito-idp-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, "fips-us-west-2": endpoint{ Hostname: "cognito-idp-fips.us-west-2.amazonaws.com", CredentialScope: credentialScope{ @@ -1686,6 +1728,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1743,7 +1786,10 @@ var awsPartition = partition{ "contact-lens": service{ Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, @@ -1880,6 +1926,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -1941,6 +1988,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2118,6 +2166,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2180,6 +2229,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2237,6 +2287,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2303,6 +2354,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2354,6 +2406,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2403,6 +2456,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2434,6 +2488,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2483,6 +2538,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2517,6 +2573,12 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "fips-ap-northeast-3": endpoint{ + Hostname: "elasticfilesystem-fips.ap-northeast-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "fips-ap-south-1": endpoint{ Hostname: "elasticfilesystem-fips.ap-south-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2630,6 +2692,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2682,6 +2745,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2761,9 +2825,19 @@ var awsPartition = partition{ "emr-containers": service{ Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "entitlement.marketplace": service{ @@ -2783,6 +2857,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2814,6 +2889,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -2863,6 +2939,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3159,6 +3236,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3214,6 +3292,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3674,6 +3753,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3767,6 +3847,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3825,11 +3906,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "lambda": service{ @@ -3839,6 +3921,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -3955,6 +4038,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4254,6 +4338,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4328,6 +4413,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -4935,12 +5021,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "me-south-1": endpoint{}, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "ram-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "ram-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "ram-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "ram-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "ram-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "rds": service{ @@ -4950,6 +5066,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5007,6 +5124,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5110,6 +5228,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5312,6 +5431,7 @@ var awsPartition = partition{ SignatureVersions: []string{"s3", "s3v4"}, }, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{ Hostname: "s3.ap-southeast-1.amazonaws.com", @@ -5388,6 +5508,13 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-northeast-3": endpoint{ + Hostname: "s3-control.ap-northeast-3.amazonaws.com", + SignatureVersions: []string{"s3v4"}, + CredentialScope: credentialScope{ + Region: "ap-northeast-3", + }, + }, "ap-south-1": endpoint{ Hostname: "s3-control.ap-south-1.amazonaws.com", SignatureVersions: []string{"s3v4"}, @@ -5583,6 +5710,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5824,6 +5952,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -5934,6 +6063,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6056,6 +6186,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6108,6 +6239,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6159,6 +6291,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6214,6 +6347,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6359,6 +6493,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6426,6 +6561,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6475,6 +6611,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -6560,6 +6697,8 @@ var awsPartition = partition{ "transfer": service{ Endpoints: endpoints{ + "af-south-1": endpoint{}, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -6601,11 +6740,12 @@ var awsPartition = partition{ Region: "us-west-2", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "translate": service{ @@ -6951,6 +7091,7 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, @@ -6981,6 +7122,7 @@ var awsPartition = partition{ "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-northeast-3": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, @@ -7449,6 +7591,16 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "guardduty": service{ + IsRegionalized: boxedTrue, + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "health": service{ Endpoints: endpoints{ @@ -8323,6 +8475,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "connect": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "datasync": service{ Endpoints: endpoints{ @@ -8964,6 +9122,22 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "models.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "models-fips.lex.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "monitoring": service{ Endpoints: endpoints{ @@ -9072,8 +9246,18 @@ var awsusgovPartition = partition{ "ram": service{ Endpoints: endpoints{ - "us-gov-east-1": endpoint{}, - "us-gov-west-1": endpoint{}, + "us-gov-east-1": endpoint{ + Hostname: "ram.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-west-1": endpoint{ + Hostname: "ram.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, }, }, "rds": service{ @@ -9169,6 +9353,22 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "runtime.lex": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "lex", + }, + }, + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + "us-gov-west-1-fips": endpoint{ + Hostname: "runtime-fips.lex.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ @@ -10311,6 +10511,19 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "route53": service{ + PartitionEndpoint: "aws-iso-b-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-iso-b-global": endpoint{ + Hostname: "route53.sc2s.sgov.gov", + CredentialScope: credentialScope{ + Region: "us-isob-east-1", + }, + }, + }, + }, "s3": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go index d71f7b3f4fa..1737c2686de 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/v4.go @@ -689,9 +689,12 @@ func (ctx *signingCtx) buildBodyDigest() error { if hash == "" { includeSHA256Header := ctx.unsignedPayload || ctx.ServiceName == "s3" || + ctx.ServiceName == "s3-object-lambda" || ctx.ServiceName == "glacier" - s3Presign := ctx.isPresign && ctx.ServiceName == "s3" + s3Presign := ctx.isPresign && + (ctx.ServiceName == "s3" || + ctx.ServiceName == "s3-object-lambda") if ctx.unsignedPayload || s3Presign { hash = "UNSIGNED-PAYLOAD" diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go index 781c2ca1086..937f765df1b 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.37.4" +const SDKVersion = "1.38.0" diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go index 7a8e46fbdae..3079e4ab0e2 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go @@ -7,6 +7,21 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" ) +var supportedServiceARN = []string{ + "s3", + "s3-outposts", + "s3-object-lambda", +} + +func isSupportedServiceARN(service string) bool { + for _, name := range supportedServiceARN { + if name == service { + return true + } + } + return false +} + // Resource provides the interfaces abstracting ARNs of specific resource // types. type Resource interface { @@ -29,9 +44,10 @@ func ParseResource(s string, resParser ResourceParser) (resARN Resource, err err return nil, InvalidARNError{ARN: a, Reason: "partition not set"} } - if a.Service != "s3" && a.Service != "s3-outposts" { + if !isSupportedServiceARN(a.Service) { return nil, InvalidARNError{ARN: a, Reason: "service is not supported"} } + if len(a.Resource) == 0 { return nil, InvalidARNError{ARN: a, Reason: "resource not set"} } diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go new file mode 100644 index 00000000000..513154cc0e3 --- /dev/null +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go @@ -0,0 +1,15 @@ +package arn + +// S3ObjectLambdaARN represents an ARN for the s3-object-lambda service +type S3ObjectLambdaARN interface { + Resource + + isS3ObjectLambdasARN() +} + +// S3ObjectLambdaAccessPointARN is an S3ObjectLambdaARN for the Access Point resource type +type S3ObjectLambdaAccessPointARN struct { + AccessPointARN +} + +func (s S3ObjectLambdaAccessPointARN) isS3ObjectLambdasARN() {} diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 89a0a29afff..6cc91dd2c56 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -14,6 +14,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aws/aws-sdk-go/internal/s3shared/arn" "github.com/aws/aws-sdk-go/private/checksum" "github.com/aws/aws-sdk-go/private/protocol" @@ -67,7 +68,7 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // AbortMultipartUpload API operation for Amazon Simple Storage Service. // -// This operation aborts a multipart upload. After a multipart upload is aborted, +// This action aborts a multipart upload. After a multipart upload is aborted, // no additional parts can be uploaded using that upload ID. The storage consumed // by any previously uploaded parts will be freed. However, if any part uploads // are currently in progress, those part uploads might or might not succeed. @@ -76,10 +77,10 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // // To verify that all parts have been removed, so you don't get charged for // the part storage, you should call the ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// operation and ensure that the parts list is empty. +// action and ensure that the parts list is empty. // -// For information about permissions required to use the multipart upload API, -// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// For information about permissions required to use the multipart upload, see +// Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // The following operations are related to AbortMultipartUpload: // @@ -175,10 +176,10 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // You first initiate the multipart upload and then upload all parts using the // UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // operation. After successfully uploading all relevant parts of an upload, -// you call this operation to complete the upload. Upon receiving this request, +// you call this action to complete the upload. Upon receiving this request, // Amazon S3 concatenates all the parts in ascending order by part number to // create a new object. In the Complete Multipart Upload request, you must provide -// the parts list. You must ensure that the parts list is complete. This operation +// the parts list. You must ensure that the parts list is complete. This action // concatenates the parts that you provide in the list. For each part in the // list, you must provide the part number and the ETag value, returned after // that part was uploaded. @@ -199,7 +200,7 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). // // For information about permissions required to use the multipart upload API, -// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // CompleteMultipartUpload has the following special errors: // @@ -306,10 +307,10 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // Creates a copy of an object that is already stored in Amazon S3. // // You can store individual objects of up to 5 TB in Amazon S3. You create a -// copy of your object up to 5 GB in size in a single atomic operation using -// this API. However, to copy an object greater than 5 GB, you must use the -// multipart upload Upload Part - Copy API. For more information, see Copy Object -// Using the REST Multipart Upload API (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html). +// copy of your object up to 5 GB in size in a single atomic action using this +// API. However, to copy an object greater than 5 GB, you must use the multipart +// upload Upload Part - Copy API. For more information, see Copy Object Using +// the REST Multipart Upload API (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html). // // All copy requests must be authenticated. Additionally, you must have read // access to the source object and write access to the destination bucket. For @@ -319,7 +320,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // A copy request might return an error when Amazon S3 receives the copy request // or while Amazon S3 is copying the files. If the error occurs before the copy -// operation starts, you receive a standard Amazon S3 error. If the error occurs +// action starts, you receive a standard Amazon S3 error. If the error occurs // during the copy operation, the error response is embedded in the 200 OK response. // This means that a 200 OK response can contain either a success or an error. // Design your application to parse the contents of the response and handle @@ -334,7 +335,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // The copy request charge is based on the storage class and Region that you // specify for the destination object. For pricing information, see Amazon S3 -// pricing (https://aws.amazon.com/s3/pricing/). +// pricing (http://aws.amazon.com/s3/pricing/). // // Amazon S3 transfer acceleration does not support cross-Region copies. If // you request a cross-Region copy using a transfer acceleration endpoint, you @@ -404,7 +405,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the // object. For more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Access Control List (ACL)-Specific Request Headers // @@ -418,7 +419,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // Storage Class Options // -// You can use the CopyObject operation to change the storage class of an object +// You can use the CopyObject action to change the storage class of an object // that is already stored in Amazon S3 using the StorageClass parameter. For // more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) // in the Amazon S3 Service Developer Guide. @@ -459,8 +460,8 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // Returned Error Codes: // * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" -// The source object of the COPY operation is not in the active tier and is -// only stored in Amazon S3 Glacier. +// The source object of the COPY action is not in the active tier and is only +// stored in Amazon S3 Glacier. // // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { @@ -678,10 +679,10 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // CreateMultipartUpload API operation for Amazon Simple Storage Service. // -// This operation initiates a multipart upload and returns an upload ID. This -// upload ID is used to associate all of the parts in the specific multipart -// upload. You specify this upload ID in each of your subsequent upload part -// requests (see UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)). +// This action initiates a multipart upload and returns an upload ID. This upload +// ID is used to associate all of the parts in the specific multipart upload. +// You specify this upload ID in each of your subsequent upload part requests +// (see UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)). // You also include this upload ID in the final request to either complete or // abort the multipart upload request. // @@ -691,12 +692,12 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // If you have configured a lifecycle rule to abort incomplete multipart uploads, // the upload must complete within the number of days specified in the bucket // lifecycle configuration. Otherwise, the incomplete multipart upload becomes -// eligible for an abort operation and Amazon S3 aborts the multipart upload. -// For more information, see Aborting Incomplete Multipart Uploads Using a Bucket +// eligible for an abort action and Amazon S3 aborts the multipart upload. For +// more information, see Aborting Incomplete Multipart Uploads Using a Bucket // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). // // For information about the permissions required to use the multipart upload -// API, see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// API, see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // For request signing, multipart upload is just a series of regular requests. // You initiate a multipart upload, send one or more requests to upload parts, @@ -716,7 +717,7 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // and decrypts it when you access it. You can provide your own encryption key, // or use AWS Key Management Service (AWS KMS) customer master keys (CMKs) or // Amazon S3-managed encryption keys. If you choose to provide your own encryption -// key, the request headers you provide in UploadPart (AmazonS3/latest/API/API_UploadPart.html) +// key, the request headers you provide in UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) // and UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) // requests must match the headers you used in the request to initiate the upload // by using CreateMultipartUpload. @@ -989,8 +990,8 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about the Amazon S3 analytics feature, see Amazon S3 Analytics // – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). @@ -1083,7 +1084,7 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request // permission to others. // // For information about cors, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Related Resources: // @@ -1164,17 +1165,17 @@ func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) ( // DeleteBucketEncryption API operation for Amazon Simple Storage Service. // -// This implementation of the DELETE operation removes default encryption from +// This implementation of the DELETE action removes default encryption from // the bucket. For information about the Amazon S3 default encryption feature, // see Amazon S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // Related Resources // @@ -1361,8 +1362,8 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent // To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about the Amazon S3 inventory feature, see Amazon S3 Inventory // (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). @@ -1550,8 +1551,8 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC // To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about CloudWatch request metrics for Amazon S3, see Monitoring // Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). @@ -1725,9 +1726,9 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req // DeleteBucketPolicy API operation for Amazon Simple Storage Service. // -// This implementation of the DELETE operation uses the policy subresource to -// delete the policy of a specified bucket. If you are using an identity other -// than the root user of the AWS account that owns the bucket, the calling identity +// This implementation of the DELETE action uses the policy subresource to delete +// the policy of a specified bucket. If you are using an identity other than +// the root user of the AWS account that owns the bucket, the calling identity // must have the DeleteBucketPolicy permissions on the specified bucket and // belong to the bucket owner's account to use this operation. // @@ -1827,8 +1828,8 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) // To use this operation, you must have permissions to perform the s3:PutReplicationConfiguration // action. The bucket owner has these permissions by default and can grant it // to others. For more information about permissions, see Permissions Related -// to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // It can take a while for the deletion of a replication configuration to fully // propagate. @@ -2000,15 +2001,15 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r // DeleteBucketWebsite API operation for Amazon Simple Storage Service. // -// This operation removes the website configuration for a bucket. Amazon S3 -// returns a 200 OK response upon successfully deleting a website configuration -// on the specified bucket. You will get a 200 OK response if the website configuration +// This action removes the website configuration for a bucket. Amazon S3 returns +// a 200 OK response upon successfully deleting a website configuration on the +// specified bucket. You will get a 200 OK response if the website configuration // you are trying to delete does not exist on the bucket. Amazon S3 returns // a 404 response if the bucket specified in the request does not exist. // -// This DELETE operation requires the S3:DeleteBucketWebsite permission. By -// default, only the bucket owner can delete the website configuration attached -// to a bucket. However, bucket owners can grant other users permission to delete +// This DELETE action requires the S3:DeleteBucketWebsite permission. By default, +// only the bucket owner can delete the website configuration attached to a +// bucket. However, bucket owners can grant other users permission to delete // the website configuration by writing a bucket policy granting them the S3:DeleteBucketWebsite // permission. // @@ -2110,14 +2111,14 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // For more information about MFA Delete, see Using MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html). // To see sample requests that use versioning, see Sample Request (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete). // -// You can delete objects by explicitly calling the DELETE Object API or configure -// its lifecycle (PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html)) +// You can delete objects by explicitly calling DELETE Object or configure its +// lifecycle (PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html)) // to enable Amazon S3 to remove them for you. If you want to block users or // accounts from removing or deleting objects from your bucket, you must deny // them the s3:DeleteObject, s3:DeleteObjectVersion, and s3:PutLifeCycleConfiguration // actions. // -// The following operation is related to DeleteObject: +// The following action is related to DeleteObject: // // * PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) // @@ -2285,27 +2286,27 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque // DeleteObjects API operation for Amazon Simple Storage Service. // -// This operation enables you to delete multiple objects from a bucket using -// a single HTTP request. If you know the object keys that you want to delete, -// then this operation provides a suitable alternative to sending individual -// delete requests, reducing per-request overhead. +// This action enables you to delete multiple objects from a bucket using a +// single HTTP request. If you know the object keys that you want to delete, +// then this action provides a suitable alternative to sending individual delete +// requests, reducing per-request overhead. // // The request contains a list of up to 1000 keys that you want to delete. In // the XML, you provide the object key names, and optionally, version IDs if // you want to delete a specific version of the object from a versioning-enabled -// bucket. For each key, Amazon S3 performs a delete operation and returns the +// bucket. For each key, Amazon S3 performs a delete action and returns the // result of that delete, success, or failure, in the response. Note that if // the object specified in the request is not found, Amazon S3 returns the result // as deleted. // -// The operation supports two modes for the response: verbose and quiet. By -// default, the operation uses verbose mode in which the response includes the -// result of deletion of each key in your request. In quiet mode the response -// includes only keys where the delete operation encountered an error. For a -// successful deletion, the operation does not return any information about -// the delete in the response body. +// The action supports two modes for the response: verbose and quiet. By default, +// the action uses verbose mode in which the response includes the result of +// deletion of each key in your request. In quiet mode the response includes +// only keys where the delete action encountered an error. For a successful +// deletion, the action does not return any information about the delete in +// the response body. // -// When performing this operation on an MFA Delete enabled bucket, that attempts +// When performing this action on an MFA Delete enabled bucket, that attempts // to delete any versioned objects, you must include an MFA token. If you do // not provide one, the entire request will fail, even if there are non-versioned // objects you are trying to delete. If you provide an invalid token, whether @@ -2404,8 +2405,8 @@ func (c *S3) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) // Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use // this operation, you must have the s3:PutBucketPublicAccessBlock permission. // For more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // The following operations are related to DeletePublicAccessBlock: // @@ -2489,17 +2490,17 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. // -// This implementation of the GET operation uses the accelerate subresource -// to return the Transfer Acceleration state of a bucket, which is either Enabled +// This implementation of the GET action uses the accelerate subresource to +// return the Transfer Acceleration state of a bucket, which is either Enabled // or Suspended. Amazon S3 Transfer Acceleration is a bucket-level feature that // enables you to perform faster data transfers to and from Amazon S3. // // To use this operation, you must have permission to perform the s3:GetAccelerateConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // You set the Transfer Acceleration state of an existing bucket to Enabled // or Suspended by using the PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) @@ -2511,7 +2512,7 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // // For more information about transfer acceleration, see Transfer Acceleration // (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Related Resources // @@ -2589,7 +2590,7 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request // GetBucketAcl API operation for Amazon Simple Storage Service. // -// This implementation of the GET operation uses the acl subresource to return +// This implementation of the GET action uses the acl subresource to return // the access control list (ACL) of a bucket. To use GET to return the ACL of // the bucket, you must have READ_ACP access to the bucket. If READ_ACP permission // is granted to the anonymous user, you can return the ACL of the bucket without @@ -2671,19 +2672,19 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon // GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. // -// This implementation of the GET operation returns an analytics configuration +// This implementation of the GET action returns an analytics configuration // (identified by the analytics configuration ID) from the bucket. // // To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // For information about Amazon S3 analytics feature, see Amazon S3 Analytics // – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Related Resources // @@ -2852,15 +2853,18 @@ func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *r // GetBucketEncryption API operation for Amazon Simple Storage Service. // -// Returns the default encryption configuration for an Amazon S3 bucket. For -// information about the Amazon S3 default encryption feature, see Amazon S3 -// Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html). +// Returns the default encryption configuration for an Amazon S3 bucket. If +// the bucket does not have a default encryption configuration, GetBucketEncryption +// returns ServerSideEncryptionConfigurationNotFoundError. +// +// For information about the Amazon S3 default encryption feature, see Amazon +// S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html). // // To use this operation, you must have permission to perform the s3:GetEncryptionConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // The following operations are related to GetBucketEncryption: // @@ -3045,8 +3049,8 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon // To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration // action. The bucket owner has this permission by default and can grant this // permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about the Amazon S3 inventory feature, see Amazon S3 Inventory // (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). @@ -3148,8 +3152,8 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // GetBucketLifecycle has the following special error: // @@ -3247,8 +3251,8 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // Accordingly, this section describes the latest API. The response describes // the new filter element that you can use to specify a filter to select a subset // of objects to which the rule applies. If you are using a previous version -// of the lifecycle configuration, it still works. For the earlier API description, -// see GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html). +// of the lifecycle configuration, it still works. For the earlier action, see +// GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html). // // Returns the lifecycle configuration information set on the bucket. For information // about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). @@ -3256,8 +3260,8 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration // action. The bucket owner has this permission, by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // GetBucketLifecycleConfiguration has the following special error: // @@ -3516,8 +3520,8 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu // To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about CloudWatch request metrics for Amazon S3, see Monitoring // Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). @@ -3689,8 +3693,8 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // // Returns the notification configuration of a bucket. // -// If notifications are not enabled on the bucket, the operation returns an -// empty NotificationConfiguration element. +// If notifications are not enabled on the bucket, the action returns an empty +// NotificationConfiguration element. // // By default, you must be the bucket owner to read the notification configuration // of a bucket. However, the bucket owner can use a bucket policy to grant permission @@ -3701,7 +3705,7 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // on a bucket, see Setting Up Notification of Bucket Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). // For more information about bucket policies, see Using Bucket Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). // -// The following operation is related to GetBucketNotification: +// The following action is related to GetBucketNotification: // // * PutBucketNotification (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) // @@ -3879,7 +3883,7 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R // For more information about bucket policies, see Using Bucket Policies and // User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). // -// The following operation is related to GetBucketPolicy: +// The following action is related to GetBucketPolicy: // // * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // @@ -4052,11 +4056,11 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req // can return a wrong result. // // For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // -// This operation requires permissions for the s3:GetReplicationConfiguration -// action. For more information about permissions, see Using Bucket Policies -// and User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// This action requires permissions for the s3:GetReplicationConfiguration action. +// For more information about permissions, see Using Bucket Policies and User +// Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). // // If you include the Filter element in a replication configuration, you must // also include the DeleteMarkerReplication and Priority elements. The response @@ -4405,7 +4409,7 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request // For more information about hosting websites, see Hosting Websites on Amazon // S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). // -// This GET operation requires the S3:GetBucketWebsite permission. By default, +// This GET action requires the S3:GetBucketWebsite permission. By default, // only the bucket owner can read the bucket website configuration. However, // bucket owners can allow other users to read the website configuration by // writing a bucket policy granting them the S3:GetBucketWebsite permission. @@ -4515,7 +4519,7 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // Deep Archive storage class, or S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering // Deep Archive tiers, before you can retrieve the object you must first restore // a copy using RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). -// Otherwise, this operation returns an InvalidObjectStateError error. For information +// Otherwise, this action returns an InvalidObjectStateError error. For information // about restoring archived objects, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html). // // Encryption request headers, like x-amz-server-side-encryption, should not @@ -4558,8 +4562,8 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // // Versioning // -// By default, the GET operation returns the current version of an object. To -// return a different version, use the versionId subresource. +// By default, the GET action returns the current version of an object. To return +// a different version, use the versionId subresource. // // If the current version of the object is a delete marker, Amazon S3 behaves // as if the object was deleted and includes x-amz-delete-marker: true in the @@ -5026,7 +5030,7 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // subresource associated with the object. // // To use this operation, you must have permission to perform the s3:GetObjectTagging -// action. By default, the GET operation returns information about current version +// action. By default, the GET action returns information about current version // of an object. For a versioned bucket, you can have multiple versions of an // object in your bucket. To retrieve tags of any other version, use the versionId // query parameter. You also need permission for the s3:GetObjectVersionTagging @@ -5038,10 +5042,12 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // For information about the Amazon S3 object tagging feature, see Object Tagging // (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). // -// The following operation is related to GetObjectTagging: +// The following action is related to GetObjectTagging: // // * PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) // +// * DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5126,7 +5132,7 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request // // This action is not supported by Amazon S3 on Outposts. // -// The following operation is related to GetObjectTorrent: +// The following action is related to GetObjectTorrent: // // * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // @@ -5300,16 +5306,20 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou // HeadBucket API operation for Amazon Simple Storage Service. // -// This operation is useful to determine if a bucket exists and you have permission -// to access it. The operation returns a 200 OK if the bucket exists and you -// have permission to access it. Otherwise, the operation might return responses -// such as 404 Not Found and 403 Forbidden. +// This action is useful to determine if a bucket exists and you have permission +// to access it. The action returns a 200 OK if the bucket exists and you have +// permission to access it. +// +// If the bucket does not exist or you do not have permission to access it, +// the HEAD request returns a generic 404 Not Found or 403 Forbidden code. A +// message body is not included, so you cannot determine the exception beyond +// these error codes. // // To use this operation, you must have permissions to perform the s3:ListBucket // action. The bucket owner has this permission by default and can grant this // permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5388,13 +5398,15 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // HeadObject API operation for Amazon Simple Storage Service. // -// The HEAD operation retrieves metadata from an object without returning the -// object itself. This operation is useful if you're only interested in an object's -// metadata. To use HEAD, you must have READ access to the object. +// The HEAD action retrieves metadata from an object without returning the object +// itself. This action is useful if you're only interested in an object's metadata. +// To use HEAD, you must have READ access to the object. // -// A HEAD request has the same options as a GET operation on an object. The -// response is identical to the GET response except that there is no response -// body. +// A HEAD request has the same options as a GET action on an object. The response +// is identical to the GET response except that there is no response body. Because +// of this, if the HEAD request generates an error, it returns a generic 404 +// Not Found or 403 Forbidden code. It is not possible to retrieve the exact +// exception beyond these error codes. // // If you encrypt an object by using server-side encryption with customer-provided // encryption keys (SSE-C) when you store the object in Amazon S3, then when @@ -5409,11 +5421,14 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided // Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). // -// Encryption request headers, like x-amz-server-side-encryption, should not -// be sent for GET requests if your object uses server-side encryption with -// CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with Amazon S3–managed -// encryption keys (SSE-S3). If your object does use these types of keys, you’ll -// get an HTTP 400 BadRequest error. +// * Encryption request headers, like x-amz-server-side-encryption, should +// not be sent for GET requests if your object uses server-side encryption +// with CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with Amazon +// S3–managed encryption keys (SSE-S3). If your object does use these types +// of keys, you’ll get an HTTP 400 BadRequest error. +// +// * The last modified property in this case is the creation date of the +// object. // // Request headers are limited to 8 KB in size. For more information, see Common // Request Headers (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html). @@ -5445,7 +5460,7 @@ func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, ou // * If you don’t have the s3:ListBucket permission, Amazon S3 returns // an HTTP status code 403 ("access denied") error. // -// The following operation is related to HeadObject: +// The following action is related to HeadObject: // // * GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) // @@ -5527,19 +5542,19 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics // Lists the analytics configurations for the bucket. You can have up to 1,000 // analytics configurations per bucket. // -// This operation supports list pagination and does not return more than 100 -// configurations at a time. You should always check the IsTruncated element -// in the response. If there are no more configurations to list, IsTruncated -// is set to false. If there are more configurations to list, IsTruncated is -// set to true, and there will be a value in NextContinuationToken. You use -// the NextContinuationToken value to continue the pagination of the list by -// passing the value in continuation-token in the request to GET the next page. +// This action supports list pagination and does not return more than 100 configurations +// at a time. You should always check the IsTruncated element in the response. +// If there are no more configurations to list, IsTruncated is set to false. +// If there are more configurations to list, IsTruncated is set to true, and +// there will be a value in NextContinuationToken. You use the NextContinuationToken +// value to continue the pagination of the list by passing the value in continuation-token +// in the request to GET the next page. // // To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about Amazon S3 analytics feature, see Amazon S3 Analytics // – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). @@ -5726,19 +5741,19 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory // Returns a list of inventory configurations for the bucket. You can have up // to 1,000 analytics configurations per bucket. // -// This operation supports list pagination and does not return more than 100 -// configurations at a time. Always check the IsTruncated element in the response. -// If there are no more configurations to list, IsTruncated is set to false. -// If there are more configurations to list, IsTruncated is set to true, and -// there is a value in NextContinuationToken. You use the NextContinuationToken -// value to continue the pagination of the list by passing the value in continuation-token +// This action supports list pagination and does not return more than 100 configurations +// at a time. Always check the IsTruncated element in the response. If there +// are no more configurations to list, IsTruncated is set to false. If there +// are more configurations to list, IsTruncated is set to true, and there is +// a value in NextContinuationToken. You use the NextContinuationToken value +// to continue the pagination of the list by passing the value in continuation-token // in the request to GET the next page. // // To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about the Amazon S3 inventory feature, see Amazon S3 Inventory // (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) @@ -5827,19 +5842,19 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf // are only for the request metrics of the bucket and do not provide information // on daily storage metrics. You can have up to 1,000 configurations per bucket. // -// This operation supports list pagination and does not return more than 100 -// configurations at a time. Always check the IsTruncated element in the response. -// If there are no more configurations to list, IsTruncated is set to false. -// If there are more configurations to list, IsTruncated is set to true, and -// there is a value in NextContinuationToken. You use the NextContinuationToken -// value to continue the pagination of the list by passing the value in continuation-token +// This action supports list pagination and does not return more than 100 configurations +// at a time. Always check the IsTruncated element in the response. If there +// are no more configurations to list, IsTruncated is set to false. If there +// are more configurations to list, IsTruncated is set to true, and there is +// a value in NextContinuationToken. You use the NextContinuationToken value +// to continue the pagination of the list by passing the value in continuation-token // in the request to GET the next page. // // To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For more information about metrics configurations and CloudWatch request // metrics, see Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). @@ -6004,11 +6019,11 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // ListMultipartUploads API operation for Amazon Simple Storage Service. // -// This operation lists in-progress multipart uploads. An in-progress multipart +// This action lists in-progress multipart uploads. An in-progress multipart // upload is a multipart upload that has been initiated using the Initiate Multipart // Upload request, but has not yet been completed or aborted. // -// This operation returns at most 1,000 multipart uploads in the response. 1,000 +// This action returns at most 1,000 multipart uploads in the response. 1,000 // multipart uploads is the maximum number of uploads a response can include, // which is also the default value. You can further limit the number of uploads // in a response by specifying the max-uploads parameter in the response. If @@ -6025,7 +6040,7 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). // // For information on permissions required to use the multipart upload API, -// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // The following operations are related to ListMultipartUploads: // @@ -6326,8 +6341,8 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, // to design your application to parse the contents of the response and handle // it appropriately. // -// This API has been revised. We recommend that you use the newer version, ListObjectsV2 -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html), +// This action has been revised. We recommend that you use the newer version, +// ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html), // when developing applications. For backward compatibility, Amazon S3 continues // to support ListObjects. // @@ -6482,18 +6497,19 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque // the request parameters as selection criteria to return a subset of the objects // in a bucket. A 200 OK response can contain valid or invalid XML. Make sure // to design your application to parse the contents of the response and handle -// it appropriately. +// it appropriately. Objects are returned sorted in an ascending order of the +// respective key names in the list. // // To use this operation, you must have READ access to the bucket. // -// To use this operation in an AWS Identity and Access Management (IAM) policy, +// To use this action in an AWS Identity and Access Management (IAM) policy, // you must have permissions to perform the s3:ListBucket action. The bucket // owner has this permission by default and can grant this permission to others. // For more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // -// This section describes the latest revision of the API. We recommend that +// This section describes the latest revision of this action. We recommend that // you use this revised API for application development. For backward compatibility, // Amazon S3 continues to support the prior version of this API, ListObjects // (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html). @@ -6658,7 +6674,7 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). // // For information on permissions required to use the multipart upload API, -// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). // // The following operations are related to ListParts: // @@ -6804,8 +6820,8 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // The Transfer Acceleration state of a bucket can be set to one of the following // two values: @@ -6815,7 +6831,7 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // * Suspended – Disables accelerated data transfers to the bucket. // // The GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) -// operation returns the transfer acceleration state of a bucket. +// action returns the transfer acceleration state of a bucket. // // After setting the Transfer Acceleration state of a bucket to Enabled, it // might take up to thirty minutes before the data transfer rates to the bucket @@ -7092,8 +7108,8 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon // To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // Special Errors // @@ -7227,7 +7243,7 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque // // For more information about CORS, go to Enabling Cross-Origin Resource Sharing // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon -// Simple Storage Service Developer Guide. +// S3 User Guide. // // Related Resources // @@ -7314,7 +7330,7 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r // PutBucketEncryption API operation for Amazon Simple Storage Service. // -// This operation uses the encryption subresource to configure default encryption +// This action uses the encryption subresource to configure default encryption // and Amazon S3 Bucket Key for an existing bucket. // // Default encryption for a bucket can use server-side encryption with Amazon @@ -7322,19 +7338,19 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r // specify default encryption using SSE-KMS, you can also configure Amazon S3 // Bucket Key. For information about default encryption, see Amazon S3 default // bucket encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon Simple Storage Service Developer Guide. For more information -// about S3 Bucket Keys, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. For more information about S3 Bucket Keys, see +// Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) +// in the Amazon S3 User Guide. // -// This operation requires AWS Signature Version 4. For more information, see -// Authenticating Requests (AWS Signature Version 4) (sig-v4-authenticating-requests.html). +// This action requires AWS Signature Version 4. For more information, see Authenticating +// Requests (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html). // // To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // Related Resources // @@ -7415,7 +7431,8 @@ func (c *S3) PutBucketIntelligentTieringConfigurationRequest(input *PutBucketInt // PutBucketIntelligentTieringConfiguration API operation for Amazon Simple Storage Service. // -// Puts a S3 Intelligent-Tiering configuration to the specified bucket. +// Puts a S3 Intelligent-Tiering configuration to the specified bucket. You +// can have up to 1,000 S3 Intelligent-Tiering configurations per bucket. // // The S3 Intelligent-Tiering storage class is designed to optimize storage // costs by automatically moving data to the most cost-effective storage access @@ -7442,6 +7459,22 @@ func (c *S3) PutBucketIntelligentTieringConfigurationRequest(input *PutBucketInt // // * ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) // +// You only need S3 Intelligent-Tiering enabled on a bucket if you want to automatically +// move objects stored in the S3 Intelligent-Tiering storage class to the Archive +// Access or Deep Archive Access tier. +// +// Special Errors +// +// * HTTP 400 Bad Request Error Code: InvalidArgument Cause: Invalid Argument +// +// * HTTP 400 Bad Request Error Code: TooManyConfigurations Cause: You are +// attempting to create a new configuration but have already reached the +// 1,000-configuration limit. +// +// * HTTP 403 Forbidden Error Code: AccessDenied Cause: You are not the owner +// of the specified bucket, or you do not have the s3:PutIntelligentTieringConfiguration +// bucket permission to set the configuration on the bucket. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -7515,9 +7548,9 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. // -// This implementation of the PUT operation adds an inventory configuration -// (identified by the inventory ID) to the bucket. You can have up to 1,000 -// inventory configurations per bucket. +// This implementation of the PUT action adds an inventory configuration (identified +// by the inventory ID) to the bucket. You can have up to 1,000 inventory configurations +// per bucket. // // Amazon S3 inventory generates inventories of the objects in the bucket on // a daily or weekly basis, and the results are published to a flat file. The @@ -7530,7 +7563,7 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // the inventory daily or weekly. You can also configure what object metadata // to include and whether to inventory all object versions or only current versions. // For more information, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // You must create a bucket policy on the destination bucket to grant permissions // to Amazon S3 to write objects to the bucket in the defined location. For @@ -7540,9 +7573,9 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration // action. The bucket owner has this permission by default and can grant this // permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // Special Errors // @@ -7654,7 +7687,7 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // Creates a new lifecycle configuration for the bucket or replaces an existing // lifecycle configuration. For information about lifecycle configuration, see // Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // By default, all Amazon S3 resources, including buckets, objects, and related // subresources (for example, lifecycle configuration and website configuration) @@ -7675,8 +7708,8 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // * s3:PutLifecycleConfiguration // // For more information about permissions, see Managing Access Permissions to -// your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // For more examples of transitioning objects to storage classes such as STANDARD_IA // or ONEZONE_IA, see Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#lifecycle-configuration-examples). @@ -7692,9 +7725,9 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // * By default, a resource owner—in this case, a bucket owner, which is // the AWS account that created the bucket—can perform any of the operations. // A resource owner can also grant others permission to perform the operation. -// For more information, see the following topics in the Amazon Simple Storage -// Service Developer Guide: Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) +// For more information, see the following topics in the Amazon S3 User Guide: +// Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) +// Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7779,7 +7812,7 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // // Creates a new lifecycle configuration for the bucket or replaces an existing // lifecycle configuration. For information about lifecycle configuration, see -// Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // Bucket lifecycle configuration now supports specifying a lifecycle rule using // an object key name prefix, one or more object tags, or a combination of both. @@ -7831,7 +7864,7 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // * s3:PutLifecycleConfiguration // // For more information about permissions, see Managing Access Permissions to -// Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // The following are related to PutBucketLifecycleConfiguration: // @@ -8048,8 +8081,8 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu // To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration // action. The bucket owner has this permission by default. The bucket owner // can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // For information about CloudWatch request metrics for Amazon S3, see Monitoring // Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). @@ -8245,8 +8278,8 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // // // -// This operation replaces the existing notification configuration with the -// configuration you include in the request body. +// This action replaces the existing notification configuration with the configuration +// you include in the request body. // // After Amazon S3 receives this request, it first verifies that any Amazon // Simple Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon @@ -8266,8 +8299,8 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // The PUT notification is an atomic operation. For example, suppose your notification // configuration includes SNS topic, SQS queue, and Lambda function configurations. // When you send a PUT request with this configuration, Amazon S3 sends test -// messages to your SNS topic. If the message fails, the entire PUT operation -// will fail, and Amazon S3 will not add the configuration to your bucket. +// messages to your SNS topic. If the message fails, the entire PUT action will +// fail, and Amazon S3 will not add the configuration to your bucket. // // Responses // @@ -8276,7 +8309,7 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // will also include the x-amz-sns-test-message-id header containing the message // ID of the test notification sent to the topic. // -// The following operation is related to PutBucketNotificationConfiguration: +// The following action is related to PutBucketNotificationConfiguration: // // * GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) // @@ -8552,8 +8585,8 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) // in the Amazon S3 Developer Guide. // -// To perform this operation, the user or role performing the operation must -// have the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) +// To perform this operation, the user or role performing the action must have +// the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) // permission. // // Specify the replication configuration in the request body. In the replication @@ -8583,7 +8616,7 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // bucket, can perform this operation. The resource owner can also grant others // permissions to perform the operation. For more information about permissions, // see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // Handling Replication of Encrypted Objects // @@ -8786,8 +8819,8 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // To use this operation, you must have permissions to perform the s3:PutBucketTagging // action. The bucket owner has this permission by default and can grant this // permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). // // PutBucketTagging has the following special errors: // @@ -8801,7 +8834,7 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // match the schema. // // * Error code: OperationAbortedError Description: A conflicting conditional -// operation is currently in progress against this resource. Please try again. +// action is currently in progress against this resource. Please try again. // // * Error code: InternalError Description: The service was unable to apply // the provided tag to the bucket. @@ -9008,7 +9041,7 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request // document and any redirect rules. For more information, see Hosting Websites // on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). // -// This PUT operation requires the S3:PutBucketWebsite permission. By default, +// This PUT action requires the S3:PutBucketWebsite permission. By default, // only the bucket owner can configure the website attached to a bucket; however, // bucket owners can allow other users to set the website configuration by writing // a bucket policy that grants them the S3:PutBucketWebsite permission. @@ -9067,7 +9100,7 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request // Amazon S3 has a limitation of 50 routing rules per website configuration. // If you require more than 50 routing rules, you can use object redirect. For // more information, see Configuring an Object Redirect (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9174,7 +9207,7 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // If you request server-side encryption using AWS Key Management Service (SSE-KMS), // you can enable an S3 Bucket Key at the object-level. For more information, // see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Access Control List (ACL)-Specific Request Headers // @@ -9293,7 +9326,7 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // for a new or existing object in an S3 bucket. You must have WRITE_ACP permission // to set the ACL of an object. For more information, see What permissions can // I grant? (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // This action is not supported by Amazon S3 on Outposts. // @@ -9741,7 +9774,7 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // // * Code: MalformedXMLError Cause: The XML provided does not match the schema. // -// * Code: OperationAbortedError Cause: A conflicting conditional operation +// * Code: OperationAbortedError Cause: A conflicting conditional action // is currently in progress against this resource. Please try again. // // * Code: InternalError Cause: The service was unable to apply the provided @@ -9751,6 +9784,8 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // // * GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) // +// * DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -9938,9 +9973,9 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // To use this operation, you must have permissions to perform the s3:RestoreObject // action. The bucket owner has this permission by default and can grant this // permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) -// in the Amazon Simple Storage Service Developer Guide. +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) +// in the Amazon S3 User Guide. // // Querying Archives with Select Requests // @@ -9950,7 +9985,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // queries and custom analytics on your archived data without having to restore // your data to a hotter Amazon S3 tier. For an overview about select requests, // see Querying Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // When making a select request, do the following: // @@ -9961,13 +9996,12 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // the storage class and encryption for the output objects stored in the // bucket. For more information about output, see Querying Archived Objects // (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) -// in the Amazon Simple Storage Service Developer Guide. For more information -// about the S3 structure in the request body, see the following: PutObject -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) Managing -// Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) -// in the Amazon Simple Storage Service Developer Guide Protecting Data Using -// Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon Simple Storage Service Developer Guide +// in the Amazon S3 User Guide. For more information about the S3 structure +// in the request body, see the following: PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) +// Managing Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) +// in the Amazon S3 User Guide Protecting Data Using Server-Side Encryption +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) +// in the Amazon S3 User Guide // // * Define the SQL expression for the SELECT type of restoration for your // query in the request body's SelectParameters structure. You can use expressions @@ -9983,7 +10017,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // For more information about using SQL with S3 Glacier Select restore, see // SQL Reference for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // When making a select request, you can also do the following: // @@ -10054,19 +10088,19 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // For more information about archive retrieval options and provisioned capacity // for Expedited data access, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // You can use Amazon S3 restore speed upgrade to change the restore speed to // a faster speed while it is in progress. For more information, see Upgrading // the speed of an in-progress restore (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // To get the status of object restoration, you can send a HEAD request. Operations // return the x-amz-restore header, which provides information about the restoration // status, in the response. You can use Amazon S3 event notifications to notify // you when a restore is initiated or completed. For more information, see Configuring // Amazon S3 Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // After restoring an archived object, you can update the restoration period // by reissuing the request with a new period. Amazon S3 updates the restoration @@ -10081,11 +10115,11 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // the object in 3 days. For more information about lifecycle configuration, // see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) // and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in Amazon Simple Storage Service Developer Guide. +// in Amazon S3 User Guide. // // Responses // -// A successful operation returns either the 200 OK or 202 Accepted status code. +// A successful action returns either the 200 OK or 202 Accepted status code. // // * If the object is not previously restored, then Amazon S3 returns 202 // Accepted in the response. @@ -10112,7 +10146,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // * GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) // // * SQL Reference for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon Simple Storage Service Developer Guide +// in the Amazon S3 User Guide // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -10123,7 +10157,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // Returned Error Codes: // * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" -// This operation is not allowed against this storage tier. +// This action is not allowed against this storage tier. // // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { @@ -10200,7 +10234,7 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // SelectObjectContent API operation for Amazon Simple Storage Service. // -// This operation filters the contents of an Amazon S3 object based on a simple +// This action filters the contents of an Amazon S3 object based on a simple // structured query language (SQL) statement. In the request, along with the // SQL expression, you must also specify a data serialization format (JSON, // CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse @@ -10212,18 +10246,18 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // // For more information about Amazon S3 Select, see Selecting Content from Objects // (https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // For more information about using SQL with Amazon S3 Select, see SQL Reference // for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Permissions // // You must have s3:GetObject permission for this operation. Amazon S3 Select // does not support anonymous access. For more information about permissions, // see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Object Data Formats // @@ -10246,13 +10280,13 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // you must use the headers that are documented in the GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). // For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided // Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// in the Amazon Simple Storage Service Developer Guide. For objects that -// are encrypted with Amazon S3 managed encryption keys (SSE-S3) and customer -// master keys (CMKs) stored in AWS Key Management Service (SSE-KMS), server-side -// encryption is handled transparently, so you don't need to specify anything. -// For more information about server-side encryption, including SSE-S3 and -// SSE-KMS, see Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. For objects that are encrypted with Amazon +// S3 managed encryption keys (SSE-S3) and customer master keys (CMKs) stored +// in AWS Key Management Service (SSE-KMS), server-side encryption is handled +// transparently, so you don't need to specify anything. For more information +// about server-side encryption, including SSE-S3 and SSE-KMS, see Protecting +// Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) +// in the Amazon S3 User Guide. // // Working with the Response Body // @@ -10263,8 +10297,8 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // // GetObject Support // -// The SelectObjectContent operation does not support the following GetObject -// functionality. For more information, see GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). +// The SelectObjectContent action does not support the following GetObject functionality. +// For more information, see GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). // // * Range: Although you can specify a scan range for an Amazon S3 Select // request (see SelectObjectContentRequest - ScanRange (https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange) @@ -10274,7 +10308,7 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r // * GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You cannot // specify the GLACIER, DEEP_ARCHIVE, or REDUCED_REDUNDANCY storage classes. // For more information, about storage classes see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#storage-class-intro) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Special Errors // @@ -10567,11 +10601,11 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // // For more information on multipart uploads, go to Multipart Upload Overview // (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html) in the -// Amazon Simple Storage Service Developer Guide . +// Amazon S3 User Guide . // // For information on the permissions required to use the multipart upload API, -// go to Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon Simple Storage Service Developer Guide. +// go to Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) +// in the Amazon S3 User Guide. // // You can optionally request server-side encryption where Amazon S3 encrypts // your data as it writes it to disks in its data centers and decrypts it for @@ -10581,7 +10615,7 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // match the headers you used in the request to initiate the upload by using // CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html). // For more information, go to Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Server-side encryption is supported by the S3 Multipart Upload actions. Unless // you are using a customer-provided encryption key, you don't need to specify @@ -10697,10 +10731,10 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // // The minimum allowable part size for a multipart upload is 5 MB. For more // information about multipart upload limits, go to Quick Facts (https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Instead of using an existing object as part data, you might use the UploadPart -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) operation +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) action // and provide data in your request. // // You must initiate a multipart upload before you can upload any part. In response @@ -10711,15 +10745,15 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // // * For conceptual information about multipart uploads, see Uploading Objects // Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // * For information about permissions required to use the multipart upload -// API, see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon Simple Storage Service Developer Guide. +// API, see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) +// in the Amazon S3 User Guide. // -// * For information about copying objects using a single atomic operation -// vs. the multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) -// in the Amazon Simple Storage Service Developer Guide. +// * For information about copying objects using a single atomic action vs. +// the multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) +// in the Amazon S3 User Guide. // // * For information about using server-side encryption with customer-provided // encryption keys with the UploadPartCopy operation, see CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) @@ -10808,6 +10842,97 @@ func (c *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInp return out, req.Send() } +const opWriteGetObjectResponse = "WriteGetObjectResponse" + +// WriteGetObjectResponseRequest generates a "aws/request.Request" representing the +// client's request for the WriteGetObjectResponse operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See WriteGetObjectResponse for more information on using the WriteGetObjectResponse +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the WriteGetObjectResponseRequest method. +// req, resp := client.WriteGetObjectResponseRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WriteGetObjectResponse +func (c *S3) WriteGetObjectResponseRequest(input *WriteGetObjectResponseInput) (req *request.Request, output *WriteGetObjectResponseOutput) { + op := &request.Operation{ + Name: opWriteGetObjectResponse, + HTTPMethod: "POST", + HTTPPath: "/WriteGetObjectResponse", + } + + if input == nil { + input = &WriteGetObjectResponseInput{} + } + + output = &WriteGetObjectResponseOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Sign.Remove(v4.SignRequestHandler) + handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) + req.Handlers.Sign.PushFrontNamed(handler) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{RequestRoute}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// WriteGetObjectResponse API operation for Amazon Simple Storage Service. +// +// Passes transformed objects to a GetObject operation when using Object Lambda +// Access Points. For information about Object Lambda Access Points, see Transforming +// objects with Object Lambda Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html) +// in the Amazon S3 User Guide. +// +// This operation supports metadata that can be returned by GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html), +// in addition to RequestRoute, RequestToken, StatusCode, ErrorCode, and ErrorMessage. +// The GetObject response metadata is supported so that the WriteGetObjectResponse +// caller, typically an AWS Lambda function, can provide the same metadata when +// it internally invokes GetObject. When WriteGetObjectResponse is called by +// a customer-owned Lambda function, the metadata returned to the end user GetObject +// call might differ from what Amazon S3 would normally return. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation WriteGetObjectResponse for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WriteGetObjectResponse +func (c *S3) WriteGetObjectResponse(input *WriteGetObjectResponseInput) (*WriteGetObjectResponseOutput, error) { + req, out := c.WriteGetObjectResponseRequest(input) + return out, req.Send() +} + +// WriteGetObjectResponseWithContext is the same as WriteGetObjectResponse with the addition of +// the ability to pass a context and additional request options. +// +// See WriteGetObjectResponse for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3) WriteGetObjectResponseWithContext(ctx aws.Context, input *WriteGetObjectResponseInput, opts ...request.Option) (*WriteGetObjectResponseOutput, error) { + req, out := c.WriteGetObjectResponseRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + // Specifies the days since the initiation of an incomplete multipart upload // that Amazon S3 will wait before permanently removing all parts of the upload. // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket @@ -10842,25 +10967,25 @@ type AbortMultipartUploadInput struct { // The bucket name to which the upload was taking place. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -11656,6 +11781,9 @@ type CORSRule struct { // object). ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"` + // Unique identifier for the rule. The value cannot be longer than 255 characters. + ID *string `type:"string"` + // The time in seconds that your browser is to cache the preflight response // for the specified resource. MaxAgeSeconds *int64 `type:"integer"` @@ -11711,6 +11839,12 @@ func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { return s } +// SetID sets the ID field's value. +func (s *CORSRule) SetID(v string) *CORSRule { + s.ID = &v + return s +} + // SetMaxAgeSeconds sets the MaxAgeSeconds field's value. func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { s.MaxAgeSeconds = &v @@ -11991,7 +12125,7 @@ type CompleteMultipartUploadInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -12127,19 +12261,19 @@ type CompleteMultipartUploadOutput struct { // The name of the bucket that contains the newly created object. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. Bucket *string `type:"string"` @@ -12341,6 +12475,10 @@ type Condition struct { // the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals // is not specified. If both conditions are specified, both must be true for // the redirect to be applied. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). KeyPrefixEquals *string `type:"string"` } @@ -12409,19 +12547,19 @@ type CopyObjectInput struct { // The name of the destination bucket. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -12432,8 +12570,8 @@ type CopyObjectInput struct { // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with // SSE-KMS. // - // Specifying this header with a COPY operation doesn’t affect bucket-level - // settings for S3 Bucket Key. + // Specifying this header with a COPY action doesn’t affect bucket-level settings + // for S3 Bucket Key. BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` // Specifies caching behavior along the request/reply chain. @@ -12455,7 +12593,7 @@ type CopyObjectInput struct { // Specifies the source object for the copy operation. You specify the value // in one of two formats, depending on whether you want to access the source - // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html): + // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html): // // * For objects not accessed through an access point, specify the name of // the source bucket and the key of the source object, separated by a slash @@ -12513,12 +12651,12 @@ type CopyObjectInput struct { // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - // The account id of the expected destination bucket owner. If the destination + // The account ID of the expected destination bucket owner. If the destination // bucket is owned by a different account, the request will fail with an HTTP // 403 (Access Denied) error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - // The account id of the expected source bucket owner. If the source bucket + // The account ID of the expected source bucket owner. If the source bucket // is owned by a different account, the request will fail with an HTTP 403 (Access // Denied) error. ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` @@ -13083,10 +13221,10 @@ type CopyObjectResult struct { // Returns the ETag of the new object. The ETag reflects only changes to the // contents of an object, not its metadata. The source and destination ETag - // is identical for a successfully copied object. + // is identical for a successfully copied non-multipart object. ETag *string `type:"string"` - // Returns the date that the object was last modified. + // Creation date of the object. LastModified *time.Time `type:"timestamp"` } @@ -13326,19 +13464,19 @@ type CreateMultipartUploadInput struct { // The name of the bucket to which to initiate the upload // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -13349,7 +13487,7 @@ type CreateMultipartUploadInput struct { // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with // SSE-KMS. // - // Specifying this header with an object operation doesn’t affect bucket-level + // Specifying this header with an object action doesn’t affect bucket-level // settings for S3 Bucket Key. BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` @@ -13370,7 +13508,7 @@ type CreateMultipartUploadInput struct { // A standard MIME type describing the format of the object data. ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -13447,7 +13585,7 @@ type CreateMultipartUploadInput struct { // object encryption. All GET and PUT requests for an object protected by AWS // KMS will fail if not made via SSL or using SigV4. For information about configuring // using any of the officially supported AWS SDKs and AWS CLI, see Specifying - // the Signature Version in Request Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // the Signature Version in Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) // in the Amazon S3 Developer Guide. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` @@ -13740,19 +13878,19 @@ type CreateMultipartUploadOutput struct { // The name of the bucket to which the multipart upload was initiated. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. Bucket *string `locationName:"Bucket" type:"string"` @@ -13995,7 +14133,7 @@ type DeleteBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14109,7 +14247,7 @@ type DeleteBucketCorsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14210,7 +14348,7 @@ type DeleteBucketEncryptionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14310,7 +14448,7 @@ type DeleteBucketInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14500,7 +14638,7 @@ type DeleteBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14614,7 +14752,7 @@ type DeleteBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14714,7 +14852,7 @@ type DeleteBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14842,7 +14980,7 @@ type DeleteBucketOwnershipControlsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -14942,7 +15080,7 @@ type DeleteBucketPolicyInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15042,7 +15180,7 @@ type DeleteBucketReplicationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15142,7 +15280,7 @@ type DeleteBucketTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15242,7 +15380,7 @@ type DeleteBucketWebsiteInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15438,19 +15576,19 @@ type DeleteObjectInput struct { // The bucket name of the bucket containing the object. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -15460,7 +15598,7 @@ type DeleteObjectInput struct { // to process this operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15644,30 +15782,31 @@ type DeleteObjectTaggingInput struct { // The bucket name containing the objects from which to remove the tags. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - // Name of the object key. + // The key that identifies the object in the bucket from which to remove all + // tags. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -15794,19 +15933,19 @@ type DeleteObjectsInput struct { // The bucket name containing the objects to delete. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -15822,7 +15961,7 @@ type DeleteObjectsInput struct { // Delete is a required field Delete *Delete `locationName:"Delete" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -15952,7 +16091,7 @@ type DeleteObjectsOutput struct { // was successfully deleted. Deleted []*DeletedObject `type:"list" flattened:"true"` - // Container for a failed delete operation that describes the object that Amazon + // Container for a failed delete action that describes the object that Amazon // S3 attempted to delete and the error it encountered. Errors []*Error `locationName:"Error" type:"list" flattened:"true"` @@ -15997,7 +16136,7 @@ type DeletePublicAccessBlockInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -16423,9 +16562,9 @@ type Error struct { // Forbidden SOAP Fault Code Prefix: Client // // * Code: AccountProblem Description: There is a problem with your AWS account - // that prevents the operation from completing successfully. Contact AWS - // Support for further assistance. HTTP Status Code: 403 Forbidden SOAP Fault - // Code Prefix: Client + // that prevents the action from completing successfully. Contact AWS Support + // for further assistance. HTTP Status Code: 403 Forbidden SOAP Fault Code + // Prefix: Client // // * Code: AllAccessDisabled Description: All access to this Amazon S3 resource // has been disabled. Contact AWS Support for further assistance. HTTP Status @@ -16528,9 +16667,9 @@ type Error struct { // Select a Region for Your Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro). // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client // - // * Code: InvalidObjectState Description: The operation is not valid for - // the current state of the object. HTTP Status Code: 403 Forbidden SOAP - // Fault Code Prefix: Client + // * Code: InvalidObjectState Description: The action is not valid for the + // current state of the object. HTTP Status Code: 403 Forbidden SOAP Fault + // Code Prefix: Client // // * Code: InvalidPart Description: One or more of the specified parts could // not be found. The part might not have been uploaded, or the specified @@ -16695,7 +16834,7 @@ type Error struct { // can sign up at the following URL: https://aws.amazon.com/s3 HTTP Status // Code: 403 Forbidden SOAP Fault Code Prefix: Client // - // * Code: OperationAborted Description: A conflicting conditional operation + // * Code: OperationAborted Description: A conflicting conditional action // is currently in progress against this resource. Try again. HTTP Status // Code: 409 Conflict SOAP Fault Code Prefix: Client // @@ -16821,6 +16960,10 @@ type ErrorDocument struct { // The object key name to use when a 4XX class error occurs. // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + // // Key is a required field Key *string `min:"1" type:"string" required:"true"` } @@ -16942,7 +17085,7 @@ type GetBucketAccelerateConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17051,7 +17194,7 @@ type GetBucketAclInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17169,7 +17312,7 @@ type GetBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17292,7 +17435,7 @@ type GetBucketCorsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17403,7 +17546,7 @@ type GetBucketEncryptionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17625,7 +17768,7 @@ type GetBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17748,7 +17891,7 @@ type GetBucketLifecycleConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17857,7 +18000,7 @@ type GetBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -17966,7 +18109,7 @@ type GetBucketLocationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18077,7 +18220,7 @@ type GetBucketLoggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18189,7 +18332,7 @@ type GetBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18312,7 +18455,7 @@ type GetBucketNotificationConfigurationRequest struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18398,7 +18541,7 @@ type GetBucketOwnershipControlsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18508,7 +18651,7 @@ type GetBucketPolicyInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18617,7 +18760,7 @@ type GetBucketPolicyStatusInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18726,7 +18869,7 @@ type GetBucketReplicationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18836,7 +18979,7 @@ type GetBucketRequestPaymentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -18945,7 +19088,7 @@ type GetBucketTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19056,7 +19199,7 @@ type GetBucketVersioningInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19176,7 +19319,7 @@ type GetBucketWebsiteInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19310,17 +19453,17 @@ type GetObjectAclInput struct { // The bucket name that contains the object for which to get the ACL information. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19484,25 +19627,25 @@ type GetObjectInput struct { // The bucket name containing the object. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19565,14 +19708,14 @@ type GetObjectInput struct { // Sets the Expires header of the response. ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp" timestampFormat:"rfc822"` - // Specifies the algorithm to use to when encrypting the object (for example, + // Specifies the algorithm to use to when decrypting the object (for example, // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm + // Specifies the customer-provided encryption key for Amazon S3 used to encrypt + // the data. This value is used to decrypt the object when recovering it and + // must match the one used when storing the data. The key must be appropriate + // for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` @@ -19784,17 +19927,17 @@ type GetObjectLegalHoldInput struct { // The bucket name containing the object whose Legal Hold status you want to // retrieve. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -19939,17 +20082,17 @@ type GetObjectLockConfigurationInput struct { // The bucket whose Object Lock configuration you want to retrieve. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -20103,7 +20246,7 @@ type GetObjectOutput struct { // The date and time at which the object is no longer cacheable. Expires *string `location:"header" locationName:"Expires" type:"string"` - // Last modified date of the object + // Creation date of the object. LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` // A map of metadata to store with the object in S3. @@ -20140,7 +20283,7 @@ type GetObjectOutput struct { // request. RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - // Provides information about object restoration operation and expiration time + // Provides information about object restoration action and expiration time // of the restored object copy. Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` @@ -20387,17 +20530,17 @@ type GetObjectRetentionInput struct { // The bucket name containing the object whose retention settings you want to // retrieve. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -20542,25 +20685,25 @@ type GetObjectTaggingInput struct { // The bucket name containing the object for which to get the tagging information. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -20570,6 +20713,13 @@ type GetObjectTaggingInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + // The versionId of the object for which to get the tagging information. VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -20631,6 +20781,12 @@ func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { return s } +// SetRequestPayer sets the RequestPayer field's value. +func (s *GetObjectTaggingInput) SetRequestPayer(v string) *GetObjectTaggingInput { + s.RequestPayer = &v + return s +} + // SetVersionId sets the VersionId field's value. func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { s.VersionId = &v @@ -20707,7 +20863,7 @@ type GetObjectTorrentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -20857,7 +21013,7 @@ type GetPublicAccessBlockInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -21149,25 +21305,25 @@ type HeadBucketInput struct { // The bucket name. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -21264,25 +21420,25 @@ type HeadObjectInput struct { // The name of the bucket containing the object. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -21555,7 +21711,7 @@ type HeadObjectOutput struct { // The date and time at which the object is no longer cacheable. Expires *string `location:"header" locationName:"Expires" type:"string"` - // Last modified date of the object + // Creation date of the object. LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` // A map of metadata to store with the object in S3. @@ -21881,6 +22037,10 @@ type IndexDocument struct { // with the key name images/index.html) The suffix must not be empty and must // not include a slash character. // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + // // Suffix is a required field Suffix *string `type:"string" required:"true"` } @@ -22164,6 +22324,10 @@ type IntelligentTieringFilter struct { // An object key name prefix that identifies the subset of objects to which // the rule applies. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). Prefix *string `type:"string"` // A container of a key value name pair. @@ -22911,6 +23075,10 @@ type LifecycleRule struct { // Prefix identifying one or more objects to which the rule applies. This is // No longer used; use Filter instead. // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + // // Deprecated: Prefix has been deprecated Prefix *string `deprecated:"true" type:"string"` @@ -23073,6 +23241,10 @@ type LifecycleRuleFilter struct { And *LifecycleRuleAndOperator `type:"structure"` // Prefix identifying one or more objects to which the rule applies. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). Prefix *string `type:"string"` // This tag must exist in the object's tag set in order for the rule to apply. @@ -23139,7 +23311,7 @@ type ListBucketAnalyticsConfigurationsInput struct { // should begin. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -23433,7 +23605,7 @@ type ListBucketInventoryConfigurationsInput struct { // that Amazon S3 understands. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -23586,7 +23758,7 @@ type ListBucketMetricsConfigurationsInput struct { // value that Amazon S3 understands. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -23777,19 +23949,19 @@ type ListMultipartUploadsInput struct { // The name of the bucket to which the multipart upload was initiated. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -23813,7 +23985,7 @@ type ListMultipartUploadsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -24125,7 +24297,7 @@ type ListObjectVersionsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -24134,7 +24306,7 @@ type ListObjectVersionsInput struct { KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` // Sets the maximum number of keys returned in the response. By default the - // API returns up to 1,000 key names. The response might contain fewer keys + // action returns up to 1,000 key names. The response might contain fewer keys // but will never contain more. If additional keys satisfy the search criteria, // but were not returned because max-keys was exceeded, the response contains // true. To return the additional keys, see key-marker @@ -24417,19 +24589,19 @@ type ListObjectsInput struct { // The name of the bucket containing the objects. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -24446,7 +24618,7 @@ type ListObjectsInput struct { // keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -24455,7 +24627,7 @@ type ListObjectsInput struct { Marker *string `location:"querystring" locationName:"marker" type:"string"` // Sets the maximum number of keys returned in the response. By default the - // API returns up to 1,000 key names. The response might contain fewer keys + // action returns up to 1,000 key names. The response might contain fewer keys // but will never contain more. MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` @@ -24579,8 +24751,8 @@ func (s ListObjectsInput) updateArnableField(v string) (interface{}, error) { type ListObjectsOutput struct { _ struct{} `type:"structure"` - // All of the keys rolled up in a common prefix count as a single return when - // calculating the number of returns. + // All of the keys (up to 1,000) rolled up in a common prefix count as a single + // return when calculating the number of returns. // // A response can contain CommonPrefixes only if you specify a delimiter. // @@ -24711,19 +24883,19 @@ type ListObjectsV2Input struct { // Bucket name to list. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -24740,7 +24912,7 @@ type ListObjectsV2Input struct { // Encoding type used by Amazon S3 to encode object keys in the response. EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -24751,7 +24923,7 @@ type ListObjectsV2Input struct { FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` // Sets the maximum number of keys returned in the response. By default the - // API returns up to 1,000 key names. The response might contain fewer keys + // action returns up to 1,000 key names. The response might contain fewer keys // but will never contain more. MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` @@ -24891,8 +25063,8 @@ func (s ListObjectsV2Input) updateArnableField(v string) (interface{}, error) { type ListObjectsV2Output struct { _ struct{} `type:"structure"` - // All of the keys rolled up into a common prefix count as a single return when - // calculating the number of returns. + // All of the keys (up to 1,000) rolled up into a common prefix count as a single + // return when calculating the number of returns. // // A response can contain CommonPrefixes only if you specify a delimiter. // @@ -24936,30 +25108,30 @@ type ListObjectsV2Output struct { IsTruncated *bool `type:"boolean"` // KeyCount is the number of keys returned with this request. KeyCount will - // always be less than equals to MaxKeys field. Say you ask for 50 keys, your - // result will include less than equals 50 keys + // always be less than or equals to MaxKeys field. Say you ask for 50 keys, + // your result will include less than equals 50 keys KeyCount *int64 `type:"integer"` // Sets the maximum number of keys returned in the response. By default the - // API returns up to 1,000 key names. The response might contain fewer keys + // action returns up to 1,000 key names. The response might contain fewer keys // but will never contain more. MaxKeys *int64 `type:"integer"` // The bucket name. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. Name *string `type:"string"` @@ -25063,25 +25235,25 @@ type ListPartsInput struct { // The name of the bucket to which the parts are being uploaded. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -26195,7 +26367,7 @@ type Object struct { // the object. Key *string `min:"1" type:"string"` - // The date the Object was Last Modified + // Creation date of the object. LastModified *time.Time `type:"timestamp"` // The owner of the object @@ -26258,7 +26430,11 @@ func (s *Object) SetStorageClass(v string) *Object { type ObjectIdentifier struct { _ struct{} `type:"structure"` - // Key name of the object to delete. + // Key name of the object. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). // // Key is a required field Key *string `min:"1" type:"string" required:"true"` @@ -26899,7 +27075,7 @@ func (s *ProgressEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstr // S3 bucket. You can enable the configuration options in any combination. For // more information about when Amazon S3 considers a bucket or object public, // see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type PublicAccessBlockConfiguration struct { _ struct{} `type:"structure"` @@ -26990,7 +27166,7 @@ type PutBucketAccelerateConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27105,7 +27281,7 @@ type PutBucketAclInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27273,7 +27449,7 @@ type PutBucketAnalyticsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27404,12 +27580,12 @@ type PutBucketCorsInput struct { // Describes the cross-origin access configuration for objects in an Amazon // S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon - // Simple Storage Service Developer Guide. + // S3 User Guide. // // CORSConfiguration is a required field CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27527,7 +27703,7 @@ type PutBucketEncryptionInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27769,7 +27945,7 @@ type PutBucketInventoryConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -27902,7 +28078,7 @@ type PutBucketLifecycleConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28014,7 +28190,7 @@ type PutBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28133,7 +28309,7 @@ type PutBucketLoggingInput struct { // BucketLoggingStatus is a required field BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28247,7 +28423,7 @@ type PutBucketMetricsConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28380,7 +28556,7 @@ type PutBucketNotificationConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28500,7 +28676,7 @@ type PutBucketNotificationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28614,7 +28790,7 @@ type PutBucketOwnershipControlsInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28738,7 +28914,7 @@ type PutBucketPolicyInput struct { // to change this bucket policy in the future. ConfirmRemoveSelfBucketAccess *bool `location:"header" locationName:"x-amz-confirm-remove-self-bucket-access" type:"boolean"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28858,7 +29034,7 @@ type PutBucketReplicationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -28987,7 +29163,7 @@ type PutBucketRequestPaymentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29106,7 +29282,7 @@ type PutBucketTaggingInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29225,7 +29401,7 @@ type PutBucketVersioningInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29349,7 +29525,7 @@ type PutBucketWebsiteInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29473,17 +29649,17 @@ type PutObjectAclInput struct { // The bucket name that contains the object to which you want to attach the // ACL. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29512,21 +29688,21 @@ type PutObjectAclInput struct { // This action is not supported by Amazon S3 on Outposts. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - // Key for which the PUT operation was initiated. + // Key for which the PUT action was initiated. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Key is a required field @@ -29722,21 +29898,21 @@ type PutObjectInput struct { // Object data. Body io.ReadSeeker `type:"blob"` - // The bucket name to which the PUT operation was initiated. + // The bucket name to which the PUT action was initiated. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -29747,8 +29923,8 @@ type PutObjectInput struct { // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with // SSE-KMS. // - // Specifying this header with a PUT operation doesn’t affect bucket-level - // settings for S3 Bucket Key. + // Specifying this header with a PUT action doesn’t affect bucket-level settings + // for S3 Bucket Key. BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` // Can be used to specify caching behavior along the request/reply chain. For @@ -29786,7 +29962,7 @@ type PutObjectInput struct { // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -29815,7 +29991,7 @@ type PutObjectInput struct { // This action is not supported by Amazon S3 on Outposts. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - // Object key for which the PUT operation was initiated. + // Object key for which the PUT action was initiated. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -30181,17 +30357,17 @@ type PutObjectLegalHoldInput struct { // The bucket name containing the object that you want to place a Legal Hold // on. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -30350,7 +30526,7 @@ type PutObjectLockConfigurationInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -30611,20 +30787,20 @@ type PutObjectRetentionInput struct { // The bucket name that contains the object you want to apply this Object Retention // configuration to. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Indicates whether this operation should bypass Governance-mode restrictions. + // Indicates whether this action should bypass Governance-mode restrictions. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -30787,25 +30963,25 @@ type PutObjectTaggingInput struct { // The bucket name containing the object. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -30815,6 +30991,13 @@ type PutObjectTaggingInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. + RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + // Container for the TagSet and Tag elements // // Tagging is a required field @@ -30889,6 +31072,12 @@ func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { return s } +// SetRequestPayer sets the RequestPayer field's value. +func (s *PutObjectTaggingInput) SetRequestPayer(v string) *PutObjectTaggingInput { + s.RequestPayer = &v + return s +} + // SetTagging sets the Tagging field's value. func (s *PutObjectTaggingInput) SetTagging(v *Tagging) *PutObjectTaggingInput { s.Tagging = v @@ -30960,7 +31149,7 @@ type PutPublicAccessBlockInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -31158,7 +31347,7 @@ type QueueConfigurationDeprecated struct { // Deprecated: Event has been deprecated Event *string `deprecated:"true" type:"string" enum:"Event"` - // A collection of bucket events for which to send notifications + // A collection of bucket events for which to send notifications. Events []*string `locationName:"Event" type:"list" flattened:"true"` // An optional unique identifier for configurations in a notification configuration. @@ -31275,11 +31464,19 @@ type Redirect struct { // and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required // if one of the siblings is present. Can be present only if ReplaceKeyWith // is not provided. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). ReplaceKeyPrefixWith *string `type:"string"` // The specific object key to use in the redirect request. For example, redirect // request to error.html. Not required if one of the siblings is present. Can // be present only if ReplaceKeyPrefixWith is not provided. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). ReplaceKeyWith *string `type:"string"` } @@ -31529,6 +31726,10 @@ type ReplicationRule struct { // the rule applies. The maximum prefix length is 1,024 characters. To include // all objects in a bucket, specify an empty string. // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + // // Deprecated: Prefix has been deprecated Prefix *string `deprecated:"true" type:"string"` @@ -31665,7 +31866,7 @@ func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { // an And tag. // // * If you specify a filter based on multiple tags, wrap the Tag elements -// in an And tag +// in an And tag. type ReplicationRuleAndOperator struct { _ struct{} `type:"structure"` @@ -31737,6 +31938,10 @@ type ReplicationRuleFilter struct { // An object key name prefix that identifies the subset of objects to which // the rule applies. + // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). Prefix *string `type:"string"` // A container for specifying a tag key and value. @@ -31946,30 +32151,30 @@ type RestoreObjectInput struct { // The bucket name containing the object to restore. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - // Object key for which the operation was initiated. + // Object key for which the action was initiated. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -32240,7 +32445,7 @@ func (s *RestoreRequest) SetType(v string) *RestoreRequest { // Specifies the redirect behavior and when a redirect is applied. For more // information about routing rules, see Configuring advanced conditional redirects // (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type RoutingRule struct { _ struct{} `type:"structure"` @@ -32296,7 +32501,7 @@ func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { // Specifies lifecycle rules for an Amazon S3 bucket. For more information, // see Put Bucket Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) // in the Amazon Simple Storage Service API Reference. For examples, see Put -// Bucket Lifecycle Configuration Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html#API_PutBucketLifecycleConfiguration_Examples) +// Bucket Lifecycle Configuration Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html#API_PutBucketLifecycleConfiguration_Examples). type Rule struct { _ struct{} `type:"structure"` @@ -32332,6 +32537,10 @@ type Rule struct { // Object key prefix that identifies one or more objects to which this rule // applies. // + // Replacement must be made for object keys containing special characters (such + // as carriage returns) when using XML requests. For more information, see XML + // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). + // // Prefix is a required field Prefix *string `type:"string" required:"true"` @@ -32344,7 +32553,7 @@ type Rule struct { // Specifies when an object transitions to a specified storage class. For more // information about Amazon S3 lifecycle configuration rules, see Transitioning // Objects Using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Transition *Transition `type:"structure"` } @@ -32703,7 +32912,7 @@ type SelectObjectContentInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -33168,7 +33377,7 @@ type ServerSideEncryptionRule struct { // S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. // // For more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. BucketKeyEnabled *bool `type:"boolean"` } @@ -33735,7 +33944,7 @@ type TopicConfiguration struct { // The Amazon S3 bucket event about which to send notifications. For more information, // see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` @@ -33868,7 +34077,7 @@ func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDep // Specifies when an object transitions to a specified storage class. For more // information about Amazon S3 lifecycle configuration rules, see Transitioning // Objects Using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type Transition struct { _ struct{} `type:"structure"` @@ -33917,19 +34126,19 @@ type UploadPartCopyInput struct { // The bucket name. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -33937,7 +34146,7 @@ type UploadPartCopyInput struct { // Specifies the source object for the copy operation. You specify the value // in one of two formats, depending on whether you want to access the source - // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html): + // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html): // // * For objects not accessed through an access point, specify the name of // the source bucket and key of the source object, separated by a slash (/). @@ -34001,12 +34210,12 @@ type UploadPartCopyInput struct { // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - // The account id of the expected destination bucket owner. If the destination + // The account ID of the expected destination bucket owner. If the destination // bucket is owned by a different account, the request will fail with an HTTP // 403 (Access Denied) error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - // The account id of the expected source bucket owner. If the source bucket + // The account ID of the expected source bucket owner. If the source bucket // is owned by a different account, the request will fail with an HTTP 403 (Access // Denied) error. ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` @@ -34359,19 +34568,19 @@ type UploadPartInput struct { // The name of the bucket to which the multipart upload was initiated. // - // When using this API with an access point, you must direct requests to the - // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this operation with an access point through the AWS SDKs, you - // provide the access point ARN in place of the bucket name. For more information - // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // When using this action with an access point, you must direct requests to + // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this action with an access point through the AWS SDKs, you provide + // the access point ARN in place of the bucket name. For more information about + // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) // in the Amazon Simple Storage Service Developer Guide. // - // When using this API with Amazon S3 on Outposts, you must direct requests + // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this operation using S3 on Outposts through the AWS SDKs, you provide + // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information - // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html) + // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -34386,7 +34595,7 @@ type UploadPartInput struct { // if object lock parameters are specified. ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` - // The account id of the expected bucket owner. If the bucket is owned by a + // The account ID of the expected bucket owner. If the bucket is owned by a // different account, the request will fail with an HTTP 403 (Access Denied) // error. ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` @@ -34793,6 +35002,451 @@ func (s *WebsiteConfiguration) SetRoutingRules(v []*RoutingRule) *WebsiteConfigu return s } +type WriteGetObjectResponseInput struct { + _ struct{} `locationName:"WriteGetObjectResponseRequest" type:"structure" payload:"Body"` + + // Indicates that a range of bytes was specified. + AcceptRanges *string `location:"header" locationName:"x-amz-fwd-header-accept-ranges" type:"string"` + + // The object data. + // + // To use an non-seekable io.Reader for this request wrap the io.Reader with + // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable + // readers. This will allow the SDK to send the reader's payload as chunked + // transfer encoding. + Body io.ReadSeeker `type:"blob"` + + // Indicates whether the object stored in Amazon S3 uses an S3 bucket key for + // server-side encryption with AWS KMS (SSE-KMS). + BucketKeyEnabled *bool `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` + + // Specifies caching behavior along the request/reply chain. + CacheControl *string `location:"header" locationName:"x-amz-fwd-header-Cache-Control" type:"string"` + + // Specifies presentational information for the object. + ContentDisposition *string `location:"header" locationName:"x-amz-fwd-header-Content-Disposition" type:"string"` + + // Specifies what content encodings have been applied to the object and thus + // what decoding mechanisms must be applied to obtain the media-type referenced + // by the Content-Type header field. + ContentEncoding *string `location:"header" locationName:"x-amz-fwd-header-Content-Encoding" type:"string"` + + // The language the content is in. + ContentLanguage *string `location:"header" locationName:"x-amz-fwd-header-Content-Language" type:"string"` + + // The size of the content body in bytes. + ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` + + // The portion of the object returned in the response. + ContentRange *string `location:"header" locationName:"x-amz-fwd-header-Content-Range" type:"string"` + + // A standard MIME type describing the format of the object data. + ContentType *string `location:"header" locationName:"x-amz-fwd-header-Content-Type" type:"string"` + + // Specifies whether an object stored in Amazon S3 is (true) or is not (false) + // a delete marker. + DeleteMarker *bool `location:"header" locationName:"x-amz-fwd-header-x-amz-delete-marker" type:"boolean"` + + // An opaque identifier assigned by a web server to a specific version of a + // resource found at a URL. + ETag *string `location:"header" locationName:"x-amz-fwd-header-ETag" type:"string"` + + // A string that uniquely identifies an error condition. Returned in the + // tag of the error XML response for a corresponding GetObject call. Cannot + // be used with a successful StatusCode header or when the transformed object + // is provided in the body. + ErrorCode *string `location:"header" locationName:"x-amz-fwd-error-code" type:"string"` + + // Contains a generic description of the error condition. Returned in the + // tag of the error XML response for a corresponding GetObject call. Cannot + // be used with a successful StatusCode header or when the transformed object + // is provided in body. + ErrorMessage *string `location:"header" locationName:"x-amz-fwd-error-message" type:"string"` + + // If object stored in Amazon S3 expiration is configured (see PUT Bucket lifecycle) + // it includes expiry-date and rule-id key-value pairs providing object expiration + // information. The value of the rule-id is URL encoded. + Expiration *string `location:"header" locationName:"x-amz-fwd-header-x-amz-expiration" type:"string"` + + // The date and time at which the object is no longer cacheable. + Expires *time.Time `location:"header" locationName:"x-amz-fwd-header-Expires" type:"timestamp"` + + // The date and time that the object was last modified. + LastModified *time.Time `location:"header" locationName:"x-amz-fwd-header-Last-Modified" type:"timestamp"` + + // A map of metadata to store with the object in S3. + Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` + + // Set to the number of metadata entries not returned in x-amz-meta headers. + // This can happen if you create metadata using an API like SOAP that supports + // more flexible metadata than the REST API. For example, using SOAP, you can + // create metadata whose values are not legal HTTP headers. + MissingMeta *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-missing-meta" type:"integer"` + + // Indicates whether an object stored in Amazon S3 has an active legal hold. + ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` + + // Indicates whether an object stored in Amazon S3 has Object Lock enabled. + // For more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html). + ObjectLockMode *string `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` + + // The date and time when Object Lock is configured to expire. + ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` + + // The count of parts this object has. + PartsCount *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-mp-parts-count" type:"integer"` + + // Indicates if request involves bucket that is either a source or destination + // in a Replication rule. For more information about S3 Replication, see Replication + // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html). + ReplicationStatus *string `location:"header" locationName:"x-amz-fwd-header-x-amz-replication-status" type:"string" enum:"ReplicationStatus"` + + // If present, indicates that the requester was successfully charged for the + // request. + RequestCharged *string `location:"header" locationName:"x-amz-fwd-header-x-amz-request-charged" type:"string" enum:"RequestCharged"` + + // Route prefix to the HTTP URL generated. + // + // RequestRoute is a required field + RequestRoute *string `location:"header" locationName:"x-amz-request-route" type:"string" required:"true"` + + // A single use encrypted token that maps WriteGetObjectResponse to the end + // user GetObject request. + // + // RequestToken is a required field + RequestToken *string `location:"header" locationName:"x-amz-request-token" type:"string" required:"true"` + + // Provides information about object restoration operation and expiration time + // of the restored object copy. + Restore *string `location:"header" locationName:"x-amz-fwd-header-x-amz-restore" type:"string"` + + // Encryption algorithm used if server-side encryption with a customer-provided + // encryption key was specified for object stored in Amazon S3. + SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm" type:"string"` + + // 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 + // to encrypt data stored in S3. For more information, see Protecting data using + // server-side encryption with customer-provided encryption keys (SSE-C) (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html). + SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for stored + // in Amazon S3 object. + SSEKMSKeyId *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` + + // The server-side encryption algorithm used when storing requested object in + // Amazon S3 (for example, AES256, aws:kms). + ServerSideEncryption *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + + // The integer status code for an HTTP response of a corresponding GetObject + // request. + // + // Status Codes + // + // * 200 - OK + // + // * 206 - Partial Content + // + // * 304 - Not Modified + // + // * 400 - Bad Request + // + // * 401 - Unauthorized + // + // * 403 - Forbidden + // + // * 404 - Not Found + // + // * 405 - Method Not Allowed + // + // * 409 - Conflict + // + // * 411 - Length Required + // + // * 412 - Precondition Failed + // + // * 416 - Range Not Satisfiable + // + // * 500 - Internal Server Error + // + // * 503 - Service Unavailable + StatusCode *int64 `location:"header" locationName:"x-amz-fwd-status" type:"integer"` + + // The class of storage used to store object in Amazon S3. + StorageClass *string `location:"header" locationName:"x-amz-fwd-header-x-amz-storage-class" type:"string" enum:"StorageClass"` + + // The number of tags, if any, on the object. + TagCount *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-tagging-count" type:"integer"` + + // An ID used to reference a specific version of the object. + VersionId *string `location:"header" locationName:"x-amz-fwd-header-x-amz-version-id" type:"string"` +} + +// String returns the string representation +func (s WriteGetObjectResponseInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WriteGetObjectResponseInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *WriteGetObjectResponseInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "WriteGetObjectResponseInput"} + if s.RequestRoute == nil { + invalidParams.Add(request.NewErrParamRequired("RequestRoute")) + } + if s.RequestRoute != nil && len(*s.RequestRoute) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RequestRoute", 1)) + } + if s.RequestToken == nil { + invalidParams.Add(request.NewErrParamRequired("RequestToken")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcceptRanges sets the AcceptRanges field's value. +func (s *WriteGetObjectResponseInput) SetAcceptRanges(v string) *WriteGetObjectResponseInput { + s.AcceptRanges = &v + return s +} + +// SetBody sets the Body field's value. +func (s *WriteGetObjectResponseInput) SetBody(v io.ReadSeeker) *WriteGetObjectResponseInput { + s.Body = v + return s +} + +// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. +func (s *WriteGetObjectResponseInput) SetBucketKeyEnabled(v bool) *WriteGetObjectResponseInput { + s.BucketKeyEnabled = &v + return s +} + +// SetCacheControl sets the CacheControl field's value. +func (s *WriteGetObjectResponseInput) SetCacheControl(v string) *WriteGetObjectResponseInput { + s.CacheControl = &v + return s +} + +// SetContentDisposition sets the ContentDisposition field's value. +func (s *WriteGetObjectResponseInput) SetContentDisposition(v string) *WriteGetObjectResponseInput { + s.ContentDisposition = &v + return s +} + +// SetContentEncoding sets the ContentEncoding field's value. +func (s *WriteGetObjectResponseInput) SetContentEncoding(v string) *WriteGetObjectResponseInput { + s.ContentEncoding = &v + return s +} + +// SetContentLanguage sets the ContentLanguage field's value. +func (s *WriteGetObjectResponseInput) SetContentLanguage(v string) *WriteGetObjectResponseInput { + s.ContentLanguage = &v + return s +} + +// SetContentLength sets the ContentLength field's value. +func (s *WriteGetObjectResponseInput) SetContentLength(v int64) *WriteGetObjectResponseInput { + s.ContentLength = &v + return s +} + +// SetContentRange sets the ContentRange field's value. +func (s *WriteGetObjectResponseInput) SetContentRange(v string) *WriteGetObjectResponseInput { + s.ContentRange = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *WriteGetObjectResponseInput) SetContentType(v string) *WriteGetObjectResponseInput { + s.ContentType = &v + return s +} + +// SetDeleteMarker sets the DeleteMarker field's value. +func (s *WriteGetObjectResponseInput) SetDeleteMarker(v bool) *WriteGetObjectResponseInput { + s.DeleteMarker = &v + return s +} + +// SetETag sets the ETag field's value. +func (s *WriteGetObjectResponseInput) SetETag(v string) *WriteGetObjectResponseInput { + s.ETag = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *WriteGetObjectResponseInput) SetErrorCode(v string) *WriteGetObjectResponseInput { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *WriteGetObjectResponseInput) SetErrorMessage(v string) *WriteGetObjectResponseInput { + s.ErrorMessage = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *WriteGetObjectResponseInput) SetExpiration(v string) *WriteGetObjectResponseInput { + s.Expiration = &v + return s +} + +// SetExpires sets the Expires field's value. +func (s *WriteGetObjectResponseInput) SetExpires(v time.Time) *WriteGetObjectResponseInput { + s.Expires = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *WriteGetObjectResponseInput) SetLastModified(v time.Time) *WriteGetObjectResponseInput { + s.LastModified = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *WriteGetObjectResponseInput) SetMetadata(v map[string]*string) *WriteGetObjectResponseInput { + s.Metadata = v + return s +} + +// SetMissingMeta sets the MissingMeta field's value. +func (s *WriteGetObjectResponseInput) SetMissingMeta(v int64) *WriteGetObjectResponseInput { + s.MissingMeta = &v + return s +} + +// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. +func (s *WriteGetObjectResponseInput) SetObjectLockLegalHoldStatus(v string) *WriteGetObjectResponseInput { + s.ObjectLockLegalHoldStatus = &v + return s +} + +// SetObjectLockMode sets the ObjectLockMode field's value. +func (s *WriteGetObjectResponseInput) SetObjectLockMode(v string) *WriteGetObjectResponseInput { + s.ObjectLockMode = &v + return s +} + +// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. +func (s *WriteGetObjectResponseInput) SetObjectLockRetainUntilDate(v time.Time) *WriteGetObjectResponseInput { + s.ObjectLockRetainUntilDate = &v + return s +} + +// SetPartsCount sets the PartsCount field's value. +func (s *WriteGetObjectResponseInput) SetPartsCount(v int64) *WriteGetObjectResponseInput { + s.PartsCount = &v + return s +} + +// SetReplicationStatus sets the ReplicationStatus field's value. +func (s *WriteGetObjectResponseInput) SetReplicationStatus(v string) *WriteGetObjectResponseInput { + s.ReplicationStatus = &v + return s +} + +// SetRequestCharged sets the RequestCharged field's value. +func (s *WriteGetObjectResponseInput) SetRequestCharged(v string) *WriteGetObjectResponseInput { + s.RequestCharged = &v + return s +} + +// SetRequestRoute sets the RequestRoute field's value. +func (s *WriteGetObjectResponseInput) SetRequestRoute(v string) *WriteGetObjectResponseInput { + s.RequestRoute = &v + return s +} + +// SetRequestToken sets the RequestToken field's value. +func (s *WriteGetObjectResponseInput) SetRequestToken(v string) *WriteGetObjectResponseInput { + s.RequestToken = &v + return s +} + +// SetRestore sets the Restore field's value. +func (s *WriteGetObjectResponseInput) SetRestore(v string) *WriteGetObjectResponseInput { + s.Restore = &v + return s +} + +// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. +func (s *WriteGetObjectResponseInput) SetSSECustomerAlgorithm(v string) *WriteGetObjectResponseInput { + s.SSECustomerAlgorithm = &v + return s +} + +// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. +func (s *WriteGetObjectResponseInput) SetSSECustomerKeyMD5(v string) *WriteGetObjectResponseInput { + s.SSECustomerKeyMD5 = &v + return s +} + +// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. +func (s *WriteGetObjectResponseInput) SetSSEKMSKeyId(v string) *WriteGetObjectResponseInput { + s.SSEKMSKeyId = &v + return s +} + +// SetServerSideEncryption sets the ServerSideEncryption field's value. +func (s *WriteGetObjectResponseInput) SetServerSideEncryption(v string) *WriteGetObjectResponseInput { + s.ServerSideEncryption = &v + return s +} + +// SetStatusCode sets the StatusCode field's value. +func (s *WriteGetObjectResponseInput) SetStatusCode(v int64) *WriteGetObjectResponseInput { + s.StatusCode = &v + return s +} + +// SetStorageClass sets the StorageClass field's value. +func (s *WriteGetObjectResponseInput) SetStorageClass(v string) *WriteGetObjectResponseInput { + s.StorageClass = &v + return s +} + +// SetTagCount sets the TagCount field's value. +func (s *WriteGetObjectResponseInput) SetTagCount(v int64) *WriteGetObjectResponseInput { + s.TagCount = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *WriteGetObjectResponseInput) SetVersionId(v string) *WriteGetObjectResponseInput { + s.VersionId = &v + return s +} + +func (s *WriteGetObjectResponseInput) hostLabels() map[string]string { + return map[string]string{ + "RequestRoute": aws.StringValue(s.RequestRoute), + } +} + +type WriteGetObjectResponseOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s WriteGetObjectResponseOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WriteGetObjectResponseOutput) GoString() string { + return s.String() +} + const ( // AnalyticsS3ExportFileFormatCsv is a AnalyticsS3ExportFileFormat enum value AnalyticsS3ExportFileFormatCsv = "CSV" diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go index f1959b03a95..ce87ab32017 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go @@ -48,6 +48,8 @@ func defaultInitRequestFn(r *request.Request) { // case opGetObject: // r.Handlers.Build.PushBack(askForTxEncodingAppendMD5) // r.Handlers.Unmarshal.PushBack(useMD5ValidationReader) + case opWriteGetObjectResponse: + r.Handlers.Build.PushFront(buildWriteGetObjectResponseEndpoint) } } diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go index 6346b927960..9fc2105fd2f 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go @@ -1,6 +1,8 @@ package s3 import ( + "fmt" + "github.com/aws/aws-sdk-go/aws/awserr" "net/url" "strings" @@ -11,6 +13,13 @@ import ( "github.com/aws/aws-sdk-go/internal/s3shared/arn" ) +const ( + s3Namespace = "s3" + s3AccessPointNamespace = "s3-accesspoint" + s3ObjectsLambdaNamespace = "s3-object-lambda" + s3OutpostsNamespace = "s3-outposts" +) + // Used by shapes with members decorated as endpoint ARN. func parseEndpointARN(v string) (arn.Resource, error) { return arn.ParseResource(v, accessPointResourceParser) @@ -20,10 +29,14 @@ func accessPointResourceParser(a awsarn.ARN) (arn.Resource, error) { resParts := arn.SplitResource(a.Resource) switch resParts[0] { case "accesspoint": - if a.Service != "s3" { - return arn.AccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "service is not s3"} + switch a.Service { + case s3Namespace: + return arn.ParseAccessPointResource(a, resParts[1:]) + case s3ObjectsLambdaNamespace: + return parseS3ObjectLambdaAccessPointResource(a, resParts) + default: + return arn.AccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("service is not %s or %s", s3Namespace, s3ObjectsLambdaNamespace)} } - return arn.ParseAccessPointResource(a, resParts[1:]) case "outpost": if a.Service != "s3-outposts" { return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "service is not s3-outposts"} @@ -80,6 +93,25 @@ func parseOutpostAccessPointResource(a awsarn.ARN, resParts []string) (arn.Outpo return outpostAccessPointARN, nil } +func parseS3ObjectLambdaAccessPointResource(a awsarn.ARN, resParts []string) (arn.S3ObjectLambdaAccessPointARN, error) { + if a.Service != s3ObjectsLambdaNamespace { + return arn.S3ObjectLambdaAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("service is not %s", s3ObjectsLambdaNamespace)} + } + + accessPointARN, err := arn.ParseAccessPointResource(a, resParts[1:]) + if err != nil { + return arn.S3ObjectLambdaAccessPointARN{}, err + } + + if len(accessPointARN.Region) == 0 { + return arn.S3ObjectLambdaAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("%s region not set", s3ObjectsLambdaNamespace)} + } + + return arn.S3ObjectLambdaAccessPointARN{ + AccessPointARN: accessPointARN, + }, nil +} + func endpointHandler(req *request.Request) { endpoint, ok := req.Params.(endpointARNGetter) if !ok || !endpoint.hasEndpointARN() { @@ -116,6 +148,11 @@ func endpointHandler(req *request.Request) { if err != nil { req.Error = err } + case arn.S3ObjectLambdaAccessPointARN: + err = updateRequestS3ObjectLambdaAccessPointEndpoint(req, tv) + if err != nil { + req.Error = err + } case arn.OutpostAccessPointARN: // outposts does not support FIPS regions if resReq.ResourceConfiguredForFIPS() { @@ -162,6 +199,31 @@ func updateRequestAccessPointEndpoint(req *request.Request, accessPoint arn.Acce return nil } +func updateRequestS3ObjectLambdaAccessPointEndpoint(req *request.Request, accessPoint arn.S3ObjectLambdaAccessPointARN) error { + // DualStack not supported + if aws.BoolValue(req.Config.UseDualStack) { + return s3shared.NewClientConfiguredForDualStackError(accessPoint, + req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) + } + + // Accelerate not supported + if aws.BoolValue(req.Config.S3UseAccelerate) { + return s3shared.NewClientConfiguredForAccelerateError(accessPoint, + req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) + } + + // Ignore the disable host prefix for access points + req.Config.DisableEndpointHostPrefix = aws.Bool(false) + + if err := s3ObjectLambdaAccessPointEndpointBuilder(accessPoint).build(req); err != nil { + return err + } + + removeBucketFromPath(req.HTTPRequest.URL) + + return nil +} + func updateRequestOutpostAccessPointEndpoint(req *request.Request, accessPoint arn.OutpostAccessPointARN) error { // Accelerate not supported if aws.BoolValue(req.Config.S3UseAccelerate) { @@ -192,3 +254,37 @@ func removeBucketFromPath(u *url.URL) { u.Path = "/" } } + +func buildWriteGetObjectResponseEndpoint(req *request.Request) { + // DualStack not supported + if aws.BoolValue(req.Config.UseDualStack) { + req.Error = awserr.New("ConfigurationError", "client configured for dualstack but not supported for operation", nil) + return + } + + // Accelerate not supported + if aws.BoolValue(req.Config.S3UseAccelerate) { + req.Error = awserr.New("ConfigurationError", "client configured for accelerate but not supported for operation", nil) + return + } + + signingName := s3ObjectsLambdaNamespace + signingRegion := req.ClientInfo.SigningRegion + + if !hasCustomEndpoint(req) { + endpoint, err := resolveRegionalEndpoint(req, aws.StringValue(req.Config.Region), EndpointsID) + if err != nil { + req.Error = awserr.New(request.ErrCodeSerialization, "failed to resolve endpoint", err) + return + } + signingRegion = endpoint.SigningRegion + + if err = updateRequestEndpoint(req, endpoint.URL); err != nil { + req.Error = err + return + } + updateS3HostPrefixForS3ObjectLambda(req) + } + + redirectSigner(req, signingName, signingRegion) +} diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go index eb77d981ef6..71e9c9eff06 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go @@ -66,13 +66,9 @@ func (a accessPointEndpointBuilder) build(req *request.Request) error { if err = updateRequestEndpoint(req, endpoint.URL); err != nil { return err } - const serviceEndpointLabel = "s3-accesspoint" // dual stack provided by endpoint resolver - cfgHost := req.HTTPRequest.URL.Host - if strings.HasPrefix(cfgHost, "s3") { - req.HTTPRequest.URL.Host = serviceEndpointLabel + cfgHost[2:] - } + updateS3HostForS3AccessPoint(req) } protocol.HostPrefixBuilder{ @@ -98,6 +94,73 @@ func (a accessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { } } +// s3ObjectLambdaAccessPointEndpointBuilder represents the endpoint builder for an s3 object lambda access point arn +type s3ObjectLambdaAccessPointEndpointBuilder arn.S3ObjectLambdaAccessPointARN + +// build builds the endpoint for corresponding access point arn +// +// For building an endpoint from access point arn, format used is: +// - Access point endpoint format : {accesspointName}-{accountId}.s3-object-lambda.{region}.{dnsSuffix} +// - example : myaccesspoint-012345678901.s3-object-lambda.us-west-2.amazonaws.com +// +// Access Point Endpoint requests are signed using "s3-object-lambda" as signing name. +// +func (a s3ObjectLambdaAccessPointEndpointBuilder) build(req *request.Request) error { + resolveRegion := arn.S3ObjectLambdaAccessPointARN(a).Region + cfgRegion := aws.StringValue(req.Config.Region) + + if s3shared.IsFIPS(cfgRegion) { + if aws.BoolValue(req.Config.S3UseARNRegion) && s3shared.IsCrossRegion(req, resolveRegion) { + // FIPS with cross region is not supported, the SDK must fail + // because there is no well defined method for SDK to construct a + // correct FIPS endpoint. + return s3shared.NewClientConfiguredForCrossRegionFIPSError(arn.S3ObjectLambdaAccessPointARN(a), + req.ClientInfo.PartitionID, cfgRegion, nil) + } + resolveRegion = cfgRegion + } + + endpoint, err := resolveRegionalEndpoint(req, resolveRegion, EndpointsID) + if err != nil { + return s3shared.NewFailedToResolveEndpointError(arn.S3ObjectLambdaAccessPointARN(a), + req.ClientInfo.PartitionID, cfgRegion, err) + } + + endpoint.URL = endpoints.AddScheme(endpoint.URL, aws.BoolValue(req.Config.DisableSSL)) + + endpoint.SigningName = s3ObjectsLambdaNamespace + + if !hasCustomEndpoint(req) { + if err = updateRequestEndpoint(req, endpoint.URL); err != nil { + return err + } + + updateS3HostPrefixForS3ObjectLambda(req) + } + + protocol.HostPrefixBuilder{ + Prefix: accessPointPrefixTemplate, + LabelsFn: a.hostPrefixLabelValues, + }.Build(req) + + // signer redirection + redirectSigner(req, endpoint.SigningName, endpoint.SigningRegion) + + err = protocol.ValidateEndpointHost(req.Operation.Name, req.HTTPRequest.URL.Host) + if err != nil { + return s3shared.NewInvalidARNError(arn.S3ObjectLambdaAccessPointARN(a), err) + } + + return nil +} + +func (a s3ObjectLambdaAccessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { + return map[string]string{ + accessPointPrefixLabel: arn.S3ObjectLambdaAccessPointARN(a).AccessPointName, + accountIDPrefixLabel: arn.S3ObjectLambdaAccessPointARN(a).AccountID, + } +} + // outpostAccessPointEndpointBuilder represents the Endpoint builder for outpost access point arn. type outpostAccessPointEndpointBuilder arn.OutpostAccessPointARN @@ -114,7 +177,7 @@ func (o outpostAccessPointEndpointBuilder) build(req *request.Request) error { resolveService := o.Service endpointsID := resolveService - if resolveService == "s3-outposts" { + if resolveService == s3OutpostsNamespace { endpointsID = "s3" } @@ -130,11 +193,7 @@ func (o outpostAccessPointEndpointBuilder) build(req *request.Request) error { if err = updateRequestEndpoint(req, endpoint.URL); err != nil { return err } - // add url host as s3-outposts - cfgHost := req.HTTPRequest.URL.Host - if strings.HasPrefix(cfgHost, endpointsID) { - req.HTTPRequest.URL.Host = resolveService + cfgHost[len(endpointsID):] - } + updateHostPrefix(req, endpointsID, resolveService) } protocol.HostPrefixBuilder{ @@ -170,7 +229,6 @@ func resolveRegionalEndpoint(r *request.Request, region string, endpointsID stri } func updateRequestEndpoint(r *request.Request, endpoint string) (err error) { - r.HTTPRequest.URL, err = url.Parse(endpoint + r.Operation.HTTPPath) if err != nil { return awserr.New(request.ErrCodeSerialization, @@ -185,3 +243,19 @@ func redirectSigner(req *request.Request, signingName string, signingRegion stri req.ClientInfo.SigningName = signingName req.ClientInfo.SigningRegion = signingRegion } + +func updateS3HostForS3AccessPoint(req *request.Request) { + updateHostPrefix(req, "s3", s3AccessPointNamespace) +} + +func updateS3HostPrefixForS3ObjectLambda(req *request.Request) { + updateHostPrefix(req, "s3", s3ObjectsLambdaNamespace) +} + +func updateHostPrefix(req *request.Request, oldEndpointPrefix, newEndpointPrefix string) { + host := req.HTTPRequest.URL.Host + if strings.HasPrefix(host, oldEndpointPrefix) { + // replace service hostlabel oldEndpointPrefix to newEndpointPrefix + req.HTTPRequest.URL.Host = newEndpointPrefix + host[len(oldEndpointPrefix):] + } +} diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go index f64b55135ee..6d3e726cf51 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go @@ -48,13 +48,13 @@ const ( // ErrCodeObjectAlreadyInActiveTierError for service response error code // "ObjectAlreadyInActiveTierError". // - // This operation is not allowed against this storage tier. + // This action is not allowed against this storage tier. ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" // ErrCodeObjectNotInActiveTierError for service response error code // "ObjectNotInActiveTierError". // - // The source object of the COPY operation is not in the active tier and is - // only stored in Amazon S3 Glacier. + // The source object of the COPY action is not in the active tier and is only + // stored in Amazon S3 Glacier. ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" ) diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index 617282868dc..62d9aa9926e 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -12,7 +12,7 @@ cloud.google.com/go/storage github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v12 v12.0.0 github.com/apparentlymart/go-textseg/v12/textseg -# github.com/aws/aws-sdk-go v1.37.4 +# github.com/aws/aws-sdk-go v1.38.0 ## explicit github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/arn From 05ca6d051f9c295ba51c5d8ae838994afebda60b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:09:41 -0400 Subject: [PATCH 0895/1252] tests/r/gamelift_alias: Add ErrorCheck --- aws/resource_aws_gamelift_alias_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_gamelift_alias_test.go b/aws/resource_aws_gamelift_alias_test.go index f55bbaa2ddf..e035a8f857f 100644 --- a/aws/resource_aws_gamelift_alias_test.go +++ b/aws/resource_aws_gamelift_alias_test.go @@ -97,6 +97,7 @@ func TestAccAWSGameliftAlias_basic(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftAliasDestroy, Steps: []resource.TestStep{ @@ -147,6 +148,7 @@ func TestAccAWSGameliftAlias_tags(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftAliasDestroy, Steps: []resource.TestStep{ @@ -220,6 +222,7 @@ func TestAccAWSGameliftAlias_fleetRouting(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftAliasDestroy, Steps: []resource.TestStep{ @@ -261,6 +264,7 @@ func TestAccAWSGameliftAlias_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftAliasDestroy, Steps: []resource.TestStep{ From 0a071ea8756f0dbe970d775882d7d4e2b235b6df Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:09:52 -0400 Subject: [PATCH 0896/1252] tests/r/gamelift_build: Add ErrorCheck --- aws/resource_aws_gamelift_build_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_gamelift_build_test.go b/aws/resource_aws_gamelift_build_test.go index f0e727c38a3..6e138f499ee 100644 --- a/aws/resource_aws_gamelift_build_test.go +++ b/aws/resource_aws_gamelift_build_test.go @@ -90,6 +90,7 @@ func TestAccAWSGameliftBuild_basic(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftBuildDestroy, Steps: []resource.TestStep{ @@ -154,6 +155,7 @@ func TestAccAWSGameliftBuild_tags(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftBuildDestroy, Steps: []resource.TestStep{ @@ -216,6 +218,7 @@ func TestAccAWSGameliftBuild_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftBuildDestroy, Steps: []resource.TestStep{ From 9e628847300e91e9ccc8c09056ddeb0f31695b5e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:10:05 -0400 Subject: [PATCH 0897/1252] tests/r/gamelift_fleet: Add ErrorCheck --- aws/resource_aws_gamelift_fleet_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_gamelift_fleet_test.go b/aws/resource_aws_gamelift_fleet_test.go index 00a224a4868..a610038a157 100644 --- a/aws/resource_aws_gamelift_fleet_test.go +++ b/aws/resource_aws_gamelift_fleet_test.go @@ -266,6 +266,7 @@ func TestAccAWSGameliftFleet_basic(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftFleetDestroy, Steps: []resource.TestStep{ @@ -347,6 +348,7 @@ func TestAccAWSGameliftFleet_tags(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftFleetDestroy, Steps: []resource.TestStep{ @@ -416,6 +418,7 @@ func TestAccAWSGameliftFleet_allFields(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftFleetDestroy, Steps: []resource.TestStep{ @@ -533,6 +536,7 @@ func TestAccAWSGameliftFleet_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftFleetDestroy, Steps: []resource.TestStep{ From 8e31d5bb4c5631202f1a388a61642e153322f650 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:10:15 -0400 Subject: [PATCH 0898/1252] tests/r/gamelift_game_session_queue: Add ErrorCheck --- aws/resource_aws_gamelift_game_session_queue_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_gamelift_game_session_queue_test.go b/aws/resource_aws_gamelift_game_session_queue_test.go index 6a4424997a5..1bb24ecc264 100644 --- a/aws/resource_aws_gamelift_game_session_queue_test.go +++ b/aws/resource_aws_gamelift_game_session_queue_test.go @@ -98,6 +98,7 @@ func TestAccAWSGameliftGameSessionQueue_basic(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftGameSessionQueueDestroy, Steps: []resource.TestStep{ @@ -161,6 +162,7 @@ func TestAccAWSGameliftGameSessionQueue_tags(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftGameSessionQueueDestroy, Steps: []resource.TestStep{ @@ -221,6 +223,7 @@ func TestAccAWSGameliftGameSessionQueue_disappears(t *testing.T) { testAccPartitionHasServicePreCheck(gamelift.EndpointsID, t) testAccPreCheckAWSGamelift(t) }, + ErrorCheck: testAccErrorCheck(t, gamelift.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSGameliftGameSessionQueueDestroy, Steps: []resource.TestStep{ From d00a06a44e76703eb6e6fade019c21e09c10f1b4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:10:53 -0400 Subject: [PATCH 0899/1252] tests/r/lex_bot: Add ErrorCheck --- aws/resource_aws_lex_bot_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_lex_bot_test.go b/aws/resource_aws_lex_bot_test.go index afd02bccda8..db638ee81d0 100644 --- a/aws/resource_aws_lex_bot_test.go +++ b/aws/resource_aws_lex_bot_test.go @@ -19,6 +19,7 @@ func TestAccAwsLexBot_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -87,6 +88,7 @@ func testAccAwsLexBot_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() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -130,6 +132,7 @@ func TestAccAwsLexBot_abortStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -186,6 +189,7 @@ func TestAccAwsLexBot_clarificationPrompt(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -238,6 +242,7 @@ func TestAccAwsLexBot_childDirected(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -281,6 +286,7 @@ func TestAccAwsLexBot_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -324,6 +330,7 @@ func TestAccAwsLexBot_detectSentiment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -367,6 +374,7 @@ func TestAccAwsLexBot_enableModelImprovements(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -411,6 +419,7 @@ func TestAccAwsLexBot_idleSessionTtlInSeconds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -454,6 +463,7 @@ func TestAccAwsLexBot_intents(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -497,6 +507,7 @@ func TestAccAwsLexBot_locale(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -540,6 +551,7 @@ func TestAccAwsLexBot_voiceId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ @@ -583,6 +595,7 @@ func TestAccAwsLexBot_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ From a05302e1a562778baf42a14b0641b455a55b13d0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:02 -0400 Subject: [PATCH 0900/1252] tests/r/lex_bot_alias: Add ErrorCheck --- aws/resource_aws_lex_bot_alias_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_lex_bot_alias_test.go b/aws/resource_aws_lex_bot_alias_test.go index 6ee14589e1c..d7318cfd396 100644 --- a/aws/resource_aws_lex_bot_alias_test.go +++ b/aws/resource_aws_lex_bot_alias_test.go @@ -20,6 +20,7 @@ func TestAccAwsLexBotAlias_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotAliasID, testBotAliasID), Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func testAccAwsLexBotAlias_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() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotAliasID, testBotAliasID), Steps: []resource.TestStep{ @@ -110,6 +112,7 @@ func TestAccAwsLexBotAlias_conversationLogsText(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotID, testBotAliasID), Steps: []resource.TestStep{ @@ -156,6 +159,7 @@ func TestAccAwsLexBotAlias_conversationLogsAudio(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotID, testBotAliasID), Steps: []resource.TestStep{ @@ -203,6 +207,7 @@ func TestAccAwsLexBotAlias_conversationLogsBoth(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotID, testBotAliasID), Steps: []resource.TestStep{ @@ -249,6 +254,7 @@ func TestAccAwsLexBotAlias_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotAliasDestroy(testBotAliasID, testBotAliasID), Steps: []resource.TestStep{ @@ -294,6 +300,7 @@ func TestAccAwsLexBotAlias_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexBotDestroy, Steps: []resource.TestStep{ From 25bf60b5b37054163984851cdc5f13d28c2e7a3f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:22 -0400 Subject: [PATCH 0901/1252] tests/r/lex_intent: Add ErrorCheck --- aws/resource_aws_lex_intent_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_lex_intent_test.go b/aws/resource_aws_lex_intent_test.go index a04497990b8..136217087c0 100644 --- a/aws/resource_aws_lex_intent_test.go +++ b/aws/resource_aws_lex_intent_test.go @@ -21,6 +21,7 @@ func TestAccAwsLexIntent_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -66,6 +67,7 @@ func TestAccAwsLexIntent_createVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -107,6 +109,7 @@ func TestAccAwsLexIntent_conclusionStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -159,6 +162,7 @@ func TestAccAwsLexIntent_confirmationPromptAndRejectionStatement(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -221,6 +225,7 @@ func TestAccAwsLexIntent_dialogCodeHook(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -253,6 +258,7 @@ func TestAccAwsLexIntent_followUpPrompt(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -321,6 +327,7 @@ func TestAccAwsLexIntent_fulfillmentActivity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -355,6 +362,7 @@ func TestAccAwsLexIntent_sampleUtterances(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -396,6 +404,7 @@ func TestAccAwsLexIntent_slots(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -448,6 +457,7 @@ func TestAccAwsLexIntent_slotsCustom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -491,6 +501,7 @@ func TestAccAwsLexIntent_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ @@ -550,6 +561,7 @@ func TestAccAwsLexIntent_updateWithExternalChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexIntentDestroy, Steps: []resource.TestStep{ From 920008c23bacda889f5b05d9ba3809448664e25b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:32 -0400 Subject: [PATCH 0902/1252] tests/r/lex_slot_type: Add ErrorCheck --- aws/resource_aws_lex_slot_type_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_lex_slot_type_test.go b/aws/resource_aws_lex_slot_type_test.go index f9b62ca06c9..d03148246d3 100644 --- a/aws/resource_aws_lex_slot_type_test.go +++ b/aws/resource_aws_lex_slot_type_test.go @@ -19,6 +19,7 @@ func TestAccAwsLexSlotType_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -60,6 +61,7 @@ func TestAccAwsLexSlotType_createVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -102,6 +104,7 @@ func TestAccAwsLexSlotType_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -142,6 +145,7 @@ func TestAccAwsLexSlotType_enumerationValues(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -188,6 +192,7 @@ func TestAccAwsLexSlotType_name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -228,6 +233,7 @@ func TestAccAwsLexSlotType_valueSelectionStrategy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ @@ -268,6 +274,7 @@ func TestAccAwsLexSlotType_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsLexSlotTypeDestroy, Steps: []resource.TestStep{ From 08a6552dc28a576e30479ab82b35ae5bc0b2c9f2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:32 -0400 Subject: [PATCH 0903/1252] tests/ds/lex_bot: Add ErrorCheck --- aws/data_source_aws_lex_bot_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_lex_bot_test.go b/aws/data_source_aws_lex_bot_test.go index 2d13bc19621..a89236f27d2 100644 --- a/aws/data_source_aws_lex_bot_test.go +++ b/aws/data_source_aws_lex_bot_test.go @@ -14,8 +14,9 @@ func TestAccDataSourceAwsLexBot_basic(t *testing.T) { resourceName := "aws_lex_bot.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( @@ -52,8 +53,9 @@ func testAccDataSourceAwsLexBot_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() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( From 3cec70d17e39d2f12cf84c12a9dced71aadd4552 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:33 -0400 Subject: [PATCH 0904/1252] tests/ds/lex_bot_alias: Add ErrorCheck --- aws/data_source_aws_lex_bot_alias_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_lex_bot_alias_test.go b/aws/data_source_aws_lex_bot_alias_test.go index 4498da3a41f..622649097fa 100644 --- a/aws/data_source_aws_lex_bot_alias_test.go +++ b/aws/data_source_aws_lex_bot_alias_test.go @@ -15,8 +15,9 @@ func testAccDataSourceAwsLexBotAlias_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() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( From a03ff0e4a15d091520fbe68a3c6bff33301990aa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:33 -0400 Subject: [PATCH 0905/1252] tests/ds/lex_intent: Add ErrorCheck --- aws/data_source_aws_lex_intent_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_lex_intent_test.go b/aws/data_source_aws_lex_intent_test.go index 2cca31c93e6..e8a1e64e917 100644 --- a/aws/data_source_aws_lex_intent_test.go +++ b/aws/data_source_aws_lex_intent_test.go @@ -14,8 +14,9 @@ func TestAccDataSourceAwsLexIntent_basic(t *testing.T) { resourceName := "aws_lex_intent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( @@ -42,8 +43,9 @@ func TestAccDataSourceAwsLexIntent_withVersion(t *testing.T) { resourceName := "aws_lex_intent.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( From 47f0ccdb2740302538647f1de65aca715ea30bac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:11:34 -0400 Subject: [PATCH 0906/1252] tests/ds/lex_slot_type: Add ErrorCheck --- aws/data_source_aws_lex_slot_type_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_lex_slot_type_test.go b/aws/data_source_aws_lex_slot_type_test.go index 0d2f7cffcd1..ae8a3e223d9 100644 --- a/aws/data_source_aws_lex_slot_type_test.go +++ b/aws/data_source_aws_lex_slot_type_test.go @@ -14,8 +14,9 @@ func TestAccDataSourceAwsLexSlotType_basic(t *testing.T) { resourceName := "aws_lex_slot_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( @@ -43,8 +44,9 @@ func TestAccDataSourceAwsLexSlotType_withVersion(t *testing.T) { resourceName := "aws_lex_slot_type.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(lexmodelbuildingservice.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, lexmodelbuildingservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: composeConfig( From cd1b3c68c3f61b65564fee5f7273e92995c9a129 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:12:17 -0400 Subject: [PATCH 0907/1252] tests/r/networkfirewall_firewall: Add ErrorCheck --- aws/resource_aws_networkfirewall_firewall_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_networkfirewall_firewall_test.go b/aws/resource_aws_networkfirewall_firewall_test.go index a6754f1a846..ed7050a7ca2 100644 --- a/aws/resource_aws_networkfirewall_firewall_test.go +++ b/aws/resource_aws_networkfirewall_firewall_test.go @@ -86,6 +86,7 @@ func TestAccAwsNetworkFirewallFirewall_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -127,6 +128,7 @@ func TestAccAwsNetworkFirewallFirewall_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAwsNetworkFirewallFirewall_deleteProtection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -208,6 +211,7 @@ func TestAccAwsNetworkFirewallFirewall_subnetMappings_updateSubnet(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -252,6 +256,7 @@ func TestAccAwsNetworkFirewallFirewall_subnetMappings_updateMultipleSubnets(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -307,6 +312,7 @@ func TestAccAwsNetworkFirewallFirewall_tags(t *testing.T) { resourceName := "aws_networkfirewall_firewall.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ @@ -349,6 +355,7 @@ func TestAccAwsNetworkFirewallFirewall_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallDestroy, Steps: []resource.TestStep{ From 756e11ec904b14468667212df33199f66d7fb399 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:12:26 -0400 Subject: [PATCH 0908/1252] tests/r/networkfirewall_firewall_policy: Add ErrorCheck --- ...urce_aws_networkfirewall_firewall_policy_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_networkfirewall_firewall_policy_test.go b/aws/resource_aws_networkfirewall_firewall_policy_test.go index 7d339047e88..26004e40c4d 100644 --- a/aws/resource_aws_networkfirewall_firewall_policy_test.go +++ b/aws/resource_aws_networkfirewall_firewall_policy_test.go @@ -83,6 +83,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -117,6 +118,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_statefulRuleGroupReference(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -145,6 +147,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_updateStatefulRuleGroupReference(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -186,6 +189,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_multipleStatefulRuleGroupReferences resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -224,6 +228,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_statelessRuleGroupReference(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -266,6 +271,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_updateStatelessRuleGroupReference(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -311,6 +317,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_multipleStatelessRuleGroupReference resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -357,6 +364,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_statelessCustomAction(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -389,6 +397,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_updateStatelessCustomAction(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -448,6 +457,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_multipleStatelessCustomActions(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -501,6 +511,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_statefulRuleGroupReferenceAndCustom resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -543,6 +554,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ @@ -585,6 +597,7 @@ func TestAccAwsNetworkFirewallFirewallPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallFirewallPolicyDestroy, Steps: []resource.TestStep{ From 98fa35eca0914ac9260b938ee4fd9c3466584f16 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:12:45 -0400 Subject: [PATCH 0909/1252] tests/r/networkfirewall_logging_configuration: Add ErrorCheck --- ...ws_networkfirewall_logging_configuration_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_networkfirewall_logging_configuration_test.go b/aws/resource_aws_networkfirewall_logging_configuration_test.go index c727feff1db..c2366fb54fc 100644 --- a/aws/resource_aws_networkfirewall_logging_configuration_test.go +++ b/aws/resource_aws_networkfirewall_logging_configuration_test.go @@ -83,6 +83,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_cloudwatchLogDestination_logG resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -126,6 +127,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_cloudwatchLogDestination_logT resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_kinesisLogDestination_deliver resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -209,6 +212,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_kinesisLogDestination_logType resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -249,6 +253,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_s3LogDestination_bucketName(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -291,6 +296,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_s3LogDestination_logType(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -331,6 +337,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_s3LogDestination_prefix(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -375,6 +382,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_updateFirewallArn(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -411,6 +419,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_updateLogDestinationType(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -468,6 +477,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_updateToMultipleLogDestinatio resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -522,6 +532,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_updateToSingleAlertTypeLogDes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -576,6 +587,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_updateToSingleFlowTypeLogDest resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ @@ -629,6 +641,7 @@ func TestAccAwsNetworkFirewallLoggingConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallLoggingConfigurationDestroy, Steps: []resource.TestStep{ From 487c91028e1ff3e884ad045a8250716d4a3367f6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:12:54 -0400 Subject: [PATCH 0910/1252] tests/r/networkfirewall_resource_policy: Add ErrorCheck --- aws/resource_aws_networkfirewall_resource_policy_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_networkfirewall_resource_policy_test.go b/aws/resource_aws_networkfirewall_resource_policy_test.go index 9fdd47a59d3..142de57a31d 100644 --- a/aws/resource_aws_networkfirewall_resource_policy_test.go +++ b/aws/resource_aws_networkfirewall_resource_policy_test.go @@ -20,6 +20,7 @@ func TestAccAwsNetworkFirewallResourcePolicy_firewallPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAwsNetworkFirewallResourcePolicy_ruleGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -88,6 +90,7 @@ func TestAccAwsNetworkFirewallResourcePolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -109,6 +112,7 @@ func TestAccAwsNetworkFirewallResourcePolicy_disappears_FirewallPolicy(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallResourcePolicyDestroy, Steps: []resource.TestStep{ @@ -130,6 +134,7 @@ func TestAccAwsNetworkFirewallResourcePolicy_disappears_RuleGroup(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallResourcePolicyDestroy, Steps: []resource.TestStep{ From c736da9eba6984e2122695a03f72fda5856d1280 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:13:06 -0400 Subject: [PATCH 0911/1252] tests/r/networkfirewall_rule_group: Add ErrorCheck --- ...resource_aws_networkfirewall_rule_group_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aws/resource_aws_networkfirewall_rule_group_test.go b/aws/resource_aws_networkfirewall_rule_group_test.go index 5a03f00387e..255ba5780f2 100644 --- a/aws/resource_aws_networkfirewall_rule_group_test.go +++ b/aws/resource_aws_networkfirewall_rule_group_test.go @@ -83,6 +83,7 @@ func TestAccAwsNetworkFirewallRuleGroup_basic_rulesSourceList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -120,6 +121,7 @@ func TestAccAwsNetworkFirewallRuleGroup_basic_statefulRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -166,6 +168,7 @@ func TestAccAwsNetworkFirewallRuleGroup_basic_statelessRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -208,6 +211,7 @@ func TestAccAwsNetworkFirewallRuleGroup_basic_rules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -243,6 +247,7 @@ func TestAccAwsNetworkFirewallRuleGroup_statelessRuleWithCustomAction(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -290,6 +295,7 @@ func TestAccAwsNetworkFirewallRuleGroup_updateRulesSourceList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -334,6 +340,7 @@ func TestAccAwsNetworkFirewallRuleGroup_rulesSourceAndRuleVariables(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -412,6 +419,7 @@ func TestAccAwsNetworkFirewallRuleGroup_updateStatefulRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -457,6 +465,7 @@ func TestAccAwsNetworkFirewallRuleGroup_updateMultipleStatefulRules(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -537,6 +546,7 @@ func TestAccAwsNetworkFirewallRuleGroup_statefulRule_action(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -596,6 +606,7 @@ func TestAccAwsNetworkFirewallRuleGroup_statefulRule_header(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -655,6 +666,7 @@ func TestAccAwsNetworkFirewallRuleGroup_updateStatelessRule(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -703,6 +715,7 @@ func TestAccAwsNetworkFirewallRuleGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ @@ -745,6 +758,7 @@ func TestAccAwsNetworkFirewallRuleGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAwsNetworkFirewall(t) }, + ErrorCheck: testAccErrorCheck(t, networkfirewall.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsNetworkFirewallRuleGroupDestroy, Steps: []resource.TestStep{ From 10839d7cf6ab408ca393f9c47612eb4c03b9d4ac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:13:42 -0400 Subject: [PATCH 0912/1252] tests/r/inspector_assessment_target: Add ErrorCheck --- aws/resource_aws_inspector_assessment_target_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_inspector_assessment_target_test.go b/aws/resource_aws_inspector_assessment_target_test.go index 9402ce95424..dbf4a9dfa39 100644 --- a/aws/resource_aws_inspector_assessment_target_test.go +++ b/aws/resource_aws_inspector_assessment_target_test.go @@ -18,6 +18,7 @@ func TestAccAWSInspectorTarget_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTargetAssessmentDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSInspectorTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTargetAssessmentDestroy, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAWSInspectorTarget_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTargetAssessmentDestroy, Steps: []resource.TestStep{ @@ -104,6 +107,7 @@ func TestAccAWSInspectorTarget_ResourceGroupArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTargetAssessmentDestroy, Steps: []resource.TestStep{ From ce23505718a06bd6905740a92fe877f0001abb4a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:13:52 -0400 Subject: [PATCH 0913/1252] tests/r/inspector_assessment_template: Add ErrorCheck --- aws/resource_aws_inspector_assessment_template_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_inspector_assessment_template_test.go b/aws/resource_aws_inspector_assessment_template_test.go index 3595d9e5511..3de7e13ea2f 100644 --- a/aws/resource_aws_inspector_assessment_template_test.go +++ b/aws/resource_aws_inspector_assessment_template_test.go @@ -20,6 +20,7 @@ func TestAccAWSInspectorTemplate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTemplateDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSInspectorTemplate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTemplateDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSInspectorTemplate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSInspectorTemplateDestroy, Steps: []resource.TestStep{ From 36d71a223da77bdc66b44a41d7f0288223155dd4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:14:01 -0400 Subject: [PATCH 0914/1252] tests/r/inspector_resource_group: Add ErrorCheck --- aws/resource_aws_inspector_resource_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_inspector_resource_group_test.go b/aws/resource_aws_inspector_resource_group_test.go index 653faae0b5c..9ce3d8e2251 100644 --- a/aws/resource_aws_inspector_resource_group_test.go +++ b/aws/resource_aws_inspector_resource_group_test.go @@ -17,6 +17,7 @@ func TestAccAWSInspectorResourceGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From a26603d6e840f877586c766c7ca9b8acf873b3ac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:14:11 -0400 Subject: [PATCH 0915/1252] tests/ds/inspector_rules_packages: Add ErrorCheck --- aws/data_source_aws_inspector_rules_packages_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_inspector_rules_packages_test.go b/aws/data_source_aws_inspector_rules_packages_test.go index 8f1a14794d7..e3ee9e4fcde 100644 --- a/aws/data_source_aws_inspector_rules_packages_test.go +++ b/aws/data_source_aws_inspector_rules_packages_test.go @@ -3,13 +3,15 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/inspector" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccAWSInspectorRulesPackages_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, inspector.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSInspectorRulesPackagesConfig, From 7d1339cadcc14070d802df9641214fb77dccf018 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:16:00 -0400 Subject: [PATCH 0916/1252] tests/r/ram_principal_association: Add ErrorCheck --- aws/resource_aws_ram_principal_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ram_principal_association_test.go b/aws/resource_aws_ram_principal_association_test.go index 9fbac3acf51..c18f870bf9d 100644 --- a/aws/resource_aws_ram_principal_association_test.go +++ b/aws/resource_aws_ram_principal_association_test.go @@ -18,6 +18,7 @@ func TestAccAwsRamPrincipalAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamPrincipalAssociationDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAwsRamPrincipalAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceAssociationDestroy, Steps: []resource.TestStep{ From 06106deb5a04b61efc46b4f39ff2c364701c3840 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:16:10 -0400 Subject: [PATCH 0917/1252] tests/r/ram_resource_association: Add ErrorCheck --- aws/resource_aws_ram_resource_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_ram_resource_association_test.go b/aws/resource_aws_ram_resource_association_test.go index bde53d2f4a1..113ba64bfa9 100644 --- a/aws/resource_aws_ram_resource_association_test.go +++ b/aws/resource_aws_ram_resource_association_test.go @@ -18,6 +18,7 @@ func TestAccAwsRamResourceAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceAssociationDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAwsRamResourceAssociation_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceAssociationDestroy, Steps: []resource.TestStep{ From 2969232d371a22d0cd200c3d0061766b499244ec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:16:19 -0400 Subject: [PATCH 0918/1252] tests/r/ram_resource_share: Add ErrorCheck --- aws/resource_aws_ram_resource_share_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ram_resource_share_test.go b/aws/resource_aws_ram_resource_share_test.go index a3c67850c8d..a73dff1f5ef 100644 --- a/aws/resource_aws_ram_resource_share_test.go +++ b/aws/resource_aws_ram_resource_share_test.go @@ -19,6 +19,7 @@ func TestAccAwsRamResourceShare_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAwsRamResourceShare_AllowExternalPrincipals(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ @@ -82,6 +84,7 @@ func TestAccAwsRamResourceShare_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ @@ -115,6 +118,7 @@ func TestAccAwsRamResourceShare_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ From 8c110349aad84c50a249001a05919aa8a499aa19 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:16:29 -0400 Subject: [PATCH 0919/1252] tests/r/ram_resource_share_accepter: Add ErrorCheck --- aws/resource_aws_ram_resource_share_accepter_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ram_resource_share_accepter_test.go b/aws/resource_aws_ram_resource_share_accepter_test.go index bf057f3651f..79a2bd000a1 100644 --- a/aws/resource_aws_ram_resource_share_accepter_test.go +++ b/aws/resource_aws_ram_resource_share_accepter_test.go @@ -25,6 +25,7 @@ func TestAccAwsRamResourceShareAccepter_basic(t *testing.T) { testAccPreCheck(t) testAccAlternateAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAwsRamResourceShareAccepterDestroy, Steps: []resource.TestStep{ From 0e13a5e3d1b2844b9473db831de0338c6d5fe483 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:16:49 -0400 Subject: [PATCH 0920/1252] tests/ds/ram_resource_share: Add ErrorCheck --- aws/data_source_aws_ram_resource_share_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ram_resource_share_test.go b/aws/data_source_aws_ram_resource_share_test.go index 9e304bd91e8..81b46bcecf2 100644 --- a/aws/data_source_aws_ram_resource_share_test.go +++ b/aws/data_source_aws_ram_resource_share_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/ram" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,8 +16,9 @@ func TestAccDataSourceAwsRamResourceShare_basic(t *testing.T) { datasourceName := "data.aws_ram_resource_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRamResourceShareConfig_NonExistent, @@ -40,8 +42,9 @@ func TestAccDataSourceAwsRamResourceShare_Tags(t *testing.T) { datasourceName := "data.aws_ram_resource_share.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ram.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsRamResourceShareConfig_Tags(rName), From c049f9d39e5701a467a058e0f3904817c5d51409 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:17:29 -0400 Subject: [PATCH 0921/1252] tests/r/s3_access_point: Add ErrorCheck --- aws/resource_aws_s3_access_point_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_s3_access_point_test.go b/aws/resource_aws_s3_access_point_test.go index 9dc1917e132..c6defba7846 100644 --- a/aws/resource_aws_s3_access_point_test.go +++ b/aws/resource_aws_s3_access_point_test.go @@ -86,6 +86,7 @@ func TestAccAWSS3AccessPoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -126,6 +127,7 @@ func TestAccAWSS3AccessPoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSS3AccessPoint_disappears_Bucket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -172,6 +175,7 @@ func TestAccAWSS3AccessPoint_Bucket_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -252,6 +256,7 @@ func TestAccAWSS3AccessPoint_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -305,6 +310,7 @@ func TestAccAWSS3AccessPoint_PublicAccessBlockConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ @@ -344,6 +350,7 @@ func TestAccAWSS3AccessPoint_VpcConfiguration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccessPointDestroy, Steps: []resource.TestStep{ From 8767ead48da3ea33564bc928670db3ebafd9bbba Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:17:38 -0400 Subject: [PATCH 0922/1252] tests/r/s3_account_public_access_block: Add ErrorCheck --- aws/resource_aws_s3_account_public_access_block_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_s3_account_public_access_block_test.go b/aws/resource_aws_s3_account_public_access_block_test.go index 0cea344960d..5b77d47908b 100644 --- a/aws/resource_aws_s3_account_public_access_block_test.go +++ b/aws/resource_aws_s3_account_public_access_block_test.go @@ -47,6 +47,7 @@ func testAccAWSS3AccountPublicAccessBlock_basic(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -76,6 +77,7 @@ func testAccAWSS3AccountPublicAccessBlock_disappears(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func testAccAWSS3AccountPublicAccessBlock_AccountId(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -122,6 +125,7 @@ func testAccAWSS3AccountPublicAccessBlock_BlockPublicAcls(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -161,6 +165,7 @@ func testAccAWSS3AccountPublicAccessBlock_BlockPublicPolicy(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -200,6 +205,7 @@ func testAccAWSS3AccountPublicAccessBlock_IgnorePublicAcls(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ @@ -239,6 +245,7 @@ func testAccAWSS3AccountPublicAccessBlock_RestrictPublicBuckets(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3AccountPublicAccessBlockDestroy, Steps: []resource.TestStep{ From b6374e96820be8445a2b20a006c1eeef6f4117e4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:17:48 -0400 Subject: [PATCH 0923/1252] tests/r/s3control_bucket: Add ErrorCheck --- aws/resource_aws_s3control_bucket_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_s3control_bucket_test.go b/aws/resource_aws_s3control_bucket_test.go index f280150b2a8..35054754a9d 100644 --- a/aws/resource_aws_s3control_bucket_test.go +++ b/aws/resource_aws_s3control_bucket_test.go @@ -20,6 +20,7 @@ func TestAccAWSS3ControlBucket_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSS3ControlBucket_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSS3ControlBucket_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketDestroy, Steps: []resource.TestStep{ From 49cdb77680f732d494e357673baf4c0f4936f8a0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:17:57 -0400 Subject: [PATCH 0924/1252] tests/r/s3control_bucket_lifecycle_configuration: Add ErrorCheck --- ...ws_s3control_bucket_lifecycle_configuration_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_s3control_bucket_lifecycle_configuration_test.go b/aws/resource_aws_s3control_bucket_lifecycle_configuration_test.go index 7b11ceb6915..508b9603049 100644 --- a/aws/resource_aws_s3control_bucket_lifecycle_configuration_test.go +++ b/aws/resource_aws_s3control_bucket_lifecycle_configuration_test.go @@ -20,6 +20,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -73,6 +75,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_AbortIncompleteMultipa resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -115,6 +118,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Expiration_Date(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -155,6 +159,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Expiration_Days(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -196,6 +201,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Expiration_ExpiredObje resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -236,6 +242,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Filter_Prefix(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -276,6 +283,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Filter_Tags(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -334,6 +342,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ @@ -372,6 +381,7 @@ func TestAccAWSS3ControlBucketLifecycleConfiguration_Rule_Status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketLifecycleConfigurationDestroy, Steps: []resource.TestStep{ From 75da0d6d8893207bc9d24d9bf5bb8b966debf882 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:18:07 -0400 Subject: [PATCH 0925/1252] tests/r/s3control_bucket_policy: Add ErrorCheck --- aws/resource_aws_s3control_bucket_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_s3control_bucket_policy_test.go b/aws/resource_aws_s3control_bucket_policy_test.go index 7d42f8723a8..40a2bf7c38c 100644 --- a/aws/resource_aws_s3control_bucket_policy_test.go +++ b/aws/resource_aws_s3control_bucket_policy_test.go @@ -20,6 +20,7 @@ func TestAccAWSS3ControlBucketPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketPolicyDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSS3ControlBucketPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketPolicyDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSS3ControlBucketPolicy_Policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3control.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3ControlBucketPolicyDestroy, Steps: []resource.TestStep{ From d0e36f6d55ba429aa460ce2394b03dc76ad2bc3c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:19:09 -0400 Subject: [PATCH 0926/1252] tests/r/transfer_ssh_key: Add ErrorCheck --- aws/resource_aws_transfer_ssh_key_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_transfer_ssh_key_test.go b/aws/resource_aws_transfer_ssh_key_test.go index dbb35eadb24..9437daee8f8 100644 --- a/aws/resource_aws_transfer_ssh_key_test.go +++ b/aws/resource_aws_transfer_ssh_key_test.go @@ -17,6 +17,7 @@ func TestAccAWSTransferSshKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferSshKeyDestroy, Steps: []resource.TestStep{ From c6904d2f3846e09c114597b390fb5d39e1141126 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:19:18 -0400 Subject: [PATCH 0927/1252] tests/r/transfer_user: Add ErrorCheck --- aws/resource_aws_transfer_user_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_transfer_user_test.go b/aws/resource_aws_transfer_user_test.go index 4e02ba41fca..2fb9d25a7f8 100644 --- a/aws/resource_aws_transfer_user_test.go +++ b/aws/resource_aws_transfer_user_test.go @@ -19,6 +19,7 @@ func TestAccAWSTransferUser_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferUserDestroy, @@ -51,6 +52,7 @@ func TestAccAWSTransferUser_modifyWithOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferUserDestroy, @@ -110,6 +112,7 @@ func TestAccAWSTransferUser_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferUserDestroy, Steps: []resource.TestStep{ @@ -129,6 +132,7 @@ func TestAccAWSTransferUser_disappears(t *testing.T) { func TestAccAWSTransferUser_UserName_Validation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferUserDestroy, Steps: []resource.TestStep{ @@ -169,6 +173,7 @@ func TestAccAWSTransferUser_homeDirectoryMappings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferUserDestroy, From ba708bebad49716a7167d3f1473f4f7e6e8aafab Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:19:28 -0400 Subject: [PATCH 0928/1252] tests/ds/transfer_server: Add ErrorCheck --- aws/data_source_aws_transfer_server_test.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/aws/data_source_aws_transfer_server_test.go b/aws/data_source_aws_transfer_server_test.go index e624772be42..ad55309eb06 100644 --- a/aws/data_source_aws_transfer_server_test.go +++ b/aws/data_source_aws_transfer_server_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/transfer" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccDataSourceAwsTransferServer_basic(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsTransferServerConfig_basic, @@ -35,8 +37,9 @@ func TestAccDataSourceAwsTransferServer_service_managed(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsTransferServerConfig_service_managed(rName), @@ -57,8 +60,9 @@ func TestAccDataSourceAwsTransferServer_apigateway(t *testing.T) { datasourceName := "data.aws_transfer_server.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t); testAccAPIGatewayTypeEDGEPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsTransferServerConfig_apigateway(rName), From 01c35a1ce2b436f157cdc24637386791d8f3b736 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:20:35 -0400 Subject: [PATCH 0929/1252] tests/r/transfer_server: Add ErrorCheck --- aws/resource_aws_transfer_server_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_transfer_server_test.go b/aws/resource_aws_transfer_server_test.go index 25d895ad6dc..d2be51f27c7 100644 --- a/aws/resource_aws_transfer_server_test.go +++ b/aws/resource_aws_transfer_server_test.go @@ -71,6 +71,7 @@ func TestAccAWSTransferServer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, @@ -117,6 +118,7 @@ func TestAccAWSTransferServer_Vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, @@ -160,6 +162,7 @@ func TestAccAWSTransferServer_apigateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccAPIGatewayTypeEDGEPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, @@ -189,6 +192,7 @@ func TestAccAWSTransferServer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, Steps: []resource.TestStep{ @@ -212,6 +216,7 @@ func TestAccAWSTransferServer_forcedestroy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, @@ -245,6 +250,7 @@ func TestAccAWSTransferServer_vpcEndpointId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSTransfer(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, @@ -274,6 +280,7 @@ func TestAccAWSTransferServer_hostKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, transfer.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSTransferServerDestroy, From 842893806c37631ee790b76a4d88199ff641bd53 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:21:34 -0400 Subject: [PATCH 0930/1252] tests/r/elastic_beanstalk_application: Add ErrorCheck --- aws/resource_aws_elastic_beanstalk_application_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_elastic_beanstalk_application_test.go b/aws/resource_aws_elastic_beanstalk_application_test.go index 14b37acd5ed..897c672c39e 100644 --- a/aws/resource_aws_elastic_beanstalk_application_test.go +++ b/aws/resource_aws_elastic_beanstalk_application_test.go @@ -68,6 +68,7 @@ func TestAccAWSElasticBeanstalkApplication_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkAppDestroy, Steps: []resource.TestStep{ @@ -99,6 +100,7 @@ func TestAccAWSBeanstalkApp_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkAppDestroy, Steps: []resource.TestStep{ @@ -118,6 +120,7 @@ func TestAccAWSBeanstalkApp_appversionlifecycle(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkAppDestroy, Steps: []resource.TestStep{ @@ -178,6 +181,7 @@ func TestAccAWSBeanstalkApp_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkAppDestroy, Steps: []resource.TestStep{ From 6da3a52f0f013bbcdf52d237b0406efd86fcecbc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:21:43 -0400 Subject: [PATCH 0931/1252] tests/r/elastic_beanstalk_application_version: Add ErrorCheck --- aws/resource_aws_elastic_beanstalk_application_version_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_elastic_beanstalk_application_version_test.go b/aws/resource_aws_elastic_beanstalk_application_version_test.go index df1498f9f7a..b10eb0b7b1f 100644 --- a/aws/resource_aws_elastic_beanstalk_application_version_test.go +++ b/aws/resource_aws_elastic_beanstalk_application_version_test.go @@ -18,6 +18,7 @@ func TestAccAWSBeanstalkAppVersion_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckApplicationVersionDestroy, Steps: []resource.TestStep{ @@ -37,6 +38,7 @@ func TestAccAWSBeanstalkAppVersion_duplicateLabels(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckApplicationVersionDestroy, Steps: []resource.TestStep{ @@ -57,6 +59,7 @@ func TestAccAWSBeanstalkAppVersion_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckApplicationVersionDestroy, Steps: []resource.TestStep{ From 257b739ac6be0abc18c9620dc243b016687f8f62 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:21:53 -0400 Subject: [PATCH 0932/1252] tests/r/elastic_beanstalk_configuration_template: Add ErrorCheck --- ...source_aws_elastic_beanstalk_configuration_template_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_elastic_beanstalk_configuration_template_test.go b/aws/resource_aws_elastic_beanstalk_configuration_template_test.go index d28b5e5a8fe..faa8a1dc7c4 100644 --- a/aws/resource_aws_elastic_beanstalk_configuration_template_test.go +++ b/aws/resource_aws_elastic_beanstalk_configuration_template_test.go @@ -17,6 +17,7 @@ func TestAccAWSBeanstalkConfigurationTemplate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkConfigurationTemplateDestroy, Steps: []resource.TestStep{ @@ -35,6 +36,7 @@ func TestAccAWSBeanstalkConfigurationTemplate_VPC(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkConfigurationTemplateDestroy, Steps: []resource.TestStep{ @@ -53,6 +55,7 @@ func TestAccAWSBeanstalkConfigurationTemplate_Setting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkConfigurationTemplateDestroy, Steps: []resource.TestStep{ From b11bdea5bb7b9f6ba31a1357a46aad44ab918e7a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:22:03 -0400 Subject: [PATCH 0933/1252] tests/r/elastic_beanstalk_environment: Add ErrorCheck --- ...urce_aws_elastic_beanstalk_environment_test.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_elastic_beanstalk_environment_test.go b/aws/resource_aws_elastic_beanstalk_environment_test.go index 0c5b7004024..d049a7b14b0 100644 --- a/aws/resource_aws_elastic_beanstalk_environment_test.go +++ b/aws/resource_aws_elastic_beanstalk_environment_test.go @@ -80,6 +80,7 @@ func TestAccAWSBeanstalkEnv_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -117,6 +118,7 @@ func TestAccAWSBeanstalkEnv_tier(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -150,6 +152,7 @@ func TestAccAWSBeanstalkEnv_cname_prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -181,6 +184,7 @@ func TestAccAWSBeanstalkEnv_config(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -227,6 +231,7 @@ func TestAccAWSBeanstalkEnv_resource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -257,6 +262,7 @@ func TestAccAWSBeanstalkEnv_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -301,9 +307,8 @@ func TestAccAWSBeanstalkEnv_template_change(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -337,6 +342,7 @@ func TestAccAWSBeanstalkEnv_settings_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -380,6 +386,7 @@ func TestAccAWSBeanstalkEnv_version_label(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -416,6 +423,7 @@ func TestAccAWSBeanstalkEnv_settingWithJsonValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ @@ -446,6 +454,7 @@ func TestAccAWSBeanstalkEnv_platformArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ From 023197cd2f3d02f1039f7f64164a0d6fba88b2cf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:22:13 -0400 Subject: [PATCH 0934/1252] tests/ds/elastic_beanstalk_application: Add ErrorCheck --- aws/data_source_aws_elastic_beanstalk_application_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_elastic_beanstalk_application_test.go b/aws/data_source_aws_elastic_beanstalk_application_test.go index bd1c689cce2..a4d19ccdd5d 100644 --- a/aws/data_source_aws_elastic_beanstalk_application_test.go +++ b/aws/data_source_aws_elastic_beanstalk_application_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAwsElasticBeanstalkApplicationDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ From 18809e3df1d05e7651e2d5bc983aec89babd72db Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:22:22 -0400 Subject: [PATCH 0935/1252] tests/ds/elastic_beanstalk_solution_stack: Add ErrorCheck --- ...data_source_aws_elastic_beanstalk_solution_stack_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_elastic_beanstalk_solution_stack_test.go b/aws/data_source_aws_elastic_beanstalk_solution_stack_test.go index e3a2419a5ac..e2f8a4ca150 100644 --- a/aws/data_source_aws_elastic_beanstalk_solution_stack_test.go +++ b/aws/data_source_aws_elastic_beanstalk_solution_stack_test.go @@ -5,14 +5,16 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccAWSElasticBeanstalkSolutionStackDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElasticBeanstalkSolutionStackDataSourceConfig, From 061080b91e43832d54a2391d2525eb2f3c4a209d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:03 -0400 Subject: [PATCH 0936/1252] tests/r/dms_certificate: Add ErrorCheck --- aws/resource_aws_dms_certificate_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_dms_certificate_test.go b/aws/resource_aws_dms_certificate_test.go index cf902dbf89f..aae0633cb9d 100644 --- a/aws/resource_aws_dms_certificate_test.go +++ b/aws/resource_aws_dms_certificate_test.go @@ -18,6 +18,7 @@ func TestAccAWSDmsCertificate_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsCertificateDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSDmsCertificate_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -64,6 +66,7 @@ func TestAccAWSDmsCertificate_CertificateWallet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsCertificateDestroy, Steps: []resource.TestStep{ @@ -89,6 +92,7 @@ func TestAccAWSDmsCertificate_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsCertificateDestroy, Steps: []resource.TestStep{ From eb35d3a033b430cce834074ded7d8cddebb1ec61 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:13 -0400 Subject: [PATCH 0937/1252] tests/r/dms_endpoint: Add ErrorCheck --- aws/resource_aws_dms_endpoint_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_dms_endpoint_test.go b/aws/resource_aws_dms_endpoint_test.go index 7902378f534..79723c31187 100644 --- a/aws/resource_aws_dms_endpoint_test.go +++ b/aws/resource_aws_dms_endpoint_test.go @@ -18,6 +18,7 @@ func TestAccAwsDmsEndpoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAwsDmsEndpoint_S3(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -104,6 +106,7 @@ func TestAccAwsDmsEndpoint_S3_ExtraConnectionAttributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -130,6 +133,7 @@ func TestAccAwsDmsEndpoint_DynamoDb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -162,6 +166,7 @@ func TestAccAwsDmsEndpoint_Elasticsearch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -195,6 +200,7 @@ func TestAccAwsDmsEndpoint_Elasticsearch_ExtraConnectionAttributes(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -221,6 +227,7 @@ func TestAccAwsDmsEndpoint_Elasticsearch_ErrorRetryDuration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -258,6 +265,7 @@ func TestAccAwsDmsEndpoint_Elasticsearch_FullLoadErrorPercentage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -299,6 +307,7 @@ func TestAccAwsDmsEndpoint_Kafka_Broker(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -336,6 +345,7 @@ func TestAccAwsDmsEndpoint_Kafka_Topic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -371,6 +381,7 @@ func TestAccAwsDmsEndpoint_Kinesis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -408,6 +419,7 @@ func TestAccAwsDmsEndpoint_MongoDb(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -437,6 +449,7 @@ func TestAccAwsDmsEndpoint_MongoDb_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -481,6 +494,7 @@ func TestAccAwsDmsEndpoint_DocDB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ @@ -520,6 +534,7 @@ func TestAccAwsDmsEndpoint_Db2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsEndpointDestroy, Steps: []resource.TestStep{ From ae32a8d73164b7fd6040f03cc18871fa50c0eab9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:23 -0400 Subject: [PATCH 0938/1252] tests/r/dms_event_subscription: Add ErrorCheck --- aws/resource_aws_dms_event_subscription_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_dms_event_subscription_test.go b/aws/resource_aws_dms_event_subscription_test.go index 727cc9d6147..67151226c28 100644 --- a/aws/resource_aws_dms_event_subscription_test.go +++ b/aws/resource_aws_dms_event_subscription_test.go @@ -19,6 +19,7 @@ func TestAccAWSDmsEventSubscription_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDmsEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSDmsEventSubscription_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDmsEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAWSDmsEventSubscription_Enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDmsEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -114,6 +117,7 @@ func TestAccAWSDmsEventSubscription_EventCategories(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDmsEventSubscriptionDestroy, Steps: []resource.TestStep{ @@ -151,6 +155,7 @@ func TestAccAWSDmsEventSubscription_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDmsEventSubscriptionDestroy, Steps: []resource.TestStep{ From 6d154fc64598a2b71d4f39a0c34b0b48c1abae88 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:33 -0400 Subject: [PATCH 0939/1252] tests/r/dms_replication_instance: Add ErrorCheck --- aws/resource_aws_dms_replication_instance_test.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/aws/resource_aws_dms_replication_instance_test.go b/aws/resource_aws_dms_replication_instance_test.go index 7dc7d6d499c..95ffea3ad1d 100644 --- a/aws/resource_aws_dms_replication_instance_test.go +++ b/aws/resource_aws_dms_replication_instance_test.go @@ -85,6 +85,7 @@ func TestAccAWSDmsReplicationInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -123,6 +124,7 @@ func TestAccAWSDmsReplicationInstance_AllocatedStorage(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -156,6 +158,7 @@ func TestAccAWSDmsReplicationInstance_AutoMinorVersionUpgrade(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -197,6 +200,7 @@ func TestAccAWSDmsReplicationInstance_AvailabilityZone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -274,6 +278,7 @@ func TestAccAWSDmsReplicationInstance_KmsKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -300,6 +305,7 @@ func TestAccAWSDmsReplicationInstance_MultiAz(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -340,6 +346,7 @@ func TestAccAWSDmsReplicationInstance_PreferredMaintenanceWindow(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -373,6 +380,7 @@ func TestAccAWSDmsReplicationInstance_PubliclyAccessible(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -403,6 +411,7 @@ func TestAccAWSDmsReplicationInstance_ReplicationInstanceClass(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -437,6 +446,7 @@ func TestAccAWSDmsReplicationInstance_ReplicationSubnetGroupId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -463,6 +473,7 @@ func TestAccAWSDmsReplicationInstance_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ @@ -507,6 +518,7 @@ func TestAccAWSDmsReplicationInstance_VpcSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: []resource.TestStep{ From dab87aab1b2627b59f72658aef6602342fcb3df2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:33 -0400 Subject: [PATCH 0940/1252] tests/r/dms_replication_subnet_group: Add ErrorCheck --- aws/resource_aws_dms_replication_subnet_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_dms_replication_subnet_group_test.go b/aws/resource_aws_dms_replication_subnet_group_test.go index de908478df1..34217467750 100644 --- a/aws/resource_aws_dms_replication_subnet_group_test.go +++ b/aws/resource_aws_dms_replication_subnet_group_test.go @@ -18,6 +18,7 @@ func TestAccAWSDmsReplicationSubnetGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsReplicationSubnetGroupDestroy, Steps: []resource.TestStep{ From a5214cee2bb7f4b01aaab88c9f5579e3c0235525 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:24:42 -0400 Subject: [PATCH 0941/1252] tests/r/dms_replication_task: Add ErrorCheck --- aws/resource_aws_dms_replication_task_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_dms_replication_task_test.go b/aws/resource_aws_dms_replication_task_test.go index ae10aa8164c..62ac0facf4c 100644 --- a/aws/resource_aws_dms_replication_task_test.go +++ b/aws/resource_aws_dms_replication_task_test.go @@ -17,6 +17,7 @@ func TestAccAWSDmsReplicationTask_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: dmsReplicationTaskDestroy, Steps: []resource.TestStep{ From 04232074515605101fc0c0abf01f9d5d211befb1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:25:25 -0400 Subject: [PATCH 0942/1252] tests/r/directory_service_conditional_forwarder: Add ErrorCheck --- aws/resource_aws_directory_service_conditional_forwarder_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_directory_service_conditional_forwarder_test.go b/aws/resource_aws_directory_service_conditional_forwarder_test.go index bfa948a45f9..93c7f78a06c 100644 --- a/aws/resource_aws_directory_service_conditional_forwarder_test.go +++ b/aws/resource_aws_directory_service_conditional_forwarder_test.go @@ -17,6 +17,7 @@ func TestAccAWSDirectoryServiceConditionForwarder_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDirectoryServiceConditionalForwarderDestroy, Steps: []resource.TestStep{ From 4b3b66eebe154505d7090d02800d3f21f35a97e3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:25:35 -0400 Subject: [PATCH 0943/1252] tests/r/directory_service_directory: Add ErrorCheck --- aws/resource_aws_directory_service_directory_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_directory_service_directory_test.go b/aws/resource_aws_directory_service_directory_test.go index a3a53bf6f02..78d9bfaf646 100644 --- a/aws/resource_aws_directory_service_directory_test.go +++ b/aws/resource_aws_directory_service_directory_test.go @@ -89,6 +89,7 @@ func TestAccAWSDirectoryServiceDirectory_basic(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSDirectoryServiceDirectory_tags(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -169,6 +171,7 @@ func TestAccAWSDirectoryServiceDirectory_microsoft(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -197,6 +200,7 @@ func TestAccAWSDirectoryServiceDirectory_microsoftStandard(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -229,6 +233,7 @@ func TestAccAWSDirectoryServiceDirectory_connector(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -263,6 +268,7 @@ func TestAccAWSDirectoryServiceDirectory_withAliasAndSso(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ @@ -341,6 +347,7 @@ func TestAccAWSDirectoryServiceDirectory_disappears(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, Steps: []resource.TestStep{ From 63522f0e3837e46f639ff36ed1ef3e45550966ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:25:45 -0400 Subject: [PATCH 0944/1252] tests/r/directory_service_log_subscription: Add ErrorCheck --- aws/resource_aws_directory_service_log_subscription_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_directory_service_log_subscription_test.go b/aws/resource_aws_directory_service_log_subscription_test.go index 858acf5611f..1ed01c8313e 100644 --- a/aws/resource_aws_directory_service_log_subscription_test.go +++ b/aws/resource_aws_directory_service_log_subscription_test.go @@ -16,6 +16,7 @@ func TestAccAWSDirectoryServiceLogSubscription_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsDirectoryServiceLogSubscriptionDestroy, Steps: []resource.TestStep{ From 087997288b77aeeae769cdecaf6a297c9afd457d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:25:45 -0400 Subject: [PATCH 0945/1252] tests/ds/directory_service_directory: Add ErrorCheck --- ...rce_aws_directory_service_directory_test.go | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/aws/data_source_aws_directory_service_directory_test.go b/aws/data_source_aws_directory_service_directory_test.go index a8c01c95314..f6742d3bc07 100644 --- a/aws/data_source_aws_directory_service_directory_test.go +++ b/aws/data_source_aws_directory_service_directory_test.go @@ -13,8 +13,9 @@ import ( func TestAccDataSourceAwsDirectoryServiceDirectory_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsDirectoryServiceDirectoryConfig_NonExistent, @@ -30,8 +31,9 @@ func TestAccDataSourceAwsDirectoryServiceDirectory_SimpleAD(t *testing.T) { dataSourceName := "data.aws_directory_service_directory.test-simple-ad" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsDirectoryServiceDirectoryConfig_SimpleAD(alias), @@ -61,8 +63,9 @@ func TestAccDataSourceAwsDirectoryServiceDirectory_MicrosoftAD(t *testing.T) { dataSourceName := "data.aws_directory_service_directory.test-microsoft-ad" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsDirectoryServiceDirectoryConfig_MicrosoftAD(alias), @@ -96,7 +99,8 @@ func TestAccDataSourceAWSDirectoryServiceDirectory_connector(t *testing.T) { testAccPreCheckAWSDirectoryService(t) testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) }, - Providers: testAccProviders, + ErrorCheck: testAccErrorCheck(t, directoryservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceDirectoryServiceDirectoryConfig_connector(), From 60c13715a937a16e87beb37871928a1748652351 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:27:03 -0400 Subject: [PATCH 0946/1252] tests/r/cloudwatch_log_destination: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_destination_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cloudwatch_log_destination_test.go b/aws/resource_aws_cloudwatch_log_destination_test.go index 5b8348a2179..899b84048b5 100644 --- a/aws/resource_aws_cloudwatch_log_destination_test.go +++ b/aws/resource_aws_cloudwatch_log_destination_test.go @@ -20,6 +20,7 @@ func TestAccAWSCloudwatchLogDestination_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudwatchLogDestinationDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSCloudwatchLogDestination_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudwatchLogDestinationDestroy, Steps: []resource.TestStep{ From 4c8aecc82ba1800dce2b246d5558a0d4af36ad45 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:27:12 -0400 Subject: [PATCH 0947/1252] tests/r/cloudwatch_log_destination_policy: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_destination_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_cloudwatch_log_destination_policy_test.go b/aws/resource_aws_cloudwatch_log_destination_policy_test.go index 91f661dc540..5a968c503d3 100644 --- a/aws/resource_aws_cloudwatch_log_destination_policy_test.go +++ b/aws/resource_aws_cloudwatch_log_destination_policy_test.go @@ -17,6 +17,7 @@ func TestAccAWSCloudwatchLogDestinationPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudwatchLogDestinationPolicyDestroy, Steps: []resource.TestStep{ From fa26f9a448390d8d2772acebe4ca36046fa94196 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:27:32 -0400 Subject: [PATCH 0948/1252] tests/r/cloudwatch_log_group: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_group_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_cloudwatch_log_group_test.go b/aws/resource_aws_cloudwatch_log_group_test.go index 463eb570179..4665d617c9f 100644 --- a/aws/resource_aws_cloudwatch_log_group_test.go +++ b/aws/resource_aws_cloudwatch_log_group_test.go @@ -101,6 +101,7 @@ func TestAccAWSCloudWatchLogGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -130,6 +131,7 @@ func TestAccAWSCloudWatchLogGroup_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -157,6 +159,7 @@ func TestAccAWSCloudWatchLogGroup_namePrefix_retention(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -192,6 +195,7 @@ func TestAccAWSCloudWatchLogGroup_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -218,6 +222,7 @@ func TestAccAWSCloudWatchLogGroup_retentionPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -252,6 +257,7 @@ func TestAccAWSCloudWatchLogGroup_multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -283,6 +289,7 @@ func TestAccAWSCloudWatchLogGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -305,6 +312,7 @@ func TestAccAWSCloudWatchLogGroup_tagging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ @@ -367,6 +375,7 @@ func TestAccAWSCloudWatchLogGroup_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, Steps: []resource.TestStep{ From 0609ddba090bc5579f78e4651ea7d2254cea1e75 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:27:42 -0400 Subject: [PATCH 0949/1252] tests/r/cloudwatch_log_metric_filter: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_metric_filter_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_cloudwatch_log_metric_filter_test.go b/aws/resource_aws_cloudwatch_log_metric_filter_test.go index f5acf3565a3..53a9274a0d2 100644 --- a/aws/resource_aws_cloudwatch_log_metric_filter_test.go +++ b/aws/resource_aws_cloudwatch_log_metric_filter_test.go @@ -18,6 +18,7 @@ func TestAccAWSCloudWatchLogMetricFilter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogMetricFilterDestroy, Steps: []resource.TestStep{ From ba298a8ee8f76313d152156477ce8de291f39fac Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:27:51 -0400 Subject: [PATCH 0950/1252] tests/r/cloudwatch_log_resource_policy: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_resource_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_cloudwatch_log_resource_policy_test.go b/aws/resource_aws_cloudwatch_log_resource_policy_test.go index 81155feb4fa..3d1725382a4 100644 --- a/aws/resource_aws_cloudwatch_log_resource_policy_test.go +++ b/aws/resource_aws_cloudwatch_log_resource_policy_test.go @@ -69,6 +69,7 @@ func TestAccAWSCloudWatchLogResourcePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchLogResourcePolicyDestroy, Steps: []resource.TestStep{ From 932645a19f045c00a9f90155d47dfdf41bd2bd43 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:28:01 -0400 Subject: [PATCH 0951/1252] tests/r/cloudwatch_log_stream: Add ErrorCheck --- aws/resource_aws_cloudwatch_log_stream_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudwatch_log_stream_test.go b/aws/resource_aws_cloudwatch_log_stream_test.go index 9a914e7691b..fe564dcd20e 100644 --- a/aws/resource_aws_cloudwatch_log_stream_test.go +++ b/aws/resource_aws_cloudwatch_log_stream_test.go @@ -17,6 +17,7 @@ func TestAccAWSCloudWatchLogStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogStreamDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSCloudWatchLogStream_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogStreamDestroy, Steps: []resource.TestStep{ @@ -67,6 +69,7 @@ func TestAccAWSCloudWatchLogStream_disappears_LogGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchLogStreamDestroy, Steps: []resource.TestStep{ From 18013dbf649995899a8f4f4344e1829e94e54133 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:28:12 -0400 Subject: [PATCH 0952/1252] tests/r/cloudwatch_log_subscription_filter: Add ErrorCheck --- ...resource_aws_cloudwatch_log_subscription_filter_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_cloudwatch_log_subscription_filter_test.go b/aws/resource_aws_cloudwatch_log_subscription_filter_test.go index e828f3dbdaa..14f9b54c8cd 100644 --- a/aws/resource_aws_cloudwatch_log_subscription_filter_test.go +++ b/aws/resource_aws_cloudwatch_log_subscription_filter_test.go @@ -21,6 +21,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_disappears_LogGroup(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -103,6 +106,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_DestinationArn_KinesisDataFirehos resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -132,6 +136,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_DestinationArn_KinesisStream(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -160,6 +165,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_Distribution(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ @@ -197,6 +203,7 @@ func TestAccAWSCloudwatchLogSubscriptionFilter_RoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudwatchLogSubscriptionFilterDestroy, Steps: []resource.TestStep{ From 25c5dbfb82964e92eac07b2a790e48b6d5afb329 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:29:02 -0400 Subject: [PATCH 0953/1252] tests/r/cloudwatch_event_archive: Add ErrorCheck --- aws/resource_aws_cloudwatch_event_archive_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_cloudwatch_event_archive_test.go b/aws/resource_aws_cloudwatch_event_archive_test.go index 685577b496c..214edcfadcd 100644 --- a/aws/resource_aws_cloudwatch_event_archive_test.go +++ b/aws/resource_aws_cloudwatch_event_archive_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" events "github.com/aws/aws-sdk-go/service/cloudwatchevents" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -77,6 +78,7 @@ func TestAccAWSCloudWatchEventArchive_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventArchiveDestroy, Steps: []resource.TestStep{ @@ -107,6 +109,7 @@ func TestAccAWSCloudWatchEventArchive_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventArchiveDestroy, Steps: []resource.TestStep{ @@ -136,6 +139,7 @@ func TestAccAWSCloudWatchEventArchive_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventArchiveDestroy, Steps: []resource.TestStep{ @@ -207,6 +211,7 @@ func TestAccAWSCloudWatchEventArchive_retentionSetOnCreation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventArchiveDestroy, Steps: []resource.TestStep{ From a4e27daee18459af67e9cd9a1d8436d532e527c6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:29:12 -0400 Subject: [PATCH 0954/1252] tests/r/cloudwatch_event_bus: Add ErrorCheck --- aws/resource_aws_cloudwatch_event_bus_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_cloudwatch_event_bus_test.go b/aws/resource_aws_cloudwatch_event_bus_test.go index bd8a52601f0..741833dce10 100644 --- a/aws/resource_aws_cloudwatch_event_bus_test.go +++ b/aws/resource_aws_cloudwatch_event_bus_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" events "github.com/aws/aws-sdk-go/service/cloudwatchevents" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -81,6 +82,7 @@ func TestAccAWSCloudWatchEventBus_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventBusDestroy, Steps: []resource.TestStep{ @@ -129,6 +131,7 @@ func TestAccAWSCloudWatchEventBus_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventBusDestroy, Steps: []resource.TestStep{ @@ -179,6 +182,7 @@ func TestAccAWSCloudWatchEventBus_tags(t *testing.T) { func TestAccAWSCloudWatchEventBus_default(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventBusDestroy, Steps: []resource.TestStep{ @@ -198,6 +202,7 @@ func TestAccAWSCloudWatchEventBus_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventBusDestroy, Steps: []resource.TestStep{ From 907c557a047f081ccacb6ce3ad7f791c99bfe96b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:29:21 -0400 Subject: [PATCH 0955/1252] tests/r/cloudwatch_event_permission: Add ErrorCheck --- aws/resource_aws_cloudwatch_event_permission_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_cloudwatch_event_permission_test.go b/aws/resource_aws_cloudwatch_event_permission_test.go index 5e1471f2076..153309ab038 100644 --- a/aws/resource_aws_cloudwatch_event_permission_test.go +++ b/aws/resource_aws_cloudwatch_event_permission_test.go @@ -9,6 +9,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" events "github.com/aws/aws-sdk-go/service/cloudwatchevents" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -75,6 +76,7 @@ func TestAccAWSCloudWatchEventPermission_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ @@ -146,6 +148,7 @@ func TestAccAWSCloudWatchEventPermission_EventBusName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ @@ -176,6 +179,7 @@ func TestAccAWSCloudWatchEventPermission_Action(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ @@ -217,6 +221,7 @@ func TestAccAWSCloudWatchEventPermission_Condition(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ @@ -259,6 +264,7 @@ func TestAccAWSCloudWatchEventPermission_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ @@ -292,6 +298,7 @@ func TestAccAWSCloudWatchEventPermission_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudWatchEventPermissionDestroy, Steps: []resource.TestStep{ From b540ade03917cfabad7ea5faf2060c05306c98a4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:29:31 -0400 Subject: [PATCH 0956/1252] tests/r/cloudwatch_event_rule: Add ErrorCheck --- aws/resource_aws_cloudwatch_event_rule_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_cloudwatch_event_rule_test.go b/aws/resource_aws_cloudwatch_event_rule_test.go index ca0768b38e8..2a9944073be 100644 --- a/aws/resource_aws_cloudwatch_event_rule_test.go +++ b/aws/resource_aws_cloudwatch_event_rule_test.go @@ -7,6 +7,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" events "github.com/aws/aws-sdk-go/service/cloudwatchevents" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" @@ -84,6 +85,7 @@ func TestAccAWSCloudWatchEventRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAWSCloudWatchEventRule_EventBusName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -203,6 +206,7 @@ func TestAccAWSCloudWatchEventRule_role(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -230,6 +234,7 @@ func TestAccAWSCloudWatchEventRule_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -265,6 +270,7 @@ func TestAccAWSCloudWatchEventRule_pattern(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -301,6 +307,7 @@ func TestAccAWSCloudWatchEventRule_ScheduleAndPattern(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -329,6 +336,7 @@ func TestAccAWSCloudWatchEventRule_NamePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -355,6 +363,7 @@ func TestAccAWSCloudWatchEventRule_Name_Generated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -382,6 +391,7 @@ func TestAccAWSCloudWatchEventRule_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ @@ -433,6 +443,7 @@ func TestAccAWSCloudWatchEventRule_IsEnabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventRuleDestroy, Steps: []resource.TestStep{ From 1e69af8cd90d7771cb638a3ef1b84d9e82f5692f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:29:41 -0400 Subject: [PATCH 0957/1252] tests/r/cloudwatch_event_target: Add ErrorCheck --- aws/resource_aws_cloudwatch_event_target_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aws/resource_aws_cloudwatch_event_target_test.go b/aws/resource_aws_cloudwatch_event_target_test.go index f258ded59aa..3599a5bb708 100644 --- a/aws/resource_aws_cloudwatch_event_target_test.go +++ b/aws/resource_aws_cloudwatch_event_target_test.go @@ -9,6 +9,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/cloudwatchevents" events "github.com/aws/aws-sdk-go/service/cloudwatchevents" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" @@ -118,6 +119,7 @@ func TestAccAWSCloudWatchEventTarget_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -184,6 +186,7 @@ func TestAccAWSCloudWatchEventTarget_EventBusName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -225,6 +228,7 @@ func TestAccAWSCloudWatchEventTarget_GeneratedTargetId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -259,6 +263,7 @@ func TestAccAWSCloudWatchEventTarget_RetryPolicy_DeadLetterConfig(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -291,6 +296,7 @@ func TestAccAWSCloudWatchEventTarget_full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -326,6 +332,7 @@ func TestAccAWSCloudWatchEventTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -348,6 +355,7 @@ func TestAccAWSCloudWatchEventTarget_ssmDocument(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -380,6 +388,7 @@ func TestAccAWSCloudWatchEventTarget_ecs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -413,6 +422,7 @@ func TestAccAWSCloudWatchEventTarget_ecsWithBlankTaskCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -442,6 +452,7 @@ func TestAccAWSCloudWatchEventTarget_batch(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -471,6 +482,7 @@ func TestAccAWSCloudWatchEventTarget_kinesis(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -498,6 +510,7 @@ func TestAccAWSCloudWatchEventTarget_sqs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -563,6 +576,7 @@ func TestAccAWSCloudWatchEventTarget_input_transformer(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ @@ -598,6 +612,7 @@ func TestAccAWSCloudWatchEventTarget_inputTransformerJsonString(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchevents.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchEventTargetDestroy, Steps: []resource.TestStep{ From 150f681cdbe020b944db8a500ec4e62de69d44ec Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:36:16 -0400 Subject: [PATCH 0958/1252] tests/r/eks_cluster: Add ErrorCheck --- aws/resource_aws_eks_cluster_test.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/aws/resource_aws_eks_cluster_test.go b/aws/resource_aws_eks_cluster_test.go index dc1072979f9..991f0df8090 100644 --- a/aws/resource_aws_eks_cluster_test.go +++ b/aws/resource_aws_eks_cluster_test.go @@ -74,6 +74,7 @@ func TestAccAWSEksCluster_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -121,6 +122,7 @@ func TestAccAWSEksCluster_EncryptionConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -151,6 +153,7 @@ func TestAccAWSEksCluster_Version(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -186,6 +189,7 @@ func TestAccAWSEksCluster_Logging(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -232,6 +236,7 @@ func TestAccAWSEksCluster_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -277,6 +282,7 @@ func TestAccAWSEksCluster_VpcConfig_SecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -305,6 +311,7 @@ func TestAccAWSEksCluster_VpcConfig_EndpointPrivateAccess(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -351,6 +358,7 @@ func TestAccAWSEksCluster_VpcConfig_EndpointPublicAccess(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -397,6 +405,7 @@ func TestAccAWSEksCluster_VpcConfig_PublicAccessCidrs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ @@ -433,6 +442,7 @@ func TestAccAWSEksCluster_NetworkConfig_ServiceIpv4Cidr(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ From 7522c4b6119836932249980faa9c311995092190 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:36:26 -0400 Subject: [PATCH 0959/1252] tests/r/eks_fargate_profile: Add ErrorCheck --- aws/resource_aws_eks_fargate_profile_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_eks_fargate_profile_test.go b/aws/resource_aws_eks_fargate_profile_test.go index 38e316b26f8..d01b7b2eed1 100644 --- a/aws/resource_aws_eks_fargate_profile_test.go +++ b/aws/resource_aws_eks_fargate_profile_test.go @@ -87,6 +87,7 @@ func TestAccAWSEksFargateProfile_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, Steps: []resource.TestStep{ @@ -120,6 +121,7 @@ func TestAccAWSEksFargateProfile_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, Steps: []resource.TestStep{ @@ -143,6 +145,7 @@ func TestAccAWSEksFargateProfile_Multi_Profile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, Steps: []resource.TestStep{ @@ -164,6 +167,7 @@ func TestAccAWSEksFargateProfile_Selector_Labels(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, Steps: []resource.TestStep{ @@ -189,6 +193,7 @@ func TestAccAWSEksFargateProfile_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, Steps: []resource.TestStep{ From 0712c7cd6178410cebe112d7b7376d4abc0a765c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:36:35 -0400 Subject: [PATCH 0960/1252] tests/r/eks_node_group: Add ErrorCheck --- aws/resource_aws_eks_node_group_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aws/resource_aws_eks_node_group_test.go b/aws/resource_aws_eks_node_group_test.go index 33a74043018..be56247e5fa 100644 --- a/aws/resource_aws_eks_node_group_test.go +++ b/aws/resource_aws_eks_node_group_test.go @@ -86,6 +86,7 @@ func TestAccAWSEksNodeGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -132,6 +133,7 @@ func TestAccAWSEksNodeGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAWSEksNodeGroup_AmiType(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -187,6 +190,7 @@ func TestAccAWSEksNodeGroup_CapacityType_Spot(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -213,6 +217,7 @@ func TestAccAWSEksNodeGroup_DiskSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -239,6 +244,7 @@ func TestAccAWSEksNodeGroup_ForceUpdateVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -274,6 +280,7 @@ func TestAccAWSEksNodeGroup_InstanceTypes_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -300,6 +307,7 @@ func TestAccAWSEksNodeGroup_InstanceTypes_Single(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -326,6 +334,7 @@ func TestAccAWSEksNodeGroup_Labels(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -372,6 +381,7 @@ func TestAccAWSEksNodeGroup_LaunchTemplate_Id(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -410,6 +420,7 @@ func TestAccAWSEksNodeGroup_LaunchTemplate_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -447,6 +458,7 @@ func TestAccAWSEksNodeGroup_LaunchTemplate_Version(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -484,6 +496,7 @@ func TestAccAWSEksNodeGroup_ReleaseVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -518,6 +531,7 @@ func TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -545,6 +559,7 @@ func TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -572,6 +587,7 @@ func TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -612,6 +628,7 @@ func TestAccAWSEksNodeGroup_ScalingConfig_MaxSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -652,6 +669,7 @@ func TestAccAWSEksNodeGroup_ScalingConfig_MinSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -692,6 +710,7 @@ func TestAccAWSEksNodeGroup_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ @@ -738,6 +757,7 @@ func TestAccAWSEksNodeGroup_Version(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, Steps: []resource.TestStep{ From a570e9154e27f8b7da77a7815a75f9b85b40f8c7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:36:45 -0400 Subject: [PATCH 0961/1252] tests/ds/eks_cluster: Add ErrorCheck --- aws/data_source_aws_eks_cluster_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_eks_cluster_test.go b/aws/data_source_aws_eks_cluster_test.go index c940b7b89f3..e83cb6bb612 100644 --- a/aws/data_source_aws_eks_cluster_test.go +++ b/aws/data_source_aws_eks_cluster_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSEksClusterDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEksClusterDestroy, Steps: []resource.TestStep{ From 492fa663436b86c4dad7d5e17898b688f0178442 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:37:33 -0400 Subject: [PATCH 0962/1252] tests/r/service_discovery_http_namespace: Add ErrorCheck --- aws/resource_aws_service_discovery_http_namespace_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_service_discovery_http_namespace_test.go b/aws/resource_aws_service_discovery_http_namespace_test.go index 1af657a7aa7..4a818fe1c24 100644 --- a/aws/resource_aws_service_discovery_http_namespace_test.go +++ b/aws/resource_aws_service_discovery_http_namespace_test.go @@ -99,6 +99,7 @@ func TestAccAWSServiceDiscoveryHttpNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryHttpNamespaceDestroy, Steps: []resource.TestStep{ @@ -128,6 +129,7 @@ func TestAccAWSServiceDiscoveryHttpNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryHttpNamespaceDestroy, Steps: []resource.TestStep{ @@ -149,6 +151,7 @@ func TestAccAWSServiceDiscoveryHttpNamespace_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryHttpNamespaceDestroy, Steps: []resource.TestStep{ @@ -174,6 +177,7 @@ func TestAccAWSServiceDiscoveryHttpNamespace_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryHttpNamespaceDestroy, Steps: []resource.TestStep{ From 993c6484ce19da13a33e537b5f438d497dd46263 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:37:43 -0400 Subject: [PATCH 0963/1252] tests/r/service_discovery_private_dns_namespace: Add ErrorCheck --- ...ource_aws_service_discovery_private_dns_namespace_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_service_discovery_private_dns_namespace_test.go b/aws/resource_aws_service_discovery_private_dns_namespace_test.go index b1545bebdcd..fe3f2d4fc8c 100644 --- a/aws/resource_aws_service_discovery_private_dns_namespace_test.go +++ b/aws/resource_aws_service_discovery_private_dns_namespace_test.go @@ -99,6 +99,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -128,6 +129,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -149,6 +151,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -171,6 +174,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -188,6 +192,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ From 0e299e6372053f9533105caf0aeaa2022dddc89a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:37:53 -0400 Subject: [PATCH 0964/1252] tests/r/service_discovery_public_dns_namespace: Add ErrorCheck --- ...esource_aws_service_discovery_public_dns_namespace_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_service_discovery_public_dns_namespace_test.go b/aws/resource_aws_service_discovery_public_dns_namespace_test.go index c2c703ca8c1..ce02f7c2e3a 100644 --- a/aws/resource_aws_service_discovery_public_dns_namespace_test.go +++ b/aws/resource_aws_service_discovery_public_dns_namespace_test.go @@ -99,6 +99,7 @@ func TestAccAWSServiceDiscoveryPublicDnsNamespace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPublicDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -127,6 +128,7 @@ func TestAccAWSServiceDiscoveryPublicDnsNamespace_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPublicDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -148,6 +150,7 @@ func TestAccAWSServiceDiscoveryPublicDnsNamespace_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPublicDnsNamespaceDestroy, Steps: []resource.TestStep{ @@ -168,6 +171,7 @@ func TestAccAWSServiceDiscoveryPublicDnsNamespace_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryPublicDnsNamespaceDestroy, Steps: []resource.TestStep{ From 1d3029177b4814d50b74005236fdab62900d8024 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:38:03 -0400 Subject: [PATCH 0965/1252] tests/r/service_discovery_service: Add ErrorCheck --- aws/resource_aws_service_discovery_service_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_service_discovery_service_test.go b/aws/resource_aws_service_discovery_service_test.go index 79a19f3e41d..b24b80579d2 100644 --- a/aws/resource_aws_service_discovery_service_test.go +++ b/aws/resource_aws_service_discovery_service_test.go @@ -123,6 +123,7 @@ func TestAccAWSServiceDiscoveryService_private(t *testing.T) { testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryServiceDestroy, Steps: []resource.TestStep{ @@ -173,6 +174,7 @@ func TestAccAWSServiceDiscoveryService_public(t *testing.T) { testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) testAccPreCheckAWSServiceDiscovery(t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryServiceDestroy, Steps: []resource.TestStep{ @@ -226,6 +228,7 @@ func TestAccAWSServiceDiscoveryService_http(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryServiceDestroy, Steps: []resource.TestStep{ @@ -253,6 +256,7 @@ func TestAccAWSServiceDiscoveryService_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryServiceDestroy, Steps: []resource.TestStep{ @@ -274,6 +278,7 @@ func TestAccAWSServiceDiscoveryService_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicediscovery.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsServiceDiscoveryServiceDestroy, Steps: []resource.TestStep{ From d5d3346eb87c805688a6293ebce36a0c432b122e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:44:20 -0400 Subject: [PATCH 0966/1252] tests/r/appautoscaling_policy: Add ErrorCheck --- aws/resource_aws_appautoscaling_policy_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/aws/resource_aws_appautoscaling_policy_test.go b/aws/resource_aws_appautoscaling_policy_test.go index 98c76ee2f65..6d038ab1263 100644 --- a/aws/resource_aws_appautoscaling_policy_test.go +++ b/aws/resource_aws_appautoscaling_policy_test.go @@ -85,6 +85,7 @@ func TestAccAWSAppautoScalingPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -124,6 +125,7 @@ func TestAccAWSAppautoScalingPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -147,6 +149,7 @@ func TestAccAWSAppautoScalingPolicy_scaleOutAndIn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -227,6 +230,7 @@ func TestAccAWSAppautoScalingPolicy_spotFleetRequest(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -258,6 +262,7 @@ func TestAccAWSAppautoScalingPolicy_dynamodb_table(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -289,6 +294,7 @@ func TestAccAWSAppautoScalingPolicy_dynamodb_index(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -322,6 +328,7 @@ func TestAccAWSAppautoScalingPolicy_multiplePoliciesSameName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -354,6 +361,7 @@ func TestAccAWSAppautoScalingPolicy_multiplePoliciesSameResource(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ @@ -398,6 +406,7 @@ func TestAccAWSAppautoScalingPolicy_ResourceId_ForceNew(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingPolicyDestroy, Steps: []resource.TestStep{ From 52cb1c1159101c478c292829c05e10b7fd89b1fc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:44:31 -0400 Subject: [PATCH 0967/1252] tests/r/appautoscaling_scheduled_action: Add ErrorCheck --- ...urce_aws_appautoscaling_scheduled_action_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/aws/resource_aws_appautoscaling_scheduled_action_test.go b/aws/resource_aws_appautoscaling_scheduled_action_test.go index e0258c69fee..dc375065227 100644 --- a/aws/resource_aws_appautoscaling_scheduled_action_test.go +++ b/aws/resource_aws_appautoscaling_scheduled_action_test.go @@ -25,6 +25,7 @@ func TestAccAWSAppautoscalingScheduledAction_DynamoDB(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -78,6 +79,7 @@ func TestAccAWSAppautoscalingScheduledAction_ECS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -110,6 +112,7 @@ func TestAccAWSAppautoscalingScheduledAction_EMR(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -141,6 +144,7 @@ func TestAccAWSAppautoscalingScheduledAction_Name_Duplicate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -165,6 +169,7 @@ func TestAccAWSAppautoscalingScheduledAction_SpotFleet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -201,6 +206,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_AtExpression_Timezone(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -235,6 +241,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_CronExpression_basic(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -272,6 +279,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_CronExpression_Timezone(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -313,6 +321,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_CronExpression_StartEndTim resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -365,6 +374,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_RateExpression_basic(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -402,6 +412,7 @@ func TestAccAWSAppautoscalingScheduledAction_Schedule_RateExpression_Timezone(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -436,6 +447,7 @@ func TestAccAWSAppautoscalingScheduledAction_MinCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ @@ -490,6 +502,7 @@ func TestAccAWSAppautoscalingScheduledAction_MaxCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsAppautoscalingScheduledActionDestroy, Steps: []resource.TestStep{ From 3d41ebdb1adf5551eb91becb874125345e9bae84 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:44:41 -0400 Subject: [PATCH 0968/1252] tests/r/appautoscaling_target: Add ErrorCheck --- aws/resource_aws_appautoscaling_target_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_appautoscaling_target_test.go b/aws/resource_aws_appautoscaling_target_test.go index b02e2604855..e1146bf059d 100644 --- a/aws/resource_aws_appautoscaling_target_test.go +++ b/aws/resource_aws_appautoscaling_target_test.go @@ -20,6 +20,7 @@ func TestAccAWSAppautoScalingTarget_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), IDRefreshName: "aws_appautoscaling_target.bar", Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, @@ -60,6 +61,7 @@ func TestAccAWSAppautoScalingTarget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, Steps: []resource.TestStep{ @@ -81,6 +83,7 @@ func TestAccAWSAppautoScalingTarget_spotFleetRequest(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), IDRefreshName: "aws_appautoscaling_target.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, @@ -109,6 +112,7 @@ func TestAccAWSAppautoScalingTarget_emrCluster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, Steps: []resource.TestStep{ @@ -139,6 +143,7 @@ func TestAccAWSAppautoScalingTarget_multipleTargets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, Steps: []resource.TestStep{ @@ -172,6 +177,7 @@ func TestAccAWSAppautoScalingTarget_optionalRoleArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, applicationautoscaling.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAppautoscalingTargetDestroy, Steps: []resource.TestStep{ From 37421558f507a1585ca21f3667dccd7ec9c21221 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:45:02 -0400 Subject: [PATCH 0969/1252] tests/r/autoscalingplans_scaling_plan: Add ErrorCheck --- aws/resource_aws_autoscalingplans_scaling_plan_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_autoscalingplans_scaling_plan_test.go b/aws/resource_aws_autoscalingplans_scaling_plan_test.go index 2c24fd1ffbd..c03b02e7b3f 100644 --- a/aws/resource_aws_autoscalingplans_scaling_plan_test.go +++ b/aws/resource_aws_autoscalingplans_scaling_plan_test.go @@ -78,6 +78,7 @@ func TestAccAwsAutoScalingPlansScalingPlan_basicDynamicScaling(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscalingplans.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAutoScalingPlansScalingPlanDestroy, Steps: []resource.TestStep{ @@ -129,6 +130,7 @@ func TestAccAwsAutoScalingPlansScalingPlan_basicPredictiveScaling(t *testing.T) testAccPreCheck(t) testAccPreCheckIamServiceLinkedRole(t, "/aws-service-role/autoscaling-plans") }, + ErrorCheck: testAccErrorCheck(t, autoscalingplans.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAutoScalingPlansScalingPlanDestroy, Steps: []resource.TestStep{ @@ -184,6 +186,7 @@ func TestAccAwsAutoScalingPlansScalingPlan_basicUpdate(t *testing.T) { testAccPreCheck(t) testAccPreCheckIamServiceLinkedRole(t, "/aws-service-role/autoscaling-plans") }, + ErrorCheck: testAccErrorCheck(t, autoscalingplans.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAutoScalingPlansScalingPlanDestroy, Steps: []resource.TestStep{ @@ -261,6 +264,7 @@ func TestAccAwsAutoScalingPlansScalingPlan_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, autoscalingplans.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAutoScalingPlansScalingPlanDestroy, Steps: []resource.TestStep{ From 81aaffe1f1986bf9d9c9561c6b08a48631992736 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:45:23 -0400 Subject: [PATCH 0970/1252] tests/r/budgets_budget: Add ErrorCheck --- aws/resource_aws_budgets_budget_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_budgets_budget_test.go b/aws/resource_aws_budgets_budget_test.go index c1ee3a8b3ba..312145b8d82 100644 --- a/aws/resource_aws_budgets_budget_test.go +++ b/aws/resource_aws_budgets_budget_test.go @@ -86,6 +86,7 @@ func TestAccAWSBudgetsBudget_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(budgets.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, budgets.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSBudgetsBudgetDestroy, Steps: []resource.TestStep{ @@ -140,6 +141,7 @@ func TestAccAWSBudgetsBudget_prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(budgets.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, budgets.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSBudgetsBudgetDestroy, Steps: []resource.TestStep{ @@ -203,6 +205,7 @@ func TestAccAWSBudgetsBudget_notification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(budgets.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, budgets.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSBudgetsBudgetDestroy, Steps: []resource.TestStep{ @@ -285,6 +288,7 @@ func TestAccAWSBudgetsBudget_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(budgets.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, budgets.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccAWSBudgetsBudgetDestroy, Steps: []resource.TestStep{ @@ -502,6 +506,7 @@ func testAccAWSBudgetsBudgetNotificationConfigDefaults() budgets.Notification { ComparisonOperator: aws.String(budgets.ComparisonOperatorGreaterThan), } } + func testAccAWSBudgetsBudgetNotificationConfigUpdate() budgets.Notification { return budgets.Notification{ NotificationType: aws.String(budgets.NotificationTypeForecasted), @@ -580,6 +585,7 @@ resource "aws_budgets_budget" "test" { } `, aws.StringValue(budgetConfig.BudgetName), aws.StringValue(budgetConfig.BudgetType), aws.StringValue(budgetConfig.BudgetLimit.Amount), aws.StringValue(budgetConfig.BudgetLimit.Unit), aws.BoolValue(budgetConfig.CostTypes.IncludeTax), aws.BoolValue(budgetConfig.CostTypes.IncludeSubscription), aws.BoolValue(budgetConfig.CostTypes.UseBlended), timePeriodStart, timePeriodEnd, aws.StringValue(budgetConfig.TimeUnit), costFilterKey, costFilterValue) } + func testAccAWSBudgetsBudgetConfig_BasicDefaults(budgetConfig budgets.Budget, costFilterKey string) string { timePeriodStart := budgetConfig.TimePeriod.Start.Format("2006-01-02_15:04") costFilterValue := aws.StringValue(budgetConfig.CostFilters[costFilterKey][0]) From badf654fa6a8b5c4cfc8c5406ad852f9ce8a2d7c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:45:50 -0400 Subject: [PATCH 0971/1252] tests/r/codestarconnections_connection: Add ErrorCheck --- aws/resource_aws_codestarconnections_connection_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_codestarconnections_connection_test.go b/aws/resource_aws_codestarconnections_connection_test.go index 4d2826584fd..09f93ac269a 100644 --- a/aws/resource_aws_codestarconnections_connection_test.go +++ b/aws/resource_aws_codestarconnections_connection_test.go @@ -20,6 +20,7 @@ func TestAccAWSCodeStarConnectionsConnection_Basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarconnections.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarConnectionsConnectionDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSCodeStarConnectionsConnection_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarconnections.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarConnectionsConnectionDestroy, Steps: []resource.TestStep{ @@ -72,6 +74,7 @@ func TestAccAWSCodeStarConnectionsConnection_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarconnections.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarconnections.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarConnectionsConnectionDestroy, Steps: []resource.TestStep{ From 9b7b6b9b214690475fe49654374084b95f46c2d4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:46:21 -0400 Subject: [PATCH 0972/1252] tests/r/codestarnotifications_notification_rule: Add ErrorCheck --- ...ource_aws_codestarnotifications_notification_rule_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_codestarnotifications_notification_rule_test.go b/aws/resource_aws_codestarnotifications_notification_rule_test.go index 789d04d09c8..5765409bae0 100644 --- a/aws/resource_aws_codestarnotifications_notification_rule_test.go +++ b/aws/resource_aws_codestarnotifications_notification_rule_test.go @@ -18,6 +18,7 @@ func TestAccAWSCodeStarNotificationsNotificationRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarnotifications.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarnotifications.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarNotificationsNotificationRuleDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSCodeStarNotificationsNotificationRule_Status(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarnotifications.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarnotifications.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarNotificationsNotificationRuleDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAWSCodeStarNotificationsNotificationRule_Targets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarnotifications.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarnotifications.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarNotificationsNotificationRuleDestroy, Steps: []resource.TestStep{ @@ -120,6 +123,7 @@ func TestAccAWSCodeStarNotificationsNotificationRule_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarnotifications.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarnotifications.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarNotificationsNotificationRuleDestroy, Steps: []resource.TestStep{ @@ -162,6 +166,7 @@ func TestAccAWSCodeStarNotificationsNotificationRule_EventTypeIds(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(codestarnotifications.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, codestarnotifications.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeStarNotificationsNotificationRuleDestroy, Steps: []resource.TestStep{ From c1683cc3fe34c88fd3237172f58bbd3bfd906448 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:46:48 -0400 Subject: [PATCH 0973/1252] tests/r/cognito_identity_pool: Add ErrorCheck --- aws/resource_aws_cognito_identity_pool_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/aws/resource_aws_cognito_identity_pool_test.go b/aws/resource_aws_cognito_identity_pool_test.go index 22029caf626..fe4bb43c785 100644 --- a/aws/resource_aws_cognito_identity_pool_test.go +++ b/aws/resource_aws_cognito_identity_pool_test.go @@ -21,6 +21,7 @@ func TestAccAWSCognitoIdentityPool_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -55,6 +56,7 @@ func TestAccAWSCognitoIdentityPool_supportedLoginProviders(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -97,6 +99,7 @@ func TestAccAWSCognitoIdentityPool_openidConnectProviderArns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -138,6 +141,7 @@ func TestAccAWSCognitoIdentityPool_samlProviderArns(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -180,6 +184,7 @@ func TestAccAWSCognitoIdentityPool_cognitoIdentityProviders(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -234,6 +239,7 @@ func TestAccAWSCognitoIdentityPool_addingNewProviderKeepsOldProvider(t *testing. resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ @@ -278,6 +284,7 @@ func TestAccAWSCognitoIdentityPool_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ From b50d34ae5931e41b35db74bde6714f7581b092f2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:46:58 -0400 Subject: [PATCH 0974/1252] tests/r/cognito_identity_pool_roles_attachment: Add ErrorCheck --- ...ource_aws_cognito_identity_pool_roles_attachment_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go b/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go index af012f813e5..1ebbdf00ed2 100644 --- a/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go +++ b/aws/resource_aws_cognito_identity_pool_roles_attachment_test.go @@ -20,6 +20,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_roleMappings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ @@ -108,6 +110,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ @@ -128,6 +131,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_roleMappingsWithAmbiguousRoleR resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ @@ -144,6 +148,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_roleMappingsWithRulesTypeError resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ @@ -160,6 +165,7 @@ func TestAccAWSCognitoIdentityPoolRolesAttachment_roleMappingsWithTokenTypeError resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, + ErrorCheck: testAccErrorCheck(t, cognitoidentity.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCognitoIdentityPoolRolesAttachmentDestroy, Steps: []resource.TestStep{ From 8fb01c10fbaf870a4606cb6605d7b8a40ccc75c5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:48:04 -0400 Subject: [PATCH 0975/1252] tests/r/cur_report_definition: Add ErrorCheck --- aws/resource_aws_cur_report_definition_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_cur_report_definition_test.go b/aws/resource_aws_cur_report_definition_test.go index bb1d8e77aae..8675269b9d5 100644 --- a/aws/resource_aws_cur_report_definition_test.go +++ b/aws/resource_aws_cur_report_definition_test.go @@ -19,6 +19,7 @@ func TestAccAwsCurReportDefinition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAwsCurReportDefinition_textOrCsv(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -92,6 +94,7 @@ func TestAccAwsCurReportDefinition_parquet(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -129,6 +132,7 @@ func TestAccAwsCurReportDefinition_athena(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -167,6 +171,7 @@ func TestAccAwsCurReportDefinition_refresh(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -205,6 +210,7 @@ func TestAccAwsCurReportDefinition_overwrite(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ From f0ed5c9abe66ce178553cbda574ef69776bfbcab Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:48:29 -0400 Subject: [PATCH 0976/1252] tests/r/datapipeline_pipeline: Add ErrorCheck --- aws/resource_aws_datapipeline_pipeline_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_datapipeline_pipeline_test.go b/aws/resource_aws_datapipeline_pipeline_test.go index 2e1de55d551..d9690aeb4ac 100644 --- a/aws/resource_aws_datapipeline_pipeline_test.go +++ b/aws/resource_aws_datapipeline_pipeline_test.go @@ -19,6 +19,7 @@ func TestAccAWSDataPipelinePipeline_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataPipeline(t) }, + ErrorCheck: testAccErrorCheck(t, datapipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataPipelinePipelineDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSDataPipelinePipeline_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataPipeline(t) }, + ErrorCheck: testAccErrorCheck(t, datapipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataPipelinePipelineDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSDataPipelinePipeline_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataPipeline(t) }, + ErrorCheck: testAccErrorCheck(t, datapipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataPipelinePipelineDestroy, Steps: []resource.TestStep{ @@ -109,6 +112,7 @@ func TestAccAWSDataPipelinePipeline_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDataPipeline(t) }, + ErrorCheck: testAccErrorCheck(t, datapipeline.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDataPipelinePipelineDestroy, Steps: []resource.TestStep{ From 4b0be03e2bff781830fdeeff19b9a8923e30ecfe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:48:50 -0400 Subject: [PATCH 0977/1252] tests/r/dlm_lifecycle_policy: Add ErrorCheck --- aws/resource_aws_dlm_lifecycle_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_dlm_lifecycle_policy_test.go b/aws/resource_aws_dlm_lifecycle_policy_test.go index 3bcbf7d3339..7542f55bb4e 100644 --- a/aws/resource_aws_dlm_lifecycle_policy_test.go +++ b/aws/resource_aws_dlm_lifecycle_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSDlmLifecyclePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDlm(t) }, + ErrorCheck: testAccErrorCheck(t, dlm.EndpointsID), Providers: testAccProviders, CheckDestroy: dlmLifecyclePolicyDestroy, Steps: []resource.TestStep{ @@ -54,6 +55,7 @@ func TestAccAWSDlmLifecyclePolicy_Full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDlm(t) }, + ErrorCheck: testAccErrorCheck(t, dlm.EndpointsID), Providers: testAccProviders, CheckDestroy: dlmLifecyclePolicyDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAWSDlmLifecyclePolicy_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDlm(t) }, + ErrorCheck: testAccErrorCheck(t, dlm.EndpointsID), Providers: testAccProviders, CheckDestroy: dlmLifecyclePolicyDestroy, Steps: []resource.TestStep{ From 1cdd324235b7b5bfa005eb87826677c0f6fedc55 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:49:15 -0400 Subject: [PATCH 0978/1252] tests/r/elasticsearch_domain_policy: Add ErrorCheck --- aws/resource_aws_elasticsearch_domain_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_elasticsearch_domain_policy_test.go b/aws/resource_aws_elasticsearch_domain_policy_test.go index 9251236993b..a58db5900f2 100644 --- a/aws/resource_aws_elasticsearch_domain_policy_test.go +++ b/aws/resource_aws_elasticsearch_domain_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elasticsearchservice" elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -45,6 +46,7 @@ func TestAccAWSElasticSearchDomainPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearchservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ From 91d01e874e3952ef2f24c16ffa9c2032f253070f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:49:25 -0400 Subject: [PATCH 0979/1252] tests/ds/elasticsearch_domain: Add ErrorCheck --- aws/data_source_aws_elasticsearch_domain_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_elasticsearch_domain_test.go b/aws/data_source_aws_elasticsearch_domain_test.go index b5a602188f9..1ea735ffc1b 100644 --- a/aws/data_source_aws_elasticsearch_domain_test.go +++ b/aws/data_source_aws_elasticsearch_domain_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSDataElasticsearchDomain_basic(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearchservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSElasticsearchDomainConfigWithDataSource(rInt), @@ -46,8 +48,9 @@ func TestAccAWSDataElasticsearchDomain_advanced(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearchservice.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSElasticsearchDomainConfigAdvancedWithDataSource(rInt), From 2a1652103150057e2f83d01e68cd5d4f4a312d20 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:51:05 -0400 Subject: [PATCH 0980/1252] tests/r/elasticsearch_domain: Add ErrorCheck --- aws/resource_aws_elasticsearch_domain_test.go | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_elasticsearch_domain_test.go b/aws/resource_aws_elasticsearch_domain_test.go index e86f2fbd601..287cad2dbc9 100644 --- a/aws/resource_aws_elasticsearch_domain_test.go +++ b/aws/resource_aws_elasticsearch_domain_test.go @@ -110,6 +110,7 @@ func TestAccAWSElasticSearchDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -139,6 +140,7 @@ func TestAccAWSElasticSearchDomain_RequireHTTPS(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -173,6 +175,7 @@ func TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -231,6 +234,7 @@ func TestAccAWSElasticSearchDomain_warm(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -288,6 +292,7 @@ func TestAccAWSElasticSearchDomain_withDedicatedMaster(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -326,8 +331,9 @@ func TestAccAWSElasticSearchDomain_duplicate(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), + Providers: testAccProviders, CheckDestroy: func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).esconn _, err := conn.DeleteElasticsearchDomain(&elasticsearch.DeleteElasticsearchDomainInput{ @@ -376,6 +382,7 @@ func TestAccAWSElasticSearchDomain_v23(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -405,6 +412,7 @@ func TestAccAWSElasticSearchDomain_complex(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -432,6 +440,7 @@ func TestAccAWSElasticSearchDomain_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -459,6 +468,7 @@ func TestAccAWSElasticSearchDomain_vpc_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -494,6 +504,7 @@ func TestAccAWSElasticSearchDomain_internetToVpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -526,6 +537,7 @@ func TestAccAWSElasticSearchDomain_AdvancedSecurityOptions_UserDB(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -558,6 +570,7 @@ func TestAccAWSElasticSearchDomain_AdvancedSecurityOptions_IAM(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -590,6 +603,7 @@ func TestAccAWSElasticSearchDomain_AdvancedSecurityOptions_Disabled(t *testing.T resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -623,6 +637,7 @@ func TestAccAWSElasticSearchDomain_LogPublishingOptions_IndexSlowLogs(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -654,6 +669,7 @@ func TestAccAWSElasticSearchDomain_LogPublishingOptions_SearchSlowLogs(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -685,6 +701,7 @@ func TestAccAWSElasticSearchDomain_LogPublishingOptions_EsApplicationLogs(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -716,6 +733,7 @@ func TestAccAWSElasticSearchDomain_LogPublishingOptions_AuditLogs(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -753,6 +771,7 @@ func TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove(t *testing.T) { testAccPreCheckAWSCognitoIdentityProvider(t) testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -792,6 +811,7 @@ func TestAccAWSElasticSearchDomain_CognitoOptionsUpdate(t *testing.T) { testAccPreCheckAWSCognitoIdentityProvider(t) testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -827,6 +847,7 @@ func TestAccAWSElasticSearchDomain_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -854,6 +875,7 @@ func TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -882,6 +904,7 @@ func TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -910,6 +933,7 @@ func TestAccAWSElasticSearchDomain_NodeToNodeEncryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -938,6 +962,7 @@ func TestAccAWSElasticSearchDomain_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, Steps: []resource.TestStep{ @@ -975,6 +1000,7 @@ func TestAccAWSElasticSearchDomain_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -1011,6 +1037,7 @@ func TestAccAWSElasticSearchDomain_update_volume_type(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -1054,6 +1081,7 @@ func TestAccAWSElasticSearchDomain_WithVolumeType_Missing(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -1088,6 +1116,7 @@ func TestAccAWSElasticSearchDomain_update_version(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -1155,6 +1184,7 @@ func testAccCheckESEBSVolumeSize(ebsVolumeSize int, status *elasticsearch.Elasti return nil } } + func testAccCheckESEBSVolumeEnabled(ebsEnabled bool, status *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { return func(s *terraform.State) error { conf := status.EBSOptions From c1e9c90def8bbb16f3f5b95c8a8e33651bc48602 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:52:47 -0400 Subject: [PATCH 0981/1252] tests/r/elasticsearch_domain_policy: Fix for import alias --- aws/resource_aws_elasticsearch_domain_policy_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/aws/resource_aws_elasticsearch_domain_policy_test.go b/aws/resource_aws_elasticsearch_domain_policy_test.go index a58db5900f2..1f57dcd7f6e 100644 --- a/aws/resource_aws_elasticsearch_domain_policy_test.go +++ b/aws/resource_aws_elasticsearch_domain_policy_test.go @@ -4,7 +4,6 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/elasticsearchservice" elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" @@ -46,7 +45,7 @@ func TestAccAWSElasticSearchDomainPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, elasticsearchservice.EndpointsID), + ErrorCheck: testAccErrorCheck(t, elasticsearch.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ From 23676b27cb59e838881b0359ce570d667af3b0be Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:53:16 -0400 Subject: [PATCH 0982/1252] tests/r/elastic_transcoder_pipeline: Add ErrorCheck --- aws/resource_aws_elastic_transcoder_pipeline_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_elastic_transcoder_pipeline_test.go b/aws/resource_aws_elastic_transcoder_pipeline_test.go index 3e4991912b8..b94335fb9da 100644 --- a/aws/resource_aws_elastic_transcoder_pipeline_test.go +++ b/aws/resource_aws_elastic_transcoder_pipeline_test.go @@ -21,6 +21,7 @@ func TestAccAWSElasticTranscoderPipeline_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, @@ -49,6 +50,7 @@ func TestAccAWSElasticTranscoderPipeline_kmsKey(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, @@ -77,6 +79,7 @@ func TestAccAWSElasticTranscoderPipeline_notifications(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, @@ -147,6 +150,7 @@ func TestAccAWSElasticTranscoderPipeline_withContentConfig(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, @@ -180,6 +184,7 @@ func TestAccAWSElasticTranscoderPipeline_withPermissions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, @@ -206,6 +211,7 @@ func TestAccAWSElasticTranscoderPipeline_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPipelineDestroy, Steps: []resource.TestStep{ From 01fd4641e31f1c156571b886524c23f6565002b6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:53:26 -0400 Subject: [PATCH 0983/1252] tests/r/elastic_transcoder_preset: Add ErrorCheck --- aws/resource_aws_elastic_transcoder_preset_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_elastic_transcoder_preset_test.go b/aws/resource_aws_elastic_transcoder_preset_test.go index 815cc164bb8..d5f878bffac 100644 --- a/aws/resource_aws_elastic_transcoder_preset_test.go +++ b/aws/resource_aws_elastic_transcoder_preset_test.go @@ -18,6 +18,7 @@ func TestAccAWSElasticTranscoderPreset_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ @@ -43,6 +44,7 @@ func TestAccAWSElasticTranscoderPreset_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ @@ -66,6 +68,7 @@ func TestAccAWSElasticTranscoderPreset_AudioCodecOptions_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ @@ -92,6 +95,7 @@ func TestAccAWSElasticTranscoderPreset_Description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ @@ -119,6 +123,7 @@ func TestAccAWSElasticTranscoderPreset_Full(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ @@ -168,6 +173,7 @@ func TestAccAWSElasticTranscoderPreset_Video_FrameRate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSElasticTranscoder(t) }, + ErrorCheck: testAccErrorCheck(t, elastictranscoder.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckElasticTranscoderPresetDestroy, Steps: []resource.TestStep{ From b5df447f12e42e3bd2d8710a0e73a93c838265fd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:56:14 -0400 Subject: [PATCH 0984/1252] tests/r/kinesis_firehose_delivery_stream: Add ErrorCheck --- ...s_kinesis_firehose_delivery_stream_test.go | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index 0eeb7ec0565..71834bdba74 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -93,6 +93,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -140,6 +141,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -164,6 +166,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -188,6 +191,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithSSE(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -236,6 +240,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithSSEAndKeyArn(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -282,6 +287,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithSSEAndKeyType(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -328,6 +334,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -370,6 +377,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3KinesisStreamSource(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -391,6 +399,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -424,6 +433,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -460,6 +470,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -489,6 +500,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -536,6 +548,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ExternalUpdate(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -595,6 +608,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -637,6 +651,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -668,6 +683,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -699,6 +715,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -730,6 +747,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -761,6 +779,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -803,6 +822,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ErrorOutputPrefix(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -840,6 +860,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ProcessingConfiguration_ resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -875,6 +896,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3KmsKeyArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -951,6 +973,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy_ExtendedS3, Steps: []resource.TestStep{ @@ -993,6 +1016,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_KinesisStreamSource(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1041,6 +1065,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1106,6 +1131,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_SplunkConfigUpdates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1172,6 +1198,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_HttpEndpointConfiguration(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1205,6 +1232,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_HttpEndpointConfiguration_RetryDura resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1266,6 +1294,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1329,6 +1358,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigEndpointUpdates( resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1389,6 +1419,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchWithVpcConfigUpdates(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ @@ -1431,6 +1462,7 @@ func TestAccAWSKinesisFirehoseDeliveryStream_missingProcessingConfiguration(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, firehose.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisFirehoseDeliveryStreamDestroy, Steps: []resource.TestStep{ From 2d23a3412a42e8d5f779d284269a4beb00e760f0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:56:41 -0400 Subject: [PATCH 0985/1252] tests/r/fms_admin_account: Add ErrorCheck --- aws/resource_aws_fms_admin_account_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_fms_admin_account_test.go b/aws/resource_aws_fms_admin_account_test.go index 33c20a62c4d..4f58317d5d1 100644 --- a/aws/resource_aws_fms_admin_account_test.go +++ b/aws/resource_aws_fms_admin_account_test.go @@ -19,6 +19,7 @@ func TestAccAwsFmsAdminAccount_basic(t *testing.T) { testAccPreCheckFmsAdmin(t) testAccOrganizationsAccountPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckFmsAdminAccountDestroy, Steps: []resource.TestStep{ From f05d02ab0143b2cbe6d411474e2d8cd79622be4e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:56:51 -0400 Subject: [PATCH 0986/1252] tests/r/fms_policy: Add ErrorCheck --- aws/resource_aws_fms_policy_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_fms_policy_test.go b/aws/resource_aws_fms_policy_test.go index 6fc08067a5b..9a22595bf2b 100644 --- a/aws/resource_aws_fms_policy_test.go +++ b/aws/resource_aws_fms_policy_test.go @@ -18,6 +18,7 @@ func TestAccAWSFmsPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsFmsPolicyDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSFmsPolicy_cloudfrontDistribution(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsFmsPolicyDestroy, Steps: []resource.TestStep{ @@ -74,6 +76,7 @@ func TestAccAWSFmsPolicy_includeMap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsFmsPolicyDestroy, Steps: []resource.TestStep{ @@ -103,6 +106,7 @@ func TestAccAWSFmsPolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsFmsPolicyDestroy, Steps: []resource.TestStep{ @@ -128,6 +132,7 @@ func TestAccAWSFmsPolicy_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, fms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsFmsPolicyDestroy, Steps: []resource.TestStep{ From 06d7ce5cbee9ea1c6582f5460b7280c3e96cbf3c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:57:18 -0400 Subject: [PATCH 0987/1252] tests/r/fsx_lustre_file_system: Add ErrorCheck --- ...resource_aws_fsx_lustre_file_system_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/aws/resource_aws_fsx_lustre_file_system_test.go b/aws/resource_aws_fsx_lustre_file_system_test.go index efcc8a09a01..1d980e4ec4a 100644 --- a/aws/resource_aws_fsx_lustre_file_system_test.go +++ b/aws/resource_aws_fsx_lustre_file_system_test.go @@ -80,6 +80,7 @@ func TestAccAWSFsxLustreFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -123,6 +124,7 @@ func TestAccAWSFsxLustreFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -145,6 +147,7 @@ func TestAccAWSFsxLustreFileSystem_ExportPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -183,6 +186,7 @@ func TestAccAWSFsxLustreFileSystem_ImportPath(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -219,6 +223,7 @@ func TestAccAWSFsxLustreFileSystem_ImportedFileChunkSize(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -253,6 +258,7 @@ func TestAccAWSFsxLustreFileSystem_SecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -287,6 +293,7 @@ func TestAccAWSFsxLustreFileSystem_StorageCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -321,6 +328,7 @@ func TestAccAWSFsxLustreFileSystem_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -367,6 +375,7 @@ func TestAccAWSFsxLustreFileSystem_WeeklyMaintenanceStartTime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -401,6 +410,7 @@ func TestAccAWSFsxLustreFileSystem_automaticBackupRetentionDays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -442,6 +452,7 @@ func TestAccAWSFsxLustreFileSystem_dailyAutomaticBackupStartTime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -476,6 +487,7 @@ func TestAccAWSFsxLustreFileSystem_DeploymentTypePersistent1(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -510,6 +522,7 @@ func TestAccAWSFsxLustreFileSystem_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -546,6 +559,7 @@ func TestAccAWSFsxLustreFileSystem_DeploymentTypeScratch2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -574,6 +588,7 @@ func TestAccAWSFsxLustreFileSystem_StorageTypeHddDriveCacheRead(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -601,6 +616,7 @@ func TestAccAWSFsxLustreFileSystem_StorageTypeHddDriveCacheNone(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -628,6 +644,7 @@ func TestAccAWSFsxLustreFileSystem_copyTagsToBackups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ @@ -655,6 +672,7 @@ func TestAccAWSFsxLustreFileSystem_autoImportPolicy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxLustreFileSystemDestroy, Steps: []resource.TestStep{ From c746f06d94e390b376dc09f871ccf20e8989bdc4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 10:57:27 -0400 Subject: [PATCH 0988/1252] tests/r/fsx_windows_file_system: Add ErrorCheck --- aws/resource_aws_fsx_windows_file_system_test.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/aws/resource_aws_fsx_windows_file_system_test.go b/aws/resource_aws_fsx_windows_file_system_test.go index 981fb52ba89..d1344158d7f 100644 --- a/aws/resource_aws_fsx_windows_file_system_test.go +++ b/aws/resource_aws_fsx_windows_file_system_test.go @@ -77,6 +77,7 @@ func TestAccAWSFsxWindowsFileSystem_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -128,6 +129,7 @@ func TestAccAWSFsxWindowsFileSystem_singleAz2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -175,6 +177,7 @@ func TestAccAWSFsxWindowsFileSystem_storageTypeHdd(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -205,6 +208,7 @@ func TestAccAWSFsxWindowsFileSystem_multiAz(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -251,6 +255,7 @@ func TestAccAWSFsxWindowsFileSystem_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -272,6 +277,7 @@ func TestAccAWSFsxWindowsFileSystem_AutomaticBackupRetentionDays(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -317,6 +323,7 @@ func TestAccAWSFsxWindowsFileSystem_CopyTagsToBackups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -354,6 +361,7 @@ func TestAccAWSFsxWindowsFileSystem_DailyAutomaticBackupStartTime(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -393,6 +401,7 @@ func TestAccAWSFsxWindowsFileSystem_KmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -430,6 +439,7 @@ func TestAccAWSFsxWindowsFileSystem_SecurityGroupIds(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -467,6 +477,7 @@ func TestAccAWSFsxWindowsFileSystem_SelfManagedActiveDirectory(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -497,6 +508,7 @@ func TestAccAWSFsxWindowsFileSystem_SelfManagedActiveDirectory_Username(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -534,6 +546,7 @@ func TestAccAWSFsxWindowsFileSystem_StorageCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -571,6 +584,7 @@ func TestAccAWSFsxWindowsFileSystem_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -620,6 +634,7 @@ func TestAccAWSFsxWindowsFileSystem_ThroughputCapacity(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ @@ -657,6 +672,7 @@ func TestAccAWSFsxWindowsFileSystem_WeeklyMaintenanceStartTime(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(fsx.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, fsx.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckFsxWindowsFileSystemDestroy, Steps: []resource.TestStep{ From 963ead30da2bb4fbba45eaf894fee7f647c021df Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:00:37 -0400 Subject: [PATCH 0989/1252] tests/r/glacier_vault: Add ErrorCheck --- aws/resource_aws_glacier_vault_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_glacier_vault_test.go b/aws/resource_aws_glacier_vault_test.go index 16261e9e365..9055e8b55da 100644 --- a/aws/resource_aws_glacier_vault_test.go +++ b/aws/resource_aws_glacier_vault_test.go @@ -81,6 +81,7 @@ func TestAccAWSGlacierVault_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultDestroy, Steps: []resource.TestStep{ @@ -112,6 +113,7 @@ func TestAccAWSGlacierVault_notification(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultDestroy, Steps: []resource.TestStep{ @@ -157,6 +159,7 @@ func TestAccAWSGlacierVault_policy(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultDestroy, Steps: []resource.TestStep{ @@ -201,6 +204,7 @@ func TestAccAWSGlacierVault_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultDestroy, Steps: []resource.TestStep{ @@ -245,6 +249,7 @@ func TestAccAWSGlacierVault_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultDestroy, Steps: []resource.TestStep{ From 5b42133b00b5a923f4d76e813344f105a2a9f454 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:00:46 -0400 Subject: [PATCH 0990/1252] tests/r/glacier_vault_lock: Add ErrorCheck --- aws/resource_aws_glacier_vault_lock_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_glacier_vault_lock_test.go b/aws/resource_aws_glacier_vault_lock_test.go index 7dfddaf2e7b..cd916ec5cba 100644 --- a/aws/resource_aws_glacier_vault_lock_test.go +++ b/aws/resource_aws_glacier_vault_lock_test.go @@ -19,6 +19,7 @@ func TestAccAWSGlacierVaultLock_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultLockDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSGlacierVaultLock_CompleteLock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, glacier.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlacierVaultLockDestroy, Steps: []resource.TestStep{ From 8a124dc9214a2196c1d2c3176ef37982add64bd6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:01:18 -0400 Subject: [PATCH 0991/1252] tests/r/globalaccelerator_accelerator: Add ErrorCheck --- aws/resource_aws_globalaccelerator_accelerator_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_globalaccelerator_accelerator_test.go b/aws/resource_aws_globalaccelerator_accelerator_test.go index 19657d5b93a..c6c0538f8c3 100644 --- a/aws/resource_aws_globalaccelerator_accelerator_test.go +++ b/aws/resource_aws_globalaccelerator_accelerator_test.go @@ -157,6 +157,7 @@ func TestAccAwsGlobalAcceleratorAccelerator_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorAcceleratorDestroy, Steps: []resource.TestStep{ @@ -195,6 +196,7 @@ func TestAccAwsGlobalAcceleratorAccelerator_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorAcceleratorDestroy, Steps: []resource.TestStep{ @@ -217,6 +219,7 @@ func TestAccAwsGlobalAcceleratorAccelerator_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorAcceleratorDestroy, Steps: []resource.TestStep{ @@ -260,6 +263,7 @@ func TestAccAwsGlobalAcceleratorAccelerator_attributes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorAcceleratorDestroy, Steps: []resource.TestStep{ @@ -318,6 +322,7 @@ func TestAccAwsGlobalAcceleratorAccelerator_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorAcceleratorDestroy, Steps: []resource.TestStep{ From dc763618df76cbecc72464a85ee61aefe54ede3e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:01:28 -0400 Subject: [PATCH 0992/1252] tests/r/globalaccelerator_listener: Add ErrorCheck --- aws/resource_aws_globalaccelerator_listener_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_globalaccelerator_listener_test.go b/aws/resource_aws_globalaccelerator_listener_test.go index abe312d872b..d1178612c36 100644 --- a/aws/resource_aws_globalaccelerator_listener_test.go +++ b/aws/resource_aws_globalaccelerator_listener_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/globalaccelerator" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -17,6 +18,7 @@ func TestAccAwsGlobalAcceleratorListener_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorListenerDestroy, Steps: []resource.TestStep{ @@ -48,6 +50,7 @@ func TestAccAwsGlobalAcceleratorListener_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorListenerDestroy, Steps: []resource.TestStep{ @@ -69,6 +72,7 @@ func TestAccAwsGlobalAcceleratorListener_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorListenerDestroy, Steps: []resource.TestStep{ From e231de9d55b7f8ce28573c948315da180bec7256 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 11:02:00 -0400 Subject: [PATCH 0993/1252] build(deps): bump github.com/mitchellh/copystructure from 1.0.0 to 1.1.1 (#17428) Bumps [github.com/mitchellh/copystructure](https://github.com/mitchellh/copystructure) from 1.0.0 to 1.1.1. - [Release notes](https://github.com/mitchellh/copystructure/releases) - [Commits](https://github.com/mitchellh/copystructure/compare/v1.0.0...v1.1.1) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index ee38bfb2ba6..1dcff5cd1f5 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/jen20/awspolicyequivalence v1.1.0 github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba github.com/mattn/go-colorable v0.1.7 // indirect - github.com/mitchellh/copystructure v1.0.0 + github.com/mitchellh/copystructure v1.1.1 github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-testing-interface v1.14.1 github.com/pquerna/otp v1.3.0 diff --git a/go.sum b/go.sum index 31bd96aa0df..cb73d3bf4a7 100644 --- a/go.sum +++ b/go.sum @@ -248,8 +248,9 @@ github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHX github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.1.1 h1:Bp6x9R1Wn16SIz3OfeDr0b7RnCG2OB66Y7PQyC/cvq4= +github.com/mitchellh/copystructure v1.1.1/go.mod h1:EBArHfARyrSWO/+Wyr9zwEkc6XMFB9XyNgFNmRkZZU4= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= From 92b58b3fe0f7ed59438f6ea1a4255203bc75c7dd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:02:34 -0400 Subject: [PATCH 0994/1252] tests/r/globalaccelerator_endpoint_group: Add ErrorCheck --- aws/resource_aws_globalaccelerator_endpoint_group_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_globalaccelerator_endpoint_group_test.go b/aws/resource_aws_globalaccelerator_endpoint_group_test.go index 00e0be4bfeb..0dda503b349 100644 --- a/aws/resource_aws_globalaccelerator_endpoint_group_test.go +++ b/aws/resource_aws_globalaccelerator_endpoint_group_test.go @@ -23,6 +23,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -59,6 +60,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_ALBEndpoint_ClientIP(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -157,6 +160,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_InstanceEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -207,6 +211,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_MultiRegion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccMultipleRegionPreCheck(t, 2); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -248,6 +253,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_PortOverrides(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -314,6 +320,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_TCPHealthCheckProtocol(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ @@ -356,6 +363,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckGlobalAccelerator(t) }, + ErrorCheck: testAccErrorCheck(t, globalaccelerator.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckGlobalAcceleratorEndpointGroupDestroy, Steps: []resource.TestStep{ From 401bf51fec81f08fbec9a817f40a872ebc5fd76a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:03:07 -0400 Subject: [PATCH 0995/1252] tests/ds/identitystore_group: Add ErrorCheck --- aws/data_source_aws_identitystore_group_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_identitystore_group_test.go b/aws/data_source_aws_identitystore_group_test.go index c5c2ce3780e..fe87fdef040 100644 --- a/aws/data_source_aws_identitystore_group_test.go +++ b/aws/data_source_aws_identitystore_group_test.go @@ -6,6 +6,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/identitystore" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -19,6 +20,7 @@ func TestAccAWSIdentityStoreGroupDataSource_DisplayName(t *testing.T) { testAccPreCheckAWSSSOAdminInstances(t) testAccPreCheckAWSIdentityStoreGroupName(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -45,6 +47,7 @@ func TestAccAWSIdentityStoreGroupDataSource_GroupID(t *testing.T) { testAccPreCheckAWSIdentityStoreGroupName(t) testAccPreCheckAWSIdentityStoreGroupID(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -62,6 +65,7 @@ func TestAccAWSIdentityStoreGroupDataSource_GroupID(t *testing.T) { func TestAccAWSIdentityStoreGroupDataSource_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 94587805b77641c76cee8137993083e9891032a1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:03:17 -0400 Subject: [PATCH 0996/1252] tests/ds/identitystore_user: Add ErrorCheck --- aws/data_source_aws_identitystore_user_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_identitystore_user_test.go b/aws/data_source_aws_identitystore_user_test.go index 346b81617f8..cc761554144 100644 --- a/aws/data_source_aws_identitystore_user_test.go +++ b/aws/data_source_aws_identitystore_user_test.go @@ -6,6 +6,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/identitystore" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -19,6 +20,7 @@ func TestAccAWSIdentityStoreUserDataSource_UserName(t *testing.T) { testAccPreCheckAWSSSOAdminInstances(t) testAccPreCheckAWSIdentityStoreUserName(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -45,6 +47,7 @@ func TestAccAWSIdentityStoreUserDataSource_UserID(t *testing.T) { testAccPreCheckAWSIdentityStoreUserName(t) testAccPreCheckAWSIdentityStoreUserID(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -62,6 +65,7 @@ func TestAccAWSIdentityStoreUserDataSource_UserID(t *testing.T) { func TestAccAWSIdentityStoreUserDataSource_NonExistent(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSSSOAdminInstances(t) }, + ErrorCheck: testAccErrorCheck(t, identitystore.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 1f7776a64777d2130f51be71d0de3966e3ed3349 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 11:05:57 -0400 Subject: [PATCH 0997/1252] build(deps): Bump gopkg.in/yaml.v2 from 2.3.0 to 2.4.0 (#16448) Bumps [gopkg.in/yaml.v2](https://github.com/go-yaml/yaml) from 2.3.0 to 2.4.0. - [Release notes](https://github.com/go-yaml/yaml/releases) - [Commits](https://github.com/go-yaml/yaml/compare/v2.3.0...v2.4.0) 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 1dcff5cd1f5..305159756c1 100644 --- a/go.mod +++ b/go.mod @@ -19,5 +19,5 @@ require ( github.com/mitchellh/go-homedir v1.1.0 github.com/mitchellh/go-testing-interface v1.14.1 github.com/pquerna/otp v1.3.0 - gopkg.in/yaml.v2 v2.3.0 + gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index cb73d3bf4a7..fe235b41d31 100644 --- a/go.sum +++ b/go.sum @@ -574,8 +574,8 @@ gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRN gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 6a8576376c502c300137a4491be868b2f0bc46c4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:06:10 -0400 Subject: [PATCH 0998/1252] tests/r/kinesis_stream: Add ErrorCheck --- aws/resource_aws_kinesis_stream_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_kinesis_stream_test.go b/aws/resource_aws_kinesis_stream_test.go index 16623fc4c51..a09eb5358b8 100644 --- a/aws/resource_aws_kinesis_stream_test.go +++ b/aws/resource_aws_kinesis_stream_test.go @@ -75,6 +75,7 @@ func TestAccAWSKinesisStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSKinesisStream_createMultipleConcurrentStreams(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -148,6 +150,7 @@ func TestAccAWSKinesisStream_encryptionWithoutKmsKeyThrowsError(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -167,6 +170,7 @@ func TestAccAWSKinesisStream_encryption(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -224,6 +228,7 @@ func TestAccAWSKinesisStream_shardCount(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -265,6 +270,7 @@ func TestAccAWSKinesisStream_retentionPeriod(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -315,6 +321,7 @@ func TestAccAWSKinesisStream_shardLevelMetrics(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -365,6 +372,7 @@ func TestAccAWSKinesisStream_enforceConsumerDeletion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -394,6 +402,7 @@ func TestAccAWSKinesisStream_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ @@ -520,6 +529,7 @@ func testAccAWSKinesisStreamRegisterStreamConsumer(stream *kinesis.StreamDescrip return nil } } + func testAccCheckKinesisStreamTags(n string, tagCount int) resource.TestCheckFunc { return func(s *terraform.State) error { if err := resource.TestCheckResourceAttr(n, "tags.%", fmt.Sprintf("%d", tagCount))(s); err != nil { @@ -546,6 +556,7 @@ func TestAccAWSKinesisStream_UpdateKmsKeyId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ From 5af49d0c38a7ba0c9466dc2d8d7fe25c26083c90 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:06:19 -0400 Subject: [PATCH 0999/1252] tests/r/kinesis_stream_consumer: Add ErrorCheck --- aws/resource_aws_kinesis_stream_consumer_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_kinesis_stream_consumer_test.go b/aws/resource_aws_kinesis_stream_consumer_test.go index 16818dba9ed..60964e7819b 100644 --- a/aws/resource_aws_kinesis_stream_consumer_test.go +++ b/aws/resource_aws_kinesis_stream_consumer_test.go @@ -20,6 +20,7 @@ func TestAccAWSKinesisStreamConsumer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSKinesisStreamConsumer_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -69,6 +71,7 @@ func TestAccAWSKinesisStreamConsumer_MaxConcurrentConsumers(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, Steps: []resource.TestStep{ @@ -93,6 +96,7 @@ func TestAccAWSKinesisStreamConsumer_ExceedMaxConcurrentConsumers(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSKinesisStreamConsumerDestroy, Steps: []resource.TestStep{ From af371e2e6afb9c0d51a9fe2210d7bc44996d6759 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:06:48 -0400 Subject: [PATCH 1000/1252] tests/ds/kinesis_stream_consumer: Add ErrorCheck --- aws/data_source_aws_kinesis_stream_consumer_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/data_source_aws_kinesis_stream_consumer_test.go b/aws/data_source_aws_kinesis_stream_consumer_test.go index 20c07c136de..6a4f18f88a4 100644 --- a/aws/data_source_aws_kinesis_stream_consumer_test.go +++ b/aws/data_source_aws_kinesis_stream_consumer_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/kinesis" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -16,6 +17,7 @@ func TestAccAWSKinesisStreamConsumerDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -41,6 +43,7 @@ func TestAccAWSKinesisStreamConsumerDataSource_Name(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -66,6 +69,7 @@ func TestAccAWSKinesisStreamConsumerDataSource_Arn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From f4bdad89239ce5bcbcb91ba078a7dffe2e9d2137 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:06:58 -0400 Subject: [PATCH 1001/1252] tests/ds/kinesis_stream: Add ErrorCheck --- aws/data_source_aws_kinesis_stream_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_kinesis_stream_test.go b/aws/data_source_aws_kinesis_stream_test.go index cf4e22a7169..11123d959d5 100644 --- a/aws/data_source_aws_kinesis_stream_test.go +++ b/aws/data_source_aws_kinesis_stream_test.go @@ -34,6 +34,7 @@ func TestAccAWSKinesisStreamDataSource_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kinesis.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisStreamDestroy, Steps: []resource.TestStep{ From 115c2353c4d8265486dc016a8ab56181c85e30fa Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:07:22 -0400 Subject: [PATCH 1002/1252] tests/r/kinesis_analytics_application: Add ErrorCheck --- ..._aws_kinesis_analytics_application_test.go | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aws/resource_aws_kinesis_analytics_application_test.go b/aws/resource_aws_kinesis_analytics_application_test.go index ffa8781b592..2a8bbaf432c 100644 --- a/aws/resource_aws_kinesis_analytics_application_test.go +++ b/aws/resource_aws_kinesis_analytics_application_test.go @@ -93,6 +93,7 @@ func TestAccAWSKinesisAnalyticsApplication_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -132,6 +133,7 @@ func TestAccAWSKinesisAnalyticsApplication_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -154,6 +156,7 @@ func TestAccAWSKinesisAnalyticsApplication_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -201,6 +204,7 @@ func TestAccAWSKinesisAnalyticsApplication_Code_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -262,6 +266,7 @@ func TestAccAWSKinesisAnalyticsApplication_CloudWatchLoggingOptions_Add(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -325,6 +330,7 @@ func TestAccAWSKinesisAnalyticsApplication_CloudWatchLoggingOptions_Delete(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -390,6 +396,7 @@ func TestAccAWSKinesisAnalyticsApplication_CloudWatchLoggingOptions_Update(t *te resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -455,6 +462,7 @@ func TestAccAWSKinesisAnalyticsApplication_Input_Add(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -542,6 +550,7 @@ func TestAccAWSKinesisAnalyticsApplication_Input_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -655,6 +664,7 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Add(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -768,6 +778,7 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Delete(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -883,6 +894,7 @@ func TestAccAWSKinesisAnalyticsApplication_InputProcessingConfiguration_Update(t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1003,6 +1015,7 @@ func TestAccAWSKinesisAnalyticsApplication_Multiple_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1172,6 +1185,7 @@ func TestAccAWSKinesisAnalyticsApplication_Output_Update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1283,6 +1297,7 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Add(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1362,6 +1377,7 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Delete(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1442,6 +1458,7 @@ func TestAccAWSKinesisAnalyticsApplication_ReferenceDataSource_Update(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1542,6 +1559,7 @@ func TestAccAWSKinesisAnalyticsApplication_StartApplication_OnCreate(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1608,6 +1626,7 @@ func TestAccAWSKinesisAnalyticsApplication_StartApplication_OnUpdate(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ @@ -1767,6 +1786,7 @@ func TestAccAWSKinesisAnalyticsApplication_StartApplication_Update(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalytics(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalytics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsApplicationDestroy, Steps: []resource.TestStep{ From 9779a6e0a5c5b8c0967276cf02dbc0bb4bb730d1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:07:49 -0400 Subject: [PATCH 1003/1252] tests/r/kinesisanalyticsv2_application: Add ErrorCheck --- ...aws_kinesisanalyticsv2_application_test.go | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/aws/resource_aws_kinesisanalyticsv2_application_test.go b/aws/resource_aws_kinesisanalyticsv2_application_test.go index 47ef42e96a4..bdcfebb9a6a 100644 --- a/aws/resource_aws_kinesisanalyticsv2_application_test.go +++ b/aws/resource_aws_kinesisanalyticsv2_application_test.go @@ -87,6 +87,7 @@ func TestAccAWSKinesisAnalyticsV2Application_basicFlinkApplication(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -224,6 +225,7 @@ func TestAccAWSKinesisAnalyticsV2Application_basicSQLApplication(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -261,6 +263,7 @@ func TestAccAWSKinesisAnalyticsV2Application_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -283,6 +286,7 @@ func TestAccAWSKinesisAnalyticsV2Application_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -331,6 +335,7 @@ func TestAccAWSKinesisAnalyticsV2Application_ApplicationCodeConfiguration_Update resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -408,6 +413,7 @@ func TestAccAWSKinesisAnalyticsV2Application_CloudWatchLoggingOptions_Add(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -466,6 +472,7 @@ func TestAccAWSKinesisAnalyticsV2Application_CloudWatchLoggingOptions_Delete(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -525,6 +532,7 @@ func TestAccAWSKinesisAnalyticsV2Application_CloudWatchLoggingOptions_Update(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -585,6 +593,7 @@ func TestAccAWSKinesisAnalyticsV2Application_EnvironmentProperties_Update(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -772,6 +781,7 @@ func TestAccAWSKinesisAnalyticsV2Application_FlinkApplicationConfiguration_Updat resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -886,6 +896,7 @@ func TestAccAWSKinesisAnalyticsV2Application_FlinkApplicationConfiguration_Envir resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1029,6 +1040,7 @@ func TestAccAWSKinesisAnalyticsV2Application_ServiceExecutionRole_Update(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1086,6 +1098,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Input_A resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1188,6 +1201,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Input_U resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1317,6 +1331,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1445,6 +1460,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1574,6 +1590,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_InputPr resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1708,6 +1725,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Multipl resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -1888,6 +1906,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Output_ resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2026,6 +2045,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2123,6 +2143,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2220,6 +2241,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_Referen resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2342,6 +2364,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_VPCConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2459,6 +2482,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_VPCConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ @@ -2576,6 +2600,7 @@ func TestAccAWSKinesisAnalyticsV2Application_SQLApplicationConfiguration_VPCConf resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSKinesisAnalyticsV2(t) }, + ErrorCheck: testAccErrorCheck(t, kinesisanalyticsv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisAnalyticsV2ApplicationDestroy, Steps: []resource.TestStep{ From ed3bd463f51051a6f26cc1d18198e50b6e247bc8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:08:11 -0400 Subject: [PATCH 1004/1252] tests/r/kinesis_video_stream: Add ErrorCheck --- aws/resource_aws_kinesis_video_stream_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_kinesis_video_stream_test.go b/aws/resource_aws_kinesis_video_stream_test.go index 8b5d9ab1dff..43053dc45a0 100644 --- a/aws/resource_aws_kinesis_video_stream_test.go +++ b/aws/resource_aws_kinesis_video_stream_test.go @@ -22,6 +22,7 @@ func TestAccAWSKinesisVideoStream_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(kinesisvideo.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, kinesisvideo.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisVideoStreamDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSKinesisVideoStream_options(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(kinesisvideo.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, kinesisvideo.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisVideoStreamDestroy, Steps: []resource.TestStep{ @@ -104,6 +106,7 @@ func TestAccAWSKinesisVideoStream_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(kinesisvideo.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, kinesisvideo.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisVideoStreamDestroy, Steps: []resource.TestStep{ @@ -149,6 +152,7 @@ func TestAccAWSKinesisVideoStream_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(kinesisvideo.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, kinesisvideo.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckKinesisVideoStreamDestroy, Steps: []resource.TestStep{ From 99868ad79419575a3999b2ee43c430a599394cbe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:09:52 -0400 Subject: [PATCH 1005/1252] tests/r/licensemanager_association: Add ErrorCheck --- aws/resource_aws_licensemanager_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_licensemanager_association_test.go b/aws/resource_aws_licensemanager_association_test.go index 25487a68b3d..2b02ff7fcf8 100644 --- a/aws/resource_aws_licensemanager_association_test.go +++ b/aws/resource_aws_licensemanager_association_test.go @@ -15,6 +15,7 @@ func TestAccAWSLicenseManagerAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, licensemanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLicenseManagerAssociationDestroy, Steps: []resource.TestStep{ From da045315da407f3e3a6d060e0d5f6fdfdf2c5897 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:10:01 -0400 Subject: [PATCH 1006/1252] tests/r/licensemanager_license_configuration: Add ErrorCheck --- aws/resource_aws_licensemanager_license_configuration_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_licensemanager_license_configuration_test.go b/aws/resource_aws_licensemanager_license_configuration_test.go index 0948bdee40d..516208d5168 100644 --- a/aws/resource_aws_licensemanager_license_configuration_test.go +++ b/aws/resource_aws_licensemanager_license_configuration_test.go @@ -66,6 +66,7 @@ func TestAccAWSLicenseManagerLicenseConfiguration_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, licensemanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLicenseManagerLicenseConfigurationDestroy, Steps: []resource.TestStep{ @@ -101,6 +102,7 @@ func TestAccAWSLicenseManagerLicenseConfiguration_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, licensemanager.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckLicenseManagerLicenseConfigurationDestroy, Steps: []resource.TestStep{ From e9e35da8c59017e3911f3e65ebcf66e86cd263f6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:10:23 -0400 Subject: [PATCH 1007/1252] tests/r/macie_member_account_association: Add ErrorCheck --- aws/resource_aws_macie_member_account_association_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_macie_member_account_association_test.go b/aws/resource_aws_macie_member_account_association_test.go index 803eb1ba2a8..cb82ce76024 100644 --- a/aws/resource_aws_macie_member_account_association_test.go +++ b/aws/resource_aws_macie_member_account_association_test.go @@ -20,6 +20,7 @@ func TestAccAWSMacieMemberAccountAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMacie(t) }, + ErrorCheck: testAccErrorCheck(t, macie.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSMacieMemberAccountAssociationDestroy, Steps: []resource.TestStep{ @@ -35,8 +36,9 @@ func TestAccAWSMacieMemberAccountAssociation_basic(t *testing.T) { func TestAccAWSMacieMemberAccountAssociation_self(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMacie(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMacie(t) }, + ErrorCheck: testAccErrorCheck(t, macie.EndpointsID), + Providers: testAccProviders, // master account associated with Macie it can't be disassociated. CheckDestroy: nil, Steps: []resource.TestStep{ From cc7c1b6f5be687b5937390e4751aa548845c91a6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:10:33 -0400 Subject: [PATCH 1008/1252] tests/r/macie_s3_bucket_association: Add ErrorCheck --- aws/resource_aws_macie_s3_bucket_association_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_macie_s3_bucket_association_test.go b/aws/resource_aws_macie_s3_bucket_association_test.go index 1d682986ac3..3bdcbd57708 100644 --- a/aws/resource_aws_macie_s3_bucket_association_test.go +++ b/aws/resource_aws_macie_s3_bucket_association_test.go @@ -16,6 +16,7 @@ func TestAccAWSMacieS3BucketAssociation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMacie(t) }, + ErrorCheck: testAccErrorCheck(t, macie.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSMacieS3BucketAssociationDestroy, Steps: []resource.TestStep{ @@ -44,6 +45,7 @@ func TestAccAWSMacieS3BucketAssociation_accountIdAndPrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMacie(t) }, + ErrorCheck: testAccErrorCheck(t, macie.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSMacieS3BucketAssociationDestroy, Steps: []resource.TestStep{ From 00bddb2f534148a5e4cbf97ccaa45e26a59b3cc2 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:10:55 -0400 Subject: [PATCH 1009/1252] tests/ds/pricing_product: Add ErrorCheck --- aws/data_source_aws_pricing_product_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_pricing_product_test.go b/aws/data_source_aws_pricing_product_test.go index 46ea0cded56..33c215fe3a9 100644 --- a/aws/data_source_aws_pricing_product_test.go +++ b/aws/data_source_aws_pricing_product_test.go @@ -5,6 +5,7 @@ import ( "fmt" "testing" + "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" ) @@ -12,6 +13,7 @@ import ( func TestAccDataSourceAwsPricingProduct_ec2(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckPricing(t) }, + ErrorCheck: testAccErrorCheck(t, pricing.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { @@ -28,6 +30,7 @@ func TestAccDataSourceAwsPricingProduct_ec2(t *testing.T) { func TestAccDataSourceAwsPricingProduct_redshift(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckPricing(t) }, + ErrorCheck: testAccErrorCheck(t, pricing.EndpointsID), ProviderFactories: testAccProviderFactories, Steps: []resource.TestStep{ { From 1cd79b91e8729fb15d273515ae3422b0f7a7c3b5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:11:26 -0400 Subject: [PATCH 1010/1252] tests/r/prometheus_workspace: Add ErrorCheck --- aws/resource_aws_prometheus_workspace_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_prometheus_workspace_test.go b/aws/resource_aws_prometheus_workspace_test.go index 7087e927517..1c47f278e72 100644 --- a/aws/resource_aws_prometheus_workspace_test.go +++ b/aws/resource_aws_prometheus_workspace_test.go @@ -17,6 +17,7 @@ func TestAccAWSAMPWorkspace_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, prometheusservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMPWorkspaceDestroy, Steps: []resource.TestStep{ @@ -53,6 +54,7 @@ func TestAccAWSAMPWorkspace_disappears(t *testing.T) { resourceName := "aws_prometheus_workspace.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, prometheusservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAMPWorkspaceDestroy, Steps: []resource.TestStep{ From 674e2e22d5a09fff708626d7f58354e8c935cdf0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:11:48 -0400 Subject: [PATCH 1011/1252] tests/r/quicksight_group: Add ErrorCheck --- aws/resource_aws_quicksight_group_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_quicksight_group_test.go b/aws/resource_aws_quicksight_group_test.go index 200a6b5afa9..ea24722ee20 100644 --- a/aws/resource_aws_quicksight_group_test.go +++ b/aws/resource_aws_quicksight_group_test.go @@ -21,6 +21,7 @@ func TestAccAWSQuickSightGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightGroupDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSQuickSightGroup_withDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightGroupDestroy, Steps: []resource.TestStep{ @@ -89,6 +91,7 @@ func TestAccAWSQuickSightGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightGroupDestroy, Steps: []resource.TestStep{ From be16586a80ae788529fb21d3b76210ca665b7111 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:11:58 -0400 Subject: [PATCH 1012/1252] tests/r/quicksight_user: Add ErrorCheck --- aws/resource_aws_quicksight_user_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_quicksight_user_test.go b/aws/resource_aws_quicksight_user_test.go index 09d108735d5..5702cf4bdcb 100644 --- a/aws/resource_aws_quicksight_user_test.go +++ b/aws/resource_aws_quicksight_user_test.go @@ -22,6 +22,7 @@ func TestAccAWSQuickSightUser_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightUserDestroy, Steps: []resource.TestStep{ @@ -52,6 +53,7 @@ func TestAccAWSQuickSightUser_withInvalidFormattedEmailStillWorks(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightUserDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSQuickSightUser_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, quicksight.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckQuickSightUserDestroy, Steps: []resource.TestStep{ From 523ab31707cad1f8bae66eaf19bcace400c957e5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:12:17 -0400 Subject: [PATCH 1013/1252] tests/r/resourcegroups_group: Add ErrorCheck --- aws/resource_aws_resourcegroups_group_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_resourcegroups_group_test.go b/aws/resource_aws_resourcegroups_group_test.go index de650c1efa6..84e60b9df74 100644 --- a/aws/resource_aws_resourcegroups_group_test.go +++ b/aws/resource_aws_resourcegroups_group_test.go @@ -35,6 +35,7 @@ func TestAccAWSResourceGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, resourcegroups.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSResourceGroupDestroy, Steps: []resource.TestStep{ @@ -72,6 +73,7 @@ func TestAccAWSResourceGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, resourcegroups.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSResourceGroupDestroy, Steps: []resource.TestStep{ From 041f7801ed943b37c51fd7f7ad546181e28e9f1c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:13:31 -0400 Subject: [PATCH 1014/1252] tests/r/servicecatalog_portfolio: Add ErrorCheck --- aws/resource_aws_servicecatalog_portfolio_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_servicecatalog_portfolio_test.go b/aws/resource_aws_servicecatalog_portfolio_test.go index e2cc949bfa3..9e565f33dbe 100644 --- a/aws/resource_aws_servicecatalog_portfolio_test.go +++ b/aws/resource_aws_servicecatalog_portfolio_test.go @@ -19,6 +19,7 @@ func TestAccAWSServiceCatalogPortfolio_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, servicecatalog.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSServiceCatalogPortfolio_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, servicecatalog.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, Steps: []resource.TestStep{ @@ -72,6 +74,7 @@ func TestAccAWSServiceCatalogPortfolio_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, servicecatalog.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, Steps: []resource.TestStep{ From 6272a2a730d96a613916208d3060c5125134b70c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:13:54 -0400 Subject: [PATCH 1015/1252] tests/r/servicequotas_service_quota: Add ErrorCheck --- aws/resource_aws_servicequotas_service_quota_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_servicequotas_service_quota_test.go b/aws/resource_aws_servicequotas_service_quota_test.go index ce5ae69190c..e0737b3cc9e 100644 --- a/aws/resource_aws_servicequotas_service_quota_test.go +++ b/aws/resource_aws_servicequotas_service_quota_test.go @@ -19,6 +19,7 @@ func TestAccAwsServiceQuotasServiceQuota_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceQuotas(t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -70,6 +71,7 @@ func TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnCreate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceQuotas(t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -112,6 +114,7 @@ func TestAccAwsServiceQuotasServiceQuota_Value_IncreaseOnUpdate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceQuotas(t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 27cb410b258b59caa8747660e86948e400fa2f47 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:13:54 -0400 Subject: [PATCH 1016/1252] tests/ds/servicequotas_service: Add ErrorCheck --- aws/data_source_aws_servicequotas_service_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_servicequotas_service_test.go b/aws/data_source_aws_servicequotas_service_test.go index 9aa922bc8d9..7979ed3a356 100644 --- a/aws/data_source_aws_servicequotas_service_test.go +++ b/aws/data_source_aws_servicequotas_service_test.go @@ -12,8 +12,9 @@ func TestAccAwsServiceQuotasServiceDataSource_ServiceName(t *testing.T) { dataSourceName := "data.aws_servicequotas_service.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsServiceQuotasServiceDataSourceConfigServiceName("Amazon Virtual Private Cloud (Amazon VPC)"), From c90aec041e51db9587e1e5709fd76a29e920f3ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:13:54 -0400 Subject: [PATCH 1017/1252] tests/ds/servicequotas_service_quota: Add ErrorCheck --- ...data_source_aws_servicequotas_service_quota_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_servicequotas_service_quota_test.go b/aws/data_source_aws_servicequotas_service_quota_test.go index 0b6ce5f7e0d..d1fa2ad2d21 100644 --- a/aws/data_source_aws_servicequotas_service_quota_test.go +++ b/aws/data_source_aws_servicequotas_service_quota_test.go @@ -13,8 +13,9 @@ func TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaCode(t *testing.T) { dataSourceName := "data.aws_servicequotas_service_quota.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsServiceQuotasServiceQuotaDataSourceConfigQuotaCode("vpc", "L-F678F1CE"), @@ -38,8 +39,9 @@ func TestAccAwsServiceQuotasServiceQuotaDataSource_QuotaName(t *testing.T) { dataSourceName := "data.aws_servicequotas_service_quota.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicequotas.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, servicequotas.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsServiceQuotasServiceQuotaDataSourceConfigQuotaName("vpc", "VPCs per Region"), From c499e04cfe9b9d87879159c61d9089f6e34a7c6e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:21:47 -0400 Subject: [PATCH 1018/1252] tests/r/media_convert_queue: Add ErrorCheck --- aws/resource_aws_media_convert_queue_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_media_convert_queue_test.go b/aws/resource_aws_media_convert_queue_test.go index dba3b7f6f34..d6f92b639e8 100644 --- a/aws/resource_aws_media_convert_queue_test.go +++ b/aws/resource_aws_media_convert_queue_test.go @@ -19,6 +19,7 @@ func TestAccAWSMediaConvertQueue_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ @@ -50,6 +51,7 @@ func TestAccAWSMediaConvertQueue_ReservationPlanSettings(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ @@ -91,6 +93,7 @@ func TestAccAWSMediaConvertQueue_withStatus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ @@ -124,6 +127,7 @@ func TestAccAWSMediaConvertQueue_withTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ @@ -168,6 +172,7 @@ func TestAccAWSMediaConvertQueue_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ @@ -192,6 +197,7 @@ func TestAccAWSMediaConvertQueue_withDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + ErrorCheck: testAccErrorCheck(t, mediaconvert.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, Steps: []resource.TestStep{ From 8ea2aaebac88f32c844d037d7bfe1659e6a56842 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:22:10 -0400 Subject: [PATCH 1019/1252] tests/r/media_package_channel: Add ErrorCheck --- aws/resource_aws_media_package_channel_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_media_package_channel_test.go b/aws/resource_aws_media_package_channel_test.go index 66da4887175..b3526787182 100644 --- a/aws/resource_aws_media_package_channel_test.go +++ b/aws/resource_aws_media_package_channel_test.go @@ -17,6 +17,7 @@ func TestAccAWSMediaPackageChannel_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaPackage(t) }, + ErrorCheck: testAccErrorCheck(t, mediapackage.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaPackageChannelDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSMediaPackageChannel_description(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaPackage(t) }, + ErrorCheck: testAccErrorCheck(t, mediapackage.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaPackageChannelDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSMediaPackageChannel_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaPackage(t) }, + ErrorCheck: testAccErrorCheck(t, mediapackage.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaPackageChannelDestroy, Steps: []resource.TestStep{ From 26472409cd4bc528d6a378a5139b11deb8d65141 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:22:31 -0400 Subject: [PATCH 1020/1252] tests/r/media_store_container: Add ErrorCheck --- aws/resource_aws_media_store_container_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_media_store_container_test.go b/aws/resource_aws_media_store_container_test.go index e51a82b94aa..34c6628d6c5 100644 --- a/aws/resource_aws_media_store_container_test.go +++ b/aws/resource_aws_media_store_container_test.go @@ -16,6 +16,7 @@ func TestAccAWSMediaStoreContainer_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaStore(t) }, + ErrorCheck: testAccErrorCheck(t, mediastore.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaStoreContainerDestroy, Steps: []resource.TestStep{ @@ -40,6 +41,7 @@ func TestAccAWSMediaStoreContainer_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaStore(t) }, + ErrorCheck: testAccErrorCheck(t, mediastore.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaStoreContainerDestroy, Steps: []resource.TestStep{ From 0b2b8e773c464f2d0c1c85455441f662ce21b897 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:22:41 -0400 Subject: [PATCH 1021/1252] tests/r/media_store_container_policy: Add ErrorCheck --- aws/resource_aws_media_store_container_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_media_store_container_policy_test.go b/aws/resource_aws_media_store_container_policy_test.go index 1295d6b2775..b5925bb3ded 100644 --- a/aws/resource_aws_media_store_container_policy_test.go +++ b/aws/resource_aws_media_store_container_policy_test.go @@ -17,6 +17,7 @@ func TestAccAWSMediaStoreContainerPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaStore(t) }, + ErrorCheck: testAccErrorCheck(t, mediastore.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMediaStoreContainerPolicyDestroy, Steps: []resource.TestStep{ From a08cc21b47640a71b3ef2e01fae319d9d1fd26cb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:30:21 -0400 Subject: [PATCH 1022/1252] tests/r/s3outposts_endpoint: Add ErrorCheck --- aws/resource_aws_s3outposts_endpoint_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_s3outposts_endpoint_test.go b/aws/resource_aws_s3outposts_endpoint_test.go index bfbd117e995..38ed3eff55e 100644 --- a/aws/resource_aws_s3outposts_endpoint_test.go +++ b/aws/resource_aws_s3outposts_endpoint_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/s3outposts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -17,6 +18,7 @@ func TestAccAWSS3OutpostsEndpoint_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3OutpostsEndpointDestroy, Steps: []resource.TestStep{ @@ -49,6 +51,7 @@ func TestAccAWSS3OutpostsEndpoint_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, s3outposts.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3OutpostsEndpointDestroy, Steps: []resource.TestStep{ From fadcd4aeff2ab4b62bbec0fa683a89b7f8e69553 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:32:34 -0400 Subject: [PATCH 1023/1252] tests/ds/serverlessapplicationrepository_application: Add ErrorCheck --- ...rverlessapplicationrepository_application_test.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_serverlessapplicationrepository_application_test.go b/aws/data_source_aws_serverlessapplicationrepository_application_test.go index a22b68bdb52..c99cd4dc240 100644 --- a/aws/data_source_aws_serverlessapplicationrepository_application_test.go +++ b/aws/data_source_aws_serverlessapplicationrepository_application_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/serverlessapplicationrepository" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -14,8 +15,9 @@ func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Basic(t *tes appARN := testAccAwsServerlessApplicationRepositoryCloudFormationApplicationID() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessapplicationrepository.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig(appARN), @@ -35,6 +37,7 @@ func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Basic(t *tes }, }) } + func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Versioned(t *testing.T) { datasourceName := "data.aws_serverlessapplicationrepository_application.secrets_manager_postgres_single_user_rotator" appARN := testAccAwsServerlessApplicationRepositoryCloudFormationApplicationID() @@ -45,8 +48,9 @@ func TestAccDataSourceAwsServerlessApplicationRepositoryApplication_Versioned(t ) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessapplicationrepository.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsServerlessApplicationRepositoryApplicationDataSourceConfig_Versioned(appARN, version1), From 8b4612f092284377edc51a91853c1e552cb23257 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:33:39 -0400 Subject: [PATCH 1024/1252] tests/r/serverlessapplicationrepository_cloudformation_stack: Add ErrorCheck --- ...erlessapplicationrepository_cloudformation_stack_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go index 8fec4456245..2aee8fbace7 100644 --- a/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go +++ b/aws/resource_aws_serverlessapplicationrepository_cloudformation_stack_test.go @@ -25,6 +25,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_basic(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -75,6 +76,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_disappears(t * resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ @@ -103,6 +105,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_versioned(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -156,6 +159,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_paired(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -181,6 +185,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_Tags(t *testin resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ @@ -227,6 +232,7 @@ func TestAccAwsServerlessApplicationRepositoryCloudFormationStack_update(t *test resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, serverlessrepository.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudFormationDestroy, Steps: []resource.TestStep{ From d018c7c0a79089e015cc837b32414d03ff090e0b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:34:26 -0400 Subject: [PATCH 1025/1252] tests/r/shield_protection: Add ErrorCheck --- aws/resource_aws_shield_protection_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_shield_protection_test.go b/aws/resource_aws_shield_protection_test.go index f6e9ca1012a..c60b7cff80b 100644 --- a/aws/resource_aws_shield_protection_test.go +++ b/aws/resource_aws_shield_protection_test.go @@ -23,6 +23,7 @@ func TestAccAWSShieldProtection_GlobalAccelerator(t *testing.T) { testAccPartitionHasServicePreCheck(shield.EndpointsID, t) testAccPreCheckAWSShield(t) }, + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ @@ -51,6 +52,7 @@ func TestAccAWSShieldProtection_ElasticIPAddress(t *testing.T) { testAccPartitionHasServicePreCheck(shield.EndpointsID, t) testAccPreCheckAWSShield(t) }, + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ @@ -79,6 +81,7 @@ func TestAccAWSShieldProtection_Alb(t *testing.T) { testAccPartitionHasServicePreCheck(shield.EndpointsID, t) testAccPreCheckAWSShield(t) }, + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ @@ -107,6 +110,7 @@ func TestAccAWSShieldProtection_Elb(t *testing.T) { testAccPartitionHasServicePreCheck(shield.EndpointsID, t) testAccPreCheckAWSShield(t) }, + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ @@ -136,6 +140,7 @@ func TestAccAWSShieldProtection_Cloudfront(t *testing.T) { testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) testAccPreCheckAWSShield(t) }, + ErrorCheck: testAccErrorCheck(t, shield.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSShieldProtectionDestroy, Steps: []resource.TestStep{ From b8b2f8aa2b7263a7ec6ef49db6c57fd21d21e129 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:34:47 -0400 Subject: [PATCH 1026/1252] tests/r/simpledb_domain: Add ErrorCheck --- aws/resource_aws_simpledb_domain_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_simpledb_domain_test.go b/aws/resource_aws_simpledb_domain_test.go index a58ccc7ae8b..54e6a0b2c8b 100644 --- a/aws/resource_aws_simpledb_domain_test.go +++ b/aws/resource_aws_simpledb_domain_test.go @@ -16,6 +16,7 @@ func TestAccAWSSimpleDBDomain_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(simpledb.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, simpledb.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSimpleDBDomainDestroy, Steps: []resource.TestStep{ From 4e7255d25b5a80cbe9db403eb9044124ce93ad9b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:35:09 -0400 Subject: [PATCH 1027/1252] tests/ds/caller_identity: Add ErrorCheck --- aws/data_source_aws_caller_identity_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_caller_identity_test.go b/aws/data_source_aws_caller_identity_test.go index 12857aa2035..e73435d0ba1 100644 --- a/aws/data_source_aws_caller_identity_test.go +++ b/aws/data_source_aws_caller_identity_test.go @@ -4,14 +4,16 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/sts" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccAWSCallerIdentity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sts.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCallerIdentityConfig_basic, From 4e4b2952df620fddd7583ddee9e51f2edf68aaf7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:35:37 -0400 Subject: [PATCH 1028/1252] tests/r/swf_domain: Add ErrorCheck --- aws/resource_aws_swf_domain_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_swf_domain_test.go b/aws/resource_aws_swf_domain_test.go index 1421bdb6406..82c003a6fbb 100644 --- a/aws/resource_aws_swf_domain_test.go +++ b/aws/resource_aws_swf_domain_test.go @@ -31,6 +31,7 @@ func TestAccAWSSwfDomain_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckSwfDomainTestingEnabled(t) }, + ErrorCheck: testAccErrorCheck(t, swf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSwfDomainDestroy, Steps: []resource.TestStep{ @@ -61,6 +62,7 @@ func TestAccAWSSwfDomain_tags(t *testing.T) { testAccPreCheck(t) testAccPreCheckSwfDomainTestingEnabled(t) }, + ErrorCheck: testAccErrorCheck(t, swf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSwfDomainDestroy, Steps: []resource.TestStep{ @@ -106,6 +108,7 @@ func TestAccAWSSwfDomain_NamePrefix(t *testing.T) { testAccPreCheck(t) testAccPreCheckSwfDomainTestingEnabled(t) }, + ErrorCheck: testAccErrorCheck(t, swf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSwfDomainDestroy, Steps: []resource.TestStep{ @@ -134,6 +137,7 @@ func TestAccAWSSwfDomain_GeneratedName(t *testing.T) { testAccPreCheck(t) testAccPreCheckSwfDomainTestingEnabled(t) }, + ErrorCheck: testAccErrorCheck(t, swf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSwfDomainDestroy, Steps: []resource.TestStep{ @@ -161,6 +165,7 @@ func TestAccAWSSwfDomain_Description(t *testing.T) { testAccPreCheck(t) testAccPreCheckSwfDomainTestingEnabled(t) }, + ErrorCheck: testAccErrorCheck(t, swf.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSwfDomainDestroy, Steps: []resource.TestStep{ From 6b1fea374376f9633878708f0fe35fc0918e991a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:36:09 -0400 Subject: [PATCH 1029/1252] tests/r/synthetics_canary: Add ErrorCheck --- aws/resource_aws_synthetics_canary_test.go | 46 +++++++++------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/aws/resource_aws_synthetics_canary_test.go b/aws/resource_aws_synthetics_canary_test.go index 95f6ab11bb5..2c92f457625 100644 --- a/aws/resource_aws_synthetics_canary_test.go +++ b/aws/resource_aws_synthetics_canary_test.go @@ -80,9 +80,8 @@ func TestAccAWSSyntheticsCanary_basic(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -155,6 +154,7 @@ func TestAccAWSSyntheticsCanary_runtimeVersion(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -188,9 +188,8 @@ func TestAccAWSSyntheticsCanary_startCanary(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -237,9 +236,8 @@ func TestAccAWSSyntheticsCanary_startCanary_codeChanges(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -279,9 +277,8 @@ func TestAccAWSSyntheticsCanary_s3(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -324,9 +321,8 @@ func TestAccAWSSyntheticsCanary_runConfig(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -371,9 +367,8 @@ func TestAccAWSSyntheticsCanary_runConfigTracing(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -414,9 +409,8 @@ func TestAccAWSSyntheticsCanary_vpc(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -464,9 +458,8 @@ func TestAccAWSSyntheticsCanary_tags(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ @@ -511,9 +504,8 @@ func TestAccAWSSyntheticsCanary_disappears(t *testing.T) { resourceName := "aws_synthetics_canary.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, synthetics.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsSyntheticsCanaryDestroy, Steps: []resource.TestStep{ From 326bb91fa0d1d1e46199c5c24ae08a9127b0bbdb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:36:34 -0400 Subject: [PATCH 1030/1252] tests/r/worklink_fleet: Add ErrorCheck --- aws/resource_aws_worklink_fleet_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_worklink_fleet_test.go b/aws/resource_aws_worklink_fleet_test.go index 7f803c29d09..d02c93c89a1 100644 --- a/aws/resource_aws_worklink_fleet_test.go +++ b/aws/resource_aws_worklink_fleet_test.go @@ -19,6 +19,7 @@ func TestAccAWSWorkLinkFleet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSWorkLinkFleet_DisplayName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -78,6 +80,7 @@ func TestAccAWSWorkLinkFleet_OptimizeForEndUserLocation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -110,6 +113,7 @@ func TestAccAWSWorkLinkFleet_AuditStreamArn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -135,6 +139,7 @@ func TestAccAWSWorkLinkFleet_Network(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -178,6 +183,7 @@ func TestAccAWSWorkLinkFleet_DeviceCaCertificate(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -211,6 +217,7 @@ func TestAccAWSWorkLinkFleet_IdentityProvider(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ @@ -241,6 +248,7 @@ func TestAccAWSWorkLinkFleet_Disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkFleetDestroy, Steps: []resource.TestStep{ From 3b41c84f1b78ab9dcfe6862275e2db8cf5caecba Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:36:43 -0400 Subject: [PATCH 1031/1252] tests/r/worklink_website_certificate_authority_association: Add ErrorCheck --- ..._worklink_website_certificate_authority_association_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_worklink_website_certificate_authority_association_test.go b/aws/resource_aws_worklink_website_certificate_authority_association_test.go index d799a07a338..13ed4f61199 100644 --- a/aws/resource_aws_worklink_website_certificate_authority_association_test.go +++ b/aws/resource_aws_worklink_website_certificate_authority_association_test.go @@ -19,6 +19,7 @@ func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_basic(t *t resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkWebsiteCertificateAuthorityAssociationDestroy, Steps: []resource.TestStep{ @@ -48,6 +49,7 @@ func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_DisplayNam displayName2 := fmt.Sprintf("tf-website-certificate-%s", acctest.RandStringFromCharSet(5, acctest.CharSetAlpha)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkWebsiteCertificateAuthorityAssociationDestroy, Steps: []resource.TestStep{ @@ -80,6 +82,7 @@ func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_Disappears resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, + ErrorCheck: testAccErrorCheck(t, worklink.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSWorkLinkWebsiteCertificateAuthorityAssociationDestroy, Steps: []resource.TestStep{ From a3a393a4158884e8cee694d8940ac5fe4d4c9e4e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:37:03 -0400 Subject: [PATCH 1032/1252] tests/r/xray_encryption_config: Add ErrorCheck --- aws/resource_aws_xray_encryption_config_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_xray_encryption_config_test.go b/aws/resource_aws_xray_encryption_config_test.go index 98f5290bd23..d5d0f5e1dbc 100644 --- a/aws/resource_aws_xray_encryption_config_test.go +++ b/aws/resource_aws_xray_encryption_config_test.go @@ -17,6 +17,7 @@ func TestAccAWSXrayEncryptionConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From b6b3dc032ee0cd31ef361aaeb183f7de2a7b5500 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:37:12 -0400 Subject: [PATCH 1033/1252] tests/r/xray_group: Add ErrorCheck --- aws/resource_aws_xray_group_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_xray_group_test.go b/aws/resource_aws_xray_group_test.go index 8e194fbb297..3e4dacc1fa7 100644 --- a/aws/resource_aws_xray_group_test.go +++ b/aws/resource_aws_xray_group_test.go @@ -19,6 +19,7 @@ func TestAccAWSXrayGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXrayGroupDestroy, Steps: []resource.TestStep{ @@ -56,6 +57,7 @@ func TestAccAWSXrayGroup_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXrayGroupDestroy, Steps: []resource.TestStep{ @@ -99,6 +101,7 @@ func TestAccAWSXrayGroup_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXrayGroupDestroy, Steps: []resource.TestStep{ From 24903357bedbcda71e8234bb608b2152e940deb9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 11:37:23 -0400 Subject: [PATCH 1034/1252] tests/r/xray_sampling_rule: Add ErrorCheck --- aws/resource_aws_xray_sampling_rule_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_xray_sampling_rule_test.go b/aws/resource_aws_xray_sampling_rule_test.go index 7f079133503..660988d5375 100644 --- a/aws/resource_aws_xray_sampling_rule_test.go +++ b/aws/resource_aws_xray_sampling_rule_test.go @@ -17,6 +17,7 @@ func TestAccAWSXraySamplingRule_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSXray(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ @@ -57,6 +58,7 @@ func TestAccAWSXraySamplingRule_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSXray(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ @@ -112,6 +114,7 @@ func TestAccAWSXraySamplingRule_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSXray(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ @@ -156,6 +159,7 @@ func TestAccAWSXraySamplingRule_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSXray(t) }, + ErrorCheck: testAccErrorCheck(t, xray.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSXraySamplingRuleDestroy, Steps: []resource.TestStep{ From 0c20fb2b582ff7e2678394f0e5db3038ec2dbf5f Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 19 Mar 2021 17:49:11 +0200 Subject: [PATCH 1035/1252] retry for eventual consistency --- aws/resource_aws_pinpoint_event_stream.go | 35 +++++----- ...resource_aws_pinpoint_event_stream_test.go | 66 ++++++++++++++----- 2 files changed, 69 insertions(+), 32 deletions(-) diff --git a/aws/resource_aws_pinpoint_event_stream.go b/aws/resource_aws_pinpoint_event_stream.go index 89e60aa4277..b39ca11e305 100644 --- a/aws/resource_aws_pinpoint_event_stream.go +++ b/aws/resource_aws_pinpoint_event_stream.go @@ -26,12 +26,14 @@ func resourceAwsPinpointEventStream() *schema.Resource { ForceNew: true, }, "destination_stream_arn": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, }, "role_arn": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, }, }, } @@ -42,19 +44,21 @@ func resourceAwsPinpointEventStreamUpsert(d *schema.ResourceData, meta interface applicationId := d.Get("application_id").(string) - params := &pinpoint.WriteEventStream{} - - params.DestinationStreamArn = aws.String(d.Get("destination_stream_arn").(string)) - params.RoleArn = aws.String(d.Get("role_arn").(string)) + params := &pinpoint.WriteEventStream{ + DestinationStreamArn: aws.String(d.Get("destination_stream_arn").(string)), + RoleArn: aws.String(d.Get("role_arn").(string)), + } req := pinpoint.PutEventStreamInput{ ApplicationId: aws.String(applicationId), WriteEventStream: params, } - _, err := conn.PutEventStream(&req) + _, err := retryOnAwsCode("BadRequestException", func() (interface{}, error) { + return conn.PutEventStream(&req) + }) if err != nil { - return fmt.Errorf("error putting Pinpoint Event Stream for application %s: %s", applicationId, err) + return fmt.Errorf("error putting Pinpoint Event Stream for application %s: %w", applicationId, err) } d.SetId(applicationId) @@ -77,12 +81,13 @@ func resourceAwsPinpointEventStreamRead(d *schema.ResourceData, meta interface{} return nil } - return fmt.Errorf("error getting Pinpoint Event Stream for application %s: %s", d.Id(), err) + return fmt.Errorf("error getting Pinpoint Event Stream for application %s: %w", d.Id(), err) } - d.Set("application_id", output.EventStream.ApplicationId) - d.Set("destination_stream_arn", output.EventStream.DestinationStreamArn) - d.Set("role_arn", output.EventStream.RoleArn) + res := output.EventStream + d.Set("application_id", res.ApplicationId) + d.Set("destination_stream_arn", res.DestinationStreamArn) + d.Set("role_arn", res.RoleArn) return nil } @@ -100,7 +105,7 @@ func resourceAwsPinpointEventStreamDelete(d *schema.ResourceData, meta interface } if err != nil { - return fmt.Errorf("error deleting Pinpoint Event Stream for application %s: %s", d.Id(), err) + return fmt.Errorf("error deleting Pinpoint Event Stream for application %s: %w", d.Id(), err) } return nil } diff --git a/aws/resource_aws_pinpoint_event_stream_test.go b/aws/resource_aws_pinpoint_event_stream_test.go index 29298040762..7411e69aaf0 100644 --- a/aws/resource_aws_pinpoint_event_stream_test.go +++ b/aws/resource_aws_pinpoint_event_stream_test.go @@ -13,7 +13,7 @@ import ( func TestAccAWSPinpointEventStream_basic(t *testing.T) { var stream pinpoint.EventStream - resourceName := "aws_pinpoint_event_stream.test_event_stream" + resourceName := "aws_pinpoint_event_stream.test" rName := acctest.RandomWithPrefix("tf-acc-test") rName2 := acctest.RandomWithPrefix("tf-acc-test") @@ -25,9 +25,12 @@ func TestAccAWSPinpointEventStream_basic(t *testing.T) { CheckDestroy: testAccCheckAWSPinpointEventStreamDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSPinpointEventStreamConfig_basic(rName), + Config: testAccAWSPinpointEventStreamConfig_basic(rName, rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointEventStreamExists(resourceName, &stream), + resource.TestCheckResourceAttrPair(resourceName, "application_id", "aws_pinpoint_app.test", "application_id"), + resource.TestCheckResourceAttrPair(resourceName, "destination_stream_arn", "aws_kinesis_stream.test", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "role_arn", "aws_iam_role.test", "arn"), ), }, { @@ -36,15 +39,42 @@ func TestAccAWSPinpointEventStream_basic(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccAWSPinpointEventStreamConfig_basic(rName2), + Config: testAccAWSPinpointEventStreamConfig_basic(rName, rName2), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointEventStreamExists(resourceName, &stream), + resource.TestCheckResourceAttrPair(resourceName, "application_id", "aws_pinpoint_app.test", "application_id"), + resource.TestCheckResourceAttrPair(resourceName, "destination_stream_arn", "aws_kinesis_stream.test", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "role_arn", "aws_iam_role.test", "arn"), ), }, }, }) } +func TestAccAWSPinpointEventStream_disappears(t *testing.T) { + var stream pinpoint.EventStream + resourceName := "aws_pinpoint_event_stream.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + IDRefreshName: resourceName, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPinpointEventStreamDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPinpointEventStreamConfig_basic(rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPinpointEventStreamExists(resourceName, &stream), + testAccCheckResourceDisappears(testAccProvider, resourceAwsPinpointEventStream(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSPinpointEventStreamExists(n string, stream *pinpoint.EventStream) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -74,22 +104,24 @@ func testAccCheckAWSPinpointEventStreamExists(n string, stream *pinpoint.EventSt } } -func testAccAWSPinpointEventStreamConfig_basic(rName string) string { +func testAccAWSPinpointEventStreamConfig_basic(rName, streamName string) string { return fmt.Sprintf(` -resource "aws_pinpoint_app" "test_app" {} +resource "aws_pinpoint_app" "test" {} -resource "aws_pinpoint_event_stream" "test_event_stream" { - application_id = aws_pinpoint_app.test_app.application_id - destination_stream_arn = aws_kinesis_stream.test_stream.arn - role_arn = aws_iam_role.test_role.arn +resource "aws_pinpoint_event_stream" "test" { + application_id = aws_pinpoint_app.test.application_id + destination_stream_arn = aws_kinesis_stream.test.arn + role_arn = aws_iam_role.test.arn } -resource "aws_kinesis_stream" "test_stream" { - name = %[1]q +resource "aws_kinesis_stream" "test" { + name = %[2]q shard_count = 1 } -resource "aws_iam_role" "test_role" { +resource "aws_iam_role" "test" { + name = %[1]q + assume_role_policy = < Date: Fri, 19 Mar 2021 17:50:10 +0200 Subject: [PATCH 1036/1252] comment --- aws/resource_aws_pinpoint_event_stream.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_pinpoint_event_stream.go b/aws/resource_aws_pinpoint_event_stream.go index b39ca11e305..14624161dbb 100644 --- a/aws/resource_aws_pinpoint_event_stream.go +++ b/aws/resource_aws_pinpoint_event_stream.go @@ -54,6 +54,7 @@ func resourceAwsPinpointEventStreamUpsert(d *schema.ResourceData, meta interface WriteEventStream: params, } + // Retry for IAM eventual consistency _, err := retryOnAwsCode("BadRequestException", func() (interface{}, error) { return conn.PutEventStream(&req) }) From f51508ed881261a5bacaf6786de0323155e860bf Mon Sep 17 00:00:00 2001 From: drfaust92 Date: Fri, 19 Mar 2021 17:52:35 +0200 Subject: [PATCH 1037/1252] docs --- .changelog/18305.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/18305.txt diff --git a/.changelog/18305.txt b/.changelog/18305.txt new file mode 100644 index 00000000000..14fd969ad2b --- /dev/null +++ b/.changelog/18305.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_pinpoint_event_stream: Retry on eventual consistency error +``` + +```release-note:enhancement +resource/aws_pinpoint_event_stream: Plan time validations for `destination_stream_arn` and `role_arn` +``` From 5a9fa757f0954298635a351121d39c525af961fc Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 12:26:19 -0400 Subject: [PATCH 1038/1252] tests/provider: Use string matching in testAccErrorCheckCommon() and catch all InvalidAction (#18283) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17566 Previously in AWS GovCloud (US): ``` === CONT TestAccAwsEc2ClientVpn_serial/NetworkAssociation_multipleSubnets resource_aws_ec2_client_vpn_network_association_test.go:144: Step 1/3 error: Error running apply: exit status 1 Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service. status code: 400, request id: 387e7807-e2b8-4314-9aa8-6cf2e33a0ded on terraform_plugin_test.tf line 61, in resource "aws_ec2_client_vpn_endpoint" "test": 61: resource "aws_ec2_client_vpn_endpoint" "test" { === CONT TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups resource_aws_ec2_client_vpn_network_association_test.go:211: Step 1/3 error: Error running apply: exit status 1 Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service. status code: 400, request id: ad7a3b32-b650-4683-a7e0-945481550c6d on terraform_plugin_test.tf line 57, in resource "aws_ec2_client_vpn_endpoint" "test": 57: resource "aws_ec2_client_vpn_endpoint" "test" { === CONT TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears resource_aws_ec2_client_vpn_network_association_test.go:186: Step 1/1 error: Error running apply: exit status 1 Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service. status code: 400, request id: feed7ccb-95a7-411f-b633-da58e8340392 on terraform_plugin_test.tf line 56, in resource "aws_ec2_client_vpn_endpoint" "test": 56: resource "aws_ec2_client_vpn_endpoint" "test" { === CONT TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic resource_aws_ec2_client_vpn_network_association_test.go:105: Step 1/2 error: Error running apply: exit status 1 Error: Error creating Client VPN endpoint: InvalidAction: The action CreateClientVpnEndpoint is not valid for this web service. status code: 400, request id: 3f31766a-9288-4e46-9f35-6d7922e938ac on terraform_plugin_test.tf line 56, in resource "aws_ec2_client_vpn_endpoint" "test": 56: resource "aws_ec2_client_vpn_endpoint" "test" { --- FAIL: TestAccAwsEc2ClientVpn_serial (0.54s) --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups (32.03s) --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_multipleSubnets (32.06s) --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears (31.96s) --- FAIL: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic (33.01s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAwsEc2ClientVpn_serial (0.41s) --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_disappears (30.61s) --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_securityGroups (31.10s) --- SKIP: TestAccAwsEc2ClientVpn_serial/NetworkAssociation_basic (31.01s) ``` --- aws/provider_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/provider_test.go b/aws/provider_test.go index 8f0923f2d61..885cb8d2773 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1110,6 +1110,9 @@ func testAccErrorCheck(t *testing.T, endpointIDs ...string) resource.ErrorCheckF } } +// NOTE: This function cannot use the standard tfawserr helpers +// as it is receiving error strings from the SDK testing framework, +// not actual error types from the resource logic. func testAccErrorCheckCommon(err error) bool { if strings.Contains(err.Error(), "is not supported in this") { return true @@ -1119,19 +1122,19 @@ func testAccErrorCheckCommon(err error) bool { return true } - if tfawserr.ErrCodeEquals(err, "UnknownOperationException") { + if strings.Contains(err.Error(), "InvalidAction") { return true } - if tfawserr.ErrCodeEquals(err, "UnsupportedOperation") { + if strings.Contains(err.Error(), "Unknown operation") { return true } - if tfawserr.ErrMessageContains(err, "InvalidInputException", "Unknown operation") { + if strings.Contains(err.Error(), "UnknownOperationException") { return true } - if tfawserr.ErrMessageContains(err, "InvalidAction", "Unavailable Operation") { + if strings.Contains(err.Error(), "UnsupportedOperation") { return true } From aeb3456e1a1c936b7d07fea2c7aa33eaec0adee3 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 13:02:25 -0400 Subject: [PATCH 1039/1252] tests/provider: Fix and enable linting for immediate dereference after AWS SDK Go pointer conversion (#18024) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12992 This is akin to `*&var`, which is flagged by the Go toolchain. --- .semgrep.yml | 16 ++++++++++++++++ aws/resource_aws_cur_report_definition.go | 2 +- aws/resource_aws_launch_configuration.go | 2 +- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.semgrep.yml b/.semgrep.yml index e9cd3e63069..4a9179232b6 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -143,6 +143,22 @@ rules: pattern: 'd.SetId(*$VALUE)' severity: WARNING + - id: aws-go-sdk-pointer-conversion-immediate-dereference + fix: $VALUE + languages: [go] + message: Using AWS Go SDK pointer conversion, e.g. aws.String(), with immediate dereferencing is extraneous + paths: + include: + - aws/ + patterns: + - pattern-either: + - pattern: '*aws.Bool($VALUE)' + - pattern: '*aws.Float64($VALUE)' + - pattern: '*aws.Int64($VALUE)' + - pattern: '*aws.String($VALUE)' + - pattern: '*aws.Time($VALUE)' + severity: WARNING + - id: helper-schema-Set-extraneous-NewSet-with-flattenStringList languages: [go] message: Prefer `flattenStringSet()` function for casting a list of string pointers to a set diff --git a/aws/resource_aws_cur_report_definition.go b/aws/resource_aws_cur_report_definition.go index 7be3a23fc90..badfcbb5324 100644 --- a/aws/resource_aws_cur_report_definition.go +++ b/aws/resource_aws_cur_report_definition.go @@ -172,7 +172,7 @@ func resourceAwsCurReportDefinitionCreate(d *schema.ResourceData, meta interface func resourceAwsCurReportDefinitionRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).costandusagereportconn - reportName := *aws.String(d.Id()) + reportName := d.Id() matchingReportDefinition, err := describeCurReportDefinition(conn, reportName) if err != nil { diff --git a/aws/resource_aws_launch_configuration.go b/aws/resource_aws_launch_configuration.go index 0740e9d1dad..d01e25da7ec 100644 --- a/aws/resource_aws_launch_configuration.go +++ b/aws/resource_aws_launch_configuration.go @@ -434,7 +434,7 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface ebs.Iops = aws.Int64(int64(v)) } - if *aws.String(bd["device_name"].(string)) == *rootDeviceName { + if bd["device_name"].(string) == aws.StringValue(rootDeviceName) { return fmt.Errorf("Root device (%s) declared as an 'ebs_block_device'. Use 'root_block_device' keyword.", *rootDeviceName) } From 5ef790aab0ec77dbd46a00c022cd2fd6dd7fa7a7 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 13:58:27 -0400 Subject: [PATCH 1040/1252] tests/provider: Fix compilation-time randomization in test configuration, enable semgrep rule to catch coding issue (#18220) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18175 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18204 Also adds `ErrorCheck` while adjusting these tests. Previously: ``` aws/data_source_aws_cloudfront_distribution_test.go severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead 36:var testAccAWSCloudFrontDistributionData = fmt.Sprintf(` 37:%s 38: 39:data "aws_cloudfront_distribution" "test" { 40: id = aws_cloudfront_distribution.s3_distribution.id 41:} 42:`, fmt.Sprintf(testAccAWSCloudFrontDistributionS3ConfigWithTags, acctest.RandInt(), originBucket, logBucket, testAccAWSCloudFrontDistributionRetainConfig())) aws/data_source_aws_ecs_cluster_test.go severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead 50:var testAccCheckAwsEcsClusterDataSourceConfig = fmt.Sprintf(` 51:resource "aws_ecs_cluster" "default" { 52: name = "default-%d" 53:} 54: 55:data "aws_ecs_cluster" "default" { 56: cluster_name = aws_ecs_cluster.default.name 57:} 58:`, acctest.RandInt()) -------------------------------------------------------------------------------- 60:var testAccCheckAwsEcsClusterDataSourceConfigContainerInsights = fmt.Sprintf(` 61:resource "aws_ecs_cluster" "default" { 62: name = "default-%d" 63: 64: setting { 65: name = "containerInsights" 66: value = "enabled" 67: } 68:} 69: -------- [hid 4 additional lines, adjust with --max-lines-per-finding] --------- aws/data_source_aws_ecs_service_test.go severity:warning rule:helper-acctest-RandInt-compiled: Using `acctest.RandInt()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead 34:var testAccCheckAwsEcsServiceDataSourceConfig = fmt.Sprintf(` 35:resource "aws_ecs_cluster" "test" { 36: name = "tf-acc-%d" 37:} 38: 39:resource "aws_ecs_task_definition" "test" { 40: family = "mongodb" 41: 42: container_definitions = <, ...) + - pattern: var $VAR = fmt.Sprintf(..., <... acctest.RandInt() ...>, ...) + severity: WARNING + + - id: helper-acctest-RandString-compiled + languages: [go] + message: Using `acctest.RandString()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead + paths: + include: + - aws/ + patterns: + - pattern-either: + - pattern: const $CONST = fmt.Sprintf(..., <... acctest.RandString(...) ...>, ...) + - pattern: var $VAR = fmt.Sprintf(..., <... acctest.RandString(...) ...>, ...) + severity: WARNING + + - id: helper-acctest-RandomWithPrefix-compiled + languages: [go] + message: Using `acctest.RandomWithPrefix()` in constant or variable declaration will execute during compilation and not randomize, pass into string generating function instead + paths: + include: + - aws/ + patterns: + - pattern-either: + - pattern: const $CONST = fmt.Sprintf(..., <... acctest.RandomWithPrefix(...) ...>, ...) + - pattern: var $VAR = fmt.Sprintf(..., <... acctest.RandomWithPrefix(...) ...>, ...) + severity: WARNING + - id: helper-schema-Set-extraneous-NewSet-with-flattenStringList languages: [go] message: Prefer `flattenStringSet()` function for casting a list of string pointers to a set diff --git a/aws/data_source_aws_cloudfront_distribution_test.go b/aws/data_source_aws_cloudfront_distribution_test.go index f2f307972de..9ae31125334 100644 --- a/aws/data_source_aws_cloudfront_distribution_test.go +++ b/aws/data_source_aws_cloudfront_distribution_test.go @@ -1,7 +1,6 @@ package aws import ( - "fmt" "testing" "github.com/aws/aws-sdk-go/service/cloudfront" @@ -12,13 +11,15 @@ import ( func TestAccAWSDataSourceCloudFrontDistribution_basic(t *testing.T) { dataSourceName := "data.aws_cloudfront_distribution.test" resourceName := "aws_cloudfront_distribution.s3_distribution" + rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccAWSCloudFrontDistributionData, + Config: testAccAWSCloudFrontDistributionDataConfig(rInt), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), resource.TestCheckResourceAttrPair(dataSourceName, "domain_name", resourceName, "domain_name"), @@ -33,10 +34,12 @@ func TestAccAWSDataSourceCloudFrontDistribution_basic(t *testing.T) { }) } -var testAccAWSCloudFrontDistributionData = fmt.Sprintf(` -%s - +func testAccAWSCloudFrontDistributionDataConfig(rInt int) string { + return composeConfig( + testAccAWSCloudFrontDistributionS3ConfigWithTags(rInt), + ` data "aws_cloudfront_distribution" "test" { id = aws_cloudfront_distribution.s3_distribution.id } -`, fmt.Sprintf(testAccAWSCloudFrontDistributionS3ConfigWithTags, acctest.RandInt(), originBucket, logBucket, testAccAWSCloudFrontDistributionRetainConfig())) +`) +} diff --git a/aws/data_source_aws_ecs_cluster_test.go b/aws/data_source_aws_ecs_cluster_test.go index 4ddc5450f1a..c608d36ef04 100644 --- a/aws/data_source_aws_ecs_cluster_test.go +++ b/aws/data_source_aws_ecs_cluster_test.go @@ -10,19 +10,23 @@ import ( ) func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) { + dataSourceName := "data.aws_ecs_cluster.test" + resourceName := "aws_ecs_cluster.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsEcsClusterDataSourceConfig, + Config: testAccCheckAwsEcsClusterDataSourceConfig(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "status", "ACTIVE"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "pending_tasks_count", "0"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "running_tasks_count", "0"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "registered_container_instances_count", "0"), - resource.TestCheckResourceAttrSet("data.aws_ecs_cluster.default", "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttr(dataSourceName, "pending_tasks_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "registered_container_instances_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "running_tasks_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "status", "ACTIVE"), ), }, }, @@ -30,39 +34,46 @@ func TestAccAWSEcsDataSource_ecsCluster(t *testing.T) { } func TestAccAWSEcsDataSource_ecsClusterContainerInsights(t *testing.T) { + dataSourceName := "data.aws_ecs_cluster.test" + resourceName := "aws_ecs_cluster.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsEcsClusterDataSourceConfigContainerInsights, + Config: testAccCheckAwsEcsClusterDataSourceConfigContainerInsights(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "status", "ACTIVE"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "pending_tasks_count", "0"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "running_tasks_count", "0"), - resource.TestCheckResourceAttr("data.aws_ecs_cluster.default", "registered_container_instances_count", "0"), - resource.TestCheckResourceAttrSet("data.aws_ecs_cluster.default", "arn"), - resource.TestCheckResourceAttrPair("data.aws_ecs_cluster.default", "setting.#", "aws_ecs_cluster.default", "setting.#"), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttr(dataSourceName, "pending_tasks_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "registered_container_instances_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "running_tasks_count", "0"), + resource.TestCheckResourceAttr(dataSourceName, "status", "ACTIVE"), + resource.TestCheckResourceAttrPair(dataSourceName, "setting.#", resourceName, "setting.#"), ), }, }, }) } -var testAccCheckAwsEcsClusterDataSourceConfig = fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { - name = "default-%d" +func testAccCheckAwsEcsClusterDataSourceConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q } -data "aws_ecs_cluster" "default" { - cluster_name = aws_ecs_cluster.default.name +data "aws_ecs_cluster" "test" { + cluster_name = aws_ecs_cluster.test.name +} +`, rName) } -`, acctest.RandInt()) -var testAccCheckAwsEcsClusterDataSourceConfigContainerInsights = fmt.Sprintf(` -resource "aws_ecs_cluster" "default" { - name = "default-%d" +func testAccCheckAwsEcsClusterDataSourceConfigContainerInsights(rName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q setting { name = "containerInsights" @@ -70,7 +81,8 @@ resource "aws_ecs_cluster" "default" { } } -data "aws_ecs_cluster" "default" { - cluster_name = aws_ecs_cluster.default.name +data "aws_ecs_cluster" "test" { + cluster_name = aws_ecs_cluster.test.name +} +`, rName) } -`, acctest.RandInt()) diff --git a/aws/data_source_aws_ecs_service_test.go b/aws/data_source_aws_ecs_service_test.go index 54e57cb93ec..d45038aff9a 100644 --- a/aws/data_source_aws_ecs_service_test.go +++ b/aws/data_source_aws_ecs_service_test.go @@ -12,6 +12,7 @@ import ( func TestAccAWSEcsServiceDataSource_basic(t *testing.T) { dataSourceName := "data.aws_ecs_service.test" resourceName := "aws_ecs_service.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -19,7 +20,7 @@ func TestAccAWSEcsServiceDataSource_basic(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsEcsServiceDataSourceConfig, + Config: testAccCheckAwsEcsServiceDataSourceConfig(rName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "arn"), resource.TestCheckResourceAttrPair(resourceName, "desired_count", dataSourceName, "desired_count"), @@ -33,13 +34,14 @@ func TestAccAWSEcsServiceDataSource_basic(t *testing.T) { }) } -var testAccCheckAwsEcsServiceDataSourceConfig = fmt.Sprintf(` +func testAccCheckAwsEcsServiceDataSourceConfig(rName string) string { + return fmt.Sprintf(` resource "aws_ecs_cluster" "test" { - name = "tf-acc-%d" + name = %[1]q } resource "aws_ecs_task_definition" "test" { - family = "mongodb" + family = %[1]q container_definitions = < Date: Fri, 19 Mar 2021 14:09:39 -0400 Subject: [PATCH 1041/1252] tests/ds/apigatewayv2_api: Add ErrorCheck --- aws/data_source_aws_apigatewayv2_api_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_apigatewayv2_api_test.go b/aws/data_source_aws_apigatewayv2_api_test.go index f61c0f3bfa3..fddaab54627 100644 --- a/aws/data_source_aws_apigatewayv2_api_test.go +++ b/aws/data_source_aws_apigatewayv2_api_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -15,6 +16,7 @@ func TestAccAWSAPIGatewayV2ApiDataSource_Http(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -54,6 +56,7 @@ func TestAccAWSAPIGatewayV2ApiDataSource_WebSocket(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ From 421a04b2ad96fd508a377d05eadbfa8c9d7a5514 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:10:04 -0400 Subject: [PATCH 1042/1252] core_acc_test: Add ErrorCheck --- aws/core_acceptance_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/core_acceptance_test.go b/aws/core_acceptance_test.go index cdf212a86ac..3fdfa0f6a1e 100644 --- a/aws/core_acceptance_test.go +++ b/aws/core_acceptance_test.go @@ -12,6 +12,7 @@ func TestAccAWSVpc_coreMismatchedDiffs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ From 608899256ea5103404084393bf77ea273c88fd3d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:13:30 -0400 Subject: [PATCH 1043/1252] tests/ds/arn: Add ErrorCheck --- aws/data_source_aws_arn_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_arn_test.go b/aws/data_source_aws_arn_test.go index 01b366802c8..21870dc4efa 100644 --- a/aws/data_source_aws_arn_test.go +++ b/aws/data_source_aws_arn_test.go @@ -22,8 +22,9 @@ func TestAccDataSourceAwsArn_basic(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsArnConfig(testARN.String()), From d99259b7b6facaebe8de943aba52bfb93817e4fd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:14:28 -0400 Subject: [PATCH 1044/1252] tests/ds/billing_service: Add ErrorCheck --- aws/data_source_aws_billing_service_account_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_billing_service_account_test.go b/aws/data_source_aws_billing_service_account_test.go index 189d109b749..d9a42a647d1 100644 --- a/aws/data_source_aws_billing_service_account_test.go +++ b/aws/data_source_aws_billing_service_account_test.go @@ -12,8 +12,9 @@ func TestAccAWSBillingServiceAccount_basic(t *testing.T) { billingAccountID := "386209384616" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsBillingServiceAccountConfig, From 0136db7774ab9d45149928ea65f457ba17a3e1f4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:03 -0400 Subject: [PATCH 1045/1252] tests/r/cloudfront_cache_policy: Add ErrorCheck --- aws/resource_aws_cloudfront_cache_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_cache_policy_test.go b/aws/resource_aws_cloudfront_cache_policy_test.go index 6c3649ca202..5b1a6d9c03a 100644 --- a/aws/resource_aws_cloudfront_cache_policy_test.go +++ b/aws/resource_aws_cloudfront_cache_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontCachePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSCloudFrontCachePolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func TestAccAWSCloudFrontCachePolicy_noneBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 4463aa5dd17e3d8dcf0d9e5675f4921c8b5c9783 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:12 -0400 Subject: [PATCH 1046/1252] tests/r/cloudfront_distribution: Add ErrorCheck --- aws/resource_aws_cloudfront_distribution_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index 1e01b6a027c..97cf9fc4906 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -947,6 +947,7 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ @@ -978,6 +979,7 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_Confli resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ From 9295caf3b35955d2c5cddf3e827bb4a98363de7f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:22 -0400 Subject: [PATCH 1047/1252] tests/r/cloudfront_origin_access_identity: Add ErrorCheck --- aws/resource_aws_cloudfront_origin_access_identity_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_origin_access_identity_test.go b/aws/resource_aws_cloudfront_origin_access_identity_test.go index 3758e1e363c..1982989b008 100644 --- a/aws/resource_aws_cloudfront_origin_access_identity_test.go +++ b/aws/resource_aws_cloudfront_origin_access_identity_test.go @@ -17,6 +17,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_noComment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ From e81f53bdb18665bbace5d968e1a005babf788116 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:22 -0400 Subject: [PATCH 1048/1252] tests/r/cloudfront_origin_request_policy: Add ErrorCheck --- aws/resource_aws_cloudfront_origin_request_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_origin_request_policy_test.go b/aws/resource_aws_cloudfront_origin_request_policy_test.go index e9bf7d1619f..52d22bfcd29 100644 --- a/aws/resource_aws_cloudfront_origin_request_policy_test.go +++ b/aws/resource_aws_cloudfront_origin_request_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_noneBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 01f6ac335b8f7ae859db4e4db89e74492d2f134b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:31 -0400 Subject: [PATCH 1049/1252] tests/r/cloudfront_public_key: Add ErrorCheck --- aws/resource_aws_cloudfront_public_key_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_cloudfront_public_key_test.go b/aws/resource_aws_cloudfront_public_key_test.go index 3b6a7c4304b..fbc0751551d 100644 --- a/aws/resource_aws_cloudfront_public_key_test.go +++ b/aws/resource_aws_cloudfront_public_key_test.go @@ -18,6 +18,7 @@ func TestAccAWSCloudFrontPublicKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSCloudFrontPublicKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -66,6 +68,7 @@ func TestAccAWSCloudFrontPublicKey_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -94,6 +97,7 @@ func TestAccAWSCloudFrontPublicKey_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 8444cf861f702937b2fdaf93ceefa1c88f721347 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:41 -0400 Subject: [PATCH 1050/1252] tests/r/cloudfront_realtime_log_config: Add ErrorCheck --- aws/resource_aws_cloudfront_realtime_log_config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_realtime_log_config_test.go b/aws/resource_aws_cloudfront_realtime_log_config_test.go index 2bcb92202b2..c5ec7026969 100644 --- a/aws/resource_aws_cloudfront_realtime_log_config_test.go +++ b/aws/resource_aws_cloudfront_realtime_log_config_test.go @@ -79,6 +79,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ @@ -144,6 +146,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ From 47d5a7e37db4ae5866fa6c2d7aee9c93573b9eda Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:49 -0400 Subject: [PATCH 1051/1252] tests/ds/cloudfront_cache_policy: Add ErrorCheck --- aws/data_source_aws_cloudfront_cache_policy_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_cloudfront_cache_policy_test.go b/aws/data_source_aws_cloudfront_cache_policy_test.go index 4b8f20f9300..c0edfee27f7 100644 --- a/aws/data_source_aws_cloudfront_cache_policy_test.go +++ b/aws/data_source_aws_cloudfront_cache_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontDataSourceCachePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 19e389baa80b1fe232c71bbbfb2371ac2dcad6cb Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:15:50 -0400 Subject: [PATCH 1052/1252] tests/ds/cloudfront_origin_request_policy: Add ErrorCheck --- aws/data_source_aws_cloudfront_origin_request_policy_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/data_source_aws_cloudfront_origin_request_policy_test.go b/aws/data_source_aws_cloudfront_origin_request_policy_test.go index 10b55921ba3..9d58f5eff1c 100644 --- a/aws/data_source_aws_cloudfront_origin_request_policy_test.go +++ b/aws/data_source_aws_cloudfront_origin_request_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontDataSourceOriginRequestPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -33,6 +34,7 @@ func TestAccAWSCloudFrontDataSourceOriginRequestPolicy_basic(t *testing.T) { }, }) } + func testAccAWSCloudFrontDataSourceOriginRequestPolicyConfig(rInt int) string { return fmt.Sprintf(` data "aws_cloudfront_origin_request_policy" "example" { From 4077e0f3ecdbe9d104936efde1203657f3b8c3fd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:17:10 -0400 Subject: [PATCH 1053/1252] tests/ds/cloudtrail_service_account: Add ErrorCheck --- aws/data_source_aws_cloudtrail_service_account_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_cloudtrail_service_account_test.go b/aws/data_source_aws_cloudtrail_service_account_test.go index 04a489fb749..c3b16abf954 100644 --- a/aws/data_source_aws_cloudtrail_service_account_test.go +++ b/aws/data_source_aws_cloudtrail_service_account_test.go @@ -12,8 +12,9 @@ func TestAccAWSCloudTrailServiceAccount_basic(t *testing.T) { dataSourceName := "data.aws_cloudtrail_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudTrailServiceAccountConfig, @@ -32,8 +33,9 @@ func TestAccAWSCloudTrailServiceAccount_Region(t *testing.T) { dataSourceName := "data.aws_cloudtrail_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsCloudTrailServiceAccountConfigRegion, From bc94185342478ade4ab8fb8da9e03e3ccfe232da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:18:33 -0400 Subject: [PATCH 1054/1252] tests/ds/cloudwatch_log_group: Add ErrorCheck --- ...ta_source_aws_cloudwatch_log_group_test.go | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/aws/data_source_aws_cloudwatch_log_group_test.go b/aws/data_source_aws_cloudwatch_log_group_test.go index bc7c14f072b..a64db6c8921 100644 --- a/aws/data_source_aws_cloudwatch_log_group_test.go +++ b/aws/data_source_aws_cloudwatch_log_group_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSCloudwatchLogGroupDataSource_basic(t *testing.T) { resourceName := "data.aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfig(rName), @@ -34,8 +36,9 @@ func TestAccAWSCloudwatchLogGroupDataSource_tags(t *testing.T) { resourceName := "data.aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigTags(rName), @@ -58,8 +61,9 @@ func TestAccAWSCloudwatchLogGroupDataSource_kms(t *testing.T) { resourceName := "data.aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigKMS(rName), @@ -80,8 +84,9 @@ func TestAccAWSCloudwatchLogGroupDataSource_retention(t *testing.T) { resourceName := "data.aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, cloudwatchlogs.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigRetention(rName), From 2307a528478344ab17a6f83c2d3c8adf1d138063 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:20:03 -0400 Subject: [PATCH 1055/1252] tests/ds/cur_report_definition: Add ErrorCheck --- aws/data_source_aws_cur_report_definition_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/data_source_aws_cur_report_definition_test.go b/aws/data_source_aws_cur_report_definition_test.go index 97d1013e93b..5a07215fd71 100644 --- a/aws/data_source_aws_cur_report_definition_test.go +++ b/aws/data_source_aws_cur_report_definition_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/costandusagereportservice" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -18,6 +19,7 @@ func TestAccDataSourceAwsCurReportDefinition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ @@ -48,6 +50,7 @@ func TestAccDataSourceAwsCurReportDefinition_additional(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) }, + ErrorCheck: testAccErrorCheck(t, costandusagereportservice.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy, Steps: []resource.TestStep{ From f743c2fed10502a5d477aa51504bf5ba34f46717 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:21:20 -0400 Subject: [PATCH 1056/1252] tests/ds/ec2_transit_gateway_route_tables: Add ErrorCheck --- ...ource_aws_ec2_transit_gateway_route_tables_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go index 8e9ffa52da7..336d05ac1ea 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_tables_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,8 +11,9 @@ func TestAccDataSourceAwsEc2TransitGatewayRouteTables_basic(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2TransitGatewayRouteTablesConfig, @@ -27,8 +29,9 @@ func TestAccDataSourceAwsEc2TransitGatewayRouteTables_Filter(t *testing.T) { dataSourceName := "data.aws_ec2_transit_gateway_route_tables.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccDataSourceAwsEc2TransitGatewayRouteTablesTransitGatewayFilter, From b0047d7cca16073fde05c6f295575354bac2733c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:22:16 -0400 Subject: [PATCH 1057/1252] tests/ds/eks_cluster_auth: Add ErrorCheck --- aws/data_source_aws_eks_cluster_auth_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_eks_cluster_auth_test.go b/aws/data_source_aws_eks_cluster_auth_test.go index f0222c5485a..8f0fa6c97bc 100644 --- a/aws/data_source_aws_eks_cluster_auth_test.go +++ b/aws/data_source_aws_eks_cluster_auth_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/eks" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/eks/token" @@ -13,8 +14,9 @@ func TestAccAWSEksClusterAuthDataSource_basic(t *testing.T) { dataSourceResourceName := "data.aws_eks_cluster_auth.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, eks.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsEksClusterAuthConfig_basic, From a9a5b2637c7d03c6ab3ae9962f455004e416968b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:23:41 -0400 Subject: [PATCH 1058/1252] tests/ds/elastic_beanstalk_hosted_zone: Add ErrorCheck --- ...a_source_aws_elastic_beanstalk_hosted_zone_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_elastic_beanstalk_hosted_zone_test.go b/aws/data_source_aws_elastic_beanstalk_hosted_zone_test.go index c1c9b1d3c7f..f19d07be0ed 100644 --- a/aws/data_source_aws_elastic_beanstalk_hosted_zone_test.go +++ b/aws/data_source_aws_elastic_beanstalk_hosted_zone_test.go @@ -5,6 +5,7 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) @@ -13,8 +14,9 @@ func TestAccAWSDataSourceElasticBeanstalkHostedZone_basic(t *testing.T) { dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElasticBeanstalkHostedZoneDataSource_currentRegion, @@ -30,8 +32,9 @@ func TestAccAWSDataSourceElasticBeanstalkHostedZone_Region(t *testing.T) { dataSourceName := "data.aws_elastic_beanstalk_hosted_zone.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticbeanstalk.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElasticBeanstalkHostedZoneDataSource_byRegion("ap-southeast-2"), //lintignore:AWSAT003 // passes in GovCloud From 3551a55f85a22d4a282482fcc60ec8188a227e03 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:24:10 -0400 Subject: [PATCH 1059/1252] tests/ds/elasticache_cluster: Add ErrorCheck --- aws/data_source_aws_elasticache_cluster_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_elasticache_cluster_test.go b/aws/data_source_aws_elasticache_cluster_test.go index 9891262b660..df4ffdf95eb 100644 --- a/aws/data_source_aws_elasticache_cluster_test.go +++ b/aws/data_source_aws_elasticache_cluster_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSDataElasticacheCluster_basic(t *testing.T) { dataSourceName := "data.aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSElastiCacheClusterConfigWithDataSource(rName), From ba97e4fd441339658427f0b1d2a0068f6c13f02b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:25:41 -0400 Subject: [PATCH 1060/1252] tests/ds/elb_hosted_zone_id: Add ErrorCheck --- aws/data_source_aws_elb_hosted_zone_id_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_elb_hosted_zone_id_test.go b/aws/data_source_aws_elb_hosted_zone_id_test.go index 96c0ff98d91..0ac6299cb72 100644 --- a/aws/data_source_aws_elb_hosted_zone_id_test.go +++ b/aws/data_source_aws_elb_hosted_zone_id_test.go @@ -3,13 +3,15 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccAWSElbHostedZoneId_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElbHostedZoneIdConfig, From 9ce4975349b70dd25636d6e3c6d0bfffd53268ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:26:06 -0400 Subject: [PATCH 1061/1252] tests/ds/elb_service_account: Add ErrorCheck --- aws/data_source_aws_elb_service_account_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_elb_service_account_test.go b/aws/data_source_aws_elb_service_account_test.go index d4ba325e34a..48df06c6071 100644 --- a/aws/data_source_aws_elb_service_account_test.go +++ b/aws/data_source_aws_elb_service_account_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSElbServiceAccount_basic(t *testing.T) { dataSourceName := "data.aws_elb_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElbServiceAccountConfig, @@ -32,8 +34,9 @@ func TestAccAWSElbServiceAccount_Region(t *testing.T) { dataSourceName := "data.aws_elb_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsElbServiceAccountExplicitRegionConfig, From fa38e8a35e8ab727c66ee346e514a09055fdd171 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:36:42 -0400 Subject: [PATCH 1062/1252] tests/ds/iam_policy_document: Add ErrorCheck --- ...ata_source_aws_iam_policy_document_test.go | 71 +++++++++++-------- 1 file changed, 43 insertions(+), 28 deletions(-) diff --git a/aws/data_source_aws_iam_policy_document_test.go b/aws/data_source_aws_iam_policy_document_test.go index d9af7a3112a..7927f584546 100644 --- a/aws/data_source_aws_iam_policy_document_test.go +++ b/aws/data_source_aws_iam_policy_document_test.go @@ -6,6 +6,7 @@ import ( "testing" "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -14,8 +15,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentConfig, @@ -34,8 +36,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_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() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentSourceConfig, @@ -59,8 +62,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_source(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_sourceList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentSourceListConfig, @@ -76,8 +80,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_sourceList(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_sourceConflicting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentSourceConflictingConfig, @@ -93,8 +98,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_sourceConflicting(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_sourceListConflicting(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentSourceListConflictingConfig, @@ -106,8 +112,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_sourceListConflicting(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_override(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentOverrideConfig, @@ -123,8 +130,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_override(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_overrideList(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentOverrideListConfig, @@ -140,8 +148,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_overrideList(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_noStatementMerge(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentNoStatementMergeConfig, @@ -157,8 +166,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_noStatementMerge(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_noStatementOverride(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentNoStatementOverrideConfig, @@ -174,8 +184,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_noStatementOverride(t *testing.T) { func TestAccAWSDataSourceIAMPolicyDocument_duplicateSid(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentDuplicateSidConfig, @@ -198,8 +209,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_statementPrincipalIdentifiers_stringA dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersStringAndSlice, @@ -216,8 +228,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_statementPrincipalIdentifiers_multipl dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionPreCheck(endpoints.AwsPartitionID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionPreCheck(endpoints.AwsPartitionID, t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersMultiplePrincipals, @@ -233,8 +246,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_statementPrincipalIdentifiers_multipl dataSourceName := "data.aws_iam_policy_document.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPartitionPreCheck(endpoints.AwsUsGovPartitionID, t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t); testAccPartitionPreCheck(endpoints.AwsUsGovPartitionID, t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersMultiplePrincipals, @@ -248,8 +262,9 @@ func TestAccAWSDataSourceIAMPolicyDocument_statementPrincipalIdentifiers_multipl func TestAccAWSDataSourceIAMPolicyDocument_version20081017(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIAMPolicyDocumentDataSourceConfigVersion20081017ConversionCondition, From 1507cb7bc20cb13162956775a05d68166e56e4da Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:37:06 -0400 Subject: [PATCH 1063/1252] tests/ds/iam_policy: Add ErrorCheck --- aws/data_source_aws_iam_policy_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_iam_policy_test.go b/aws/data_source_aws_iam_policy_test.go index c78712bb513..42bf6de1142 100644 --- a/aws/data_source_aws_iam_policy_test.go +++ b/aws/data_source_aws_iam_policy_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -13,8 +14,9 @@ func TestAccAWSDataSourceIAMPolicy_basic(t *testing.T) { policyName := fmt.Sprintf("test-policy-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsDataSourceIamPolicyConfig(policyName), From bab4c56efe19517d1078e47956f7b53e4ba43560 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:38:03 -0400 Subject: [PATCH 1064/1252] tests/ip_ranges: Add ErrorCheck --- aws/data_source_aws_ip_ranges_test.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_ip_ranges_test.go b/aws/data_source_aws_ip_ranges_test.go index c8de3a0d915..9cc095ec9e5 100644 --- a/aws/data_source_aws_ip_ranges_test.go +++ b/aws/data_source_aws_ip_ranges_test.go @@ -15,8 +15,9 @@ import ( func TestAccAWSIPRanges_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIPRangesConfig, @@ -32,8 +33,9 @@ func TestAccAWSIPRanges_basic(t *testing.T) { func TestAccAWSIPRanges_Url(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAWSIPRangesConfigUrl, From 9752cd104a4c3f462d91b1d9d321e1383f30bb69 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:38:30 -0400 Subject: [PATCH 1065/1252] tests/ds/kms_secret: Add ErrorCheck --- aws/data_source_aws_kms_secret_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_kms_secret_test.go b/aws/data_source_aws_kms_secret_test.go index 7b4d37ef0eb..99fae3e3101 100644 --- a/aws/data_source_aws_kms_secret_test.go +++ b/aws/data_source_aws_kms_secret_test.go @@ -4,13 +4,15 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/service/kms" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) func TestAccAWSKmsSecretDataSource_removed(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, kms.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccAwsKmsSecretDataSourceConfig, From 630f17750dc2ae47e7b538f7272a5a99ac115580 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:39:16 -0400 Subject: [PATCH 1066/1252] tests/ds/partition: Add ErrorCheck --- aws/data_source_aws_partition_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/data_source_aws_partition_test.go b/aws/data_source_aws_partition_test.go index f23951978dd..eaa1d576be5 100644 --- a/aws/data_source_aws_partition_test.go +++ b/aws/data_source_aws_partition_test.go @@ -10,8 +10,9 @@ import ( func TestAccAWSPartition_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsPartitionConfig_basic, From d7728f40fe7340aec0a99c0f3fce3482dd7c3e57 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:39:55 -0400 Subject: [PATCH 1067/1252] tests/ds/redshift_service_account: Add ErrorCheck --- aws/data_source_aws_redshift_service_account_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_redshift_service_account_test.go b/aws/data_source_aws_redshift_service_account_test.go index 3e6d2be4bba..7218d1cb301 100644 --- a/aws/data_source_aws_redshift_service_account_test.go +++ b/aws/data_source_aws_redshift_service_account_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/redshift" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSRedshiftServiceAccount_basic(t *testing.T) { dataSourceName := "data.aws_redshift_service_account.main" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsRedshiftServiceAccountConfig, @@ -32,8 +34,9 @@ func TestAccAWSRedshiftServiceAccount_Region(t *testing.T) { dataSourceName := "data.aws_redshift_service_account.regional" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, redshift.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsRedshiftServiceAccountExplicitRegionConfig, From 280acc2d757586911adda64c2a39cddd86a2887a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:40:17 -0400 Subject: [PATCH 1068/1252] tests/ds/sagemaker_prebuilt_ecr_image: Add ErrorCheck --- ...ta_source_aws_sagemaker_prebuilt_ecr_image_test.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_sagemaker_prebuilt_ecr_image_test.go b/aws/data_source_aws_sagemaker_prebuilt_ecr_image_test.go index b50bde85dd7..8c8a8c5cc63 100644 --- a/aws/data_source_aws_sagemaker_prebuilt_ecr_image_test.go +++ b/aws/data_source_aws_sagemaker_prebuilt_ecr_image_test.go @@ -3,6 +3,7 @@ package aws import ( "testing" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,8 +13,9 @@ func TestAccAWSSageMakerPrebuiltECRImage_basic(t *testing.T) { dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSageMakerPrebuiltECRImageConfig, @@ -33,8 +35,9 @@ func TestAccAWSSageMakerPrebuiltECRImage_region(t *testing.T) { dataSourceName := "data.aws_sagemaker_prebuilt_ecr_image.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sagemaker.EndpointsID), + Providers: testAccProviders, Steps: []resource.TestStep{ { Config: testAccCheckAwsSageMakerPrebuiltECRImageExplicitRegionConfig, From ed17b3dcbb1a0d66ee22060610a7110df5754f7e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:42:45 -0400 Subject: [PATCH 1069/1252] tests/provider: Add ErrorCheck --- aws/provider_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/aws/provider_test.go b/aws/provider_test.go index 885cb8d2773..c93a9d5dfb5 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -1228,6 +1228,7 @@ func TestAccProvider_DefaultTags_EmptyConfigurationBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1246,6 +1247,7 @@ func TestAccAWSProvider_DefaultTags_Tags_None(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1264,6 +1266,7 @@ func TestAccAWSProvider_DefaultTags_Tags_One(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1282,6 +1285,7 @@ func TestAccAWSProvider_DefaultTags_Tags_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1303,6 +1307,7 @@ func TestAccAWSProvider_DefaultAndIgnoreTags_EmptyConfigurationBlocks(t *testing resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1329,6 +1334,7 @@ func TestAccAWSProvider_Endpoints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1347,6 +1353,7 @@ func TestAccAWSProvider_IgnoreTags_EmptyConfigurationBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1366,6 +1373,7 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_None(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1384,6 +1392,7 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_One(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1402,6 +1411,7 @@ func TestAccAWSProvider_IgnoreTags_KeyPrefixes_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1420,6 +1430,7 @@ func TestAccAWSProvider_IgnoreTags_Keys_None(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1438,6 +1449,7 @@ func TestAccAWSProvider_IgnoreTags_Keys_One(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1456,6 +1468,7 @@ func TestAccAWSProvider_IgnoreTags_Keys_Multiple(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1474,6 +1487,7 @@ func TestAccAWSProvider_Region_AwsC2S(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1495,6 +1509,7 @@ func TestAccAWSProvider_Region_AwsChina(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1516,6 +1531,7 @@ func TestAccAWSProvider_Region_AwsCommercial(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1537,6 +1553,7 @@ func TestAccAWSProvider_Region_AwsGovCloudUs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1558,6 +1575,7 @@ func TestAccAWSProvider_Region_AwsSC2S(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -1579,6 +1597,7 @@ func TestAccAWSProvider_AssumeRole_Empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ From 54b80adc180be216f8f2c47d62bbff2535de794c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:43:21 -0400 Subject: [PATCH 1070/1252] tests/r/apigatewayv2_api_mapping: Add ErrorCheck --- aws/resource_aws_apigatewayv2_api_mapping_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_apigatewayv2_api_mapping_test.go b/aws/resource_aws_apigatewayv2_api_mapping_test.go index ae77f9ea59a..0ca812940f0 100644 --- a/aws/resource_aws_apigatewayv2_api_mapping_test.go +++ b/aws/resource_aws_apigatewayv2_api_mapping_test.go @@ -43,6 +43,7 @@ func TestAccAWSAPIGatewayV2ApiMapping_basic(t *testing.T) { func testAccAWSAPIGatewayV2ApiMapping_createCertificate(t *testing.T, rName string, certificateArn *string) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: nil, Steps: []resource.TestStep{ @@ -67,6 +68,7 @@ func testAccAWSAPIGatewayV2ApiMapping_basic(t *testing.T, rName string, certific resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiMappingDestroy, Steps: []resource.TestStep{ @@ -94,6 +96,7 @@ func testAccAWSAPIGatewayV2ApiMapping_disappears(t *testing.T, rName string, cer resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiMappingDestroy, Steps: []resource.TestStep{ @@ -118,6 +121,7 @@ func testAccAWSAPIGatewayV2ApiMapping_ApiMappingKey(t *testing.T, rName string, resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, apigatewayv2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayV2ApiMappingDestroy, Steps: []resource.TestStep{ From 0e5cd3a0a973c06dbbec7c1a369b78e58073cc60 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:43:50 -0400 Subject: [PATCH 1071/1252] tests/r/cloudfront_cache_policy: Add ErrorCheck --- aws/resource_aws_cloudfront_cache_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_cache_policy_test.go b/aws/resource_aws_cloudfront_cache_policy_test.go index 6c3649ca202..5b1a6d9c03a 100644 --- a/aws/resource_aws_cloudfront_cache_policy_test.go +++ b/aws/resource_aws_cloudfront_cache_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontCachePolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -49,6 +50,7 @@ func TestAccAWSCloudFrontCachePolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -98,6 +100,7 @@ func TestAccAWSCloudFrontCachePolicy_noneBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 1c2deaec8d7b2c0cb8acbb7ba0d3b230e1d3d6f7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:43:59 -0400 Subject: [PATCH 1072/1252] tests/r/cloudfront_distribution: Add ErrorCheck --- aws/resource_aws_cloudfront_distribution_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index 1e01b6a027c..97cf9fc4906 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -947,6 +947,7 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn(t *tes resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ @@ -978,6 +979,7 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_Confli resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), ProviderFactories: testAccProviderFactories, CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ From 76aea306b056bfb5acccfd29a554e3169fb8458c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:44:09 -0400 Subject: [PATCH 1073/1252] tests/r/cloudfront_origin_access_identity: Add ErrorCheck --- aws/resource_aws_cloudfront_origin_access_identity_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_origin_access_identity_test.go b/aws/resource_aws_cloudfront_origin_access_identity_test.go index 3758e1e363c..1982989b008 100644 --- a/aws/resource_aws_cloudfront_origin_access_identity_test.go +++ b/aws/resource_aws_cloudfront_origin_access_identity_test.go @@ -17,6 +17,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ @@ -47,6 +48,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_noComment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ @@ -76,6 +78,7 @@ func TestAccAWSCloudFrontOriginAccessIdentity_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontOriginAccessIdentityDestroy, Steps: []resource.TestStep{ From d45b7b884c55d5c6013b7051f6e7e2c2e877189c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:44:09 -0400 Subject: [PATCH 1074/1252] tests/r/cloudfront_origin_request_policy: Add ErrorCheck --- aws/resource_aws_cloudfront_origin_request_policy_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_origin_request_policy_test.go b/aws/resource_aws_cloudfront_origin_request_policy_test.go index e9bf7d1619f..52d22bfcd29 100644 --- a/aws/resource_aws_cloudfront_origin_request_policy_test.go +++ b/aws/resource_aws_cloudfront_origin_request_policy_test.go @@ -15,6 +15,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -46,6 +47,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -87,6 +89,7 @@ func TestAccAWSCloudFrontOriginRequestPolicy_noneBehavior(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 29e313cc73ba79c8fe4621f7002b12ce42b5f376 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:44:20 -0400 Subject: [PATCH 1075/1252] tests/r/cloudfront_public_key: Add ErrorCheck --- aws/resource_aws_cloudfront_public_key_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_cloudfront_public_key_test.go b/aws/resource_aws_cloudfront_public_key_test.go index 3b6a7c4304b..fbc0751551d 100644 --- a/aws/resource_aws_cloudfront_public_key_test.go +++ b/aws/resource_aws_cloudfront_public_key_test.go @@ -18,6 +18,7 @@ func TestAccAWSCloudFrontPublicKey_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -45,6 +46,7 @@ func TestAccAWSCloudFrontPublicKey_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -66,6 +68,7 @@ func TestAccAWSCloudFrontPublicKey_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ @@ -94,6 +97,7 @@ func TestAccAWSCloudFrontPublicKey_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontPublicKeyDestroy, Steps: []resource.TestStep{ From 5d881d6d0977b323d4a2194df43a3189c4b3a101 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:44:30 -0400 Subject: [PATCH 1076/1252] tests/r/cloudfront_realtime_log_config: Add ErrorCheck --- aws/resource_aws_cloudfront_realtime_log_config_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_cloudfront_realtime_log_config_test.go b/aws/resource_aws_cloudfront_realtime_log_config_test.go index 2bcb92202b2..c5ec7026969 100644 --- a/aws/resource_aws_cloudfront_realtime_log_config_test.go +++ b/aws/resource_aws_cloudfront_realtime_log_config_test.go @@ -79,6 +79,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ @@ -116,6 +117,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ @@ -144,6 +146,7 @@ func TestAccAWSCloudFrontRealtimeLogConfig_updates(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontRealtimeLogConfigDestroy, Steps: []resource.TestStep{ From 6826f3618d4ef7d7dff8bae5e9d997ed4d2d2d49 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:44:51 -0400 Subject: [PATCH 1077/1252] tests/r/customer_gateway: Add ErrorCheck --- aws/resource_aws_customer_gateway_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aws/resource_aws_customer_gateway_test.go b/aws/resource_aws_customer_gateway_test.go index 80174d674f2..6ed7e1f06a9 100644 --- a/aws/resource_aws_customer_gateway_test.go +++ b/aws/resource_aws_customer_gateway_test.go @@ -20,6 +20,7 @@ func TestAccAWSCustomerGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, @@ -55,6 +56,7 @@ func TestAccAWSCustomerGateway_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, @@ -97,6 +99,7 @@ func TestAccAWSCustomerGateway_similarAlreadyExists(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, @@ -127,6 +130,7 @@ func TestAccAWSCustomerGateway_deviceName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, @@ -180,6 +184,7 @@ func TestAccAWSCustomerGateway_4ByteAsn(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, From 02c17a5aefcf84f12f54ee41897e31fb1b5701d4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:45:20 -0400 Subject: [PATCH 1078/1252] tests/r/db_parameter_group: Add ErrorCheck --- aws/resource_aws_db_parameter_group_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_db_parameter_group_test.go b/aws/resource_aws_db_parameter_group_test.go index c80880280de..9cc0734cb6b 100644 --- a/aws/resource_aws_db_parameter_group_test.go +++ b/aws/resource_aws_db_parameter_group_test.go @@ -172,6 +172,7 @@ func TestAccAWSDBParameterGroup_caseWithMixedParameters(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, rds.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ From 9773f18f7c88407959930a4ef175f5f81707c6e5 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:45:41 -0400 Subject: [PATCH 1079/1252] tests/r/default_route_table: Add ErrorCheck --- aws/resource_aws_default_route_table_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index 877bdce29c5..f26e1c1383b 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -90,6 +90,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckDefaultRouteTableDestroy, @@ -157,6 +158,7 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckDefaultRouteTableDestroy, @@ -295,6 +297,7 @@ func TestAccAWSDefaultRouteTable_VpcEndpointAssociation(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckDefaultRouteTableDestroy, From e25987514b5b78b507148d7a6b115c3528ef759f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:45:57 -0400 Subject: [PATCH 1080/1252] tests/r/default_security_group: Add ErrorCheck --- aws/resource_aws_default_security_group_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_default_security_group_test.go b/aws/resource_aws_default_security_group_test.go index 16123c4847c..40117d58d9e 100644 --- a/aws/resource_aws_default_security_group_test.go +++ b/aws/resource_aws_default_security_group_test.go @@ -17,6 +17,7 @@ func TestAccAWSDefaultSecurityGroup_Vpc_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultSecurityGroupDestroy, @@ -70,6 +71,7 @@ func TestAccAWSDefaultSecurityGroup_Vpc_empty(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultSecurityGroupDestroy, From 637dd31df29da9025776d77c864037c4a3bfacb6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:46:05 -0400 Subject: [PATCH 1081/1252] tests/r/default_vpc: Add ErrorCheck --- aws/resource_aws_default_vpc_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_default_vpc_test.go b/aws/resource_aws_default_vpc_test.go index 956179377d9..80e58427737 100644 --- a/aws/resource_aws_default_vpc_test.go +++ b/aws/resource_aws_default_vpc_test.go @@ -13,6 +13,7 @@ func TestAccAWSDefaultVpc_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDefaultVpcDestroy, Steps: []resource.TestStep{ From 55e2b39564d8efd09598abc95a32373780ad7500 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:47:14 -0400 Subject: [PATCH 1082/1252] tests/r/ec2_carrier_gateway: Add ErrorCheck --- aws/resource_aws_ec2_carrier_gateway_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/aws/resource_aws_ec2_carrier_gateway_test.go b/aws/resource_aws_ec2_carrier_gateway_test.go index 56d1e6daab3..9665241f6dc 100644 --- a/aws/resource_aws_ec2_carrier_gateway_test.go +++ b/aws/resource_aws_ec2_carrier_gateway_test.go @@ -74,6 +74,7 @@ func TestAccAWSEc2CarrierGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckEc2CarrierGatewayDestroy, @@ -104,6 +105,7 @@ func TestAccAWSEc2CarrierGateway_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckEc2CarrierGatewayDestroy, @@ -127,6 +129,7 @@ func TestAccAWSEc2CarrierGateway_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckEc2CarrierGatewayDestroy, From 70dfa1a923249e31079e2af2dbffefd0bec6a1a4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:47:28 -0400 Subject: [PATCH 1083/1252] tests/r/ec2_client_vpn_network_association: Add ErrorCheck --- aws/resource_aws_ec2_client_vpn_network_association_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index b809595c6e9..48b825064c6 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -144,6 +144,7 @@ func testAccAwsEc2ClientVpnNetworkAssociation_multipleSubnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheckClientVPNSyncronize(t); testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsEc2ClientVpnNetworkAssociationDestroy, Steps: []resource.TestStep{ From c338c0e807713d4aea9bb6c7e3eaf832ca0baf4e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:47:51 -0400 Subject: [PATCH 1084/1252] tests/r/ec2_tag: Add ErrorCheck --- aws/resource_aws_ec2_tag_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ec2_tag_test.go b/aws/resource_aws_ec2_tag_test.go index a542e6222fb..8b379a02ad7 100644 --- a/aws/resource_aws_ec2_tag_test.go +++ b/aws/resource_aws_ec2_tag_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -16,6 +17,7 @@ func TestAccAWSEc2Tag_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2TagDestroy, Steps: []resource.TestStep{ @@ -42,6 +44,7 @@ func TestAccAWSEc2Tag_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2TagDestroy, Steps: []resource.TestStep{ @@ -63,6 +66,7 @@ func TestAccAWSEc2Tag_Value(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2TransitGateway(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckEc2TagDestroy, Steps: []resource.TestStep{ From 6615b9f5038a321ceb25f6fc6e64f4e59b81deb8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:48:11 -0400 Subject: [PATCH 1085/1252] tests/r/egress_only_internet_gateway: Add ErrorCheck --- aws/resource_aws_egress_only_internet_gateway_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_egress_only_internet_gateway_test.go b/aws/resource_aws_egress_only_internet_gateway_test.go index 00a3152795f..f7e1ac93231 100644 --- a/aws/resource_aws_egress_only_internet_gateway_test.go +++ b/aws/resource_aws_egress_only_internet_gateway_test.go @@ -93,6 +93,7 @@ func TestAccAWSEgressOnlyInternetGateway_Tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEgressOnlyInternetGatewayDestroy, From 6a4cfb4ae2e5ed4d36abed94dc2ea2181cb1c33f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:48:52 -0400 Subject: [PATCH 1086/1252] tests/r/eip: Add ErrorCheck --- aws/resource_aws_eip_test.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aws/resource_aws_eip_test.go b/aws/resource_aws_eip_test.go index 2abb3635fde..b45ef8a31fb 100644 --- a/aws/resource_aws_eip_test.go +++ b/aws/resource_aws_eip_test.go @@ -119,6 +119,7 @@ func TestAccAWSEIP_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -147,6 +148,7 @@ func TestAccAWSEIP_instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -173,6 +175,7 @@ func TestAccAWSEIP_networkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -203,6 +206,7 @@ func TestAccAWSEIP_twoEIPsOneNetworkInterface(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -239,6 +243,7 @@ func TestAccAWSEIP_associated_user_private_ip(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -329,6 +334,7 @@ func TestAccAWSEIP_notAssociated(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -422,6 +428,7 @@ func TestAccAWSEIP_PublicIpv4Pool_default(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -450,6 +457,7 @@ func TestAccAWSEIP_NetworkBorderGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -479,6 +487,7 @@ func TestAccAWSEIP_CarrierIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -513,6 +522,7 @@ func TestAccAWSEIP_PublicIpv4Pool_custom(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, @@ -587,6 +597,7 @@ func TestAccAWSEIP_CustomerOwnedIpv4Pool(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, From fa76addfe983ae2f5e3a00a1eff21850e634e7b3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:49:06 -0400 Subject: [PATCH 1087/1252] tests/r/elb_attachment: Add ErrorCheck --- aws/resource_aws_elb_attachment_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aws/resource_aws_elb_attachment_test.go b/aws/resource_aws_elb_attachment_test.go index 841ff13894a..a01656d9e24 100644 --- a/aws/resource_aws_elb_attachment_test.go +++ b/aws/resource_aws_elb_attachment_test.go @@ -16,6 +16,7 @@ func TestAccAWSELBAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -76,6 +77,7 @@ func TestAccAWSELBAttachment_drift(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, From ff7ea3ad3f52ec6291fc64e1b3f74d41b04e5b61 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 14:49:30 -0400 Subject: [PATCH 1088/1252] tests/r/elb: Add ErrorCheck --- aws/resource_aws_elb_test.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/aws/resource_aws_elb_test.go b/aws/resource_aws_elb_test.go index 1187d28b89e..94dfd9c0e73 100644 --- a/aws/resource_aws_elb_test.go +++ b/aws/resource_aws_elb_test.go @@ -70,6 +70,7 @@ func TestAccAWSELB_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -130,6 +131,7 @@ func TestAccAWSELB_fullCharacterRange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -152,6 +154,7 @@ func TestAccAWSELB_AccessLogs_enabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -192,6 +195,7 @@ func TestAccAWSELB_AccessLogs_disabled(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -231,6 +235,7 @@ func TestAccAWSELB_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -253,6 +258,7 @@ func TestAccAWSELB_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -275,6 +281,7 @@ func TestAccAWSELB_generatesNameForZeroValue(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -296,6 +303,7 @@ func TestAccAWSELB_availabilityZones(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -325,6 +333,7 @@ func TestAccAWSELB_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -413,6 +422,7 @@ func TestAccAWSELB_swap_subnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -451,6 +461,7 @@ func TestAccAWSELB_InstanceAttaching(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -480,6 +491,7 @@ func TestAccAWSELB_listener(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -607,6 +619,7 @@ func TestAccAWSELB_HealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -632,6 +645,7 @@ func TestAccAWSELBUpdate_HealthCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -659,6 +673,7 @@ func TestAccAWSELB_Timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -679,6 +694,7 @@ func TestAccAWSELBUpdate_Timeout(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -704,6 +720,7 @@ func TestAccAWSELB_ConnectionDraining(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -726,6 +743,7 @@ func TestAccAWSELBUpdate_ConnectionDraining(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, @@ -759,6 +777,7 @@ func TestAccAWSELB_SecurityGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, elb.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, From 0bbf1ee74219bbed62e5b65c49bf076ba0815df7 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 14:57:33 -0400 Subject: [PATCH 1089/1252] tests/provider: Add missing ErrorCheck to TestCase (#18306) * tests/provider: Add missing ErrorCheck to TestCase Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18175 Previously: ``` aws/resource_aws_iam_group_policy_test.go:88:36: XAT001: missing ErrorCheck aws/resource_aws_iam_group_policy_test.go:128:36: XAT001: missing ErrorCheck aws/resource_aws_iam_instance_profile_test.go:75:36: XAT001: missing ErrorCheck aws/resource_aws_iam_role_policy_test.go:102:36: XAT001: missing ErrorCheck aws/resource_aws_iam_role_policy_test.go:147:36: XAT001: missing ErrorCheck aws/resource_aws_iam_role_test.go:222:36: XAT001: missing ErrorCheck aws/resource_aws_iam_user_policy_test.go:96:36: XAT001: missing ErrorCheck aws/resource_aws_iam_user_policy_test.go:138:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:237:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:270:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:399:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:443:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:534:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:610:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:664:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:720:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:779:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:813:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:843:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:871:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:970:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:997:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1034:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1265:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1321:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1385:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1422:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1462:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1504:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:1564:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:3327:36: XAT001: missing ErrorCheck aws/resource_aws_instance_test.go:3924:36: XAT001: missing ErrorCheck aws/resource_aws_internet_gateway_test.go:143:36: XAT001: missing ErrorCheck aws/resource_aws_internet_gateway_test.go:189:36: XAT001: missing ErrorCheck aws/resource_aws_internet_gateway_test.go:213:36: XAT001: missing ErrorCheck aws/resource_aws_key_pair_test.go:170:36: XAT001: missing ErrorCheck aws/resource_aws_nat_gateway_test.go:63:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:310:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:352:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:386:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:441:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:466:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:494:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:539:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:587:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:623:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:679:36: XAT001: missing ErrorCheck aws/resource_aws_network_acl_test.go:709:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_attachment_test.go:16:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:74:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:108:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:155:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:200:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:269:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:302:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:330:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:358:36: XAT001: missing ErrorCheck aws/resource_aws_network_interface_test.go:398:36: XAT001: missing ErrorCheck aws/resource_aws_opsworks_stack_test.go:228:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:231:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:281:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:316:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:354:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:398:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:416:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:735:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:770:36: XAT001: missing ErrorCheck aws/resource_aws_route_table_test.go:913:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:686:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1058:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1238:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1273:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1317:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1354:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1390:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1416:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1449:36: XAT001: missing ErrorCheck aws/resource_aws_security_group_test.go:1561:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:130:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:167:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:211:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:268:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:310:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:352:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:416:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:474:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:497:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:563:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:603:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:646:36: XAT001: missing ErrorCheck aws/resource_aws_subnet_test.go:789:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_endpoint_connection_notification_test.go:19:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_endpoint_test.go:481:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:95:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:139:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:166:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:231:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:390:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:526:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:549:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_peering_connection_test.go:584:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:169:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:225:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:266:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:307:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:370:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:427:36: XAT001: missing ErrorCheck aws/resource_aws_vpc_test.go:449:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:100:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:209:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:317:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:345:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:372:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_connection_test.go:398:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_gateway_route_propagation_test.go:16:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_gateway_test.go:110:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_gateway_test.go:257:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_gateway_test.go:321:36: XAT001: missing ErrorCheck aws/resource_aws_vpn_gateway_test.go:349:36: XAT001: missing ErrorCheck ``` * tests: Lint Co-authored-by: Dirk Avery --- aws/resource_aws_iam_group_policy_test.go | 2 ++ aws/resource_aws_iam_instance_profile_test.go | 1 + aws/resource_aws_iam_role_policy_test.go | 2 ++ aws/resource_aws_iam_role_test.go | 1 + aws/resource_aws_iam_user_policy_test.go | 2 ++ aws/resource_aws_instance_test.go | 24 +++++++++++++++++++ aws/resource_aws_internet_gateway_test.go | 3 +++ aws/resource_aws_key_pair_test.go | 1 + aws/resource_aws_nat_gateway_test.go | 1 + aws/resource_aws_network_acl_test.go | 11 +++++++++ ...e_aws_network_interface_attachment_test.go | 1 + aws/resource_aws_network_interface_test.go | 9 +++++++ aws/resource_aws_opsworks_stack_test.go | 1 + aws/resource_aws_route_table_test.go | 9 +++++++ aws/resource_aws_security_group_test.go | 10 ++++++++ aws/resource_aws_subnet_test.go | 13 ++++++++++ ...c_endpoint_connection_notification_test.go | 1 + aws/resource_aws_vpc_endpoint_test.go | 1 + ...esource_aws_vpc_peering_connection_test.go | 8 +++++++ aws/resource_aws_vpc_test.go | 7 ++++++ aws/resource_aws_vpn_connection_test.go | 6 +++++ ..._aws_vpn_gateway_route_propagation_test.go | 1 + aws/resource_aws_vpn_gateway_test.go | 4 ++++ 23 files changed, 119 insertions(+) diff --git a/aws/resource_aws_iam_group_policy_test.go b/aws/resource_aws_iam_group_policy_test.go index 417afe3dd7b..c3773cc08ee 100644 --- a/aws/resource_aws_iam_group_policy_test.go +++ b/aws/resource_aws_iam_group_policy_test.go @@ -87,6 +87,7 @@ func TestAccAWSIAMGroupPolicy_namePrefix(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: "aws_iam_group_policy.test", Providers: testAccProviders, CheckDestroy: testAccCheckIAMGroupPolicyDestroy, @@ -127,6 +128,7 @@ func TestAccAWSIAMGroupPolicy_generatedName(t *testing.T) { rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: "aws_iam_group_policy.test", Providers: testAccProviders, CheckDestroy: testAccCheckIAMGroupPolicyDestroy, diff --git a/aws/resource_aws_iam_instance_profile_test.go b/aws/resource_aws_iam_instance_profile_test.go index cffed921976..a4ba742994d 100644 --- a/aws/resource_aws_iam_instance_profile_test.go +++ b/aws/resource_aws_iam_instance_profile_test.go @@ -74,6 +74,7 @@ func TestAccAWSIAMInstanceProfile_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"name_prefix"}, Providers: testAccProviders, diff --git a/aws/resource_aws_iam_role_policy_test.go b/aws/resource_aws_iam_role_policy_test.go index c09270ad839..e3b2d53b0fa 100644 --- a/aws/resource_aws_iam_role_policy_test.go +++ b/aws/resource_aws_iam_role_policy_test.go @@ -101,6 +101,7 @@ func TestAccAWSIAMRolePolicy_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, @@ -146,6 +147,7 @@ func TestAccAWSIAMRolePolicy_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckIAMRolePolicyDestroy, diff --git a/aws/resource_aws_iam_role_test.go b/aws/resource_aws_iam_role_test.go index 13b90656f6d..0c020ff95e1 100644 --- a/aws/resource_aws_iam_role_test.go +++ b/aws/resource_aws_iam_role_test.go @@ -221,6 +221,7 @@ func TestAccAWSIAMRole_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"name_prefix"}, Providers: testAccProviders, diff --git a/aws/resource_aws_iam_user_policy_test.go b/aws/resource_aws_iam_user_policy_test.go index 47954c6cd9d..dd74d67c5e6 100644 --- a/aws/resource_aws_iam_user_policy_test.go +++ b/aws/resource_aws_iam_user_policy_test.go @@ -95,6 +95,7 @@ func TestAccAWSIAMUserPolicy_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: policyResourceName, Providers: testAccProviders, CheckDestroy: testAccCheckIAMUserPolicyDestroy, @@ -137,6 +138,7 @@ func TestAccAWSIAMUserPolicy_generatedName(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), IDRefreshName: policyResourceName, Providers: testAccProviders, CheckDestroy: testAccCheckIAMUserPolicyDestroy, diff --git a/aws/resource_aws_instance_test.go b/aws/resource_aws_instance_test.go index af111930b14..106041f5794 100644 --- a/aws/resource_aws_instance_test.go +++ b/aws/resource_aws_instance_test.go @@ -240,6 +240,7 @@ func TestAccAWSInstance_basic(t *testing.T) { testAccPreCheck(t) testAccPreCheckEc2ClassicOrHasDefaultVpcWithDefaultSubnets(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -269,6 +270,7 @@ func TestAccAWSInstance_atLeastOneOtherEbsVolume(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -398,6 +400,7 @@ func TestAccAWSInstance_userDataBase64(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -442,6 +445,7 @@ func TestAccAWSInstance_GP2IopsDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"}, Providers: testAccProviders, @@ -533,6 +537,7 @@ func TestAccAWSInstance_blockDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device"}, Providers: testAccProviders, @@ -609,6 +614,7 @@ func TestAccAWSInstance_rootInstanceStore(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -663,6 +669,7 @@ func TestAccAWSInstance_noAMIEphemeralDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device"}, Providers: testAccProviders, @@ -719,6 +726,7 @@ func TestAccAWSInstance_sourceDestCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -778,6 +786,7 @@ func TestAccAWSInstance_disableApiTermination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -812,6 +821,7 @@ func TestAccAWSInstance_dedicatedInstance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, @@ -842,6 +852,7 @@ func TestAccAWSInstance_outpost(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, @@ -870,6 +881,7 @@ func TestAccAWSInstance_placementGroup(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, @@ -969,6 +981,7 @@ func TestAccAWSInstance_NetworkInstanceSecurityGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, @@ -996,6 +1009,7 @@ func TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1033,6 +1047,7 @@ func TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1264,6 +1279,7 @@ func TestAccAWSInstance_instanceProfileChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1320,6 +1336,7 @@ func TestAccAWSInstance_withIamInstanceProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1384,6 +1401,7 @@ func TestAccAWSInstance_privateIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1421,6 +1439,7 @@ func TestAccAWSInstance_associatePublicIPAndPrivateIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, @@ -1461,6 +1480,7 @@ func TestAccAWSInstance_Empty_PrivateIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -1503,6 +1523,7 @@ func TestAccAWSInstance_keyPairCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"source_dest_check"}, Providers: testAccProviders, @@ -1563,6 +1584,7 @@ func TestAccAWSInstance_forceNewAndTagsDrift(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -3326,6 +3348,7 @@ func TestAccAWSInstance_metadataOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -3923,6 +3946,7 @@ func TestAccAWSInstance_GP3RootBlockDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"}, Providers: testAccProviders, diff --git a/aws/resource_aws_internet_gateway_test.go b/aws/resource_aws_internet_gateway_test.go index c0101515706..caba4f023c0 100644 --- a/aws/resource_aws_internet_gateway_test.go +++ b/aws/resource_aws_internet_gateway_test.go @@ -142,6 +142,7 @@ func TestAccAWSInternetGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInternetGatewayDestroy, @@ -188,6 +189,7 @@ func TestAccAWSInternetGateway_delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInternetGatewayDestroy, @@ -212,6 +214,7 @@ func TestAccAWSInternetGateway_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInternetGatewayDestroy, diff --git a/aws/resource_aws_key_pair_test.go b/aws/resource_aws_key_pair_test.go index f3dc5ad69f1..afb57fbf7a5 100644 --- a/aws/resource_aws_key_pair_test.go +++ b/aws/resource_aws_key_pair_test.go @@ -169,6 +169,7 @@ func TestAccAWSKeyPair_namePrefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"key_name_prefix"}, Providers: testAccProviders, diff --git a/aws/resource_aws_nat_gateway_test.go b/aws/resource_aws_nat_gateway_test.go index 927051b705e..de22388be39 100644 --- a/aws/resource_aws_nat_gateway_test.go +++ b/aws/resource_aws_nat_gateway_test.go @@ -62,6 +62,7 @@ func TestAccAWSNatGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckNatGatewayDestroy, diff --git a/aws/resource_aws_network_acl_test.go b/aws/resource_aws_network_acl_test.go index be2516b9daf..c5d5f3e03af 100644 --- a/aws/resource_aws_network_acl_test.go +++ b/aws/resource_aws_network_acl_test.go @@ -309,6 +309,7 @@ func TestAccAWSNetworkAcl_EgressAndIngressRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -351,6 +352,7 @@ func TestAccAWSNetworkAcl_OnlyIngressRules_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -385,6 +387,7 @@ func TestAccAWSNetworkAcl_OnlyIngressRules_update(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -440,6 +443,7 @@ func TestAccAWSNetworkAcl_CaseSensitivityNoChanges(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -465,6 +469,7 @@ func TestAccAWSNetworkAcl_OnlyEgressRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -493,6 +498,7 @@ func TestAccAWSNetworkAcl_SubnetChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -538,6 +544,7 @@ func TestAccAWSNetworkAcl_Subnets(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -586,6 +593,7 @@ func TestAccAWSNetworkAcl_SubnetsDelete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -622,6 +630,7 @@ func TestAccAWSNetworkAcl_ipv6Rules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -678,6 +687,7 @@ func TestAccAWSNetworkAcl_ipv6VpcRules(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, @@ -708,6 +718,7 @@ func TestAccAWSNetworkAcl_espProtocol(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNetworkAclDestroy, diff --git a/aws/resource_aws_network_interface_attachment_test.go b/aws/resource_aws_network_interface_attachment_test.go index bdfa0947f71..000d9b6e80f 100644 --- a/aws/resource_aws_network_interface_attachment_test.go +++ b/aws/resource_aws_network_interface_attachment_test.go @@ -15,6 +15,7 @@ func TestAccAWSNetworkInterfaceAttachment_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: "aws_network_interface.bar", Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, diff --git a/aws/resource_aws_network_interface_test.go b/aws/resource_aws_network_interface_test.go index 84df78dd1ed..a1c1f3e1dfe 100644 --- a/aws/resource_aws_network_interface_test.go +++ b/aws/resource_aws_network_interface_test.go @@ -73,6 +73,7 @@ func TestAccAWSENI_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -107,6 +108,7 @@ func TestAccAWSENI_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -154,6 +156,7 @@ func TestAccAWSENI_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -199,6 +202,7 @@ func TestAccAWSENI_ipv6_count(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -268,6 +272,7 @@ func TestAccAWSENI_updatedDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -301,6 +306,7 @@ func TestAccAWSENI_attached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -329,6 +335,7 @@ func TestAccAWSENI_ignoreExternalAttachment(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -357,6 +364,7 @@ func TestAccAWSENI_sourceDestCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, @@ -397,6 +405,7 @@ func TestAccAWSENI_computedIPs(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSENIDestroy, diff --git a/aws/resource_aws_opsworks_stack_test.go b/aws/resource_aws_opsworks_stack_test.go index ca27369af9f..a35106ef2ad 100644 --- a/aws/resource_aws_opsworks_stack_test.go +++ b/aws/resource_aws_opsworks_stack_test.go @@ -227,6 +227,7 @@ func TestAccAWSOpsWorksStack_classicEndpoints(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccRegionPreCheck(t, "us-west-2") }, //lintignore:AWSAT003 + ErrorCheck: testAccErrorCheck(t, opsworks.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsOpsworksStackDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_route_table_test.go b/aws/resource_aws_route_table_test.go index 54e9fdbba86..c29749f0cc1 100644 --- a/aws/resource_aws_route_table_test.go +++ b/aws/resource_aws_route_table_test.go @@ -230,6 +230,7 @@ func TestAccAWSRouteTable_IPv4_To_InternetGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -280,6 +281,7 @@ func TestAccAWSRouteTable_IPv4_To_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -315,6 +317,7 @@ func TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -353,6 +356,7 @@ func TestAccAWSRouteTable_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -397,6 +401,7 @@ func TestAccAWSRouteTable_RequireRouteDestination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -415,6 +420,7 @@ func TestAccAWSRouteTable_RequireRouteTarget(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -734,6 +740,7 @@ func TestAccAWSRouteTable_IPv4_To_NatGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -769,6 +776,7 @@ func TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, @@ -912,6 +920,7 @@ func TestAccAWSRouteTable_MultipleRoutes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, diff --git a/aws/resource_aws_security_group_test.go b/aws/resource_aws_security_group_test.go index a097b082655..6bb0204bdba 100644 --- a/aws/resource_aws_security_group_test.go +++ b/aws/resource_aws_security_group_test.go @@ -685,6 +685,7 @@ func TestAccAWSSecurityGroup_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1057,6 +1058,7 @@ func TestAccAWSSecurityGroup_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1237,6 +1239,7 @@ func TestAccAWSSecurityGroup_self(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1272,6 +1275,7 @@ func TestAccAWSSecurityGroup_vpc(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1316,6 +1320,7 @@ func TestAccAWSSecurityGroup_vpcNegOneIngress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1353,6 +1358,7 @@ func TestAccAWSSecurityGroup_vpcProtoNumIngress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1389,6 +1395,7 @@ func TestAccAWSSecurityGroup_multiIngress(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1415,6 +1422,7 @@ func TestAccAWSSecurityGroup_change(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1448,6 +1456,7 @@ func TestAccAWSSecurityGroup_ruleDescription(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, @@ -1560,6 +1569,7 @@ func TestAccAWSSecurityGroup_defaultEgressVPC(t *testing.T) { // VPC resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, diff --git a/aws/resource_aws_subnet_test.go b/aws/resource_aws_subnet_test.go index cc8d06faa36..042e23c6ac6 100644 --- a/aws/resource_aws_subnet_test.go +++ b/aws/resource_aws_subnet_test.go @@ -129,6 +129,7 @@ func TestAccAWSSubnet_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, @@ -166,6 +167,7 @@ func TestAccAWSSubnet_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, @@ -210,6 +212,7 @@ func TestAccAWSSubnet_defaultTags_providerOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -267,6 +270,7 @@ func TestAccAWSSubnet_defaultTags_updateToProviderOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -309,6 +313,7 @@ func TestAccAWSSubnet_defaultTags_updateToResourceOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -351,6 +356,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag(t *testi resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -415,6 +421,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -473,6 +480,7 @@ func TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -496,6 +504,7 @@ func TestAccAWSSubnet_defaultAndIgnoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckSubnetDestroy, Steps: []resource.TestStep{ @@ -562,6 +571,7 @@ func TestAccAWSSubnet_ipv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, @@ -602,6 +612,7 @@ func TestAccAWSSubnet_enableIpv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, @@ -645,6 +656,7 @@ func TestAccAWSSubnet_availabilityZoneId(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, @@ -788,6 +800,7 @@ func TestAccAWSSubnet_outpost(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckSubnetDestroy, diff --git a/aws/resource_aws_vpc_endpoint_connection_notification_test.go b/aws/resource_aws_vpc_endpoint_connection_notification_test.go index 9e918d0bae8..ea8caad2123 100644 --- a/aws/resource_aws_vpc_endpoint_connection_notification_test.go +++ b/aws/resource_aws_vpc_endpoint_connection_notification_test.go @@ -18,6 +18,7 @@ func TestAccAWSVpcEndpointConnectionNotification_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointConnectionNotificationDestroy, diff --git a/aws/resource_aws_vpc_endpoint_test.go b/aws/resource_aws_vpc_endpoint_test.go index e8f5cc16bc5..22012b28c3c 100644 --- a/aws/resource_aws_vpc_endpoint_test.go +++ b/aws/resource_aws_vpc_endpoint_test.go @@ -480,6 +480,7 @@ func TestAccAWSVpcEndpoint_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpcEndpointDestroy, diff --git a/aws/resource_aws_vpc_peering_connection_test.go b/aws/resource_aws_vpc_peering_connection_test.go index 1ea6c958515..3b5e3401c56 100644 --- a/aws/resource_aws_vpc_peering_connection_test.go +++ b/aws/resource_aws_vpc_peering_connection_test.go @@ -94,6 +94,7 @@ func TestAccAWSVPCPeeringConnection_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"auto_accept"}, @@ -138,6 +139,7 @@ func TestAccAWSVPCPeeringConnection_plan(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshIgnore: []string{"auto_accept"}, Providers: testAccProviders, @@ -165,6 +167,7 @@ func TestAccAWSVPCPeeringConnection_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"auto_accept"}, @@ -230,6 +233,7 @@ func TestAccAWSVPCPeeringConnection_options(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"auto_accept"}, @@ -389,6 +393,7 @@ func TestAccAWSVPCPeeringConnection_failedState(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshIgnore: []string{"auto_accept"}, Providers: testAccProviders, @@ -528,6 +533,7 @@ func TestAccAWSVPCPeeringConnection_peerRegionAutoAccept(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshIgnore: []string{"auto_accept"}, ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, @@ -551,6 +557,7 @@ func TestAccAWSVPCPeeringConnection_region(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"auto_accept"}, @@ -583,6 +590,7 @@ func TestAccAWSVPCPeeringConnection_accept(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, IDRefreshIgnore: []string{"auto_accept"}, diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index 73a7388bb9f..b67a40d64a2 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -168,6 +168,7 @@ func TestAccAWSVpc_defaultTags_providerOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -224,6 +225,7 @@ func TestAccAWSVpc_defaultTags_updateToProviderOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -265,6 +267,7 @@ func TestAccAWSVpc_defaultTags_updateToResourceOnly(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -306,6 +309,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag(t *testing. resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -369,6 +373,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag(t *testing.T) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -426,6 +431,7 @@ func TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: nil, Steps: []resource.TestStep{ @@ -448,6 +454,7 @@ func TestAccAWSVpc_defaultAndIgnoreTags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesInternal(&providers), CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_vpn_connection_test.go b/aws/resource_aws_vpn_connection_test.go index ae30abdf59c..8f5c4a2f992 100644 --- a/aws/resource_aws_vpn_connection_test.go +++ b/aws/resource_aws_vpn_connection_test.go @@ -99,6 +99,7 @@ func TestAccAWSVpnConnection_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, @@ -208,6 +209,7 @@ func TestAccAWSVpnConnection_tunnelOptions(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, @@ -316,6 +318,7 @@ func TestAccAWSVpnConnection_withoutStaticRoutes(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, @@ -344,6 +347,7 @@ func TestAccAWSVpnConnection_withEnableAcceleration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, @@ -371,6 +375,7 @@ func TestAccAWSVpnConnection_withIpv6(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, @@ -397,6 +402,7 @@ func TestAccAWSVpnConnection_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccAwsVpnConnectionDestroy, diff --git a/aws/resource_aws_vpn_gateway_route_propagation_test.go b/aws/resource_aws_vpn_gateway_route_propagation_test.go index 4fc34aa0646..ff9f4087edb 100644 --- a/aws/resource_aws_vpn_gateway_route_propagation_test.go +++ b/aws/resource_aws_vpn_gateway_route_propagation_test.go @@ -15,6 +15,7 @@ func TestAccAWSVPNGatewayRoutePropagation_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: "aws_vpn_gateway_route_propagation.foo", Providers: testAccProviders, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_vpn_gateway_test.go b/aws/resource_aws_vpn_gateway_test.go index fa133d813b0..4510cb186f2 100644 --- a/aws/resource_aws_vpn_gateway_test.go +++ b/aws/resource_aws_vpn_gateway_test.go @@ -109,6 +109,7 @@ func TestAccAWSVpnGateway_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, @@ -256,6 +257,7 @@ func TestAccAWSVpnGateway_reattach(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, @@ -320,6 +322,7 @@ func TestAccAWSVpnGateway_delete(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, @@ -348,6 +351,7 @@ func TestAccAWSVpnGateway_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckVpnGatewayDestroy, From 8d7b7da0f7fcb3ae716c0e20c489b63e64d8ac2a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 19 Mar 2021 15:25:24 -0400 Subject: [PATCH 1090/1252] tests: Enable XAT001, last fix --- GNUmakefile | 1 - aws/resource_aws_dms_replication_instance_test.go | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index d0eb270662a..61a0304aa75 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -104,7 +104,6 @@ awsproviderlint: -XR003=false \ -XR004=false \ -XR005=false \ - -XAT001=false \ -XS001=false \ -XS002=false \ ./$(PKG_NAME) diff --git a/aws/resource_aws_dms_replication_instance_test.go b/aws/resource_aws_dms_replication_instance_test.go index 95ffea3ad1d..3fc3e3922e9 100644 --- a/aws/resource_aws_dms_replication_instance_test.go +++ b/aws/resource_aws_dms_replication_instance_test.go @@ -265,6 +265,7 @@ func TestAccAWSDmsReplicationInstance_EngineVersion(t *testing.T) { ), } }, + ErrorCheck: testAccErrorCheck(t, dms.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSDmsReplicationInstanceDestroy, Steps: testSteps, From 9b51c9253ca0fd272b349c878efd06530fa4de58 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 15:45:47 -0400 Subject: [PATCH 1091/1252] provider: Enable tfproviderdocs enhanced contents checking (#18138) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/15842 Fixes remaining reports and enables the additional checking. The tooling also supports flags for requiring alphabetical list sorting, but that can be enabled in the future. Previously: ``` Error checking Terraform Provider documentation: 12 errors occurred: * website/docs/r/acmpca_certificate.html.markdown: error checking file contents: attributes section heading (Attribute Reference) should be: Attributes Reference * website/docs/r/acmpca_certificate_authority_certificate.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/cognito_identity_provider.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/config_conformance_pack.html.markdown: error checking file contents: attributes section byline (In addition to all arguments above (except for template_body and template_s3_uri), the following attributes are exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/iam_user_group_membership.html.markdown: error checking file contents: attributes section byline should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/networkfirewall_resource_policy.html.markdown: error checking file contents: attributes section byline (In addition to all arguments above, the following attribute is exported:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/pinpoint_baidu_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_event_stream.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/pinpoint_gcm_channel.markdown: error checking file contents: missing attributes section: ## Attributes Reference * website/docs/r/securityhub_invite_accepter.markdown: error checking file contents: attributes section byline (The following attributes are exported in addition to the arguments listed above:) should be: "In addition to all arguments above, the following attributes are exported:" or "No additional attributes are exported." * website/docs/r/ses_identity_notification_topic.markdown: error checking file contents: import section code block text should contain resource name: aws_ses_identity_notification_topic * website/docs/r/transfer_ssh_key.html.markdown: error checking file contents: missing attributes section: ## Attributes Reference Error checking Terraform Provider documentation: 1 error occurred: * website/docs/r/securityhub_invite_accepter.markdown: error checking file contents: import section code block text should contain resource name: aws_securityhub_invite_accepter ``` --- .github/workflows/terraform_provider.yml | 8 ++++---- tools/go.mod | 2 +- tools/go.sum | 4 ++-- website/docs/r/acmpca_certificate.html.markdown | 2 +- ...pca_certificate_authority_certificate.html.markdown | 4 ++++ website/docs/r/cognito_identity_provider.html.markdown | 4 ++++ website/docs/r/config_conformance_pack.html.markdown | 2 +- website/docs/r/iam_user_group_membership.html.markdown | 3 +-- .../r/networkfirewall_resource_policy.html.markdown | 2 +- website/docs/r/pinpoint_baidu_channel.markdown | 4 ++++ website/docs/r/pinpoint_event_stream.markdown | 4 ++++ website/docs/r/pinpoint_gcm_channel.markdown | 4 ++++ website/docs/r/securityhub_invite_accepter.markdown | 4 ++-- .../docs/r/ses_identity_notification_topic.markdown | 10 ---------- website/docs/r/transfer_ssh_key.html.markdown | 4 ++++ 15 files changed, 37 insertions(+), 24 deletions(-) diff --git a/.github/workflows/terraform_provider.yml b/.github/workflows/terraform_provider.yml index 75e6e9ddabe..cbd7fa79f27 100644 --- a/.github/workflows/terraform_provider.yml +++ b/.github/workflows/terraform_provider.yml @@ -26,7 +26,7 @@ on: env: AWS_DEFAULT_REGION: us-west-2 - TERRAFORM_VERSION: "0.12.25" + TERRAFORM_VERSION: "0.14.8" jobs: go_mod_download: @@ -85,7 +85,7 @@ jobs: key: ${{ runner.os }}-go-pkg-mod-${{ hashFiles('go.sum') }} - if: steps.cache-terraform-plugin-dir.outputs.cache-hit != 'true' || steps.cache-terraform-plugin-dir.outcome == 'failure' name: go build - run: go build -o terraform-plugin-dir/terraform-provider-aws_v99.99.99_x4 . + run: go build -o terraform-plugin-dir/registry.terraform.io/hashicorp/aws/99.99.99/$(go env GOOS)_$(go env GOARCH)/terraform-provider-aws . terraform_providers_schema: name: terraform providers schema @@ -309,9 +309,9 @@ jobs: run: | tfproviderdocs check \ -allowed-resource-subcategories-file website/allowed-subcategories.txt \ + -enable-contents-check \ -ignore-file-missing-data-sources aws_alb,aws_alb_listener,aws_alb_target_group \ -ignore-file-missing-resources aws_alb,aws_alb_listener,aws_alb_listener_certificate,aws_alb_listener_rule,aws_alb_target_group,aws_alb_target_group_attachment \ - -ignore-side-navigation-data-sources aws_alb,aws_alb_listener,aws_alb_target_group,aws_kms_secret \ - -provider-name aws \ + -provider-source registry.terraform.io/hashicorp/aws \ -providers-schema-json terraform-providers-schema/schema.json \ -require-resource-subcategory diff --git a/tools/go.mod b/tools/go.mod index ba4e4632fd6..55a6ef2245b 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws/tools go 1.15 require ( - github.com/bflad/tfproviderdocs v0.8.0 + github.com/bflad/tfproviderdocs v0.9.1 github.com/client9/misspell v0.3.4 github.com/golangci/golangci-lint v1.37.1 github.com/hashicorp/go-changelog v0.0.0-20201005170154-56335215ce3a diff --git a/tools/go.sum b/tools/go.sum index 573155057ab..8ba54c13293 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -126,8 +126,8 @@ github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= -github.com/bflad/tfproviderdocs v0.8.0 h1:LYzAkmd3MEF6465MRNZOhv6pW/xYCtR7XeRC6iurZFE= -github.com/bflad/tfproviderdocs v0.8.0/go.mod h1:gC+fjQ+tT1x1bqq+2yZ9G/y9VjRI24c6HDi+uEdgBG4= +github.com/bflad/tfproviderdocs v0.9.1 h1:C9Rkh61PgaQnRLbgfuBKRGCS8C8d8yEla3gpToC+b+o= +github.com/bflad/tfproviderdocs v0.9.1/go.mod h1:gC+fjQ+tT1x1bqq+2yZ9G/y9VjRI24c6HDi+uEdgBG4= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= diff --git a/website/docs/r/acmpca_certificate.html.markdown b/website/docs/r/acmpca_certificate.html.markdown index 1088ee2135f..cdc205e6c8a 100644 --- a/website/docs/r/acmpca_certificate.html.markdown +++ b/website/docs/r/acmpca_certificate.html.markdown @@ -68,7 +68,7 @@ The following arguments are supported: * `value` - (Required) If `type` is `DAYS`, `MONTHS`, or `YEARS`, the relative time until the certificate expires. If `type` is `ABSOLUTE`, the date in seconds since the Unix epoch. If `type` is `END_DATE`, the date in RFC 3339 format. -## Attribute Reference +## Attributes Reference In addition to all arguments above, the following attributes are exported: diff --git a/website/docs/r/acmpca_certificate_authority_certificate.html.markdown b/website/docs/r/acmpca_certificate_authority_certificate.html.markdown index 9cfe798fc48..be9f93c1a2c 100644 --- a/website/docs/r/acmpca_certificate_authority_certificate.html.markdown +++ b/website/docs/r/acmpca_certificate_authority_certificate.html.markdown @@ -111,3 +111,7 @@ The following arguments are supported: * `certificate` - (Required) The PEM-encoded certificate for the Certificate Authority. * `certificate_authority_arn` - (Required) Amazon Resource Name (ARN) of the Certificate Authority. * `certificate_chain` - (Optional) The PEM-encoded certificate chain that includes any intermediate certificates and chains up to root CA. Required for subordinate Certificate Authorities. Not allowed for root Certificate Authorities. + +## Attributes Reference + +No additional attributes are exported. diff --git a/website/docs/r/cognito_identity_provider.html.markdown b/website/docs/r/cognito_identity_provider.html.markdown index d409b558ad7..c3b7ed32407 100644 --- a/website/docs/r/cognito_identity_provider.html.markdown +++ b/website/docs/r/cognito_identity_provider.html.markdown @@ -48,6 +48,10 @@ The following arguments are supported: * `idp_identifiers` (Optional) - The list of identity providers. * `provider_details` (Optional) - The map of identity details, such as access token +## Attributes Reference + +No additional attributes are exported. + ## Import `aws_cognito_identity_provider` resources can be imported using their User Pool ID and Provider Name, e.g. diff --git a/website/docs/r/config_conformance_pack.html.markdown b/website/docs/r/config_conformance_pack.html.markdown index 190094aeb0e..19186eea110 100644 --- a/website/docs/r/config_conformance_pack.html.markdown +++ b/website/docs/r/config_conformance_pack.html.markdown @@ -100,7 +100,7 @@ The `input_parameter` configuration block supports the following arguments: ## Attributes Reference -In addition to all arguments above (except for `template_body` and `template_s3_uri`), the following attributes are exported: +In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name (ARN) of the conformance pack. diff --git a/website/docs/r/iam_user_group_membership.html.markdown b/website/docs/r/iam_user_group_membership.html.markdown index 425dfa095f3..7c6be0129e8 100644 --- a/website/docs/r/iam_user_group_membership.html.markdown +++ b/website/docs/r/iam_user_group_membership.html.markdown @@ -62,8 +62,7 @@ The following arguments are supported: ## Attributes Reference -* `user` - The name of the IAM User -* `groups` - The list of IAM Groups +No additional attributes are exported. [1]: /docs/providers/aws/r/iam_group.html [2]: /docs/providers/aws/r/iam_user.html diff --git a/website/docs/r/networkfirewall_resource_policy.html.markdown b/website/docs/r/networkfirewall_resource_policy.html.markdown index e89a051f164..7dd4c7dacbf 100644 --- a/website/docs/r/networkfirewall_resource_policy.html.markdown +++ b/website/docs/r/networkfirewall_resource_policy.html.markdown @@ -71,7 +71,7 @@ The following arguments are supported: ## Attributes Reference -In addition to all arguments above, the following attribute is exported: +In addition to all arguments above, the following attributes are exported: * `id` - The Amazon Resource Name (ARN) of the rule group or firewall policy associated with the resource policy. diff --git a/website/docs/r/pinpoint_baidu_channel.markdown b/website/docs/r/pinpoint_baidu_channel.markdown index ee6644230ac..c97299ba5bb 100644 --- a/website/docs/r/pinpoint_baidu_channel.markdown +++ b/website/docs/r/pinpoint_baidu_channel.markdown @@ -36,6 +36,10 @@ The following arguments are supported: * `api_key` - (Required) Platform credential API key from Baidu. * `secret_key` - (Required) Platform credential Secret key from Baidu. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint Baidu Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_event_stream.markdown b/website/docs/r/pinpoint_event_stream.markdown index 7b99c41d3b1..f8b91871695 100644 --- a/website/docs/r/pinpoint_event_stream.markdown +++ b/website/docs/r/pinpoint_event_stream.markdown @@ -75,6 +75,10 @@ The following arguments are supported: * `destination_stream_arn` - (Required) The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events. * `role_arn` - (Required) The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint Event Stream can be imported using the `application-id`, e.g. diff --git a/website/docs/r/pinpoint_gcm_channel.markdown b/website/docs/r/pinpoint_gcm_channel.markdown index 481efb28bdc..89681cfc681 100644 --- a/website/docs/r/pinpoint_gcm_channel.markdown +++ b/website/docs/r/pinpoint_gcm_channel.markdown @@ -33,6 +33,10 @@ The following arguments are supported: * `api_key` - (Required) Platform credential API key from Google. * `enabled` - (Optional) Whether the channel is enabled or disabled. Defaults to `true`. +## Attributes Reference + +No additional attributes are exported. + ## Import Pinpoint GCM Channel can be imported using the `application-id`, e.g. diff --git a/website/docs/r/securityhub_invite_accepter.markdown b/website/docs/r/securityhub_invite_accepter.markdown index d96a602164d..caec73c4732 100644 --- a/website/docs/r/securityhub_invite_accepter.markdown +++ b/website/docs/r/securityhub_invite_accepter.markdown @@ -42,7 +42,7 @@ The following arguments are supported: ## Attributes Reference -The following attributes are exported in addition to the arguments listed above: +In addition to all arguments above, the following attributes are exported: * `invitation_id` - The ID of the invitation. @@ -51,5 +51,5 @@ The following attributes are exported in addition to the arguments listed above: Security Hub invite acceptance can be imported using the account ID, e.g. ``` -$ terraform import aws_securityhub_invite_acceptor.example 123456789012 +$ terraform import aws_securityhub_invite_accepter.example 123456789012 ``` \ No newline at end of file diff --git a/website/docs/r/ses_identity_notification_topic.markdown b/website/docs/r/ses_identity_notification_topic.markdown index 2df6b32e20a..93dcfddbbd8 100644 --- a/website/docs/r/ses_identity_notification_topic.markdown +++ b/website/docs/r/ses_identity_notification_topic.markdown @@ -38,16 +38,6 @@ No additional attributes are exported. Identity Notification Topics can be imported using ID of the record. The ID is made up as IDENTITY|TYPE where IDENTITY is the SES Identity and TYPE is the Notification Type. -e.g. - -``` -example.com|Bounce -``` - -In this example, `example.com` is the SES Identity and `Bounce` is the Notification Type. - -To import the ID above, it would look as follows: - ``` $ terraform import aws_ses_identity_notification_topic.test 'example.com|Bounce' ``` diff --git a/website/docs/r/transfer_ssh_key.html.markdown b/website/docs/r/transfer_ssh_key.html.markdown index f81895d5eec..b53777d3065 100644 --- a/website/docs/r/transfer_ssh_key.html.markdown +++ b/website/docs/r/transfer_ssh_key.html.markdown @@ -86,6 +86,10 @@ The following arguments are supported: * `user_name` - (Requirement) The name of the user account that is assigned to one or more servers. * `body` - (Requirement) The public key portion of an SSH key pair. +## Attributes Reference + +No additional attributes are exported. + ## Import Transfer SSH Public Key can be imported using the `server_id` and `user_name` and `ssh_public_key_id` separated by `/`. From 3d3d3c6afd5c8079babd586d288b584d7f82ce12 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 16:24:21 -0400 Subject: [PATCH 1092/1252] docs/resource/aws_kinesis_stream_consumer: Adjust example code block language from hcl to terraform --- website/docs/r/kinesis_stream_consumer.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/kinesis_stream_consumer.html.markdown b/website/docs/r/kinesis_stream_consumer.html.markdown index dd204b1e6bb..7eea290a8af 100644 --- a/website/docs/r/kinesis_stream_consumer.html.markdown +++ b/website/docs/r/kinesis_stream_consumer.html.markdown @@ -16,7 +16,7 @@ For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. ## Example Usage -```hcl +```terraform resource "aws_kinesis_stream" "example" { name = "example-stream" shard_count = 1 From 7141d1c315dc0c221979f0a4f8855a13b545dbaf Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 19 Mar 2021 16:25:37 -0400 Subject: [PATCH 1093/1252] docs/provider: Adjust remaining hcl code blocks to terraform --- website/docs/d/codestarconnections_connection.html.markdown | 2 +- .../docs/d/ec2_transit_gateway_route_tables.html.markdown | 2 +- website/docs/d/kinesis_stream_consumer.html.markdown | 2 +- website/docs/index.html.markdown | 6 +++--- website/docs/r/elasticache_replication_group.html.markdown | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/website/docs/d/codestarconnections_connection.html.markdown b/website/docs/d/codestarconnections_connection.html.markdown index fea4e18f77a..acfc225d04b 100644 --- a/website/docs/d/codestarconnections_connection.html.markdown +++ b/website/docs/d/codestarconnections_connection.html.markdown @@ -12,7 +12,7 @@ Provides details about CodeStar Connection. ## Example Usage -```hcl +```terraform data "aws_codestarconnections_connection" "example" { arn = aws_codestarconnections_connection.example.arn } diff --git a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown index 9d1f3dbe74a..f81312f47ea 100644 --- a/website/docs/d/ec2_transit_gateway_route_tables.html.markdown +++ b/website/docs/d/ec2_transit_gateway_route_tables.html.markdown @@ -14,7 +14,7 @@ Provides information for multiple EC2 Transit Gateway Route Tables, such as thei The following shows outputing all Transit Gateway Route Table Ids. -```hcl +```terraform data "aws_ec2_transit_gateway_route_tables" "example" {} output "example" { diff --git a/website/docs/d/kinesis_stream_consumer.html.markdown b/website/docs/d/kinesis_stream_consumer.html.markdown index eec1bd5acf6..bd2c411976f 100644 --- a/website/docs/d/kinesis_stream_consumer.html.markdown +++ b/website/docs/d/kinesis_stream_consumer.html.markdown @@ -14,7 +14,7 @@ For more details, see the [Amazon Kinesis Stream Consumer Documentation][1]. ## Example Usage -```hcl +```terraform data "aws_kinesis_stream_consumer" "example" { name = "example-consumer" stream_arn = aws_kinesis_stream.example.arn diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 05e3dc88d9b..28105953980 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -386,7 +386,7 @@ The `assume_role` configuration block supports the following optional arguments: Example: Resource with provider default tags -```hcl +```terraform provider "aws" { default_tags { tags = { @@ -424,7 +424,7 @@ vpc_all_tags = tomap({ Example: Resource with tags and provider default tags -```hcl +```terraform provider "aws" { default_tags { tags = { @@ -469,7 +469,7 @@ vpc_resource_level_tags = tomap({ Example: Resource overriding provider default tags -```hcl +```terraform provider "aws" { default_tags { tags = { diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index 2349b70560a..dcd4a62bae5 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -107,7 +107,7 @@ for full details on using Replication Groups. A Global Replication Group can have one one two secondary Replication Groups in different regions. These are added to an existing Global Replication Group. -```hcl +```terraform resource "aws_elasticache_replication_group" "secondary" { replication_group_id = "example-secondary" replication_group_description = "secondary replication group" From a8eb986238a2694675496e2f9cbc30ec3ed13ed1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 22 Mar 2021 17:22:27 -0400 Subject: [PATCH 1094/1252] r/aws_apigatewayv2_domain_name: Use internal finder and waiter packages. Acceptance test output: $ ACM_CERTIFICATE_ROOT_DOMAIN=<> make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayV2DomainName_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2DomainName_ -timeout 180m === RUN TestAccAWSAPIGatewayV2DomainName_basic === PAUSE TestAccAWSAPIGatewayV2DomainName_basic === RUN TestAccAWSAPIGatewayV2DomainName_disappears === PAUSE TestAccAWSAPIGatewayV2DomainName_disappears === RUN TestAccAWSAPIGatewayV2DomainName_Tags === PAUSE TestAccAWSAPIGatewayV2DomainName_Tags === RUN TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === PAUSE TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === RUN TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === PAUSE TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayV2DomainName_basic === CONT TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === CONT TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayV2DomainName_Tags === CONT TestAccAWSAPIGatewayV2DomainName_disappears --- PASS: TestAccAWSAPIGatewayV2DomainName_disappears (24.80s) === CONT TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication resource_aws_apigatewayv2_domain_name_test.go:279: Step 2/4 error: Error running apply: exit status 1 2021/03/22 17:15:26 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.13.0 Error: error updating API Gateway v2 domain name (tf-acc-01xy3s6uqmlgijxzyxaupimtxq7sqdaldcnzlpdqz8.ewbankkit.com): BadRequestException: Invalid input. Expected one domain name configuration on terraform_plugin_test.tf line 62, in resource "aws_apigatewayv2_domain_name" "test": 62: resource "aws_apigatewayv2_domain_name" "test" { --- FAIL: TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication (194.33s) --- PASS: TestAccAWSAPIGatewayV2DomainName_basic (210.10s) --- PASS: TestAccAWSAPIGatewayV2DomainName_Tags (296.94s) --- PASS: TestAccAWSAPIGatewayV2DomainName_UpdateCertificate (430.93s) FAIL FAIL github.com/terraform-providers/terraform-provider-aws/aws 431.633s FAIL GNUmakefile:27: recipe for target 'testacc' failed make: *** [testacc] Error 1 --- .../service/apigatewayv2/finder/finder.go | 33 +++++ .../service/apigatewayv2/waiter/status.go | 23 ++++ .../service/apigatewayv2/waiter/waiter.go | 17 +++ aws/resource_aws_apigatewayv2_domain_name.go | 124 +++++++----------- ...ource_aws_apigatewayv2_domain_name_test.go | 32 +++-- .../r/apigatewayv2_domain_name.html.markdown | 1 + 6 files changed, 140 insertions(+), 90 deletions(-) diff --git a/aws/internal/service/apigatewayv2/finder/finder.go b/aws/internal/service/apigatewayv2/finder/finder.go index 949f6bd4896..ca399d41d85 100644 --- a/aws/internal/service/apigatewayv2/finder/finder.go +++ b/aws/internal/service/apigatewayv2/finder/finder.go @@ -72,3 +72,36 @@ func Apis(conn *apigatewayv2.ApiGatewayV2, input *apigatewayv2.GetApisInput) ([] return apis, nil } + +func DomainNameByName(conn *apigatewayv2.ApiGatewayV2, name string) (*apigatewayv2.GetDomainNameOutput, error) { + input := &apigatewayv2.GetDomainNameInput{ + DomainName: aws.String(name), + } + + return DomainName(conn, input) +} + +func DomainName(conn *apigatewayv2.ApiGatewayV2, input *apigatewayv2.GetDomainNameInput) (*apigatewayv2.GetDomainNameOutput, error) { + output, err := conn.GetDomainName(input) + + if tfawserr.ErrCodeEquals(err, apigatewayv2.ErrCodeNotFoundException) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + + if err != nil { + return nil, err + } + + // Handle any empty result. + if output == nil || len(output.DomainNameConfigurations) == 0 { + return nil, &resource.NotFoundError{ + Message: "Empty result", + LastRequest: input, + } + } + + return output, nil +} diff --git a/aws/internal/service/apigatewayv2/waiter/status.go b/aws/internal/service/apigatewayv2/waiter/status.go index 478600fa77a..dc0bd7e2052 100644 --- a/aws/internal/service/apigatewayv2/waiter/status.go +++ b/aws/internal/service/apigatewayv2/waiter/status.go @@ -2,10 +2,13 @@ package waiter import ( "fmt" + "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigatewayv2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) // DeploymentStatus fetches the Deployment and its Status @@ -32,6 +35,26 @@ func DeploymentStatus(conn *apigatewayv2.ApiGatewayV2, apiId, deploymentId strin } } +func DomainNameStatus(conn *apigatewayv2.ApiGatewayV2, name string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + domainName, err := finder.DomainNameByName(conn, name) + + if tfresource.NotFound(err) { + return nil, "", nil + } + + if err != nil { + return nil, "", err + } + + if statusMessage := aws.StringValue(domainName.DomainNameConfigurations[0].DomainNameStatusMessage); statusMessage != "" { + log.Printf("[INFO] API Gateway v2 domain name (%s) status message: %s", name, statusMessage) + } + + return domainName, aws.StringValue(domainName.DomainNameConfigurations[0].DomainNameStatus), nil + } +} + // VpcLinkStatus fetches the VPC Link and its Status func VpcLinkStatus(conn *apigatewayv2.ApiGatewayV2, vpcLinkId string) resource.StateRefreshFunc { return func() (interface{}, string, error) { diff --git a/aws/internal/service/apigatewayv2/waiter/waiter.go b/aws/internal/service/apigatewayv2/waiter/waiter.go index 4f3d536f5b9..73419717ff1 100644 --- a/aws/internal/service/apigatewayv2/waiter/waiter.go +++ b/aws/internal/service/apigatewayv2/waiter/waiter.go @@ -36,6 +36,23 @@ func DeploymentDeployed(conn *apigatewayv2.ApiGatewayV2, apiId, deploymentId str return nil, err } +func DomainNameAvailable(conn *apigatewayv2.ApiGatewayV2, name string, timeout time.Duration) (*apigatewayv2.GetDomainNameOutput, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{apigatewayv2.DomainNameStatusUpdating}, + Target: []string{apigatewayv2.DomainNameStatusAvailable}, + Refresh: DomainNameStatus(conn, name), + Timeout: timeout, + } + + outputRaw, err := stateConf.WaitForState() + + if v, ok := outputRaw.(*apigatewayv2.GetDomainNameOutput); ok { + return v, err + } + + return nil, err +} + // VpcLinkAvailable waits for a VPC Link to return Available func VpcLinkAvailable(conn *apigatewayv2.ApiGatewayV2, vpcLinkId string) (*apigatewayv2.GetVpcLinkOutput, error) { stateConf := &resource.StateChangeConf{ diff --git a/aws/resource_aws_apigatewayv2_domain_name.go b/aws/resource_aws_apigatewayv2_domain_name.go index 09658506467..fb80ebd5975 100644 --- a/aws/resource_aws_apigatewayv2_domain_name.go +++ b/aws/resource_aws_apigatewayv2_domain_name.go @@ -8,14 +8,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/apigatewayv2" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" -) - -const ( - apiGatewayV2DomainNameStatusDeleted = "DELETED" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsApiGatewayV2DomainName() *schema.Resource { @@ -29,6 +28,7 @@ func resourceAwsApiGatewayV2DomainName() *schema.Resource { }, Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), Update: schema.DefaultTimeout(60 * time.Minute), }, @@ -109,21 +109,27 @@ func resourceAwsApiGatewayV2DomainName() *schema.Resource { func resourceAwsApiGatewayV2DomainNameCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).apigatewayv2conn + domainName := d.Get("domain_name").(string) - req := &apigatewayv2.CreateDomainNameInput{ - DomainName: aws.String(d.Get("domain_name").(string)), + input := &apigatewayv2.CreateDomainNameInput{ + DomainName: aws.String(domainName), DomainNameConfigurations: expandApiGatewayV2DomainNameConfiguration(d.Get("domain_name_configuration").([]interface{})), MutualTlsAuthentication: expandApiGatewayV2MutualTlsAuthentication(d.Get("mutual_tls_authentication").([]interface{})), Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Apigatewayv2Tags(), } - log.Printf("[DEBUG] Creating API Gateway v2 domain name: %s", req) - resp, err := conn.CreateDomainName(req) + log.Printf("[DEBUG] Creating API Gateway v2 domain name: %s", input) + output, err := conn.CreateDomainName(input) + if err != nil { - return fmt.Errorf("error creating API Gateway v2 domain name: %s", err) + return fmt.Errorf("error creating API Gateway v2 domain name (%s): %w", domainName, err) } - d.SetId(aws.StringValue(resp.DomainName)) + d.SetId(aws.StringValue(output.DomainName)) + + if _, err := waiter.DomainNameAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return fmt.Errorf("error waiting for API Gateway v2 domain name (%s) to become available: %w", d.Id(), err) + } return resourceAwsApiGatewayV2DomainNameRead(d, meta) } @@ -132,19 +138,19 @@ func resourceAwsApiGatewayV2DomainNameRead(d *schema.ResourceData, meta interfac conn := meta.(*AWSClient).apigatewayv2conn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - respRaw, state, err := apiGatewayV2DomainNameRefresh(conn, d.Id())() - if err != nil { - return fmt.Errorf("error reading API Gateway v2 domain name (%s): %s", d.Id(), err) - } + output, err := finder.DomainNameByName(conn, d.Id()) - if state == apiGatewayV2DomainNameStatusDeleted { + if !d.IsNewResource() && tfresource.NotFound(err) { log.Printf("[WARN] API Gateway v2 domain name (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - resp := respRaw.(*apigatewayv2.GetDomainNameOutput) - d.Set("api_mapping_selection_expression", resp.ApiMappingSelectionExpression) + if err != nil { + return fmt.Errorf("error reading API Gateway v2 domain name (%s): %w", d.Id(), err) + } + + d.Set("api_mapping_selection_expression", output.ApiMappingSelectionExpression) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Service: "apigateway", @@ -152,17 +158,17 @@ func resourceAwsApiGatewayV2DomainNameRead(d *schema.ResourceData, meta interfac Resource: fmt.Sprintf("/domainnames/%s", d.Id()), }.String() d.Set("arn", arn) - d.Set("domain_name", resp.DomainName) - err = d.Set("domain_name_configuration", flattenApiGatewayV2DomainNameConfiguration(resp.DomainNameConfigurations[0])) + d.Set("domain_name", output.DomainName) + err = d.Set("domain_name_configuration", flattenApiGatewayV2DomainNameConfiguration(output.DomainNameConfigurations[0])) if err != nil { - return fmt.Errorf("error setting domain_name_configuration: %s", err) + return fmt.Errorf("error setting domain_name_configuration: %w", err) } - err = d.Set("mutual_tls_authentication", flattenApiGatewayV2MutualTlsAuthentication(resp.MutualTlsAuthentication)) + err = d.Set("mutual_tls_authentication", flattenApiGatewayV2MutualTlsAuthentication(output.MutualTlsAuthentication)) if err != nil { - return fmt.Errorf("error setting mutual_tls_authentication: %s", err) + return fmt.Errorf("error setting mutual_tls_authentication: %w", err) } - if err := d.Set("tags", keyvaluetags.Apigatewayv2KeyValueTags(resp.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + if err := d.Set("tags", keyvaluetags.Apigatewayv2KeyValueTags(output.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) } return nil @@ -172,43 +178,45 @@ func resourceAwsApiGatewayV2DomainNameUpdate(d *schema.ResourceData, meta interf conn := meta.(*AWSClient).apigatewayv2conn if d.HasChanges("domain_name_configuration", "mutual_tls_authentication") { - req := &apigatewayv2.UpdateDomainNameInput{ + input := &apigatewayv2.UpdateDomainNameInput{ DomainName: aws.String(d.Id()), } if d.HasChange("domain_name_configuration") { - req.DomainNameConfigurations = expandApiGatewayV2DomainNameConfiguration(d.Get("domain_name_configuration").([]interface{})) + input.DomainNameConfigurations = expandApiGatewayV2DomainNameConfiguration(d.Get("domain_name_configuration").([]interface{})) } + if d.HasChange("mutual_tls_authentication") { vMutualTlsAuthentication := d.Get("mutual_tls_authentication").([]interface{}) if len(vMutualTlsAuthentication) == 0 || vMutualTlsAuthentication[0] == nil { // To disable mutual TLS for a custom domain name, remove the truststore from your custom domain name. - req.MutualTlsAuthentication = &apigatewayv2.MutualTlsAuthenticationInput{ + input.MutualTlsAuthentication = &apigatewayv2.MutualTlsAuthenticationInput{ TruststoreUri: aws.String(""), } } else { - req.MutualTlsAuthentication = &apigatewayv2.MutualTlsAuthenticationInput{ + input.MutualTlsAuthentication = &apigatewayv2.MutualTlsAuthenticationInput{ TruststoreVersion: aws.String(vMutualTlsAuthentication[0].(map[string]interface{})["truststore_version"].(string)), } } } - log.Printf("[DEBUG] Updating API Gateway v2 domain name: %s", req) - _, err := conn.UpdateDomainName(req) + log.Printf("[DEBUG] Updating API Gateway v2 domain name: %s", input) + _, err := conn.UpdateDomainName(input) + if err != nil { - return fmt.Errorf("error updating API Gateway v2 domain name (%s): %s", d.Id(), err) + return fmt.Errorf("error updating API Gateway v2 domain name (%s): %w", d.Id(), err) } - if err := waitForApiGatewayV2DomainNameAvailabilityOnUpdate(conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { - return fmt.Errorf("error waiting for API Gateway v2 domain name (%s) to become available: %s", d.Id(), err) + if _, err := waiter.DomainNameAvailable(conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { + return fmt.Errorf("error waiting for API Gateway v2 domain name (%s) to become available: %w", d.Id(), err) } } if d.HasChange("tags") { o, n := d.GetChange("tags") if err := keyvaluetags.Apigatewayv2UpdateTags(conn, d.Get("arn").(string), o, n); err != nil { - return fmt.Errorf("error updating API Gateway v2 domain name (%s) tags: %s", d.Id(), err) + return fmt.Errorf("error updating API Gateway v2 domain name (%s) tags: %w", d.Id(), err) } } @@ -222,56 +230,18 @@ func resourceAwsApiGatewayV2DomainNameDelete(d *schema.ResourceData, meta interf _, err := conn.DeleteDomainName(&apigatewayv2.DeleteDomainNameInput{ DomainName: aws.String(d.Id()), }) - if isAWSErr(err, apigatewayv2.ErrCodeNotFoundException, "") { + + if tfawserr.ErrCodeEquals(err, apigatewayv2.ErrCodeNotFoundException) { return nil } + if err != nil { - return fmt.Errorf("error deleting API Gateway v2 domain name (%s): %s", d.Id(), err) + return fmt.Errorf("error deleting API Gateway v2 domain name (%s): %w", d.Id(), err) } return nil } -func apiGatewayV2DomainNameRefresh(conn *apigatewayv2.ApiGatewayV2, domainName string) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.GetDomainName(&apigatewayv2.GetDomainNameInput{ - DomainName: aws.String(domainName), - }) - if isAWSErr(err, apigatewayv2.ErrCodeNotFoundException, "") { - return "", apiGatewayV2DomainNameStatusDeleted, nil - } - if err != nil { - return nil, "", err - } - - if n := len(resp.DomainNameConfigurations); n != 1 { - return nil, "", fmt.Errorf("Found %d domain name configurations for %s, expected 1", n, domainName) - } - - domainNameConfiguration := resp.DomainNameConfigurations[0] - if statusMessage := aws.StringValue(domainNameConfiguration.DomainNameStatusMessage); statusMessage != "" { - log.Printf("[INFO] Domain name (%s) status message: %s", domainName, statusMessage) - } - - return resp, aws.StringValue(domainNameConfiguration.DomainNameStatus), nil - } -} - -func waitForApiGatewayV2DomainNameAvailabilityOnUpdate(conn *apigatewayv2.ApiGatewayV2, domainName string, timeout time.Duration) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{apigatewayv2.DomainNameStatusUpdating}, - Target: []string{apigatewayv2.DomainNameStatusAvailable}, - Refresh: apiGatewayV2DomainNameRefresh(conn, domainName), - Timeout: timeout, - Delay: 10 * time.Second, - MinTimeout: 5 * time.Second, - } - - _, err := stateConf.WaitForState() - - return err -} - func expandApiGatewayV2DomainNameConfiguration(vDomainNameConfiguration []interface{}) []*apigatewayv2.DomainNameConfiguration { if len(vDomainNameConfiguration) == 0 || vDomainNameConfiguration[0] == nil { return nil diff --git a/aws/resource_aws_apigatewayv2_domain_name_test.go b/aws/resource_aws_apigatewayv2_domain_name_test.go index 5073af9702a..467ad66ab74 100644 --- a/aws/resource_aws_apigatewayv2_domain_name_test.go +++ b/aws/resource_aws_apigatewayv2_domain_name_test.go @@ -12,6 +12,8 @@ import ( "github.com/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/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func init() { @@ -293,8 +295,8 @@ func TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "domain_name_configuration.0.security_policy", "TLS_1_2"), resource.TestCheckResourceAttrSet(resourceName, "domain_name_configuration.0.target_domain_name"), resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.#", "1"), - resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_uri", fmt.Sprintf("s3://%s/%s.1", rName, rName)), - resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_version", ""), + resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_uri", fmt.Sprintf("s3://%s/%s", rName, rName)), + resource.TestCheckResourceAttrPair(resourceName, "mutual_tls_authentication.0.truststore_version", s3BucketObjectResourceName, "version_id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, @@ -311,7 +313,7 @@ func TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "domain_name_configuration.0.security_policy", "TLS_1_2"), resource.TestCheckResourceAttrSet(resourceName, "domain_name_configuration.0.target_domain_name"), resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.#", "1"), - resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_uri", fmt.Sprintf("s3://%s/%s.2", rName, rName)), + resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_uri", fmt.Sprintf("s3://%s/%s", rName, rName)), resource.TestCheckResourceAttrPair(resourceName, "mutual_tls_authentication.0.truststore_version", s3BucketObjectResourceName, "version_id"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), @@ -350,12 +352,12 @@ func testAccCheckAWSAPIGatewayV2DomainNameDestroy(s *terraform.State) error { continue } - _, err := conn.GetDomainName(&apigatewayv2.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - }) - if isAWSErr(err, apigatewayv2.ErrCodeNotFoundException, "") { + _, err := finder.DomainNameByName(conn, rs.Primary.ID) + + if tfresource.NotFound(err) { continue } + if err != nil { return err } @@ -379,14 +381,13 @@ func testAccCheckAWSAPIGatewayV2DomainNameExists(n string, v *apigatewayv2.GetDo conn := testAccProvider.Meta().(*AWSClient).apigatewayv2conn - resp, err := conn.GetDomainName(&apigatewayv2.GetDomainNameInput{ - DomainName: aws.String(rs.Primary.ID), - }) + output, err := finder.DomainNameByName(conn, rs.Primary.ID) + if err != nil { return err } - *v = *resp + *v = *output return nil } @@ -500,11 +501,15 @@ resource "aws_s3_bucket" "test" { bucket = %[1]q force_destroy = true + + versioning { + enabled = true + } } resource "aws_s3_bucket_object" "test" { bucket = aws_s3_bucket.test.id - key = "%[1]s.1" + key = %[1]q source = "test-fixtures/apigateway-domain-name-truststore-1.pem" } @@ -519,6 +524,7 @@ resource "aws_apigatewayv2_domain_name" "test" { mutual_tls_authentication { truststore_uri = "s3://${aws_s3_bucket_object.test.bucket}/${aws_s3_bucket_object.test.key}" + truststore_version = aws_s3_bucket_object.test.version_id } } `, rName)) @@ -540,7 +546,7 @@ resource "aws_s3_bucket" "test" { resource "aws_s3_bucket_object" "test" { bucket = aws_s3_bucket.test.id - key = "%[1]s.2" + key = %[1]q source = "test-fixtures/apigateway-domain-name-truststore-2.pem" } diff --git a/website/docs/r/apigatewayv2_domain_name.html.markdown b/website/docs/r/apigatewayv2_domain_name.html.markdown index b122f7578a8..c6bde688df8 100644 --- a/website/docs/r/apigatewayv2_domain_name.html.markdown +++ b/website/docs/r/apigatewayv2_domain_name.html.markdown @@ -92,6 +92,7 @@ In addition to all arguments above, the following attributes are exported: `aws_apigatewayv2_domain_name` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: +- `create` - (Default `10 minutes`) Used for creating the domain name - `update` - (Default `60 minutes`) Used for updating the domain name ## Import From d34aca99e190a4c4160f393737b2f56406ebb35f Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Mon, 22 Mar 2021 22:37:06 -0400 Subject: [PATCH 1095/1252] retry on ResourceConflictException during creation --- .changelog/18341.txt | 3 + ..._securityhub_organization_admin_account.go | 18 ++++- ...rityhub_organization_admin_account_test.go | 69 +++++++++++++++++++ aws/resource_aws_securityhub_test.go | 5 +- 4 files changed, 92 insertions(+), 3 deletions(-) create mode 100644 .changelog/18341.txt diff --git a/.changelog/18341.txt b/.changelog/18341.txt new file mode 100644 index 00000000000..e732da43402 --- /dev/null +++ b/.changelog/18341.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_securityhub_organization_admin_account: Retry on `ResourceConflictException` error during creation +``` \ No newline at end of file diff --git a/aws/resource_aws_securityhub_organization_admin_account.go b/aws/resource_aws_securityhub_organization_admin_account.go index 0f1846c37f5..cec3e044478 100644 --- a/aws/resource_aws_securityhub_organization_admin_account.go +++ b/aws/resource_aws_securityhub_organization_admin_account.go @@ -7,9 +7,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/securityhub/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/securityhub/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsSecurityHubOrganizationAdminAccount() *schema.Resource { @@ -42,7 +44,21 @@ func resourceAwsSecurityHubOrganizationAdminAccountCreate(d *schema.ResourceData AdminAccountId: aws.String(adminAccountID), } - _, err := conn.EnableOrganizationAdminAccount(input) + err := resource.Retry(waiter.AdminAccountEnabledTimeout, func() *resource.RetryError { + _, err := conn.EnableOrganizationAdminAccount(input) + + if err != nil { + if tfawserr.ErrCodeEquals(err, securityhub.ErrCodeResourceConflictException) { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + + if tfresource.TimedOut(err) { + _, err = conn.EnableOrganizationAdminAccount(input) + } if err != nil { return fmt.Errorf("error enabling Security Hub Organization Admin Account (%s): %w", adminAccountID, err) diff --git a/aws/resource_aws_securityhub_organization_admin_account_test.go b/aws/resource_aws_securityhub_organization_admin_account_test.go index 84ae639ea33..e720cbf56fe 100644 --- a/aws/resource_aws_securityhub_organization_admin_account_test.go +++ b/aws/resource_aws_securityhub_organization_admin_account_test.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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/terraform-providers/terraform-provider-aws/aws/internal/service/securityhub/finder" ) @@ -63,6 +64,35 @@ func testAccAwsSecurityHubOrganizationAdminAccount_disappears(t *testing.T) { }) } +func testAccAwsSecurityHubOrganizationAdminAccount_MultiRegion(t *testing.T) { + var providers []*schema.Provider + + resourceName := "aws_securityhub_organization_admin_account.test" + altResourceName := "aws_securityhub_organization_admin_account.alternate" + thirdResourceName := "aws_securityhub_organization_admin_account.third" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccOrganizationsAccountPreCheck(t) + testAccMultipleRegionPreCheck(t, 3) + }, + ErrorCheck: testAccErrorCheck(t, securityhub.EndpointsID), + ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 3), + CheckDestroy: testAccCheckAwsSecurityHubOrganizationAdminAccountDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSecurityHubOrganizationAdminAccountConfigMultiRegion(), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsSecurityHubOrganizationAdminAccountExists(resourceName), + testAccCheckAwsSecurityHubOrganizationAdminAccountExists(altResourceName), + testAccCheckAwsSecurityHubOrganizationAdminAccountExists(thirdResourceName), + ), + }, + }, + }) +} + func testAccCheckAwsSecurityHubOrganizationAdminAccountDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).securityhubconn @@ -136,3 +166,42 @@ resource "aws_securityhub_organization_admin_account" "test" { } ` } + +func testAccSecurityHubOrganizationAdminAccountConfigMultiRegion() string { + return composeConfig( + testAccMultipleRegionProviderConfig(3), + ` +data "aws_caller_identity" "current" {} + +data "aws_partition" "current" {} + +resource "aws_organizations_organization" "test" { + aws_service_access_principals = ["securityhub.${data.aws_partition.current.dns_suffix}"] + feature_set = "ALL" +} + +resource "aws_securityhub_account" "test" {} + +resource "aws_securityhub_organization_admin_account" "test" { + depends_on = [aws_organizations_organization.test] + + admin_account_id = data.aws_caller_identity.current.account_id +} + +resource "aws_securityhub_organization_admin_account" "alternate" { + provider = awsalternate + + depends_on = [aws_organizations_organization.test] + + admin_account_id = data.aws_caller_identity.current.account_id +} + +resource "aws_securityhub_organization_admin_account" "third" { + provider = awsthird + + depends_on = [aws_organizations_organization.test] + + admin_account_id = data.aws_caller_identity.current.account_id +} +`) +} diff --git a/aws/resource_aws_securityhub_test.go b/aws/resource_aws_securityhub_test.go index e65452d1160..30ae8950a97 100644 --- a/aws/resource_aws_securityhub_test.go +++ b/aws/resource_aws_securityhub_test.go @@ -23,8 +23,9 @@ func TestAccAWSSecurityHub_serial(t *testing.T) { "basic": testAccAWSSecurityHubInviteAccepter_basic, }, "OrganizationAdminAccount": { - "basic": testAccAwsSecurityHubOrganizationAdminAccount_basic, - "disappears": testAccAwsSecurityHubOrganizationAdminAccount_disappears, + "basic": testAccAwsSecurityHubOrganizationAdminAccount_basic, + "disappears": testAccAwsSecurityHubOrganizationAdminAccount_disappears, + "MultiRegion": testAccAwsSecurityHubOrganizationAdminAccount_MultiRegion, }, "ProductSubscription": { "basic": testAccAWSSecurityHubProductSubscription_basic, From 0b314ded6584e31e68b7cace28a2b8366f595ee6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 23 Mar 2021 10:07:09 -0400 Subject: [PATCH 1096/1252] Generate 'GetDomainNamesPages'. --- .../service/apigatewayv2/lister/list.go | 2 +- .../apigatewayv2/lister/list_pages_gen.go | 23 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/aws/internal/service/apigatewayv2/lister/list.go b/aws/internal/service/apigatewayv2/lister/list.go index c4a03d8c38c..0ba32f6e67e 100644 --- a/aws/internal/service/apigatewayv2/lister/list.go +++ b/aws/internal/service/apigatewayv2/lister/list.go @@ -1,3 +1,3 @@ -//go:generate go run ../../../generators/listpages/main.go -function=GetApis github.com/aws/aws-sdk-go/service/apigatewayv2 +//go:generate go run ../../../generators/listpages/main.go -function=GetApis,GetDomainNames github.com/aws/aws-sdk-go/service/apigatewayv2 package lister diff --git a/aws/internal/service/apigatewayv2/lister/list_pages_gen.go b/aws/internal/service/apigatewayv2/lister/list_pages_gen.go index 90eba3aac46..499fa7f2c9b 100644 --- a/aws/internal/service/apigatewayv2/lister/list_pages_gen.go +++ b/aws/internal/service/apigatewayv2/lister/list_pages_gen.go @@ -1,4 +1,4 @@ -// Code generated by "aws/internal/generators/listpages/main.go -function=GetApis github.com/aws/aws-sdk-go/service/apigatewayv2"; DO NOT EDIT. +// Code generated by "aws/internal/generators/listpages/main.go -function=GetApis,GetDomainNames github.com/aws/aws-sdk-go/service/apigatewayv2"; DO NOT EDIT. package lister @@ -29,3 +29,24 @@ func GetApisPagesWithContext(ctx context.Context, conn *apigatewayv2.ApiGatewayV } return nil } + +func GetDomainNamesPages(conn *apigatewayv2.ApiGatewayV2, input *apigatewayv2.GetDomainNamesInput, fn func(*apigatewayv2.GetDomainNamesOutput, bool) bool) error { + return GetDomainNamesPagesWithContext(context.Background(), conn, input, fn) +} + +func GetDomainNamesPagesWithContext(ctx context.Context, conn *apigatewayv2.ApiGatewayV2, input *apigatewayv2.GetDomainNamesInput, fn func(*apigatewayv2.GetDomainNamesOutput, bool) bool) error { + for { + output, err := conn.GetDomainNamesWithContext(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 705190fafe8da91fe40c30bfab8d6dec4977078a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 23 Mar 2021 10:25:11 -0400 Subject: [PATCH 1097/1252] r/aws_apigatewayv2_domain_name: Use internal lister package for sweeper. Acceptance test output: $ TEST=./aws SWEEP=us-west-2 SWEEPARGS=-sweep-run=aws_apigatewayv2_domain_name make sweep WARNING: This will destroy infrastructure. Use only in development accounts. go test ./aws -v -sweep=us-west-2 -sweep-run=aws_apigatewayv2_domain_name -timeout 60m 2021/03/23 10:24:20 [DEBUG] Running Sweepers for region (us-west-2): 2021/03/23 10:24:20 [DEBUG] Running Sweeper (aws_apigatewayv2_domain_name) in region (us-west-2) 2021/03/23 10:24:20 [INFO] AWS Auth provider used: "EnvProvider" 2021/03/23 10:24:20 [DEBUG] Trying to get account information via sts:GetCallerIdentity 2021/03/23 10:24:21 [DEBUG] Trying to get account information via sts:GetCallerIdentity 2021/03/23 10:24:22 [DEBUG] Deleting API Gateway v2 domain name (testing1.ewbankkit.com) 2021/03/23 10:24:23 Sweeper Tests ran successfully: - aws_apigatewayv2_domain_name ok github.com/terraform-providers/terraform-provider-aws/aws 2.324s --- ...ource_aws_apigatewayv2_domain_name_test.go | 47 +++++++++---------- 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/aws/resource_aws_apigatewayv2_domain_name_test.go b/aws/resource_aws_apigatewayv2_domain_name_test.go index 467ad66ab74..9d3423ae1b9 100644 --- a/aws/resource_aws_apigatewayv2_domain_name_test.go +++ b/aws/resource_aws_apigatewayv2_domain_name_test.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/apigatewayv2/lister" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) @@ -26,42 +27,40 @@ func init() { func testSweepAPIGatewayV2DomainNames(region string) error { client, err := sharedClientForRegion(region) if err != nil { - return fmt.Errorf("error getting client: %s", err) + return fmt.Errorf("error getting client: %w", err) } conn := client.(*AWSClient).apigatewayv2conn input := &apigatewayv2.GetDomainNamesInput{} var sweeperErrs *multierror.Error - for { - output, err := conn.GetDomainNames(input) - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping API Gateway v2 domain names sweep for %s: %s", region, err) - return nil - } - if err != nil { - return fmt.Errorf("error retrieving API Gateway v2 domain names: %s", err) + err = lister.GetDomainNamesPages(conn, input, func(page *apigatewayv2.GetDomainNamesOutput, isLast bool) bool { + if page == nil { + return !isLast } - for _, domainName := range output.Items { - log.Printf("[INFO] Deleting API Gateway v2 domain name: %s", aws.StringValue(domainName.DomainName)) - _, err := conn.DeleteDomainName(&apigatewayv2.DeleteDomainNameInput{ - DomainName: domainName.DomainName, - }) - if isAWSErr(err, apigatewayv2.ErrCodeNotFoundException, "") { - continue - } + for _, domainName := range page.Items { + r := resourceAwsApiGatewayV2DomainName() + d := r.Data(nil) + d.SetId(aws.StringValue(domainName.DomainName)) + err = r.Delete(d, client) + if err != nil { - sweeperErr := fmt.Errorf("error deleting API Gateway v2 domain name (%s): %s", aws.StringValue(domainName.DomainName), err) - log.Printf("[ERROR] %s", sweeperErr) - sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + log.Printf("[ERROR] %s", err) + sweeperErrs = multierror.Append(sweeperErrs, err) continue } } - if aws.StringValue(output.NextToken) == "" { - break - } - input.NextToken = output.NextToken + return !isLast + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping API Gateway v2 domain names sweep for %s: %s", region, err) + return sweeperErrs.ErrorOrNil() // In case we have completed some pages, but had errors + } + + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error listing API Gateway v2 domain names: %w", err)) } return sweeperErrs.ErrorOrNil() From 22e12198ddae7abb5d70ba0921c72a622dab5b99 Mon Sep 17 00:00:00 2001 From: Dmitry Shevchuk Date: Tue, 23 Mar 2021 16:49:51 +0200 Subject: [PATCH 1098/1252] Add enable_execute_command to aws_ecs_service Make tflint happy --- aws/resource_aws_ecs_service.go | 13 +++ aws/resource_aws_ecs_service_test.go | 104 +++++++++++++++++++++++ website/docs/r/ecs_service.html.markdown | 1 + 3 files changed, 118 insertions(+) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 41adf3cd359..128c9ac596e 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -93,6 +93,12 @@ func resourceAwsEcsService() *schema.Resource { Default: false, }, + "enable_execute_command": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "force_new_deployment": { Type: schema.TypeBool, Optional: true, @@ -398,6 +404,7 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().EcsTags(), TaskDefinition: aws.String(d.Get("task_definition").(string)), EnableECSManagedTags: aws.Bool(d.Get("enable_ecs_managed_tags").(bool)), + EnableExecuteCommand: aws.Bool(d.Get("enable_execute_command").(bool)), } if schedulingStrategy == ecs.SchedulingStrategyDaemon && deploymentMinimumHealthyPercent != 100 { @@ -638,6 +645,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { d.Set("enable_ecs_managed_tags", service.EnableECSManagedTags) d.Set("propagate_tags", service.PropagateTags) d.Set("platform_version", service.PlatformVersion) + d.Set("enable_execute_command", service.EnableExecuteCommand) // Save cluster in the same format if strings.HasPrefix(d.Get("cluster").(string), "arn:"+meta.(*AWSClient).partition+":ecs:") { @@ -1030,6 +1038,11 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error input.CapacityProviderStrategy = expandEcsCapacityProviderStrategy(d.Get("capacity_provider_strategy").(*schema.Set)) } + if d.HasChange("enable_execute_command") { + updateService = true + input.EnableExecuteCommand = aws.Bool(d.Get("enable_execute_command").(bool)) + } + if updateService { log.Printf("[DEBUG] Updating ECS Service (%s): %s", d.Id(), input) // Retry due to IAM eventual consistency diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 32d9d0c5605..1ba8a542e20 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -1274,6 +1274,35 @@ func TestAccAWSEcsService_PropagateTags(t *testing.T) { }) } +func TestAccAWSEcsService_ExecuteCommand(t *testing.T) { + var service ecs.Service + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsServiceConfigExecuteCommand(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "enable_execute_command", "true"), + ), + }, + { + Config: testAccAWSEcsServiceConfigExecuteCommand(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "enable_execute_command", "false"), + ), + }, + }, + }) +} + func testAccCheckAWSEcsServiceDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ecsconn @@ -3856,3 +3885,78 @@ resource "aws_ecs_service" "ghost" { } `, clusterName, tdName, svcName) } + +func testAccAWSEcsServiceConfigExecuteCommand(rName string, enable bool) string { + return fmt.Sprintf(` +resource "aws_iam_role" "test" { + name = %q + assume_role_policy = < Date: Tue, 23 Mar 2021 12:23:30 -0400 Subject: [PATCH 1099/1252] r/aws_apigatewayv2_domain_name: Always send domain name configuration on update of mutual TLS configuration. Acceptance test output: $ ACM_CERTIFICATE_ROOT_DOMAIN=ewbankkit.com make testacc TEST=./aws TESTARGS='-run=TestAccAWSAPIGatewayV2DomainName_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayV2DomainName_ -timeout 180m === RUN TestAccAWSAPIGatewayV2DomainName_basic === PAUSE TestAccAWSAPIGatewayV2DomainName_basic === RUN TestAccAWSAPIGatewayV2DomainName_disappears === PAUSE TestAccAWSAPIGatewayV2DomainName_disappears === RUN TestAccAWSAPIGatewayV2DomainName_Tags === PAUSE TestAccAWSAPIGatewayV2DomainName_Tags === RUN TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === PAUSE TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === RUN TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === PAUSE TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayV2DomainName_basic === CONT TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication === CONT TestAccAWSAPIGatewayV2DomainName_UpdateCertificate === CONT TestAccAWSAPIGatewayV2DomainName_Tags === CONT TestAccAWSAPIGatewayV2DomainName_disappears --- PASS: TestAccAWSAPIGatewayV2DomainName_Tags (52.69s) --- PASS: TestAccAWSAPIGatewayV2DomainName_disappears (121.05s) --- PASS: TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication (263.95s) --- PASS: TestAccAWSAPIGatewayV2DomainName_basic (347.90s) --- PASS: TestAccAWSAPIGatewayV2DomainName_UpdateCertificate (469.99s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 470.492s --- aws/resource_aws_apigatewayv2_domain_name.go | 7 +--- ...ource_aws_apigatewayv2_domain_name_test.go | 39 ++++++++++++------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/aws/resource_aws_apigatewayv2_domain_name.go b/aws/resource_aws_apigatewayv2_domain_name.go index fb80ebd5975..a6c48dc2f10 100644 --- a/aws/resource_aws_apigatewayv2_domain_name.go +++ b/aws/resource_aws_apigatewayv2_domain_name.go @@ -179,11 +179,8 @@ func resourceAwsApiGatewayV2DomainNameUpdate(d *schema.ResourceData, meta interf if d.HasChanges("domain_name_configuration", "mutual_tls_authentication") { input := &apigatewayv2.UpdateDomainNameInput{ - DomainName: aws.String(d.Id()), - } - - if d.HasChange("domain_name_configuration") { - input.DomainNameConfigurations = expandApiGatewayV2DomainNameConfiguration(d.Get("domain_name_configuration").([]interface{})) + DomainName: aws.String(d.Id()), + DomainNameConfigurations: expandApiGatewayV2DomainNameConfiguration(d.Get("domain_name_configuration").([]interface{})), } if d.HasChange("mutual_tls_authentication") { diff --git a/aws/resource_aws_apigatewayv2_domain_name_test.go b/aws/resource_aws_apigatewayv2_domain_name_test.go index 9d3423ae1b9..cafa275f04f 100644 --- a/aws/resource_aws_apigatewayv2_domain_name_test.go +++ b/aws/resource_aws_apigatewayv2_domain_name_test.go @@ -282,7 +282,25 @@ func TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayV2DomainNameDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthentication(rootDomain, domain, rName), + Config: testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationNoObjectVersion(rootDomain, domain, rName, "apigateway-domain-name-truststore-1.pem"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayV2DomainNameExists(resourceName, &v), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/.+`)), + resource.TestCheckResourceAttrPair(resourceName, "domain_name", acmCertificateResourceName, "domain_name"), + resource.TestCheckResourceAttr(resourceName, "domain_name_configuration.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "domain_name_configuration.0.certificate_arn", acmCertificateResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "domain_name_configuration.0.endpoint_type", "REGIONAL"), + resource.TestCheckResourceAttrSet(resourceName, "domain_name_configuration.0.hosted_zone_id"), + resource.TestCheckResourceAttr(resourceName, "domain_name_configuration.0.security_policy", "TLS_1_2"), + resource.TestCheckResourceAttrSet(resourceName, "domain_name_configuration.0.target_domain_name"), + resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_uri", fmt.Sprintf("s3://%s/%s", rName, rName)), + resource.TestCheckResourceAttr(resourceName, "mutual_tls_authentication.0.truststore_version", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + Config: testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationObjectVersion(rootDomain, domain, rName, "apigateway-domain-name-truststore-2.pem"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayV2DomainNameExists(resourceName, &v), testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/.+`)), @@ -300,7 +318,7 @@ func TestAccAWSAPIGatewayV2DomainName_MutualTlsAuthentication(t *testing.T) { ), }, { - Config: testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationUpdated(rootDomain, domain, rName), + Config: testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationObjectVersion(rootDomain, domain, rName, "apigateway-domain-name-truststore-1.pem"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayV2DomainNameExists(resourceName, &v), testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/.+`)), @@ -492,7 +510,7 @@ resource "aws_apigatewayv2_domain_name" "test" { `, rName, index)) } -func testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthentication(rootDomain, domain, rName string) string { +func testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationNoObjectVersion(rootDomain, domain, rName, pemFileName string) string { return composeConfig( testAccAWSAPIGatewayV2DomainNameConfigPublicCert(rootDomain, domain), fmt.Sprintf(` @@ -500,16 +518,12 @@ resource "aws_s3_bucket" "test" { bucket = %[1]q force_destroy = true - - versioning { - enabled = true - } } resource "aws_s3_bucket_object" "test" { bucket = aws_s3_bucket.test.id key = %[1]q - source = "test-fixtures/apigateway-domain-name-truststore-1.pem" + source = "test-fixtures/%[2]s" } resource "aws_apigatewayv2_domain_name" "test" { @@ -523,13 +537,12 @@ resource "aws_apigatewayv2_domain_name" "test" { mutual_tls_authentication { truststore_uri = "s3://${aws_s3_bucket_object.test.bucket}/${aws_s3_bucket_object.test.key}" - truststore_version = aws_s3_bucket_object.test.version_id } } -`, rName)) +`, rName, pemFileName)) } -func testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationUpdated(rootDomain, domain, rName string) string { +func testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationObjectVersion(rootDomain, domain, rName, pemFileName string) string { return composeConfig( testAccAWSAPIGatewayV2DomainNameConfigPublicCert(rootDomain, domain), fmt.Sprintf(` @@ -546,7 +559,7 @@ resource "aws_s3_bucket" "test" { resource "aws_s3_bucket_object" "test" { bucket = aws_s3_bucket.test.id key = %[1]q - source = "test-fixtures/apigateway-domain-name-truststore-2.pem" + source = "test-fixtures/%[2]s" } resource "aws_apigatewayv2_domain_name" "test" { @@ -563,7 +576,7 @@ resource "aws_apigatewayv2_domain_name" "test" { truststore_version = aws_s3_bucket_object.test.version_id } } -`, rName)) +`, rName, pemFileName)) } func testAccAWSAPIGatewayV2DomainNameConfigMututalTlsAuthenticationMissing(rootDomain, domain string) string { From 6bd98745c5cac010e676fe83fc9058574bb239ed Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 23 Mar 2021 12:26:43 -0400 Subject: [PATCH 1100/1252] Add CHANGELOG entry. --- .changelog/18351.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18351.txt diff --git a/.changelog/18351.txt b/.changelog/18351.txt new file mode 100644 index 00000000000..e48f26687bb --- /dev/null +++ b/.changelog/18351.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_apigatewayv2_domain_name: Allow update of mutual TLS S3 object version +``` From 3cc0f8c1500c12289e2db8c44f83eb62001ca945 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 23 Mar 2021 12:55:01 -0400 Subject: [PATCH 1101/1252] tests/resource/aws_vpc_peering_connection: Remove ID-only refresh configuration (#18349) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18348 Identifier only refresh testing is generally a legacy testing practice before full import testing was the normal convention. Certain functionality of `IDRefreshName` testing, such as alternate providers defined by the test configuration and `ProviderFactories`, is not compatible since there is no method to pass in the original configuration to prevent Terraform CLI errors such as: ``` === CONT TestAccAWSVPCPeeringConnection_region testing_new.go:214: Error running terraform refresh: exit status 1 Error: Provider configuration not present To work with aws_vpc.peer (orphan) its original provider configuration at provider["registry.terraform.io/hashicorp/awsalternate"] is required, but it has been removed. This occurs when a provider configuration is removed while objects created by that provider still exist in the state. Re-add the provider configuration to destroy aws_vpc.peer (orphan), after which you can remove the provider configuration again. --- FAIL: TestAccAWSVPCPeeringConnection_region (24.38s) ``` Import testing accepts a `Config`, which is how it does not have a similar issue. Will submit followup issue to fix the Go documentation in the Terraform Plugin SDK as this testing is not run by default and note this limitation. Will also submit followup issue to remove `IDRefreshIgnore` and `IDRefreshName` from all testing. Output from acceptance testing: ``` --- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (13.29s) --- PASS: TestAccAWSVPCPeeringConnection_failedState (14.70s) --- PASS: TestAccAWSVPCPeeringConnection_plan (24.21s) --- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (25.87s) --- PASS: TestAccAWSVPCPeeringConnection_basic (27.94s) --- PASS: TestAccAWSVPCPeeringConnection_region (30.92s) --- PASS: TestAccAWSVPCPeeringConnection_options (60.28s) --- PASS: TestAccAWSVPCPeeringConnection_accept (61.32s) --- PASS: TestAccAWSVPCPeeringConnection_tags (62.79s) ``` --- ...esource_aws_vpc_peering_connection_test.go | 46 ++++++------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/aws/resource_aws_vpc_peering_connection_test.go b/aws/resource_aws_vpc_peering_connection_test.go index 3b5e3401c56..38b01f1671b 100644 --- a/aws/resource_aws_vpc_peering_connection_test.go +++ b/aws/resource_aws_vpc_peering_connection_test.go @@ -93,11 +93,8 @@ func TestAccAWSVPCPeeringConnection_basic(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshName: resourceName, - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -138,10 +135,8 @@ func TestAccAWSVPCPeeringConnection_plan(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -166,11 +161,8 @@ func TestAccAWSVPCPeeringConnection_tags(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshName: resourceName, - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckVpcDestroy, Steps: []resource.TestStep{ @@ -232,11 +224,8 @@ func TestAccAWSVPCPeeringConnection_options(t *testing.T) { } resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshName: resourceName, - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -392,10 +381,8 @@ func TestAccAWSVPCPeeringConnection_failedState(t *testing.T) { rName := fmt.Sprintf("tf-testacc-pcx-%s", acctest.RandString(17)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -534,7 +521,6 @@ func TestAccAWSVPCPeeringConnection_peerRegionAutoAccept(t *testing.T) { testAccMultipleRegionPreCheck(t, 2) }, ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshIgnore: []string{"auto_accept"}, ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -557,10 +543,7 @@ func TestAccAWSVPCPeeringConnection_region(t *testing.T) { testAccPreCheck(t) testAccMultipleRegionPreCheck(t, 2) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshName: resourceName, - IDRefreshIgnore: []string{"auto_accept"}, - + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), ProviderFactories: testAccProviderFactoriesAlternate(&providers), CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ @@ -589,11 +572,8 @@ func TestAccAWSVPCPeeringConnection_accept(t *testing.T) { resourceName := "aws_vpc_peering_connection.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), - IDRefreshName: resourceName, - IDRefreshIgnore: []string{"auto_accept"}, - + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSVpcPeeringConnectionDestroy, Steps: []resource.TestStep{ From 61f3768bed64241bcbcbc7754d1d44d56d2215c7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 23 Mar 2021 10:58:09 -0700 Subject: [PATCH 1102/1252] Updates documentation for `automatic_failover_enabled` to remove reference to multi-az and add requirement for `number_cache_clusters` --- website/docs/r/elasticache_replication_group.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index dcd4a62bae5..a441a29b8a5 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -143,10 +143,10 @@ The following arguments are supported: * `replication_group_id` – (Required) The replication group identifier. This parameter is stored as a lowercase string. * `replication_group_description` – (Required) A user-created description for the replication group. -* ``global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. +* `global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. * `number_cache_clusters` - (Optional) The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. One of `number_cache_clusters` or `cluster_mode` is required. * `node_type` - (Optional) The instance class to be used. See AWS documentation for information on [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html) and [guidance on selecting node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes-select-size.html). Required unless `global_replication_group_id` is set. Cannot be set if `global_replication_group_id` is set. -* `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. +* `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If enabled, `number_cache_clusters` must be greater than 1. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. * `multi_az_enabled` - (Optional) Specifies whether to enable Multi-AZ Support for the replication group. If `true`, `automatic_failover_enabled` must also be enabled. Defaults to `false`. * `auto_minor_version_upgrade` - (Optional) Specifies whether a minor engine upgrades will be applied automatically to the underlying Cache Cluster instances during the maintenance window. This parameter is currently not supported by the AWS API. Defaults to `true`. * `availability_zones` - (Optional) A list of EC2 availability zones in which the replication group's cache clusters will be created. The order of the availability zones in the list is not important. From b6e34c1c4e123c9eb1c23c1c8182763727452679 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Tue, 23 Mar 2021 16:50:02 -0400 Subject: [PATCH 1103/1252] tests/provider: Fix and enable AWS SDK Go pointer conversion linting (C resources) (#18335) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12992 Previously: ``` aws/resource_aws_cloud9_environment_ec2.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 132: status := *out.Status aws/resource_aws_cloudfront_distribution_test.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 53: distributionID := *distributionSummary.Id aws/resource_aws_cloudfront_origin_request_policy.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 161: originRequestPolicy := *resp.OriginRequestPolicy.OriginRequestPolicyConfig aws/resource_aws_cloudtrail.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 569: item["read_write_type"] = *raw.ReadWriteType -------------------------------------------------------------------------------- 570: item["include_management_events"] = *raw.IncludeManagementEvents -------------------------------------------------------------------------------- 584: item["type"] = *raw.Type -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 262: if d.Id() == *c.Name { aws/resource_aws_cloudwatch_log_destination.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 142: if *destination.DestinationName == name { aws/resource_aws_cloudwatch_log_metric_filter.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 173: if *mf.FilterName == name { aws/resource_aws_cloudwatch_log_resource_policy.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 107: if *resourcePolicy.PolicyName == name { aws/resource_aws_cloudwatch_log_stream.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 152: if *ls.LogStreamName == name { aws/resource_aws_cloudwatch_metric_alarm.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 310: arn := *resp.AlarmArn -------------------------------------------------------------------------------- 581: flatDims[*d.Name] = *d.Value aws/resource_aws_codedeploy_deployment_group.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 1111: l["key"] = *tf.Key -------------------------------------------------------------------------------- 1114: l["value"] = *tf.Value -------------------------------------------------------------------------------- 1117: l["type"] = *tf.Type -------------------------------------------------------------------------------- 1130: l["key"] = *tf.Key -------------------------------------------------------------------------------- 1133: l["value"] = *tf.Value -------------------------------------------------------------------------------- 1136: l["type"] = *tf.Type -------------------------------------------------------------------------------- 1171: item["trigger_name"] = *tc.TriggerName -------------------------------------------------------------------------------- 1172: item["trigger_target_arn"] = *tc.TriggerTargetArn -------------------------------------------------------------------------------- 1187: item["enabled"] = *config.Enabled -------------------------------------------------------------------------------- 1210: item["enabled"] = *config.Enabled -------------------------------------------------------------------------------- 1211: item["ignore_poll_alarm_failure"] = *config.IgnorePollAlarmFailure -------------------------------------------------------------------------------- 1315: item["deployment_option"] = *style.DeploymentOption -------------------------------------------------------------------------------- 1318: item["deployment_type"] = *style.DeploymentType -------------------------------------------------------------------------------- 1355: deploymentReadyOption["action_on_timeout"] = *config.DeploymentReadyOption.ActionOnTimeout -------------------------------------------------------------------------------- 1358: deploymentReadyOption["wait_time_in_minutes"] = *config.DeploymentReadyOption.WaitTimeInMinutes -------------------------------------------------------------------------------- 1369: greenFleetProvisioningOption["action"] = *config.GreenFleetProvisioningOption.Action -------------------------------------------------------------------------------- 1380: blueInstanceTerminationOption["action"] = *config.TerminateBlueInstancesOnDeploymentSuccess.Action -------------------------------------------------------------------------------- 1383: blueInstanceTerminationOption["termination_wait_time_in_minutes"] = *config.TerminateBlueInstancesOnDeploymentSuccess.TerminationWaitTimeInMinutes -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 1110: if tf.Key != nil && *tf.Key != "" { -------------------------------------------------------------------------------- 1113: if tf.Value != nil && *tf.Value != "" { -------------------------------------------------------------------------------- 1116: if tf.Type != nil && *tf.Type != "" { -------------------------------------------------------------------------------- 1129: if tf.Key != nil && *tf.Key != "" { -------------------------------------------------------------------------------- 1132: if tf.Value != nil && *tf.Value != "" { -------------------------------------------------------------------------------- 1135: if tf.Type != nil && *tf.Type != "" { aws/resource_aws_codepipeline.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 464: m[k] = *v aws/resource_aws_config_remediation_configuration.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 123: item["resource_value"] = *value.ResourceValue.Value -------------------------------------------------------------------------------- 126: item["static_value"] = *value.StaticValue.Values[0] ran 15 rules on 2163 files: 40 findings ``` Output from acceptance testing: ``` --- PASS: TestAccAWSCloud9EnvironmentEc2_allFields (286.70s) --- PASS: TestAccAWSCloud9EnvironmentEc2_basic (209.52s) --- PASS: TestAccAWSCloud9EnvironmentEc2_disappears (170.86s) --- PASS: TestAccAWSCloud9EnvironmentEc2_tags (232.19s) --- PASS: TestAccAWSCloudFrontOriginRequestPolicy_basic (19.69s) --- PASS: TestAccAWSCloudFrontOriginRequestPolicy_noneBehavior (22.64s) --- PASS: TestAccAWSCloudFrontOriginRequestPolicy_update (37.49s) --- FAIL: TestAccAWSCloudTrail_serial (656.14s) --- FAIL: TestAccAWSCloudTrail_serial/Trail (656.14s) --- FAIL: TestAccAWSCloudTrail_serial/Trail/basic (48.14s) # Account permissions --- FAIL: TestAccAWSCloudTrail_serial/Trail/enableLogging (46.70s) # Account permissions --- PASS: TestAccAWSCloudTrail_serial/Trail/cloudwatch (73.41s) --- PASS: TestAccAWSCloudTrail_serial/Trail/eventSelector (138.13s) --- PASS: TestAccAWSCloudTrail_serial/Trail/includeGlobalServiceEvents (35.63s) --- PASS: TestAccAWSCloudTrail_serial/Trail/insightSelector (35.46s) --- PASS: TestAccAWSCloudTrail_serial/Trail/isMultiRegion (91.64s) --- PASS: TestAccAWSCloudTrail_serial/Trail/kmsKey (35.12s) --- PASS: TestAccAWSCloudTrail_serial/Trail/logValidation (65.09s) --- PASS: TestAccAWSCloudTrail_serial/Trail/tags (86.69s) --- SKIP: TestAccAWSCloudTrail_serial/Trail/isOrganization (0.13s) --- PASS: TestAccAWSCloudwatchLogDestination_basic (84.11s) --- PASS: TestAccAWSCloudwatchLogDestination_disappears (88.96s) --- PASS: TestAccAWSCloudWatchLogMetricFilter_basic (92.40s) --- PASS: TestAccAWSCloudWatchLogResourcePolicy_basic (32.98s) --- PASS: TestAccAWSCloudWatchLogStream_basic (21.49s) --- PASS: TestAccAWSCloudWatchLogStream_disappears (20.86s) --- PASS: TestAccAWSCloudWatchLogStream_disappears_LogGroup (20.50s) --- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate (252.05s) --- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic (26.06s) --- PASS: TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction (27.65s) --- PASS: TestAccAWSCloudWatchMetricAlarm_basic (23.92s) --- PASS: TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm (17.54s) --- PASS: TestAccAWSCloudWatchMetricAlarm_disappears (18.25s) --- PASS: TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles (42.33s) --- PASS: TestAccAWSCloudWatchMetricAlarm_expression (96.17s) --- PASS: TestAccAWSCloudWatchMetricAlarm_extendedStatistic (19.08s) --- PASS: TestAccAWSCloudWatchMetricAlarm_missingStatistic (5.29s) --- PASS: TestAccAWSCloudWatchMetricAlarm_tags (62.51s) --- PASS: TestAccAWSCloudWatchMetricAlarm_treatMissingData (42.33s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_create (33.38s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_delete (51.51s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_disable (38.86s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_update (40.28s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_create (43.51s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_delete (61.36s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_disable (42.37s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_update (64.37s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_basic (71.37s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_basic_tagSet (61.98s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_blueGreenDeployment_complete (46.42s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_create (151.03s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_delete (48.72s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update (45.77s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update_with_asg (177.57s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_create (31.64s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_default (31.74s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_delete (45.98s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_update (43.92s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_disappears (30.83s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_ECS_BlueGreen (310.19s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_create (35.95s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_update (54.46s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_create (32.28s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_delete (44.30s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_create (43.70s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_delete (67.73s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_update (45.46s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_update (64.46s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_onPremiseTag (41.70s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_basic (71.08s) --- PASS: TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_multiple (73.36s) --- FAIL: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (83.25s) # https://github.com/hashicorp/terraform-provider-aws/issues/16706 --- PASS: TestAccAWSCodePipeline_basic (72.08s) --- PASS: TestAccAWSCodePipeline_deployWithServiceRole (47.91s) --- PASS: TestAccAWSCodePipeline_disappears (37.13s) --- PASS: TestAccAWSCodePipeline_emptyStageArtifacts (43.65s) --- PASS: TestAccAWSCodePipeline_multiregion_basic (46.08s) --- PASS: TestAccAWSCodePipeline_multiregion_Update (73.72s) --- PASS: TestAccAWSCodePipeline_tags (98.61s) --- PASS: TestAccAWSCodePipeline_WithNamespace (49.41s) --- SKIP: TestAccAWSCodePipeline_WithGitHubv1SourceAction (0.00s) --- PASS: TestAccAWSConfig_serial (3698.82s) --- PASS: TestAccAWSConfig_serial/RemediationConfiguration (364.40s) --- PASS: TestAccAWSConfig_serial/RemediationConfiguration/basic (86.05s) --- PASS: TestAccAWSConfig_serial/RemediationConfiguration/disappears (83.00s) --- PASS: TestAccAWSConfig_serial/RemediationConfiguration/recreates (99.34s) --- PASS: TestAccAWSConfig_serial/RemediationConfiguration/updates (96.01s) ``` --- .semgrep.yml | 2 - aws/resource_aws_cloud9_environment_ec2.go | 8 +-- ...source_aws_cloudfront_distribution_test.go | 4 +- ...ce_aws_cloudfront_origin_request_policy.go | 10 ++- aws/resource_aws_cloudtrail.go | 8 +-- ...resource_aws_cloudwatch_log_destination.go | 2 +- ...source_aws_cloudwatch_log_metric_filter.go | 2 +- ...urce_aws_cloudwatch_log_resource_policy.go | 2 +- aws/resource_aws_cloudwatch_log_stream.go | 2 +- aws/resource_aws_cloudwatch_metric_alarm.go | 4 +- ...esource_aws_codedeploy_deployment_group.go | 62 +++++++++---------- aws/resource_aws_codepipeline.go | 25 ++------ ...ce_aws_config_remediation_configuration.go | 8 +-- 13 files changed, 63 insertions(+), 76 deletions(-) diff --git a/.semgrep.yml b/.semgrep.yml index f783cf4ba45..9fe7fe430bd 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -57,7 +57,6 @@ rules: - aws/cloudfront_distribution_configuration_structure.go - aws/data_source_aws_route_table.go - aws/opsworks_layers.go - - aws/resource_aws_c* - aws/resource_aws_d* - aws/resource_aws_e* - aws/resource_aws_g* @@ -94,7 +93,6 @@ rules: - aws/data_source_aws_route* - aws/ecs_task_definition_equivalency.go - aws/opsworks_layers.go - - aws/resource_aws_c*.go - aws/resource_aws_d*.go - aws/resource_aws_e*.go - aws/resource_aws_g*.go diff --git a/aws/resource_aws_cloud9_environment_ec2.go b/aws/resource_aws_cloud9_environment_ec2.go index 24ddbdf312a..7913cd01403 100644 --- a/aws/resource_aws_cloud9_environment_ec2.go +++ b/aws/resource_aws_cloud9_environment_ec2.go @@ -129,13 +129,13 @@ func resourceAwsCloud9EnvironmentEc2Create(d *schema.ResourceData, meta interfac return 42, "", err } - status := *out.Status - var sErr error + status := aws.StringValue(out.Status) + if status == cloud9.EnvironmentStatusError && out.Message != nil { - sErr = fmt.Errorf("Reason: %s", *out.Message) + return out, status, fmt.Errorf("Reason: %s", aws.StringValue(out.Message)) } - return out, status, sErr + return out, status, nil }, } _, err = stateConf.WaitForState() diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index 97cf9fc4906..94a4110ffd3 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -50,9 +50,9 @@ func testSweepCloudFrontDistributions(region string) error { } for _, distributionSummary := range distributionSummaries { - distributionID := *distributionSummary.Id + distributionID := aws.StringValue(distributionSummary.Id) - if *distributionSummary.Enabled { + if aws.BoolValue(distributionSummary.Enabled) { log.Printf("[WARN] Skipping deletion of enabled CloudFront Distribution: %s", distributionID) continue } diff --git a/aws/resource_aws_cloudfront_origin_request_policy.go b/aws/resource_aws_cloudfront_origin_request_policy.go index 0b5b295302a..b04e490b9c3 100644 --- a/aws/resource_aws_cloudfront_origin_request_policy.go +++ b/aws/resource_aws_cloudfront_origin_request_policy.go @@ -1,6 +1,7 @@ package aws import ( + "fmt" "log" "github.com/aws/aws-sdk-go/aws" @@ -154,11 +155,16 @@ func resourceAwsCloudFrontOriginRequestPolicyRead(d *schema.ResourceData, meta i } if err != nil { - return err + return fmt.Errorf("error reading CloudFront Origin Request Policy (%s): %w", d.Id(), err) + } + + if resp == nil || resp.OriginRequestPolicy == nil || resp.OriginRequestPolicy.OriginRequestPolicyConfig == nil { + return fmt.Errorf("error reading CloudFront Origin Request Policy (%s): empty response", d.Id()) } + d.Set("etag", aws.StringValue(resp.ETag)) - originRequestPolicy := *resp.OriginRequestPolicy.OriginRequestPolicyConfig + originRequestPolicy := resp.OriginRequestPolicy.OriginRequestPolicyConfig d.Set("comment", aws.StringValue(originRequestPolicy.Comment)) d.Set("name", aws.StringValue(originRequestPolicy.Name)) d.Set("cookies_config", flattenCloudFrontOriginRequestPolicyCookiesConfig(originRequestPolicy.CookiesConfig)) diff --git a/aws/resource_aws_cloudtrail.go b/aws/resource_aws_cloudtrail.go index 292cdbdc5cd..7f06c7786ab 100644 --- a/aws/resource_aws_cloudtrail.go +++ b/aws/resource_aws_cloudtrail.go @@ -259,7 +259,7 @@ func resourceAwsCloudTrailRead(d *schema.ResourceData, meta interface{}) error { // you're looking for is not found. Instead, it's simply not in the list. var trail *cloudtrail.Trail for _, c := range resp.TrailList { - if d.Id() == *c.Name { + if d.Id() == aws.StringValue(c.Name) { trail = c } } @@ -566,8 +566,8 @@ func flattenAwsCloudTrailEventSelector(configured []*cloudtrail.EventSelector) [ for _, raw := range configured { item := make(map[string]interface{}) - item["read_write_type"] = *raw.ReadWriteType - item["include_management_events"] = *raw.IncludeManagementEvents + item["read_write_type"] = aws.StringValue(raw.ReadWriteType) + item["include_management_events"] = aws.BoolValue(raw.IncludeManagementEvents) item["data_resource"] = flattenAwsCloudTrailEventSelectorDataResource(raw.DataResources) eventSelectors = append(eventSelectors, item) @@ -581,7 +581,7 @@ func flattenAwsCloudTrailEventSelectorDataResource(configured []*cloudtrail.Data for _, raw := range configured { item := make(map[string]interface{}) - item["type"] = *raw.Type + item["type"] = aws.StringValue(raw.Type) item["values"] = flattenStringList(raw.Values) dataResources = append(dataResources, item) diff --git a/aws/resource_aws_cloudwatch_log_destination.go b/aws/resource_aws_cloudwatch_log_destination.go index 6f32e9b10f2..e986fe0e6a6 100644 --- a/aws/resource_aws_cloudwatch_log_destination.go +++ b/aws/resource_aws_cloudwatch_log_destination.go @@ -139,7 +139,7 @@ func lookupCloudWatchLogDestination(conn *cloudwatchlogs.CloudWatchLogs, } for _, destination := range resp.Destinations { - if *destination.DestinationName == name { + if aws.StringValue(destination.DestinationName) == name { return destination, true, nil } } diff --git a/aws/resource_aws_cloudwatch_log_metric_filter.go b/aws/resource_aws_cloudwatch_log_metric_filter.go index fdef50cd8fa..74aa7ef1b85 100644 --- a/aws/resource_aws_cloudwatch_log_metric_filter.go +++ b/aws/resource_aws_cloudwatch_log_metric_filter.go @@ -170,7 +170,7 @@ func lookupCloudWatchLogMetricFilter(conn *cloudwatchlogs.CloudWatchLogs, } for _, mf := range resp.MetricFilters { - if *mf.FilterName == name { + if aws.StringValue(mf.FilterName) == name { return mf, nil } } diff --git a/aws/resource_aws_cloudwatch_log_resource_policy.go b/aws/resource_aws_cloudwatch_log_resource_policy.go index a089b9459e3..863b9af1388 100644 --- a/aws/resource_aws_cloudwatch_log_resource_policy.go +++ b/aws/resource_aws_cloudwatch_log_resource_policy.go @@ -104,7 +104,7 @@ func lookupCloudWatchLogResourcePolicy(conn *cloudwatchlogs.CloudWatchLogs, } for _, resourcePolicy := range resp.ResourcePolicies { - if *resourcePolicy.PolicyName == name { + if aws.StringValue(resourcePolicy.PolicyName) == name { return resourcePolicy, true, nil } } diff --git a/aws/resource_aws_cloudwatch_log_stream.go b/aws/resource_aws_cloudwatch_log_stream.go index 90d9504f13e..55b205e90b2 100644 --- a/aws/resource_aws_cloudwatch_log_stream.go +++ b/aws/resource_aws_cloudwatch_log_stream.go @@ -149,7 +149,7 @@ func lookupCloudWatchLogStream(conn *cloudwatchlogs.CloudWatchLogs, } for _, ls := range resp.LogStreams { - if *ls.LogStreamName == name { + if aws.StringValue(ls.LogStreamName) == name { return ls, true, nil } } diff --git a/aws/resource_aws_cloudwatch_metric_alarm.go b/aws/resource_aws_cloudwatch_metric_alarm.go index b332886541b..001bf7600ad 100644 --- a/aws/resource_aws_cloudwatch_metric_alarm.go +++ b/aws/resource_aws_cloudwatch_metric_alarm.go @@ -307,7 +307,7 @@ func resourceAwsCloudWatchMetricAlarmRead(d *schema.ResourceData, meta interface if err := d.Set("alarm_actions", flattenStringSet(resp.AlarmActions)); err != nil { log.Printf("[WARN] Error setting Alarm Actions: %s", err) } - arn := *resp.AlarmArn + arn := aws.StringValue(resp.AlarmArn) d.Set("alarm_description", resp.AlarmDescription) d.Set("alarm_name", resp.AlarmName) d.Set("arn", arn) @@ -578,7 +578,7 @@ func getAwsCloudWatchMetricAlarm(d *schema.ResourceData, meta interface{}) (*clo func flattenDimensions(dims []*cloudwatch.Dimension) map[string]interface{} { flatDims := make(map[string]interface{}) for _, d := range dims { - flatDims[*d.Name] = *d.Value + flatDims[aws.StringValue(d.Name)] = aws.StringValue(d.Value) } return flatDims } diff --git a/aws/resource_aws_codedeploy_deployment_group.go b/aws/resource_aws_codedeploy_deployment_group.go index 274741c735c..e105f1ff3c6 100644 --- a/aws/resource_aws_codedeploy_deployment_group.go +++ b/aws/resource_aws_codedeploy_deployment_group.go @@ -1107,14 +1107,14 @@ func ec2TagFiltersToMap(list []*codedeploy.EC2TagFilter) []map[string]interface{ result := make([]map[string]interface{}, 0, len(list)) for _, tf := range list { l := make(map[string]interface{}) - if tf.Key != nil && *tf.Key != "" { - l["key"] = *tf.Key + if v := tf.Key; aws.StringValue(v) != "" { + l["key"] = aws.StringValue(v) } - if tf.Value != nil && *tf.Value != "" { - l["value"] = *tf.Value + if v := tf.Value; aws.StringValue(v) != "" { + l["value"] = aws.StringValue(v) } - if tf.Type != nil && *tf.Type != "" { - l["type"] = *tf.Type + if v := tf.Type; aws.StringValue(v) != "" { + l["type"] = aws.StringValue(v) } result = append(result, l) } @@ -1126,14 +1126,14 @@ func onPremisesTagFiltersToMap(list []*codedeploy.TagFilter) []map[string]string result := make([]map[string]string, 0, len(list)) for _, tf := range list { l := make(map[string]string) - if tf.Key != nil && *tf.Key != "" { - l["key"] = *tf.Key + if v := tf.Key; aws.StringValue(v) != "" { + l["key"] = aws.StringValue(v) } - if tf.Value != nil && *tf.Value != "" { - l["value"] = *tf.Value + if v := tf.Value; aws.StringValue(v) != "" { + l["value"] = aws.StringValue(v) } - if tf.Type != nil && *tf.Type != "" { - l["type"] = *tf.Type + if v := tf.Type; aws.StringValue(v) != "" { + l["type"] = aws.StringValue(v) } result = append(result, l) } @@ -1168,8 +1168,8 @@ func triggerConfigsToMap(list []*codedeploy.TriggerConfig) []map[string]interfac for _, tc := range list { item := make(map[string]interface{}) item["trigger_events"] = flattenStringSet(tc.TriggerEvents) - item["trigger_name"] = *tc.TriggerName - item["trigger_target_arn"] = *tc.TriggerTargetArn + item["trigger_name"] = aws.StringValue(tc.TriggerName) + item["trigger_target_arn"] = aws.StringValue(tc.TriggerTargetArn) result = append(result, item) } return result @@ -1184,7 +1184,7 @@ func autoRollbackConfigToMap(config *codedeploy.AutoRollbackConfiguration) []map // otherwise empty configurations will be created if config != nil && (*config.Enabled || len(config.Events) > 0) { item := make(map[string]interface{}) - item["enabled"] = *config.Enabled + item["enabled"] = aws.BoolValue(config.Enabled) item["events"] = flattenStringSet(config.Events) result = append(result, item) } @@ -1207,8 +1207,8 @@ func alarmConfigToMap(config *codedeploy.AlarmConfiguration) []map[string]interf item := make(map[string]interface{}) item["alarms"] = flattenStringSet(names) - item["enabled"] = *config.Enabled - item["ignore_poll_alarm_failure"] = *config.IgnorePollAlarmFailure + item["enabled"] = aws.BoolValue(config.Enabled) + item["ignore_poll_alarm_failure"] = aws.BoolValue(config.IgnorePollAlarmFailure) result = append(result, item) } @@ -1311,11 +1311,11 @@ func flattenDeploymentStyle(style *codedeploy.DeploymentStyle) []map[string]inte } item := make(map[string]interface{}) - if style.DeploymentOption != nil { - item["deployment_option"] = *style.DeploymentOption + if v := style.DeploymentOption; v != nil { + item["deployment_option"] = aws.StringValue(v) } - if style.DeploymentType != nil { - item["deployment_type"] = *style.DeploymentType + if v := style.DeploymentType; v != nil { + item["deployment_type"] = aws.StringValue(v) } result := make([]map[string]interface{}, 0, 1) @@ -1351,11 +1351,11 @@ func flattenBlueGreenDeploymentConfig(config *codedeploy.BlueGreenDeploymentConf a := make([]map[string]interface{}, 0) deploymentReadyOption := make(map[string]interface{}) - if config.DeploymentReadyOption.ActionOnTimeout != nil { - deploymentReadyOption["action_on_timeout"] = *config.DeploymentReadyOption.ActionOnTimeout + if v := config.DeploymentReadyOption.ActionOnTimeout; v != nil { + deploymentReadyOption["action_on_timeout"] = aws.StringValue(v) } - if config.DeploymentReadyOption.WaitTimeInMinutes != nil { - deploymentReadyOption["wait_time_in_minutes"] = *config.DeploymentReadyOption.WaitTimeInMinutes + if v := config.DeploymentReadyOption.WaitTimeInMinutes; v != nil { + deploymentReadyOption["wait_time_in_minutes"] = aws.Int64Value(v) } m["deployment_ready_option"] = append(a, deploymentReadyOption) @@ -1365,8 +1365,8 @@ func flattenBlueGreenDeploymentConfig(config *codedeploy.BlueGreenDeploymentConf b := make([]map[string]interface{}, 0) greenFleetProvisioningOption := make(map[string]interface{}) - if config.GreenFleetProvisioningOption.Action != nil { - greenFleetProvisioningOption["action"] = *config.GreenFleetProvisioningOption.Action + if v := config.GreenFleetProvisioningOption.Action; v != nil { + greenFleetProvisioningOption["action"] = aws.StringValue(v) } m["green_fleet_provisioning_option"] = append(b, greenFleetProvisioningOption) @@ -1376,11 +1376,11 @@ func flattenBlueGreenDeploymentConfig(config *codedeploy.BlueGreenDeploymentConf c := make([]map[string]interface{}, 0) blueInstanceTerminationOption := make(map[string]interface{}) - if config.TerminateBlueInstancesOnDeploymentSuccess.Action != nil { - blueInstanceTerminationOption["action"] = *config.TerminateBlueInstancesOnDeploymentSuccess.Action + if v := config.TerminateBlueInstancesOnDeploymentSuccess.Action; v != nil { + blueInstanceTerminationOption["action"] = aws.StringValue(v) } - if config.TerminateBlueInstancesOnDeploymentSuccess.TerminationWaitTimeInMinutes != nil { - blueInstanceTerminationOption["termination_wait_time_in_minutes"] = *config.TerminateBlueInstancesOnDeploymentSuccess.TerminationWaitTimeInMinutes + if v := config.TerminateBlueInstancesOnDeploymentSuccess.TerminationWaitTimeInMinutes; v != nil { + blueInstanceTerminationOption["termination_wait_time_in_minutes"] = aws.Int64Value(v) } m["terminate_blue_instances_on_deployment_success"] = append(c, blueInstanceTerminationOption) diff --git a/aws/resource_aws_codepipeline.go b/aws/resource_aws_codepipeline.go index bc0ddb3732c..00101ff30fd 100644 --- a/aws/resource_aws_codepipeline.go +++ b/aws/resource_aws_codepipeline.go @@ -348,7 +348,7 @@ func expandAwsCodePipelineActions(a []interface{}) []*codepipeline.ActionDeclara for _, config := range a { data := config.(map[string]interface{}) - conf := expandAwsCodePipelineStageActionConfiguration(data["configuration"].(map[string]interface{})) + conf := stringMapToPointers(data["configuration"].(map[string]interface{})) action := codepipeline.ActionDeclaration{ ActionTypeId: &codepipeline.ActionTypeId{ @@ -406,7 +406,7 @@ func flattenAwsCodePipelineStageActions(si int, actions []*codepipeline.ActionDe "name": aws.StringValue(action.Name), } if action.Configuration != nil { - config := flattenAwsCodePipelineStageActionConfiguration(action.Configuration) + config := aws.StringValueMap(action.Configuration) actionProvider := aws.StringValue(action.ActionTypeId.Provider) if actionProvider == CodePipelineProviderGitHub { @@ -449,23 +449,6 @@ func flattenAwsCodePipelineStageActions(si int, actions []*codepipeline.ActionDe return actionsList } -func expandAwsCodePipelineStageActionConfiguration(config map[string]interface{}) map[string]*string { - m := map[string]*string{} - for k, v := range config { - s := v.(string) - m[k] = &s - } - return m -} - -func flattenAwsCodePipelineStageActionConfiguration(config map[string]*string) map[string]string { - m := map[string]string{} - for k, v := range config { - m[k] = *v - } - return m -} - func expandAwsCodePipelineActionsOutputArtifacts(s []interface{}) []*codepipeline.OutputArtifact { outputArtifacts := []*codepipeline.OutputArtifact{} for _, artifact := range s { @@ -482,7 +465,7 @@ func expandAwsCodePipelineActionsOutputArtifacts(s []interface{}) []*codepipelin func flattenAwsCodePipelineActionsOutputArtifacts(artifacts []*codepipeline.OutputArtifact) []string { values := []string{} for _, artifact := range artifacts { - values = append(values, *artifact.Name) + values = append(values, aws.StringValue(artifact.Name)) } return values } @@ -503,7 +486,7 @@ func expandAwsCodePipelineActionsInputArtifacts(s []interface{}) []*codepipeline func flattenAwsCodePipelineActionsInputArtifacts(artifacts []*codepipeline.InputArtifact) []string { values := []string{} for _, artifact := range artifacts { - values = append(values, *artifact.Name) + values = append(values, aws.StringValue(artifact.Name)) } return values } diff --git a/aws/resource_aws_config_remediation_configuration.go b/aws/resource_aws_config_remediation_configuration.go index 8a99c0b5338..a7bde0e65fc 100644 --- a/aws/resource_aws_config_remediation_configuration.go +++ b/aws/resource_aws_config_remediation_configuration.go @@ -119,11 +119,11 @@ func flattenRemediationConfigurationParameters(parameters map[string]*configserv for key, value := range parameters { item := make(map[string]interface{}) item["name"] = key - if value.ResourceValue != nil { - item["resource_value"] = *value.ResourceValue.Value + if v := value.ResourceValue; v != nil { + item["resource_value"] = aws.StringValue(v.Value) } - if value.StaticValue != nil && len(value.StaticValue.Values) > 0 { - item["static_value"] = *value.StaticValue.Values[0] + if v := value.StaticValue; v != nil && len(v.Values) > 0 { + item["static_value"] = aws.StringValue(v.Values[0]) } items = append(items, item) From b224038232708939c9096cac65b7dcd4dfe262fc Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Tue, 23 Mar 2021 14:03:18 -0700 Subject: [PATCH 1104/1252] Prevent re-creation when encryption enabled --- ...ource_aws_elasticache_replication_group.go | 4 +- ..._aws_elasticache_replication_group_test.go | 99 ++++++++++++++++++- ...lasticache_replication_group.html.markdown | 2 +- 3 files changed, 98 insertions(+), 7 deletions(-) diff --git a/aws/resource_aws_elasticache_replication_group.go b/aws/resource_aws_elasticache_replication_group.go index 79d3d7b23ce..ae54362f002 100644 --- a/aws/resource_aws_elasticache_replication_group.go +++ b/aws/resource_aws_elasticache_replication_group.go @@ -48,8 +48,8 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { "at_rest_encryption_enabled": { Type: schema.TypeBool, Optional: true, - Default: false, ForceNew: true, + Computed: true, }, "auth_token": { Type: schema.TypeString, @@ -263,8 +263,8 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { "transit_encryption_enabled": { Type: schema.TypeBool, Optional: true, - Default: false, ForceNew: true, + Computed: true, }, "kms_key_id": { Type: schema.TypeString, diff --git a/aws/resource_aws_elasticache_replication_group_test.go b/aws/resource_aws_elasticache_replication_group_test.go index ef29d6a00fb..ebc4c807e56 100644 --- a/aws/resource_aws_elasticache_replication_group_test.go +++ b/aws/resource_aws_elasticache_replication_group_test.go @@ -1444,6 +1444,7 @@ func TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Basic(t *tes var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_elasticache_replication_group.test" + primaryGroupResourceName := "aws_elasticache_replication_group.primary" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -1459,10 +1460,53 @@ func TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Basic(t *tes Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttrPair(resourceName, "global_replication_group_id", "aws_elasticache_global_replication_group.test", "global_replication_group_id"), - resource.TestCheckResourceAttrPair(resourceName, "node_type", "aws_elasticache_replication_group.primary", "node_type"), - resource.TestCheckResourceAttrPair(resourceName, "engine", "aws_elasticache_replication_group.primary", "engine"), - resource.TestCheckResourceAttrPair(resourceName, "engine_version", "aws_elasticache_replication_group.primary", "engine_version"), - resource.TestCheckResourceAttrPair(resourceName, "parameter_group_name", "aws_elasticache_replication_group.primary", "parameter_group_name"), + resource.TestCheckResourceAttrPair(resourceName, "node_type", primaryGroupResourceName, "node_type"), + resource.TestCheckResourceAttrPair(resourceName, "engine", primaryGroupResourceName, "engine"), + resource.TestCheckResourceAttrPair(resourceName, "engine_version", primaryGroupResourceName, "engine_version"), + resource.TestCheckResourceAttrPair(resourceName, "parameter_group_name", primaryGroupResourceName, "parameter_group_name"), + ), + }, + { + Config: testAccAWSElasticacheReplicationGroupConfig_GlobalReplicationGroupId_Basic(rName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, + }, + }) +} + +func TestAccAWSElasticacheReplicationGroup_GlobalReplicationGroupId_Full(t *testing.T) { + var providers []*schema.Provider + var rg elasticache.ReplicationGroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + primaryGroupResourceName := "aws_elasticache_replication_group.primary" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccMultipleRegionPreCheck(t, 2) + }, + ErrorCheck: testAccErrorCheck(t, elasticache.EndpointsID), + ProviderFactories: testAccProviderFactoriesMultipleRegion(&providers, 2), + CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSElasticacheReplicationGroupConfig_GlobalReplicationGroupId_Full(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), + resource.TestCheckResourceAttrPair(resourceName, "global_replication_group_id", "aws_elasticache_global_replication_group.test", "global_replication_group_id"), + resource.TestCheckResourceAttrPair(resourceName, "node_type", primaryGroupResourceName, "node_type"), + resource.TestCheckResourceAttrPair(resourceName, "engine", primaryGroupResourceName, "engine"), + resource.TestCheckResourceAttrPair(resourceName, "engine_version", primaryGroupResourceName, "engine_version"), + resource.TestCheckResourceAttrPair(resourceName, "parameter_group_name", primaryGroupResourceName, "parameter_group_name"), + + resource.TestCheckResourceAttr(resourceName, "port", "16379"), + + resource.TestCheckResourceAttrPair(resourceName, "at_rest_encryption_enabled", primaryGroupResourceName, "at_rest_encryption_enabled"), + resource.TestCheckResourceAttrPair(resourceName, "transit_encryption_enabled", primaryGroupResourceName, "transit_encryption_enabled"), ), }, { @@ -2624,6 +2668,53 @@ resource "aws_elasticache_replication_group" "primary" { `, rName)) } +func testAccAWSElasticacheReplicationGroupConfig_GlobalReplicationGroupId_Full(rName string) string { + return composeConfig( + testAccMultipleRegionProviderConfig(2), + testAccElasticacheVpcBaseWithProvider(rName, "test", ProviderNameAws), + testAccElasticacheVpcBaseWithProvider(rName, "primary", ProviderNameAwsAlternate), + fmt.Sprintf(` +resource "aws_elasticache_replication_group" "test" { + replication_group_id = "%[1]s-s" + replication_group_description = "secondary" + global_replication_group_id = aws_elasticache_global_replication_group.test.global_replication_group_id + + subnet_group_name = aws_elasticache_subnet_group.test.name + + number_cache_clusters = 1 + + port = 16379 +} + +resource "aws_elasticache_global_replication_group" "test" { + provider = awsalternate + + global_replication_group_id_suffix = %[1]q + primary_replication_group_id = aws_elasticache_replication_group.primary.id +} + +resource "aws_elasticache_replication_group" "primary" { + provider = awsalternate + + replication_group_id = "%[1]s-p" + replication_group_description = "primary" + + subnet_group_name = aws_elasticache_subnet_group.primary.name + + node_type = "cache.m5.large" + + engine = "redis" + engine_version = "5.0.6" + number_cache_clusters = 1 + + port = 6379 + + at_rest_encryption_enabled = true + transit_encryption_enabled = true +} +`, rName)) +} + func resourceAwsElasticacheReplicationGroupDisableAutomaticFailover(conn *elasticache.ElastiCache, replicationGroupID string, timeout time.Duration) error { return resourceAwsElasticacheReplicationGroupModify(conn, timeout, &elasticache.ModifyReplicationGroupInput{ ReplicationGroupId: aws.String(replicationGroupID), diff --git a/website/docs/r/elasticache_replication_group.html.markdown b/website/docs/r/elasticache_replication_group.html.markdown index dcd4a62bae5..6ffa56df96b 100644 --- a/website/docs/r/elasticache_replication_group.html.markdown +++ b/website/docs/r/elasticache_replication_group.html.markdown @@ -143,7 +143,7 @@ The following arguments are supported: * `replication_group_id` – (Required) The replication group identifier. This parameter is stored as a lowercase string. * `replication_group_description` – (Required) A user-created description for the replication group. -* ``global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. +* `global_replication_group_id` - (Optional) The ID of the global replication group to which this replication group should belong. If this parameter is specified, the replication group is added to the specified global replication group as a secondary replication group; otherwise, the replication group is not part of any global replication group. * `number_cache_clusters` - (Optional) The number of cache clusters (primary and replicas) this replication group will have. If Multi-AZ is enabled, the value of this parameter must be at least 2. Updates will occur before other modifications. One of `number_cache_clusters` or `cluster_mode` is required. * `node_type` - (Optional) The instance class to be used. See AWS documentation for information on [supported node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html) and [guidance on selecting node types](https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes-select-size.html). Required unless `global_replication_group_id` is set. Cannot be set if `global_replication_group_id` is set. * `automatic_failover_enabled` - (Optional) Specifies whether a read-only replica will be automatically promoted to read/write primary if the existing primary fails. If true, Multi-AZ is enabled for this replication group. If false, Multi-AZ is disabled for this replication group. Must be enabled for Redis (cluster mode enabled) replication groups. Defaults to `false`. From 155ee8db4ec6e73f2948a9942f7966f6f6e34364 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Fri, 12 Mar 2021 16:09:24 +0100 Subject: [PATCH 1105/1252] r/aws_mq_configuration: add missing authentication_strategy When creating an ActiveMQ instance with authentication_strategy=ldap, then the corresponding configuration has to contain the same option as well for the user to be able to include a cachedLDAPAuthorizationMap element in the broker xml configuration. If the option is not provided when creating the configuration, the default strategy "simple" is assumed and AWS automatically removes the cachedLDAPAuthorizationMap element. --- aws/resource_aws_mq_configuration.go | 10 +++ aws/resource_aws_mq_configuration_test.go | 61 +++++++++++++++++++ website/docs/r/mq_configuration.html.markdown | 1 + 3 files changed, 72 insertions(+) diff --git a/aws/resource_aws_mq_configuration.go b/aws/resource_aws_mq_configuration.go index 7ac2056d1b3..eb5dbac10ca 100644 --- a/aws/resource_aws_mq_configuration.go +++ b/aws/resource_aws_mq_configuration.go @@ -42,6 +42,12 @@ func resourceAwsMqConfiguration() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "authentication_strategy": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(mq.AuthenticationStrategy_Values(), true), + }, "data": { Type: schema.TypeString, Required: true, @@ -87,6 +93,9 @@ func resourceAwsMqConfigurationCreate(d *schema.ResourceData, meta interface{}) Name: aws.String(d.Get("name").(string)), } + if v, ok := d.GetOk("authentication_strategy"); ok { + input.AuthenticationStrategy = aws.String(v.(string)) + } if v, ok := d.GetOk("tags"); ok { input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().MqTags() } @@ -121,6 +130,7 @@ func resourceAwsMqConfigurationRead(d *schema.ResourceData, meta interface{}) er } d.Set("arn", out.Arn) + d.Set("authentication_strategy", out.AuthenticationStrategy) d.Set("description", out.LatestRevision.Description) d.Set("engine_type", out.EngineType) d.Set("engine_version", out.EngineVersion) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index b013163bfff..06122ec7578 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -27,6 +27,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), + resource.TestCheckResourceAttr(resourceName, "authentication_strategy", "simple"), resource.TestCheckResourceAttr(resourceName, "description", "TfAccTest MQ Configuration"), resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), @@ -86,6 +87,37 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { }) } +func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { + configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_mq_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMqConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMqConfigurationWithLdapDataConfig(configurationName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMqConfigurationExists(resourceName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), + resource.TestCheckResourceAttr(resourceName, "authentication_strategy", "ldap"), + resource.TestCheckResourceAttr(resourceName, "description", "TfAccTest MQ Configuration"), + resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), + resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), + resource.TestCheckResourceAttr(resourceName, "latest_revision", "2"), + resource.TestCheckResourceAttr(resourceName, "name", configurationName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSMqConfiguration_updateTags(t *testing.T) { configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) resourceName := "aws_mq_configuration.test" @@ -176,6 +208,7 @@ resource "aws_mq_configuration" "test" { name = "%s" engine_type = "ActiveMQ" engine_version = "5.15.0" + authentication_strategy = "simple" data = < @@ -238,6 +271,34 @@ DATA `, configurationName) } +func testAccMqConfigurationWithLdapDataConfig(configurationName string) string { + return fmt.Sprintf(` +resource "aws_mq_configuration" "test" { + description = "TfAccTest MQ Configuration" + name = "%s" + engine_type = "ActiveMQ" + engine_version = "5.15.0" + authentication_strategy = "ldap" + + data = < + + + + + + + + + + + + +DATA +} +`, configurationName) +} + func testAccMqConfigurationConfig_updateTags1(configurationName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { diff --git a/website/docs/r/mq_configuration.html.markdown b/website/docs/r/mq_configuration.html.markdown index f3f86890923..08235e94ac2 100644 --- a/website/docs/r/mq_configuration.html.markdown +++ b/website/docs/r/mq_configuration.html.markdown @@ -45,6 +45,7 @@ The following arguments are supported: * `engine_type` - (Required) The type of broker engine. * `engine_version` - (Required) The version of the broker engine. * `name` - (Required) The name of the configuration +* `authentication_strategy` - (Optional) The authentication strategy associated with the configuration. Valid values are `simple` and `ldap`. `ldap` is not supported for `engine_type` `RabbitMQ`. * `tags` - (Optional) A map of tags to assign to the resource. ## Attributes Reference From 2850d10128704a3ae514e938f4cb1d3046887ef3 Mon Sep 17 00:00:00 2001 From: Andreas Granig Date: Fri, 12 Mar 2021 16:29:53 +0100 Subject: [PATCH 1106/1252] Fix terraform test configuration format --- aws/resource_aws_mq_configuration_test.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index 06122ec7578..ff771c26c82 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -204,10 +204,10 @@ func testAccCheckAwsMqConfigurationExists(name string) resource.TestCheckFunc { func testAccMqConfigurationConfig(configurationName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { - description = "TfAccTest MQ Configuration" - name = "%s" - engine_type = "ActiveMQ" - engine_version = "5.15.0" + description = "TfAccTest MQ Configuration" + name = "%s" + engine_type = "ActiveMQ" + engine_version = "5.15.0" authentication_strategy = "simple" data = < Date: Fri, 12 Mar 2021 16:34:47 +0100 Subject: [PATCH 1107/1252] Add PR changelog file. --- .changelog/18070.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18070.txt diff --git a/.changelog/18070.txt b/.changelog/18070.txt new file mode 100644 index 00000000000..446e85ebd69 --- /dev/null +++ b/.changelog/18070.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_mq_configuration: Add missing `authentication_strategy` option to be able to add ldap authentication options +``` From e889eaa84cd404046353fc6b7524911614eab331 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:31:38 -0400 Subject: [PATCH 1108/1252] mq_configuration: Update changelog --- .changelog/18070.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/18070.txt b/.changelog/18070.txt index 446e85ebd69..b98c495dd80 100644 --- a/.changelog/18070.txt +++ b/.changelog/18070.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_mq_configuration: Add missing `authentication_strategy` option to be able to add ldap authentication options +resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ``` From 580e6b0352cf07092a52599aee17090a6c04607a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:32:09 -0400 Subject: [PATCH 1109/1252] tests/mq_configuration: Add ErrorCheck --- aws/resource_aws_mq_configuration_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index ff771c26c82..f6842b5fed3 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -93,6 +93,7 @@ func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ From 3c7d16d91431581e5ced26da4a5c7a19416e65b6 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:33:06 -0400 Subject: [PATCH 1110/1252] r/mq_configuration: Add RabbitMQ engine type, minor cleanup --- aws/resource_aws_mq_configuration.go | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/aws/resource_aws_mq_configuration.go b/aws/resource_aws_mq_configuration.go index eb5dbac10ca..b3d8f837e0b 100644 --- a/aws/resource_aws_mq_configuration.go +++ b/aws/resource_aws_mq_configuration.go @@ -58,12 +58,10 @@ func resourceAwsMqConfiguration() *schema.Resource { Optional: true, }, "engine_type": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - mq.EngineTypeActivemq, - }, true), + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(mq.EngineType_Values(), true), }, "engine_version": { Type: schema.TypeString, @@ -134,8 +132,8 @@ func resourceAwsMqConfigurationRead(d *schema.ResourceData, meta interface{}) er d.Set("description", out.LatestRevision.Description) d.Set("engine_type", out.EngineType) d.Set("engine_version", out.EngineVersion) - d.Set("name", out.Name) d.Set("latest_revision", out.LatestRevision.Revision) + d.Set("name", out.Name) rOut, err := conn.DescribeConfigurationRevision(&mq.DescribeConfigurationRevisionInput{ ConfigurationId: aws.String(d.Id()), From cdbd9b789a5fdaa9258969e27efaecc64aee8e85 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:42:28 -0400 Subject: [PATCH 1111/1252] tests/r/mq_configuration: Standardized naming --- aws/resource_aws_mq_configuration_test.go | 72 +++++++++++------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index f6842b5fed3..e03b226272e 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -13,7 +13,7 @@ import ( ) func TestAccAWSMqConfiguration_basic(t *testing.T) { - configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ @@ -23,7 +23,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccMqConfigurationConfig(configurationName), + Config: testAccMqConfigurationConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), @@ -32,7 +32,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), resource.TestCheckResourceAttr(resourceName, "latest_revision", "2"), - resource.TestCheckResourceAttr(resourceName, "name", configurationName), + resource.TestCheckResourceAttr(resourceName, "name", rName), ), }, { @@ -41,7 +41,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccMqConfigurationConfig_descriptionUpdated(configurationName), + Config: testAccMqConfigurationConfig_descriptionUpdated(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), @@ -49,7 +49,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), resource.TestCheckResourceAttr(resourceName, "latest_revision", "3"), - resource.TestCheckResourceAttr(resourceName, "name", configurationName), + resource.TestCheckResourceAttr(resourceName, "name", rName), ), }, }, @@ -57,7 +57,7 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { } func TestAccAWSMqConfiguration_withData(t *testing.T) { - configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ @@ -67,7 +67,7 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccMqConfigurationWithDataConfig(configurationName), + Config: testAccMqConfigurationWithDataConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), @@ -75,7 +75,7 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), resource.TestCheckResourceAttr(resourceName, "latest_revision", "2"), - resource.TestCheckResourceAttr(resourceName, "name", configurationName), + resource.TestCheckResourceAttr(resourceName, "name", rName), ), }, { @@ -88,7 +88,7 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { } func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { - configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ @@ -98,7 +98,7 @@ func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccMqConfigurationWithLdapDataConfig(configurationName), + Config: testAccMqConfigurationWithLdapDataConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mq", regexp.MustCompile(`configuration:+.`)), @@ -107,7 +107,7 @@ func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "engine_type", "ActiveMQ"), resource.TestCheckResourceAttr(resourceName, "engine_version", "5.15.0"), resource.TestCheckResourceAttr(resourceName, "latest_revision", "2"), - resource.TestCheckResourceAttr(resourceName, "name", configurationName), + resource.TestCheckResourceAttr(resourceName, "name", rName), ), }, { @@ -120,7 +120,7 @@ func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { } func TestAccAWSMqConfiguration_updateTags(t *testing.T) { - configurationName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ @@ -130,7 +130,7 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) { CheckDestroy: testAccCheckAwsMqConfigurationDestroy, Steps: []resource.TestStep{ { - Config: testAccMqConfigurationConfig_updateTags1(configurationName), + Config: testAccMqConfigurationConfig_updateTags1(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -143,7 +143,7 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccMqConfigurationConfig_updateTags2(configurationName), + Config: testAccMqConfigurationConfig_updateTags2(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -152,7 +152,7 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) { ), }, { - Config: testAccMqConfigurationConfig_updateTags3(configurationName), + Config: testAccMqConfigurationConfig_updateTags3(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAwsMqConfigurationExists(resourceName), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -202,11 +202,11 @@ func testAccCheckAwsMqConfigurationExists(name string) resource.TestCheckFunc { } } -func testAccMqConfigurationConfig(configurationName string) string { +func testAccMqConfigurationConfig(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" authentication_strategy = "simple" @@ -217,14 +217,14 @@ resource "aws_mq_configuration" "test" { DATA } -`, configurationName) +`, rName) } -func testAccMqConfigurationConfig_descriptionUpdated(configurationName string) string { +func testAccMqConfigurationConfig_descriptionUpdated(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration Updated" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" @@ -234,14 +234,14 @@ resource "aws_mq_configuration" "test" { DATA } -`, configurationName) +`, rName) } -func testAccMqConfigurationWithDataConfig(configurationName string) string { +func testAccMqConfigurationWithDataConfig(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" @@ -269,14 +269,14 @@ resource "aws_mq_configuration" "test" { DATA } -`, configurationName) +`, rName) } -func testAccMqConfigurationWithLdapDataConfig(configurationName string) string { +func testAccMqConfigurationWithLdapDataConfig(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" authentication_strategy = "ldap" @@ -297,14 +297,14 @@ resource "aws_mq_configuration" "test" { DATA } -`, configurationName) +`, rName) } -func testAccMqConfigurationConfig_updateTags1(configurationName string) string { +func testAccMqConfigurationConfig_updateTags1(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" @@ -318,14 +318,14 @@ DATA env = "test" } } -`, configurationName) +`, rName) } -func testAccMqConfigurationConfig_updateTags2(configurationName string) string { +func testAccMqConfigurationConfig_updateTags2(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" @@ -340,14 +340,14 @@ DATA role = "test-role" } } -`, configurationName) +`, rName) } -func testAccMqConfigurationConfig_updateTags3(configurationName string) string { +func testAccMqConfigurationConfig_updateTags3(rName string) string { return fmt.Sprintf(` resource "aws_mq_configuration" "test" { description = "TfAccTest MQ Configuration" - name = "%s" + name = %[1]q engine_type = "ActiveMQ" engine_version = "5.15.0" @@ -361,5 +361,5 @@ DATA role = "test-role" } } -`, configurationName) +`, rName) } From 0cf6877f1656237505c7172ef307e64704dfbbb0 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:43:09 -0400 Subject: [PATCH 1112/1252] docs/r/mq_configuration: Minor cleanup of docs --- website/docs/r/mq_configuration.html.markdown | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/website/docs/r/mq_configuration.html.markdown b/website/docs/r/mq_configuration.html.markdown index 08235e94ac2..26a17bd6782 100644 --- a/website/docs/r/mq_configuration.html.markdown +++ b/website/docs/r/mq_configuration.html.markdown @@ -36,25 +36,26 @@ DATA ## Argument Reference -The following arguments are supported: - -* `data` - (Required) The broker configuration in XML format. - See [official docs](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-configuration-parameters.html) - for supported parameters and format of the XML. -* `description` - (Optional) The description of the configuration. -* `engine_type` - (Required) The type of broker engine. -* `engine_version` - (Required) The version of the broker engine. -* `name` - (Required) The name of the configuration -* `authentication_strategy` - (Optional) The authentication strategy associated with the configuration. Valid values are `simple` and `ldap`. `ldap` is not supported for `engine_type` `RabbitMQ`. -* `tags` - (Optional) A map of tags to assign to the resource. +The following arguments are required: + +* `data` - (Required) Broker configuration in XML format. See [official docs](https://docs.aws.amazon.com/amazon-mq/latest/developer-guide/amazon-mq-broker-configuration-parameters.html) for supported parameters and format of the XML. +* `engine_type` - (Required) Type of broker engine. Valid values are `ActiveMQ` and `RabbitMQ`. +* `engine_version` - (Required) Version of the broker engine. +* `name` - (Required) Name of the configuration. + +The following arguments are optional: + +* `authentication_strategy` - (Optional) Authentication strategy associated with the configuration. Valid values are `simple` and `ldap`. `ldap` is not supported for `engine_type` `RabbitMQ`. +* `description` - (Optional) Description of the configuration. +* `tags` - (Optional) Map of tags to assign to the resource. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `id` - The unique ID that Amazon MQ generates for the configuration. -* `arn` - The ARN of the configuration. -* `latest_revision` - The latest revision of the configuration. +* `arn` - ARN of the configuration. +* `id` - Unique ID that Amazon MQ generates for the configuration. +* `latest_revision` - Latest revision of the configuration. ## Import From e1850daec2ae7a068025baaa72145a0fdbcc3535 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 23 Mar 2021 14:11:47 -0400 Subject: [PATCH 1113/1252] Add 'semgrep' target. --- GNUmakefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile index 61a0304aa75..bca66a9555f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -154,4 +154,8 @@ website-lint-fix: @docker run -v $(PWD):/markdown 06kellyjac/markdownlint-cli --fix website/docs/ @terrafmt fmt ./website --pattern '*.markdown' -.PHONY: awsproviderlint build gen generate-changelog golangci-lint sweep test testacc fmt fmtcheck lint tools test-compile website-link-check website-lint website-lint-fix depscheck docscheck +semgrep: + @echo "==> Running Semgrep static analysis..." + @docker run --rm --volume "${PWD}:/src" returntocorp/semgrep --config .semgrep.yml + +.PHONY: awsproviderlint build gen generate-changelog golangci-lint sweep test testacc fmt fmtcheck lint tools test-compile website-link-check website-lint website-lint-fix depscheck docscheck semgrep From eca06c0727375c8fbe9208b457e9a88d13745803 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 11:52:47 -0400 Subject: [PATCH 1114/1252] tests/r/mq_configuration: Add partition service PreCheck --- aws/resource_aws_mq_configuration_test.go | 24 +++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_mq_configuration_test.go b/aws/resource_aws_mq_configuration_test.go index e03b226272e..8c62234154a 100644 --- a/aws/resource_aws_mq_configuration_test.go +++ b/aws/resource_aws_mq_configuration_test.go @@ -17,7 +17,11 @@ func TestAccAWSMqConfiguration_basic(t *testing.T) { resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(mq.EndpointsID, t) + testAccPreCheckAWSMq(t) + }, ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, @@ -61,7 +65,11 @@ func TestAccAWSMqConfiguration_withData(t *testing.T) { resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(mq.EndpointsID, t) + testAccPreCheckAWSMq(t) + }, ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, @@ -92,7 +100,11 @@ func TestAccAWSMqConfiguration_withLdapData(t *testing.T) { resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(mq.EndpointsID, t) + testAccPreCheckAWSMq(t) + }, ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, @@ -124,7 +136,11 @@ func TestAccAWSMqConfiguration_updateTags(t *testing.T) { resourceName := "aws_mq_configuration.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(mq.EndpointsID, t) + testAccPreCheckAWSMq(t) + }, ErrorCheck: testAccErrorCheck(t, mq.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAwsMqConfigurationDestroy, From c869f7a8a75794a5c9b6be5b669ff5ba6fdb22c1 Mon Sep 17 00:00:00 2001 From: Alexey Mikhailov Date: Fri, 10 Aug 2018 13:40:03 +0700 Subject: [PATCH 1115/1252] support lightsail open ports resource --- aws/provider.go | 1 + aws/resource_aws_lightsail_public_ports.go | 121 +++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100644 aws/resource_aws_lightsail_public_ports.go diff --git a/aws/provider.go b/aws/provider.go index 5e652ec39ba..ead0d4858d7 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -821,6 +821,7 @@ func Provider() *schema.Provider { "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), + "aws_lightsail_public_ports": resourceAwsLightsailPublicPorts(), "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), diff --git a/aws/resource_aws_lightsail_public_ports.go b/aws/resource_aws_lightsail_public_ports.go new file mode 100644 index 00000000000..752eff78ec9 --- /dev/null +++ b/aws/resource_aws_lightsail_public_ports.go @@ -0,0 +1,121 @@ +package aws + +import ( + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/lightsail" + "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform/helper/validation" +) + +func resourceAwsLightsailPublicPorts() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsLightsailPublicPortsCreate, + Read: resourceAwsLightsailPublicPortsRead, + Delete: resourceAwsLightsailPublicPortsDelete, + + Schema: map[string]*schema.Schema{ + "instance_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "port_infos": { + Type: schema.TypeList, + Required: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "from_port": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65535), + }, + "to_port": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65535), + }, + "protocol": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + lightsail.NetworkProtocolUdp, + lightsail.NetworkProtocolTcp, + }, false), + }, + }, + }, + }, + }, + } +} + +func buildAwsLightsailPortInfos(info []interface{}) []*lightsail.PortInfo { + if len(info) == 0 { + return nil + } + + var portInfos []*lightsail.PortInfo + + for _, v := range info { + m := v.(map[string]interface{}) + portInfos = append(portInfos, &lightsail.PortInfo{ + FromPort: aws.Int64((int64)(m["from_port"].(int))), + ToPort: aws.Int64((int64)(m["to_port"].(int))), + Protocol: aws.String(m["protocol"].(string)), + }) + } + return portInfos +} + +func resourceAwsLightsailPublicPortsCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + _, err := conn.PutInstancePublicPorts(&lightsail.PutInstancePublicPortsInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + PortInfos: buildAwsLightsailPortInfos(d.Get("port_infos").([]interface{})), + }) + + if err != nil { + return err + } + + return resourceAwsLightsailPublicPortsRead(d, meta) +} + +func resourceAwsLightsailPublicPortsRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + _, err := conn.GetInstancePortStates(&lightsail.GetInstancePortStatesInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + }) + + if err != nil { + if awsErr, ok := err.(awserr.Error); ok { + if awsErr.Code() == "NotFoundException" { + log.Printf("[WARN] Lightsail Instance (%s) not found, removing from state", d.Get("instance_name")) + return nil + } + return err + } + return err + } + + return nil +} + +func resourceAwsLightsailPublicPortsDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + _, err := conn.PutInstancePublicPorts(&lightsail.PutInstancePublicPortsInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + }) + + if err != nil { + return err + } + return nil +} From 9c10042780b0740a7847a9cc198ead4105dd30b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 Mar 2021 14:45:05 -0400 Subject: [PATCH 1116/1252] build(deps): bump github.com/bflad/tfproviderlint from 0.23.0 to 0.24.0 in /awsproviderlint (#18368) * build(deps): bump github.com/bflad/tfproviderlint in /awsproviderlint Bumps [github.com/bflad/tfproviderlint](https://github.com/bflad/tfproviderlint) from 0.23.0 to 0.24.0. - [Release notes](https://github.com/bflad/tfproviderlint/releases) - [Changelog](https://github.com/bflad/tfproviderlint/blob/main/CHANGELOG.md) - [Commits](https://github.com/bflad/tfproviderlint/compare/v0.23.0...v0.24.0) Signed-off-by: dependabot[bot] * tests/provider: Disable new failing tfproviderlint reports for now Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18354 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18377 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18378 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18379 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18380 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18381 Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brian Flad --- GNUmakefile | 6 + awsproviderlint/go.mod | 2 +- awsproviderlint/go.sum | 4 +- .../tfproviderlint/passes/AT010/AT010.go | 48 ++++++ .../tfproviderlint/passes/AT010/README.md | 70 ++++++++ .../tfproviderlint/passes/AT011/AT011.go | 53 ++++++ .../tfproviderlint/passes/AT011/README.md | 91 +++++++++++ .../tfproviderlint/passes/AT012/AT012.go | 118 ++++++++++++++ .../tfproviderlint/passes/AT012/README.md | 37 +++++ .../tfproviderlint/passes/V011/README.md | 50 ++++++ .../bflad/tfproviderlint/passes/V011/V011.go | 139 ++++++++++++++++ .../tfproviderlint/passes/V012/README.md | 50 ++++++ .../bflad/tfproviderlint/passes/V012/V012.go | 153 ++++++++++++++++++ .../tfproviderlint/passes/V013/README.md | 50 ++++++ .../bflad/tfproviderlint/passes/V013/V013.go | 126 +++++++++++++++ .../tfproviderlint/passes/V014/README.md | 50 ++++++ .../bflad/tfproviderlint/passes/V014/V014.go | 152 +++++++++++++++++ .../bflad/tfproviderlint/passes/checks.go | 14 ++ awsproviderlint/vendor/modules.txt | 9 +- 19 files changed, 1218 insertions(+), 4 deletions(-) create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/AT010.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/AT011.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/AT012.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/V011.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/V012.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/V013.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/V014.go diff --git a/GNUmakefile b/GNUmakefile index 61a0304aa75..7dfcac5e569 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -93,12 +93,18 @@ awsproviderlint: -c 1 \ -AWSAT006=false \ -AWSV001=false \ + -AT010=false \ + -AT012=false \ -R001=false \ -R010=false \ -R018=false \ -R019=false \ -V001=false \ -V009=false \ + -V011=false \ + -V012=false \ + -V013=false \ + -V014=false \ -XR001=false \ -XR002=false \ -XR003=false \ diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index ab28968475b..3a3a1e88184 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/aws/aws-sdk-go v1.38.0 - github.com/bflad/tfproviderlint v0.23.0 + github.com/bflad/tfproviderlint v0.24.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb ) diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index 03b7ac4aa61..3c0b0bacd6f 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -62,8 +62,8 @@ github.com/aws/aws-sdk-go v1.38.0 h1:mqnmtdW8rGIQmp2d0WRFLua0zW0Pel0P6/vd3gJuViY github.com/aws/aws-sdk-go v1.38.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= 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.23.0 h1:Hj024L2wjqqsI0ISJIfWua14r4VlBkLoZDQFmpOTEn4= -github.com/bflad/tfproviderlint v0.23.0/go.mod h1:hvNY+Nthz7T/LHmycyyBfgfHvtmkHVgZTwfVD89er3U= +github.com/bflad/tfproviderlint v0.24.0 h1:q7nuajx5fjlaH4L4DUDoNlME+MkaHUHDv5d20qmXJ6Y= +github.com/bflad/tfproviderlint v0.24.0/go.mod h1:hvNY+Nthz7T/LHmycyyBfgfHvtmkHVgZTwfVD89er3U= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/AT010.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/AT010.go new file mode 100644 index 00000000000..efe21e2f302 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/AT010.go @@ -0,0 +1,48 @@ +package AT010 + +import ( + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for TestCase including IDRefreshName implementation + +The AT010 analyzer reports likely extraneous use of ID-only refresh testing. +Most resources should prefer to include a TestStep with ImportState instead +since it will cover the same testing functionality along with verifying +resource import support.` + +const analyzerName = "AT010" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testcaseinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + testCases := pass.ResultOf[testcaseinfo.Analyzer].([]*resource.TestCaseInfo) + + for _, testCase := range testCases { + field, ok := testCase.Fields[resource.TestCaseFieldIDRefreshName] + + if !ok || field == nil { + continue + } + + if ignorer.ShouldIgnore(analyzerName, field) { + continue + } + + pass.Reportf(field.Pos(), "%s: prefer TestStep ImportState testing over TestCase IDRefreshName", analyzerName) + } + + return nil, nil +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/README.md new file mode 100644 index 00000000000..8d1c912e38b --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT010/README.md @@ -0,0 +1,70 @@ +# AT010 + +The AT010 analyzer reports likely extraneous use of ID-only refresh testing. Most resources should prefer to include a `TestStep` with `ImportState` instead since it will cover the same testing functionality along with verifying resource import support. + +## Flagged Code + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + IDRefreshName: "example_thing.test", + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + { + Config: testAccExampleThingConfig(), + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT010` Go code comment on the line immediately proceding, e.g. + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + //lintignore:AT010 + IDRefreshName: "example_thing.test", + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/AT011.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/AT011.go new file mode 100644 index 00000000000..da834d66710 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/AT011.go @@ -0,0 +1,53 @@ +package AT011 + +import ( + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for TestCase including IDRefreshIgnore implementation without IDRefreshName + +The AT011 analyzer reports likely extraneous use of ID-only refresh testing. +Most resources should prefer to include a TestStep with ImportState instead +since it will cover the same testing functionality along with verifying +resource import support. + +However for cases where IDRefreshName is being already being used, the +IDRefreshIgnore field is considered valid. If IDRefreshName is not being used, +then this analyzer will return a report. +` + +const analyzerName = "AT011" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testcaseinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + testCases := pass.ResultOf[testcaseinfo.Analyzer].([]*resource.TestCaseInfo) + + for _, testCase := range testCases { + field, ok := testCase.Fields[resource.TestCaseFieldIDRefreshIgnore] + + if !ok || field == nil || testCase.DeclaresField(resource.TestCaseFieldIDRefreshName) { + continue + } + + if ignorer.ShouldIgnore(analyzerName, field) { + continue + } + + pass.Reportf(field.Pos(), "%s: extraneous TestCase IDRefreshIgnore without IDRefreshName", analyzerName) + } + + return nil, nil +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/README.md new file mode 100644 index 00000000000..49865aa4e50 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT011/README.md @@ -0,0 +1,91 @@ +# AT011 + +The AT011 analyzer reports likely extraneous use of ID-only refresh testing. Most resources should prefer to include a `TestStep` with `ImportState` instead since it will cover the same testing functionality along with verifying resource import support. + +However for cases where `IDRefreshName` is being already being used, the `IDRefreshIgnore` field is considered valid. If `IDRefreshName` is not being used, then this analyzer will return a report. + +## Flagged Code + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + IDRefreshIgnore: []string{"attr1"}, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + { + Config: testAccExampleThingConfig(), + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// ... or ... + +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + IDRefreshName: "example_thing.test", + IDRefreshIgnore: []string{"attr1"}, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT011` Go code comment on the line immediately proceding, e.g. + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + //lintignore:AT011 + IDRefreshIgnore: []string{"attr1"}, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/AT012.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/AT012.go new file mode 100644 index 00000000000..ae696f554ab --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/AT012.go @@ -0,0 +1,118 @@ +package AT012 + +import ( + "flag" + "go/ast" + "go/token" + "path/filepath" + "strings" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for test files containing multiple acceptance test function name prefixes + +The AT012 analyzer reports likely incorrect uses of multiple TestAcc function +name prefixes up to the conventional underscore (_) prefix separator within +the same file. Typically, Terraform acceptance tests should use the same naming +prefix within one test file so testers can easily run all acceptance tests for +the file and not miss associated tests. + +Optional parameters: + - ignored-filenames Comma-separated list of file names to ignore, defaults to none.` + +const ( + acceptanceTestNameSeparator = "_" + + analyzerName = "AT012" +) + +var ( + ignoredFilenames string +) + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Flags: parseFlags(), + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testaccfuncdecl.Analyzer, + }, + Run: run, +} + +func isFilenameIgnored(fileName string, fileNameList string) bool { + prefixes := strings.Split(fileNameList, ",") + + for _, prefix := range prefixes { + if strings.HasPrefix(fileName, prefix) { + return true + } + } + return false +} + +func parseFlags() flag.FlagSet { + var flags = flag.NewFlagSet(analyzerName, flag.ExitOnError) + flags.StringVar(&ignoredFilenames, "ignored-filenames", "", "Comma-separated list of file names to ignore") + return *flags +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + funcDecls := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) + + fileFuncDecls := make(map[*token.File][]*ast.FuncDecl) + + for _, funcDecl := range funcDecls { + file := pass.Fset.File(funcDecl.Pos()) + fileName := filepath.Base(file.Name()) + + if ignoredFilenames != "" && isFilenameIgnored(fileName, ignoredFilenames) { + continue + } + + if ignorer.ShouldIgnore(analyzerName, funcDecl) { + continue + } + + fileFuncDecls[file] = append(fileFuncDecls[file], funcDecl) + } + + for file, funcDecls := range fileFuncDecls { + // Map to simplify checking + funcNamePrefixes := make(map[string]struct{}) + + for _, funcDecl := range funcDecls { + funcName := funcDecl.Name.Name + + funcNamePrefixParts := strings.SplitN(funcName, acceptanceTestNameSeparator, 2) + + // Ensure function name includes separator + if len(funcNamePrefixParts) != 2 || funcNamePrefixParts[0] == "" || funcNamePrefixParts[1] == "" { + continue + } + + funcNamePrefix := funcNamePrefixParts[0] + + funcNamePrefixes[funcNamePrefix] = struct{}{} + } + + if len(funcNamePrefixes) <= 1 { + continue + } + + // Easier to print map keys as slice + namePrefixes := make([]string, 0, len(funcNamePrefixes)) + for k := range funcNamePrefixes { + namePrefixes = append(namePrefixes, k) + } + + pass.Reportf(file.Pos(0), "%s: file contains multiple acceptance test name prefixes: %v", analyzerName, namePrefixes) + } + + return nil, nil +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/README.md new file mode 100644 index 00000000000..8b00c2864ae --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/AT012/README.md @@ -0,0 +1,37 @@ +# AT012 + +The AT012 analyzer reports likely incorrect uses of multiple `TestAcc` function name prefixes up to the conventional underscore (`_`) prefix separator within the same file. Typically, Terraform acceptance tests should use the same naming prefix within one test file so testers can easily run all acceptance tests for the file and not miss associated tests. + +Optional parameters: + +- `ignored-filenames` Comma-separated list of file names to ignore, defaults to none. + +## Flagged Code + +```go +func TestAccExampleThing1_Test(t *testing.T) { /* ... */ } + +func TestAccExampleThing2_Test(t *testing.T) { /* ... */ } +``` + +## Passing Code + +```go +func TestAccExampleThing_Test1(t *testing.T) { /* ... */ } + +func TestAccExampleThing_Test2(t *testing.T) { /* ... */ } +``` + +## Ignoring Reports + +In addition to the optional parameters, reports can be ignored by adding a `//lintignore:AT012` Go code comment before any test declaration to ignore, e.g. + +```go +//lintignore:AT012 +func TestAccExampleThing1_Test(t *testing.T) { /* ... */ } + +//lintignore:AT012 +func TestAccExampleThing2_Test(t *testing.T) { /* ... */ } +``` + +If a file mainly uses one prefix, the code ignores can be simplified to only the non-conforming test declarations. diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/README.md new file mode 100644 index 00000000000..37e59e30558 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/README.md @@ -0,0 +1,50 @@ +# V011 + +The V011 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with [validation.StringLenBetween()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#StringLenBetween). + +## Flagged Code + +```go +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if len(value) < 1 || len(value) > 255 { + errors = append(errors, fmt.Errorf("%q must be between 1 and 255 characters: %q", k, value)) + } + + return +} +``` + +## Passing Code + +```go +// directly in Schema +ValidateFunc: validation.StringLenBetween(1, 255), + +// or saving as a variable +var validateExampleThing = validation.StringLenBetween(1, 255) + +// or replacing the function +func validateExampleThing() schema.SchemaValidateFunc { + return validation.StringLenBetween(1, 255) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V011` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V011 +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if len(value) < 1 || len(value) > 255 { + errors = append(errors, fmt.Errorf("%q must be between 1 and 255 characters: %q", k, value)) + } + + return +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/V011.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/V011.go new file mode 100644 index 00000000000..857986b5123 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V011/V011.go @@ -0,0 +1,139 @@ +package V011 + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for custom SchemaValidateFunc that implement validation.StringLenBetween() + +The V011 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with validation.StringLenBetween().` + +const analyzerName = "V011" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemavalidatefuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaValidateFuncs := pass.ResultOf[schemavalidatefuncinfo.Analyzer].([]*schema.SchemaValidateFuncInfo) + + for _, schemaValidateFunc := range schemaValidateFuncs { + if ignorer.ShouldIgnore(analyzerName, schemaValidateFunc.Node) { + continue + } + + if !hasIfStringLenCheck(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + pass.Reportf(schemaValidateFunc.Pos, "%s: custom SchemaValidateFunc should be replaced with validation.StringLenBetween()", analyzerName) + } + + return nil, nil +} + +func hasIfStringLenCheck(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.IfStmt: + if !hasStringLenCheck(n, info) { + return true + } + + result = true + + return false + } + }) + + return result +} + +func hasStringLenCheck(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + binaryExpr, ok := n.(*ast.BinaryExpr) + + if !ok { + return true + } + + if !exprIsStringLenCallExpr(binaryExpr.X, info) && !exprIsStringLenCallExpr(binaryExpr.Y, info) { + return true + } + + if !tokenIsLenCheck(binaryExpr.Op) { + return true + } + + result = true + + return false + }) + + return result +} + +func exprIsStringLenCallExpr(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + default: + return false + case *ast.CallExpr: + switch fun := e.Fun.(type) { + default: + return false + case *ast.Ident: + if fun.Name != "len" { + return false + } + } + + if len(e.Args) != 1 { + return false + } + + switch arg := info.TypeOf(e.Args[0]).Underlying().(type) { + default: + return false + case *types.Basic: + return arg.Kind() == types.String + } + } +} + +func tokenIsLenCheck(t token.Token) bool { + validTokens := []token.Token{ + token.GEQ, // >= + token.GTR, // > + token.LEQ, // <= + token.LSS, // < + } + + for _, validToken := range validTokens { + if t == validToken { + return true + } + } + + return false +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/README.md new file mode 100644 index 00000000000..1719e5eb023 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/README.md @@ -0,0 +1,50 @@ +# V012 + +The V012 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with [validation.IntAtLeast()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#IntAtLeast), [validation.IntAtMost()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#IntAtMost), or [validation.IntBetween()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#IntBetween). + +## Flagged Code + +```go +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + + if value < 1 || value > 255 { + errors = append(errors, fmt.Errorf("%q must be between 1 and 255: %d", k, value)) + } + + return +} +``` + +## Passing Code + +```go +// directly in Schema +ValidateFunc: validation.IntBetween(1, 255), + +// or saving as a variable +var validateExampleThing = validation.IntBetween(1, 255) + +// or replacing the function +func validateExampleThing() schema.SchemaValidateFunc { + return validation.IntBetween(1, 255) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V012` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V012 +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + + if value < 1 || value > 255 { + errors = append(errors, fmt.Errorf("%q must be between 1 and 255: %d", k, value)) + } + + return +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/V012.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/V012.go new file mode 100644 index 00000000000..af1feb632b9 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V012/V012.go @@ -0,0 +1,153 @@ +package V012 + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for custom SchemaValidateFunc that implement validation.IntAtLeast(), validation.IntAtMost(), or validation.IntBetween() + +The V012 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with validation.IntAtLeast(), validation.IntAtMost(), or +validation.IntBetween().` + +const analyzerName = "V012" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemavalidatefuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaValidateFuncs := pass.ResultOf[schemavalidatefuncinfo.Analyzer].([]*schema.SchemaValidateFuncInfo) + + for _, schemaValidateFunc := range schemaValidateFuncs { + if ignorer.ShouldIgnore(analyzerName, schemaValidateFunc.Node) { + continue + } + + if hasStrconvAtoiCallExpr(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + if !hasIfIntCheck(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + pass.Reportf(schemaValidateFunc.Pos, "%s: custom SchemaValidateFunc should be replaced with validation.IntAtLeast(), validation.IntAtMost(), or validation.IntBetween()", analyzerName) + } + + return nil, nil +} + +func hasIfIntCheck(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.IfStmt: + if !hasIntCheck(n, info) { + return true + } + + result = true + + return false + } + }) + + return result +} + +func hasIntCheck(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + binaryExpr, ok := n.(*ast.BinaryExpr) + + if !ok { + return true + } + + if !exprIsIntIdent(binaryExpr.X, info) && !exprIsIntIdent(binaryExpr.Y, info) { + return true + } + + if !tokenIsIntCheck(binaryExpr.Op) { + return true + } + + result = true + + return false + }) + + return result +} + +func hasStrconvAtoiCallExpr(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.CallExpr: + if !astutils.IsStdlibPackageFunc(n.Fun, info, "strconv", "Atoi") { + return true + } + + result = true + + return false + } + }) + + return result +} + +func exprIsIntIdent(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + default: + return false + case *ast.Ident: + switch t := info.TypeOf(e).Underlying().(type) { + default: + return false + case *types.Basic: + return t.Kind() == types.Int + } + } +} + +func tokenIsIntCheck(t token.Token) bool { + validTokens := []token.Token{ + token.GEQ, // >= + token.GTR, // > + token.LEQ, // <= + token.LSS, // < + } + + for _, validToken := range validTokens { + if t == validToken { + return true + } + } + + return false +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/README.md new file mode 100644 index 00000000000..b926c66d947 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/README.md @@ -0,0 +1,50 @@ +# V013 + +The V013 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with [validation.StringInSlice()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#StringInSlice) or [validation.StringNotInSlice()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#StringNotInSlice). + +## Flagged Code + +```go +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if value != "value1" && value != "value2" { + errors = append(errors, fmt.Errorf("%q must be value1 or value2: %s", k, value)) + } + + return +} +``` + +## Passing Code + +```go +// directly in Schema +ValidateFunc: validation.StringInSlice([]string{"value1", "value2"}, false), + +// or saving as a variable +var validateExampleThing = validation.StringInSlice([]string{"value1", "value2"}, false) + +// or replacing the function +func validateExampleThing() schema.SchemaValidateFunc { + return validation.StringInSlice([]string{"value1", "value2"}, false) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V013` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V013 +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if value != "value1" && value != "value2" { + errors = append(errors, fmt.Errorf("%q must be value1 or value2: %s", k, value)) + } + + return +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/V013.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/V013.go new file mode 100644 index 00000000000..dea5eec8025 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V013/V013.go @@ -0,0 +1,126 @@ +package V013 + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for custom SchemaValidateFunc that implement validation.StringInSlice() or validation.StringNotInSlice() + +The V013 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with validation.StringInSlice() or validation.StringNotInSlice().` + +const analyzerName = "V013" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemavalidatefuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaValidateFuncs := pass.ResultOf[schemavalidatefuncinfo.Analyzer].([]*schema.SchemaValidateFuncInfo) + + for _, schemaValidateFunc := range schemaValidateFuncs { + if ignorer.ShouldIgnore(analyzerName, schemaValidateFunc.Node) { + continue + } + + if !hasIfStringEquality(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + pass.Reportf(schemaValidateFunc.Pos, "%s: custom SchemaValidateFunc should be replaced with validation.StringInSlice() or validation.StringNotInSlice()", analyzerName) + } + + return nil, nil +} + +func hasIfStringEquality(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.IfStmt: + if !hasStringEquality(n, info) { + return true + } + + result = true + + return false + } + }) + + return result +} + +func hasStringEquality(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + binaryExpr, ok := n.(*ast.BinaryExpr) + + if !ok { + return true + } + + if !exprIsString(binaryExpr.X, info) || !exprIsString(binaryExpr.Y, info) { + return true + } + + if !tokenIsEquality(binaryExpr.Op) { + return true + } + + result = true + + return false + }) + + return result +} + +func exprIsString(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + default: + return false + case *ast.BasicLit: + return e.Kind == token.STRING + case *ast.Ident: + switch t := info.TypeOf(e).Underlying().(type) { + default: + return false + case *types.Basic: + return t.Kind() == types.String + } + } +} + +func tokenIsEquality(t token.Token) bool { + validTokens := []token.Token{ + token.EQL, // == + token.NEQ, // != + } + + for _, validToken := range validTokens { + if t == validToken { + return true + } + } + + return false +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/README.md new file mode 100644 index 00000000000..159bce38231 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/README.md @@ -0,0 +1,50 @@ +# V014 + +The V014 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with [validation.IntInSlice()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#IntInSlice) or [validation.IntNotInSlice()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation#IntNotInSlice). + +## Flagged Code + +```go +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + + if value != 1 && value != 2 { + errors = append(errors, fmt.Errorf("%q must be 1 or 2: %d", k, value)) + } + + return +} +``` + +## Passing Code + +```go +// directly in Schema +ValidateFunc: validation.IntInSlice([]int{1, 2}, false), + +// or saving as a variable +var validateExampleThing = validation.IntInSlice([]int{1, 2}, false) + +// or replacing the function +func validateExampleThing() schema.SchemaValidateFunc { + return validation.IntInSlice([]int{1, 2}, false) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V014` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V014 +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(int) + + if value != 1 && value != 2 { + errors = append(errors, fmt.Errorf("%q must be 1 or 2: %d", k, value)) + } + + return +} +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/V014.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/V014.go new file mode 100644 index 00000000000..5f8ef1b141c --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/V014/V014.go @@ -0,0 +1,152 @@ +package V014 + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for custom SchemaValidateFunc that implement validation.IntInSlice() or validation.IntNotInSlice() + +The V014 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with validation.IntInSlice() or validation.IntNotInSlice().` + +const analyzerName = "V014" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemavalidatefuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaValidateFuncs := pass.ResultOf[schemavalidatefuncinfo.Analyzer].([]*schema.SchemaValidateFuncInfo) + + for _, schemaValidateFunc := range schemaValidateFuncs { + if ignorer.ShouldIgnore(analyzerName, schemaValidateFunc.Node) { + continue + } + + if hasStrconvAtoiCallExpr(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + if !hasIfIntEquality(schemaValidateFunc.Body, pass.TypesInfo) { + continue + } + + pass.Reportf(schemaValidateFunc.Pos, "%s: custom SchemaValidateFunc should be replaced with validation.IntInSlice() or validation.IntNotInSlice()", analyzerName) + } + + return nil, nil +} + +func hasIfIntEquality(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.IfStmt: + if !hasIntEquality(n, info) { + return true + } + + result = true + + return false + } + }) + + return result +} + +func hasIntEquality(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + binaryExpr, ok := n.(*ast.BinaryExpr) + + if !ok { + return true + } + + if !exprIsInt(binaryExpr.X, info) || !exprIsInt(binaryExpr.Y, info) { + return true + } + + if !tokenIsEquality(binaryExpr.Op) { + return true + } + + result = true + + return false + }) + + return result +} + +func hasStrconvAtoiCallExpr(node ast.Node, info *types.Info) bool { + result := false + + ast.Inspect(node, func(n ast.Node) bool { + switch n := n.(type) { + default: + return true + case *ast.CallExpr: + if !astutils.IsStdlibPackageFunc(n.Fun, info, "strconv", "Atoi") { + return true + } + + result = true + + return false + } + }) + + return result +} + +func exprIsInt(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + default: + return false + case *ast.BasicLit: + return e.Kind == token.INT + case *ast.Ident: + switch t := info.TypeOf(e).Underlying().(type) { + default: + return false + case *types.Basic: + return t.Kind() == types.Int + } + } +} + +func tokenIsEquality(t token.Token) bool { + validTokens := []token.Token{ + token.EQL, // == + token.NEQ, // != + } + + for _, validToken := range validTokens { + if t == validToken { + return true + } + } + + return false +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/checks.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/checks.go index 92cd064a782..374c47618b7 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/checks.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/checks.go @@ -10,6 +10,9 @@ import ( "github.com/bflad/tfproviderlint/passes/AT007" "github.com/bflad/tfproviderlint/passes/AT008" "github.com/bflad/tfproviderlint/passes/AT009" + "github.com/bflad/tfproviderlint/passes/AT010" + "github.com/bflad/tfproviderlint/passes/AT011" + "github.com/bflad/tfproviderlint/passes/AT012" "github.com/bflad/tfproviderlint/passes/R001" "github.com/bflad/tfproviderlint/passes/R002" "github.com/bflad/tfproviderlint/passes/R003" @@ -76,6 +79,10 @@ import ( "github.com/bflad/tfproviderlint/passes/V008" "github.com/bflad/tfproviderlint/passes/V009" "github.com/bflad/tfproviderlint/passes/V010" + "github.com/bflad/tfproviderlint/passes/V011" + "github.com/bflad/tfproviderlint/passes/V012" + "github.com/bflad/tfproviderlint/passes/V013" + "github.com/bflad/tfproviderlint/passes/V014" "golang.org/x/tools/go/analysis" ) @@ -92,6 +99,9 @@ var AllChecks = []*analysis.Analyzer{ AT007.Analyzer, AT008.Analyzer, AT009.Analyzer, + AT010.Analyzer, + AT011.Analyzer, + AT012.Analyzer, R001.Analyzer, R002.Analyzer, R003.Analyzer, @@ -158,4 +168,8 @@ var AllChecks = []*analysis.Analyzer{ V008.Analyzer, V009.Analyzer, V010.Analyzer, + V011.Analyzer, + V012.Analyzer, + V013.Analyzer, + V014.Analyzer, } diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index 62d9aa9926e..ea532746238 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -68,7 +68,7 @@ github.com/bflad/gopaniccheck/passes/logpaniccallexpr github.com/bflad/gopaniccheck/passes/logpanicfcallexpr github.com/bflad/gopaniccheck/passes/logpaniclncallexpr github.com/bflad/gopaniccheck/passes/paniccallexpr -# github.com/bflad/tfproviderlint v0.23.0 +# github.com/bflad/tfproviderlint v0.24.0 ## explicit github.com/bflad/tfproviderlint/helper/analysisutils github.com/bflad/tfproviderlint/helper/astutils @@ -88,6 +88,9 @@ github.com/bflad/tfproviderlint/passes/AT006 github.com/bflad/tfproviderlint/passes/AT007 github.com/bflad/tfproviderlint/passes/AT008 github.com/bflad/tfproviderlint/passes/AT009 +github.com/bflad/tfproviderlint/passes/AT010 +github.com/bflad/tfproviderlint/passes/AT011 +github.com/bflad/tfproviderlint/passes/AT012 github.com/bflad/tfproviderlint/passes/R001 github.com/bflad/tfproviderlint/passes/R002 github.com/bflad/tfproviderlint/passes/R003 @@ -154,6 +157,10 @@ github.com/bflad/tfproviderlint/passes/V007 github.com/bflad/tfproviderlint/passes/V008 github.com/bflad/tfproviderlint/passes/V009 github.com/bflad/tfproviderlint/passes/V010 +github.com/bflad/tfproviderlint/passes/V011 +github.com/bflad/tfproviderlint/passes/V012 +github.com/bflad/tfproviderlint/passes/V013 +github.com/bflad/tfproviderlint/passes/V014 github.com/bflad/tfproviderlint/passes/commentignore github.com/bflad/tfproviderlint/passes/helper/acctest/randstringfromcharsetcallexpr github.com/bflad/tfproviderlint/passes/helper/resource/retryfuncinfo From 43c8b0a3ffdbe068d50bf6dab101979c184b6539 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 24 Mar 2021 18:46:47 +0000 Subject: [PATCH 1117/1252] Update CHANGELOG.md for #18368 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0cff9e6be8..2fd06dbc390 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ FEATURES: BUG FIXES: +* resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) ## 3.33.0 (March 18, 2021) From b7faa197dfcee985c2c931741fb2d7992d4deb79 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 24 Mar 2021 14:49:00 -0400 Subject: [PATCH 1118/1252] remove incorrect deprecation warning for single_header argument --- aws/resource_aws_wafv2_web_acl_logging_configuration.go | 1 - 1 file changed, 1 deletion(-) diff --git a/aws/resource_aws_wafv2_web_acl_logging_configuration.go b/aws/resource_aws_wafv2_web_acl_logging_configuration.go index b9b0e65f909..83aad58827b 100644 --- a/aws/resource_aws_wafv2_web_acl_logging_configuration.go +++ b/aws/resource_aws_wafv2_web_acl_logging_configuration.go @@ -69,7 +69,6 @@ func resourceAwsWafv2WebACLLoggingConfiguration() *schema.Resource { // Trying to solve it with StateFunc and/or DiffSuppressFunc resulted in hash problem of the rule field or didn't work. validation.StringMatch(regexp.MustCompile(`^[a-z0-9-_]+$`), "must contain only lowercase alphanumeric characters, underscores, and hyphens"), ), - Deprecated: "Not supported by WAFv2 API", }, }, }, From a7071cb6d86d9152bdddd2d5baba2ee6ec0ddca0 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 24 Mar 2021 12:20:49 -0700 Subject: [PATCH 1119/1252] Fixes Terraform formatting --- aws/resource_aws_elasticache_replication_group_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_elasticache_replication_group_test.go b/aws/resource_aws_elasticache_replication_group_test.go index ebc4c807e56..539c62faaa6 100644 --- a/aws/resource_aws_elasticache_replication_group_test.go +++ b/aws/resource_aws_elasticache_replication_group_test.go @@ -2683,7 +2683,7 @@ resource "aws_elasticache_replication_group" "test" { number_cache_clusters = 1 - port = 16379 + port = 16379 } resource "aws_elasticache_global_replication_group" "test" { @@ -2707,7 +2707,7 @@ resource "aws_elasticache_replication_group" "primary" { engine_version = "5.0.6" number_cache_clusters = 1 - port = 6379 + port = 6379 at_rest_encryption_enabled = true transit_encryption_enabled = true From 2c56c6cf002570c33c239824b08bb906c94b5585 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Wed, 24 Mar 2021 12:20:58 -0700 Subject: [PATCH 1120/1252] Adds CHANGELOG --- .changelog/18361.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/18361.txt diff --git a/.changelog/18361.txt b/.changelog/18361.txt new file mode 100644 index 00000000000..5e50400f3e6 --- /dev/null +++ b/.changelog/18361.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled +``` From ab57f692eb5e1546ee40c5381205b21ae617cb08 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Wed, 24 Mar 2021 15:26:54 -0400 Subject: [PATCH 1121/1252] Update CHANGELOG for #18384 --- .changelog/18384.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .changelog/18384.txt diff --git a/.changelog/18384.txt b/.changelog/18384.txt new file mode 100644 index 00000000000..a1cf0941716 --- /dev/null +++ b/.changelog/18384.txt @@ -0,0 +1,4 @@ +```release-note:bug +resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument +``` + From 362106befee2a2b3212dc4be9ef8e1ea1a09c2b7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 24 Mar 2021 15:51:30 -0400 Subject: [PATCH 1122/1252] r/aws_api_gateway_vpc_link: Persist ID of newly created VPC Link when it fails to reach Available state (#18382) * r/aws_api_gateway_vpc_link: Persist ID of new;y created VPC Link when it fails to reach Available state. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSAPIGatewayVpcLink_basic' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSAPIGatewayVpcLink_basic -timeout 180m === RUN TestAccAWSAPIGatewayVpcLink_basic === PAUSE TestAccAWSAPIGatewayVpcLink_basic === CONT TestAccAWSAPIGatewayVpcLink_basic --- PASS: TestAccAWSAPIGatewayVpcLink_basic (750.44s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 750.547s * Add CHANGELOG entry. --- .changelog/18382.txt | 3 +++ aws/resource_aws_api_gateway_vpc_link.go | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .changelog/18382.txt diff --git a/.changelog/18382.txt b/.changelog/18382.txt new file mode 100644 index 00000000000..46a43e86818 --- /dev/null +++ b/.changelog/18382.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state +``` diff --git a/aws/resource_aws_api_gateway_vpc_link.go b/aws/resource_aws_api_gateway_vpc_link.go index 9bc2ae15e98..d608fbba5d7 100644 --- a/aws/resource_aws_api_gateway_vpc_link.go +++ b/aws/resource_aws_api_gateway_vpc_link.go @@ -86,8 +86,7 @@ func resourceAwsApiGatewayVpcLinkCreate(d *schema.ResourceData, meta interface{} _, err = stateConf.WaitForState() if err != nil { - d.SetId("") - return fmt.Errorf("Error waiting for APIGateway Vpc Link status to be \"%s\": %s", apigateway.VpcLinkStatusAvailable, err) + return fmt.Errorf("error waiting for APIGateway Vpc Link status to be \"%s\": %w", apigateway.VpcLinkStatusAvailable, err) } return resourceAwsApiGatewayVpcLinkRead(d, meta) From 87d504a9fe2f14781f465c92c2229a0988bedc9b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 24 Mar 2021 20:13:33 +0000 Subject: [PATCH 1123/1252] Update CHANGELOG.md for #18384 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd06dbc390..8235ffec9a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,10 @@ FEATURES: BUG FIXES: +* resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state ([#18382](https://github.com/hashicorp/terraform-provider-aws/issues/18382)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) +* resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument ([#18384](https://github.com/hashicorp/terraform-provider-aws/issues/18384)) ## 3.33.0 (March 18, 2021) From 733468ea4828029d56e5b406e6fed90fb7c6815c Mon Sep 17 00:00:00 2001 From: Shuhei Kitagawa Date: Thu, 25 Mar 2021 05:31:22 +0900 Subject: [PATCH 1124/1252] aws_vpc: Correct the ARN account id (#17729) * aws_vpc: Correct the ARN account id * Remove aws_vpc from the document --- aws/data_source_aws_vpc.go | 2 +- aws/resource_aws_vpc.go | 2 +- website/docs/index.html.markdown | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/aws/data_source_aws_vpc.go b/aws/data_source_aws_vpc.go index 446fbc61e0c..430fcd62b91 100644 --- a/aws/data_source_aws_vpc.go +++ b/aws/data_source_aws_vpc.go @@ -194,7 +194,7 @@ func dataSourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(vpc.OwnerId), Resource: fmt.Sprintf("vpc/%s", d.Id()), }.String() d.Set("arn", arn) diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index 8b2a82b740d..b01bcbddf87 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -272,7 +272,7 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { Partition: meta.(*AWSClient).partition, Service: ec2.ServiceName, Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, + AccountID: aws.StringValue(vpc.OwnerId), Resource: fmt.Sprintf("vpc/%s", d.Id()), }.String() d.Set("arn", arn) diff --git a/website/docs/index.html.markdown b/website/docs/index.html.markdown index 28105953980..44d0fec791d 100644 --- a/website/docs/index.html.markdown +++ b/website/docs/index.html.markdown @@ -335,8 +335,6 @@ This functionality is only supported in the following resources: - [`aws_synthetics_canary` resource](/docs/providers/aws/r/synthetics_canary.html) - [`aws_vpc_endpoint_service` data source](/docs/providers/aws/d/vpc_endpoint_service.html) - [`aws_vpc_endpoint_service` resource](/docs/providers/aws/r/vpc_endpoint_service.html) - - [`aws_vpc` data source](/docs/providers/aws/d/vpc.html) - - [`aws_vpc` resource](/docs/providers/aws/r/vpc.html) - [`aws_vpn_connection` resource](/docs/providers/aws/r/vpn_connection.html) - [`aws_vpn_gateway` data source](/docs/providers/aws/d/vpn_gateway.html) - [`aws_vpn_gateway` resource](/docs/providers/aws/r/vpn_gateway.html) From 69e2d3c5f96fbddcfcf7a349efa15fae93cfe765 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:53:19 -0400 Subject: [PATCH 1125/1252] r/lightsail_instance_public_ports: Add changelog --- .changelog/8611.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/8611.txt diff --git a/.changelog/8611.txt b/.changelog/8611.txt new file mode 100644 index 00000000000..350021e3c1b --- /dev/null +++ b/.changelog/8611.txt @@ -0,0 +1,3 @@ +```release-note:new-resource +aws_lightsail_instance_public_ports +``` \ No newline at end of file From 4fc9faa56e816ea852e79741c7a227135dbe3b31 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:53:43 -0400 Subject: [PATCH 1126/1252] r/lightsail_instance_public_ports: New resource --- aws/provider.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/provider.go b/aws/provider.go index ead0d4858d7..27bf36d6f01 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -818,10 +818,10 @@ func Provider() *schema.Provider { "aws_licensemanager_license_configuration": resourceAwsLicenseManagerLicenseConfiguration(), "aws_lightsail_domain": resourceAwsLightsailDomain(), "aws_lightsail_instance": resourceAwsLightsailInstance(), + "aws_lightsail_instance_public_ports": resourceAwsLightsailInstancePublicPorts(), "aws_lightsail_key_pair": resourceAwsLightsailKeyPair(), "aws_lightsail_static_ip": resourceAwsLightsailStaticIp(), "aws_lightsail_static_ip_attachment": resourceAwsLightsailStaticIpAttachment(), - "aws_lightsail_public_ports": resourceAwsLightsailPublicPorts(), "aws_lb_cookie_stickiness_policy": resourceAwsLBCookieStickinessPolicy(), "aws_load_balancer_policy": resourceAwsLoadBalancerPolicy(), "aws_load_balancer_backend_server_policy": resourceAwsLoadBalancerBackendServerPolicies(), From 78e067c87986372e64582216dbde709199ed846a Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:54:28 -0400 Subject: [PATCH 1127/1252] docs/lightsail_instance_public_ports: Add docs for new resource --- ...htsail_instance_public_ports.html.markdown | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 website/docs/r/lightsail_instance_public_ports.html.markdown diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown new file mode 100644 index 00000000000..7c8666859bb --- /dev/null +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -0,0 +1,55 @@ +--- +subcategory: "Lightsail" +layout: "aws" +page_title: "AWS: aws_lightsail_instance_public_ports" +description: |- + Provides an Lightsail Instance +--- + +# Resource: aws_lightsail_instance_public_ports + +Opens ports for a specific Amazon Lightsail instance, and specifies the IP addresses allowed to connect to the instance through the ports, and the protocol. + +-> See [What is Amazon Lightsail?](https://lightsail.aws.amazon.com/ls/docs/getting-started/article/what-is-amazon-lightsail) for more information. + +~> **Note:** Lightsail is currently only supported in a limited number of AWS Regions, please see ["Regions and Availability Zones in Amazon Lightsail"](https://lightsail.aws.amazon.com/ls/docs/overview/article/understanding-regions-and-availability-zones-in-amazon-lightsail) for more details. + +## Example Usage + +```terraform +resource "aws_lightsail_instance" "test" { + name = "yak_sail" + availability_zone = data.aws_availability_zones.available.names[0] + blueprint_id = "amazon_linux" + bundle_id = "nano_1_0" +} + +resource "aws_lightsail_instance_public_ports" "test" { + instance_name = aws_lightsail_instance.test.name + + port_info { + protocol = "tcp" + from_port = 80 + to_port = 80 + } +} +``` + +## Argument Reference + +The following arguments are required: + +* `instance_name` - (Required) Name of the Lightsail Instance. +* `port_info` - (Required) Configuration block with port information. AWS closes all currently open ports that are not included in the `port_info`. Detailed below. + +### port_info + +* `from_port` - (Required) First port in a range of open ports on an instance. +* `protocol` - (Required) IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`. +* `to_port` - (Required) Last port in a range of open ports on an instance. + +## Attributes Reference + +In addition to all arguments above, the following attribute is exported: + +* `id` - ID of the resource. From cbd183f58916f0fa2d172a8a433f439128ae1808 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:55:10 -0400 Subject: [PATCH 1128/1252] r/lightsail_instance_public_ports: Clean up new resource --- ...rce_aws_lightsail_instance_public_ports.go | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 aws/resource_aws_lightsail_instance_public_ports.go diff --git a/aws/resource_aws_lightsail_instance_public_ports.go b/aws/resource_aws_lightsail_instance_public_ports.go new file mode 100644 index 00000000000..5116ce73b22 --- /dev/null +++ b/aws/resource_aws_lightsail_instance_public_ports.go @@ -0,0 +1,214 @@ +package aws + +import ( + "bytes" + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/lightsail" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" +) + +func resourceAwsLightsailInstancePublicPorts() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsLightsailInstancePublicPortsCreate, + Read: resourceAwsLightsailInstancePublicPortsRead, + Delete: resourceAwsLightsailInstancePublicPortsDelete, + + Schema: map[string]*schema.Schema{ + "instance_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "port_info": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "from_port": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65535), + }, + "protocol": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(lightsail.NetworkProtocol_Values(), false), + }, + "to_port": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65535), + }, + }, + }, + }, + }, + } +} + +func resourceAwsLightsailInstancePublicPortsCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + + var portInfos []*lightsail.PortInfo + if v, ok := d.GetOk("port_info"); ok && v.(*schema.Set).Len() > 0 { + portInfos = expandLightsailPortInfos(v.(*schema.Set).List()) + } + + input := &lightsail.PutInstancePublicPortsInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + PortInfos: portInfos, + } + + _, err := conn.PutInstancePublicPorts(input) + + if err != nil { + return fmt.Errorf("unable to create public ports for instance %s: %w", d.Get("instance_name").(string), err) + } + + var buffer bytes.Buffer + for _, portInfo := range portInfos { + buffer.WriteString(fmt.Sprintf("%s-%d-%d\n", aws.StringValue(portInfo.Protocol), aws.Int64Value(portInfo.FromPort), aws.Int64Value(portInfo.ToPort))) + } + + d.SetId(fmt.Sprintf("%s-%d", d.Get("instance_name").(string), hashcode.String(buffer.String()))) + + return resourceAwsLightsailInstancePublicPortsRead(d, meta) +} + +func resourceAwsLightsailInstancePublicPortsRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + + input := &lightsail.GetInstancePortStatesInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + } + + output, err := conn.GetInstancePortStates(input) + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, "NotFoundException") { + log.Printf("[WARN] Lightsail instance public ports (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error reading Lightsail instance public ports (%s): %w", d.Id(), err) + } + + if err := d.Set("port_info", flattenLightsailInstancePortStates(output.PortStates)); err != nil { + return fmt.Errorf("error setting port_info: %w", err) + } + + return nil +} + +func resourceAwsLightsailInstancePublicPortsDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lightsailconn + + var err *multierror.Error + + var portInfos []*lightsail.PortInfo + if v, ok := d.GetOk("port_info"); ok && v.(*schema.Set).Len() > 0 { + portInfos = expandLightsailPortInfos(v.(*schema.Set).List()) + } + + for _, portInfo := range portInfos { + _, portError := conn.CloseInstancePublicPorts(&lightsail.CloseInstancePublicPortsInput{ + InstanceName: aws.String(d.Get("instance_name").(string)), + PortInfo: portInfo, + }) + + if portError != nil { + err = multierror.Append(err, portError) + } + } + + if err != nil { + return fmt.Errorf("unable to close public ports for instance %s: %w", d.Get("instance_name").(string), err) + } + + return nil +} + +func expandLightsailPortInfo(tfMap map[string]interface{}) *lightsail.PortInfo { + if tfMap == nil { + return nil + } + + apiObject := &lightsail.PortInfo{ + FromPort: aws.Int64((int64)(tfMap["from_port"].(int))), + ToPort: aws.Int64((int64)(tfMap["to_port"].(int))), + Protocol: aws.String(tfMap["protocol"].(string)), + } + + return apiObject +} + +func expandLightsailPortInfos(tfList []interface{}) []*lightsail.PortInfo { + if len(tfList) == 0 { + return nil + } + + var apiObjects []*lightsail.PortInfo + + for _, tfMapRaw := range tfList { + tfMap, ok := tfMapRaw.(map[string]interface{}) + + if !ok { + continue + } + + apiObject := expandLightsailPortInfo(tfMap) + + if apiObject == nil { + continue + } + + apiObjects = append(apiObjects, apiObject) + } + + return apiObjects +} + +func flattenLightsailInstancePortState(apiObject *lightsail.InstancePortState) map[string]interface{} { + if apiObject == nil { + return nil + } + + tfMap := map[string]interface{}{} + + tfMap["from_port"] = aws.Int64Value(apiObject.FromPort) + tfMap["to_port"] = aws.Int64Value(apiObject.ToPort) + tfMap["protocol"] = aws.StringValue(apiObject.Protocol) + + return tfMap +} + +func flattenLightsailInstancePortStates(apiObjects []*lightsail.InstancePortState) []interface{} { + if len(apiObjects) == 0 { + return nil + } + + var tfList []interface{} + + for _, apiObject := range apiObjects { + if apiObject == nil { + continue + } + + tfList = append(tfList, flattenLightsailInstancePortState(apiObject)) + } + + return tfList +} From 126bea022eb5d98cf06fe61c2818b85d197b039d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:55:28 -0400 Subject: [PATCH 1129/1252] tests/r/lightsail_instance_public_ports: Add tests --- ...ws_lightsail_instance_public_ports_test.go | 191 ++++++++++++++++++ aws/resource_aws_lightsail_public_ports.go | 121 ----------- 2 files changed, 191 insertions(+), 121 deletions(-) create mode 100644 aws/resource_aws_lightsail_instance_public_ports_test.go delete mode 100644 aws/resource_aws_lightsail_public_ports.go diff --git a/aws/resource_aws_lightsail_instance_public_ports_test.go b/aws/resource_aws_lightsail_instance_public_ports_test.go new file mode 100644 index 00000000000..da484f59440 --- /dev/null +++ b/aws/resource_aws_lightsail_instance_public_ports_test.go @@ -0,0 +1,191 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/lightsail" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" +) + +func TestAccAWSLightsailInstancePublicPorts_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lightsail_instance_public_ports.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) + testAccPreCheckAWSLightsail(t) + }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLightsailInstancePublicPortsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLightsailInstancePublicPortsConfig_basic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "port_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "80"), + ), + }, + }, + }) +} + +func TestAccAWSLightsailInstancePublicPorts_multiple(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lightsail_instance_public_ports.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) + testAccPreCheckAWSLightsail(t) + }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLightsailInstancePublicPortsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLightsailInstancePublicPortsConfig_multiple(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "port_info.#", "2"), + resource.TestCheckResourceAttr(resourceName, "port_info.1.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "port_info.1.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "port_info.1.to_port", "80"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "443"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "443"), + ), + }, + }, + }) +} + +func testAccCheckAWSLightsailInstancePublicPortsExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("resource not found: %s", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).lightsailconn + + input := &lightsail.GetInstancePortStatesInput{ + InstanceName: aws.String(rs.Primary.Attributes["instance_name"]), + } + + _, err := conn.GetInstancePortStates(input) + + if err != nil { + return fmt.Errorf("error getting Lightsail Instance Public Ports (%s): %w", rs.Primary.ID, err) + } + + return nil + } +} + +func testAccCheckAWSLightsailInstancePublicPortsDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).lightsailconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_lightsail_instance_public_ports" { + continue + } + + input := &lightsail.GetInstancePortStatesInput{ + InstanceName: aws.String(rs.Primary.Attributes["instance_name"]), + } + + output, err := conn.GetInstancePortStates(input) + + if tfawserr.ErrCodeEquals(err, lightsail.ErrCodeNotFoundException) { + continue + } + + if err != nil { + return fmt.Errorf("error getting Lightsail Instance Public Ports (%s): %w", rs.Primary.ID, err) + } + + if output != nil { + return fmt.Errorf("Lightsail Instance Public Ports (%s) still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccAWSLightsailInstancePublicPortsConfig_basic(rName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_lightsail_instance" "test" { + name = %[1]q + availability_zone = data.aws_availability_zones.available.names[0] + blueprint_id = "amazon_linux" + bundle_id = "nano_1_0" +} + +resource "aws_lightsail_instance_public_ports" "test" { + instance_name = aws_lightsail_instance.test.name + + port_info { + protocol = "tcp" + from_port = 80 + to_port = 80 + } +} +`, rName) +} + +func testAccAWSLightsailInstancePublicPortsConfig_multiple(rName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_lightsail_instance" "test" { + name = %[1]q + availability_zone = data.aws_availability_zones.available.names[0] + blueprint_id = "amazon_linux" + bundle_id = "nano_1_0" +} + +resource "aws_lightsail_instance_public_ports" "test" { + instance_name = aws_lightsail_instance.test.name + + port_info { + protocol = "tcp" + from_port = 80 + to_port = 80 + } + + port_info { + protocol = "tcp" + from_port = 443 + to_port = 443 + } +} +`, rName) +} diff --git a/aws/resource_aws_lightsail_public_ports.go b/aws/resource_aws_lightsail_public_ports.go deleted file mode 100644 index 752eff78ec9..00000000000 --- a/aws/resource_aws_lightsail_public_ports.go +++ /dev/null @@ -1,121 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" -) - -func resourceAwsLightsailPublicPorts() *schema.Resource { - return &schema.Resource{ - Create: resourceAwsLightsailPublicPortsCreate, - Read: resourceAwsLightsailPublicPortsRead, - Delete: resourceAwsLightsailPublicPortsDelete, - - Schema: map[string]*schema.Schema{ - "instance_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "port_infos": { - Type: schema.TypeList, - Required: true, - ForceNew: true, - Elem: &schema.Resource{ - Schema: map[string]*schema.Schema{ - "from_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(0, 65535), - }, - "to_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(0, 65535), - }, - "protocol": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - lightsail.NetworkProtocolUdp, - lightsail.NetworkProtocolTcp, - }, false), - }, - }, - }, - }, - }, - } -} - -func buildAwsLightsailPortInfos(info []interface{}) []*lightsail.PortInfo { - if len(info) == 0 { - return nil - } - - var portInfos []*lightsail.PortInfo - - for _, v := range info { - m := v.(map[string]interface{}) - portInfos = append(portInfos, &lightsail.PortInfo{ - FromPort: aws.Int64((int64)(m["from_port"].(int))), - ToPort: aws.Int64((int64)(m["to_port"].(int))), - Protocol: aws.String(m["protocol"].(string)), - }) - } - return portInfos -} - -func resourceAwsLightsailPublicPortsCreate(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - _, err := conn.PutInstancePublicPorts(&lightsail.PutInstancePublicPortsInput{ - InstanceName: aws.String(d.Get("instance_name").(string)), - PortInfos: buildAwsLightsailPortInfos(d.Get("port_infos").([]interface{})), - }) - - if err != nil { - return err - } - - return resourceAwsLightsailPublicPortsRead(d, meta) -} - -func resourceAwsLightsailPublicPortsRead(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - _, err := conn.GetInstancePortStates(&lightsail.GetInstancePortStatesInput{ - InstanceName: aws.String(d.Get("instance_name").(string)), - }) - - if err != nil { - if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "NotFoundException" { - log.Printf("[WARN] Lightsail Instance (%s) not found, removing from state", d.Get("instance_name")) - return nil - } - return err - } - return err - } - - return nil -} - -func resourceAwsLightsailPublicPortsDelete(d *schema.ResourceData, meta interface{}) error { - conn := meta.(*AWSClient).lightsailconn - _, err := conn.PutInstancePublicPorts(&lightsail.PutInstancePublicPortsInput{ - InstanceName: aws.String(d.Get("instance_name").(string)), - }) - - if err != nil { - return err - } - return nil -} From 6024828961e1d0b784f0de7f0f2bfc6fa55fddfe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:59:04 -0400 Subject: [PATCH 1130/1252] tests/lightsail_instance_public_ports: Lint --- aws/resource_aws_lightsail_instance_public_ports_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_lightsail_instance_public_ports_test.go b/aws/resource_aws_lightsail_instance_public_ports_test.go index da484f59440..d22363706e1 100644 --- a/aws/resource_aws_lightsail_instance_public_ports_test.go +++ b/aws/resource_aws_lightsail_instance_public_ports_test.go @@ -146,9 +146,9 @@ resource "aws_lightsail_instance_public_ports" "test" { instance_name = aws_lightsail_instance.test.name port_info { - protocol = "tcp" - from_port = 80 - to_port = 80 + protocol = "tcp" + from_port = 80 + to_port = 80 } } `, rName) From f25719dc948d118ba6e260b23cf62e8a4ab2679d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 17:59:56 -0400 Subject: [PATCH 1131/1252] docs/r/lightsail_instance_public_ports: Lint --- website/docs/r/lightsail_instance_public_ports.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index 7c8666859bb..6178af0e69f 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -40,7 +40,7 @@ resource "aws_lightsail_instance_public_ports" "test" { The following arguments are required: * `instance_name` - (Required) Name of the Lightsail Instance. -* `port_info` - (Required) Configuration block with port information. AWS closes all currently open ports that are not included in the `port_info`. Detailed below. +* `port_info` - (Required) Configuration block with port information. AWS closes all currently open ports that are not included in the `port_info`. Detailed below. ### port_info From c963d533fa7bea684221ac2da3d425cd4ef08dff Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 18:01:59 -0400 Subject: [PATCH 1132/1252] docs/r/lightsail_instance_public_ports: Lint --- .../docs/r/lightsail_instance_public_ports.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index 6178af0e69f..a87df42c307 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -28,9 +28,9 @@ resource "aws_lightsail_instance_public_ports" "test" { instance_name = aws_lightsail_instance.test.name port_info { - protocol = "tcp" - from_port = 80 - to_port = 80 + protocol = "tcp" + from_port = 80 + to_port = 80 } } ``` From 80fc255c4d40ea8ef6ec8b7caf5c51a826661108 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Wed, 24 Mar 2021 18:06:40 -0400 Subject: [PATCH 1133/1252] docs/r/lightsail_instance_public_ports: Lint --- website/docs/r/lightsail_instance_public_ports.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index a87df42c307..320f7d51957 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -50,6 +50,6 @@ The following arguments are required: ## Attributes Reference -In addition to all arguments above, the following attribute is exported: +In addition to all arguments above, the following attributes are exported: * `id` - ID of the resource. From cc28c4177be067f3065010778382f5845294c63b Mon Sep 17 00:00:00 2001 From: changelogbot Date: Wed, 24 Mar 2021 22:06:59 +0000 Subject: [PATCH 1134/1252] Update CHANGELOG.md for #18361 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8235ffec9a0..ae22f5ab4bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ FEATURES: BUG FIXES: * resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state ([#18382](https://github.com/hashicorp/terraform-provider-aws/issues/18382)) +* resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) * resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument ([#18384](https://github.com/hashicorp/terraform-provider-aws/issues/18384)) From 690280e045083a1b72d2b4bb1fa89bb44b688e83 Mon Sep 17 00:00:00 2001 From: Kurt McAlpine Date: Sat, 29 Aug 2020 13:52:14 +1200 Subject: [PATCH 1135/1252] Add cidrs attribute to aws_lightsail_instance_public_ports resource --- ...rce_aws_lightsail_instance_public_ports.go | 25 ++++++++ ...ws_lightsail_instance_public_ports_test.go | 61 +++++++++++++++++++ ...htsail_instance_public_ports.html.markdown | 1 + 3 files changed, 87 insertions(+) diff --git a/aws/resource_aws_lightsail_instance_public_ports.go b/aws/resource_aws_lightsail_instance_public_ports.go index 5116ce73b22..4019948f569 100644 --- a/aws/resource_aws_lightsail_instance_public_ports.go +++ b/aws/resource_aws_lightsail_instance_public_ports.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "log" + "sort" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" @@ -51,6 +52,15 @@ func resourceAwsLightsailInstancePublicPorts() *schema.Resource { ForceNew: true, ValidateFunc: validation.IntBetween(0, 65535), }, + "cidrs": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateCIDRNetworkAddress, + }, + }, }, }, }, @@ -151,6 +161,15 @@ func expandLightsailPortInfo(tfMap map[string]interface{}) *lightsail.PortInfo { ToPort: aws.Int64((int64)(tfMap["to_port"].(int))), Protocol: aws.String(tfMap["protocol"].(string)), } + if cidrs, ok := tfMap["cidrs"]; ok { + for _, v := range cidrs.([]interface{}) { + apiObject.Cidrs = append(apiObject.Cidrs, aws.String(v.(string))) + } + + sort.Slice(apiObject.Cidrs, func(i, j int) bool { + return *apiObject.Cidrs[i] > *apiObject.Cidrs[j] + }) + } return apiObject } @@ -192,6 +211,12 @@ func flattenLightsailInstancePortState(apiObject *lightsail.InstancePortState) m tfMap["to_port"] = aws.Int64Value(apiObject.ToPort) tfMap["protocol"] = aws.StringValue(apiObject.Protocol) + cidrs := apiObject.Cidrs + sort.Slice(cidrs, func(i, j int) bool { + return *cidrs[i] > *cidrs[j] + }) + tfMap["cidrs"] = aws.StringValueSlice(cidrs) + return tfMap } diff --git a/aws/resource_aws_lightsail_instance_public_ports_test.go b/aws/resource_aws_lightsail_instance_public_ports_test.go index d22363706e1..5907a45c526 100644 --- a/aws/resource_aws_lightsail_instance_public_ports_test.go +++ b/aws/resource_aws_lightsail_instance_public_ports_test.go @@ -71,6 +71,36 @@ func TestAccAWSLightsailInstancePublicPorts_multiple(t *testing.T) { }) } +func TestAccAWSLightsailInstancePublicPorts_cidrs(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lightsail_instance_public_ports.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t) + testAccPreCheckAWSLightsail(t) + }, + ErrorCheck: testAccErrorCheck(t, lightsail.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLightsailInstancePublicPortsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLightsailInstancePublicPortsConfig_cidrs(rName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "port_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "125"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "125"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.cidrs.0", "192.168.1.0/24"), + resource.TestCheckResourceAttr(resourceName, "port_info.0.cidrs.1", "1.1.1.1/32"), + ), + }, + }, + }) +} + func testAccCheckAWSLightsailInstancePublicPortsExists(resourceName string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] @@ -189,3 +219,34 @@ resource "aws_lightsail_instance_public_ports" "test" { } `, rName) } + +func testAccAWSLightsailInstancePublicPortsConfig_cidrs(rName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_lightsail_instance" "test" { + name = %[1]q + availability_zone = data.aws_availability_zones.available.names[0] + blueprint_id = "amazon_linux" + bundle_id = "nano_1_0" +} + +resource "aws_lightsail_instance_public_ports" "test" { + instance_name = aws_lightsail_instance.test.name + + port_info { + protocol = "tcp" + from_port = 125 + to_port = 125 + cidrs = ["192.168.1.0/24", "1.1.1.1/32"] + } +} +`, rName) +} diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index 320f7d51957..c2bbc343363 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -47,6 +47,7 @@ The following arguments are required: * `from_port` - (Required) First port in a range of open ports on an instance. * `protocol` - (Required) IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`. * `to_port` - (Required) Last port in a range of open ports on an instance. +* `cidrs` - (Optional) List of CIDR blocks. ## Attributes Reference From 04600047133297218a6f23f34e922b469426e69e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 05:31:55 -0400 Subject: [PATCH 1136/1252] build(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#18395) Bumps [github.com/hashicorp/terraform-plugin-sdk/v2](https://github.com/hashicorp/terraform-plugin-sdk) from 2.4.4 to 2.5.0. - [Release notes](https://github.com/hashicorp/terraform-plugin-sdk/releases) - [Changelog](https://github.com/hashicorp/terraform-plugin-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/hashicorp/terraform-plugin-sdk/compare/v2.4.4...v2.5.0) 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 305159756c1..f3fff429233 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 github.com/hashicorp/go-multierror v1.1.1 github.com/hashicorp/go-version v1.2.1 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 github.com/jen20/awspolicyequivalence v1.1.0 github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba github.com/mattn/go-colorable v0.1.7 // indirect diff --git a/go.sum b/go.sum index fe235b41d31..ca88e1982cc 100644 --- a/go.sum +++ b/go.sum @@ -196,8 +196,8 @@ github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8 github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 h1:6k0WcxFgVqF/GUFHPvAH8FIrCkoA1RInXzSxhkKamPg= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= From 496fe7b37ecb93071322f121f8fff0bb7b306bf1 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 25 Mar 2021 09:33:47 +0000 Subject: [PATCH 1137/1252] Update CHANGELOG.md for #18395 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae22f5ab4bb..5112fbe4193 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ FEATURES: * **New Data Source:** `aws_codestarconnections_connection` ([#18129](https://github.com/hashicorp/terraform-provider-aws/issues/18129)) +* **New Resource:** `aws_lightsail_instance_public_ports` ([#8611](https://github.com/hashicorp/terraform-provider-aws/issues/8611)) BUG FIXES: From dfc6bd9ada8e6599e5862212223f53d1b467d99c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Mar 2021 09:48:49 +0000 Subject: [PATCH 1138/1252] build(deps): Bump github.com/hashicorp/terraform-plugin-sdk/v2 (#18396) --- awsproviderlint/go.mod | 2 +- awsproviderlint/go.sum | 3 +- .../v2/helper/schema/resource.go | 96 ++++++++++++++++++- .../terraform-plugin-sdk/v2/meta/meta.go | 2 +- awsproviderlint/vendor/modules.txt | 2 +- 5 files changed, 97 insertions(+), 8 deletions(-) diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index 3a3a1e88184..d42c5b438c8 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -5,6 +5,6 @@ go 1.16 require ( github.com/aws/aws-sdk-go v1.38.0 github.com/bflad/tfproviderlint v0.24.0 - github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 + github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb ) diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index 3c0b0bacd6f..2fad834c143 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -208,8 +208,9 @@ github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/045 github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5 h1:ECRaTJhZpRUs7SHB7qHIT4+elRSEWSOYvSx7T4Y0cVo= github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 h1:6k0WcxFgVqF/GUFHPvAH8FIrCkoA1RInXzSxhkKamPg= github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= +github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= diff --git a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go index 2f5663d357e..45dc9c2efcc 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go +++ b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/resource.go @@ -142,6 +142,46 @@ type Resource struct { UpdateContext UpdateContextFunc DeleteContext DeleteContextFunc + // CreateWithoutTimeout is equivalent to CreateContext with no context timeout. + // + // Most resources should prefer CreateContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + CreateWithoutTimeout CreateContextFunc + + // ReadWithoutTimeout is equivalent to ReadContext with no context timeout. + // + // Most resources should prefer ReadContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + ReadWithoutTimeout ReadContextFunc + + // UpdateWithoutTimeout is equivalent to UpdateContext with no context timeout. + // + // Most resources should prefer UpdateContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + UpdateWithoutTimeout UpdateContextFunc + + // DeleteWithoutTimeout is equivalent to DeleteContext with no context timeout. + // + // Most resources should prefer DeleteContext with properly implemented + // operation timeout values, however there are cases where operation + // synchronization across concurrent resources is necessary in the resource + // logic, such as a mutex, to prevent remote system errors. Since these + // operations would have an indeterminate timeout that scales with the + // number of resources, this allows resources to control timeout behavior. + DeleteWithoutTimeout DeleteContextFunc + // CustomizeDiff is a custom function for working with the diff that // Terraform has created for this resource - it can be used to customize the // diff that has been created, diff values not controlled by configuration, @@ -280,6 +320,11 @@ func (r *Resource) create(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.CreateWithoutTimeout != nil { + return r.CreateWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutCreate)) defer cancel() return r.CreateContext(ctx, d, meta) @@ -292,6 +337,11 @@ func (r *Resource) read(ctx context.Context, d *ResourceData, meta interface{}) } return nil } + + if r.ReadWithoutTimeout != nil { + return r.ReadWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutRead)) defer cancel() return r.ReadContext(ctx, d, meta) @@ -304,6 +354,11 @@ func (r *Resource) update(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.UpdateWithoutTimeout != nil { + return r.UpdateWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutUpdate)) defer cancel() return r.UpdateContext(ctx, d, meta) @@ -316,6 +371,11 @@ func (r *Resource) delete(ctx context.Context, d *ResourceData, meta interface{} } return nil } + + if r.DeleteWithoutTimeout != nil { + return r.DeleteWithoutTimeout(ctx, d, meta) + } + ctx, cancel := context.WithTimeout(ctx, d.Timeout(TimeoutDelete)) defer cancel() return r.DeleteContext(ctx, d, meta) @@ -571,19 +631,19 @@ func (r *Resource) RefreshWithoutUpgrade( } func (r *Resource) createFuncSet() bool { - return (r.Create != nil || r.CreateContext != nil) + return (r.Create != nil || r.CreateContext != nil || r.CreateWithoutTimeout != nil) } func (r *Resource) readFuncSet() bool { - return (r.Read != nil || r.ReadContext != nil) + return (r.Read != nil || r.ReadContext != nil || r.ReadWithoutTimeout != nil) } func (r *Resource) updateFuncSet() bool { - return (r.Update != nil || r.UpdateContext != nil) + return (r.Update != nil || r.UpdateContext != nil || r.UpdateWithoutTimeout != nil) } func (r *Resource) deleteFuncSet() bool { - return (r.Delete != nil || r.DeleteContext != nil) + return (r.Delete != nil || r.DeleteContext != nil || r.DeleteWithoutTimeout != nil) } // InternalValidate should be called to validate the structure @@ -722,6 +782,34 @@ func (r *Resource) InternalValidate(topSchemaMap schemaMap, writable bool) error return fmt.Errorf("DeleteContext and Delete should not both be set") } + // check context funcs are not set alongside their without timeout counterparts + if r.CreateContext != nil && r.CreateWithoutTimeout != nil { + return fmt.Errorf("CreateContext and CreateWithoutTimeout should not both be set") + } + if r.ReadContext != nil && r.ReadWithoutTimeout != nil { + return fmt.Errorf("ReadContext and ReadWithoutTimeout should not both be set") + } + if r.UpdateContext != nil && r.UpdateWithoutTimeout != nil { + return fmt.Errorf("UpdateContext and UpdateWithoutTimeout should not both be set") + } + if r.DeleteContext != nil && r.DeleteWithoutTimeout != nil { + return fmt.Errorf("DeleteContext and DeleteWithoutTimeout should not both be set") + } + + // check non-context funcs are not set alongside the context without timeout counterparts + if r.Create != nil && r.CreateWithoutTimeout != nil { + return fmt.Errorf("Create and CreateWithoutTimeout should not both be set") + } + if r.Read != nil && r.ReadWithoutTimeout != nil { + return fmt.Errorf("Read and ReadWithoutTimeout should not both be set") + } + if r.Update != nil && r.UpdateWithoutTimeout != nil { + return fmt.Errorf("Update and UpdateWithoutTimeout should not both be set") + } + if r.Delete != nil && r.DeleteWithoutTimeout != nil { + return fmt.Errorf("Delete and DeleteWithoutTimeout should not both be set") + } + return schemaMap(r.Schema).InternalValidate(tsm) } diff --git a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go index 83537555fb7..e8e2b62f9c2 100644 --- a/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go +++ b/awsproviderlint/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/meta/meta.go @@ -11,7 +11,7 @@ import ( ) // The main version number that is being run at the moment. -var SDKVersion = "2.4.4" +var SDKVersion = "2.5.0" // A pre-release marker for the version. If this is "" (empty string) // then it means that it is a final release. Otherwise, this is a pre-release diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index ea532746238..048a9a27bae 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -285,7 +285,7 @@ github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/tfplugin5 github.com/hashicorp/terraform-plugin-go/tfprotov5/internal/toproto github.com/hashicorp/terraform-plugin-go/tfprotov5/server github.com/hashicorp/terraform-plugin-go/tfprotov5/tftypes -# github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4 +# github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 ## explicit github.com/hashicorp/terraform-plugin-sdk/v2/diag github.com/hashicorp/terraform-plugin-sdk/v2/helper/logging From 9f292958bccd667febea9fa5cba861ea90a288b8 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 09:44:34 -0400 Subject: [PATCH 1139/1252] r/lightsail_instance_public_ports: Alphabetize args --- ...urce_aws_lightsail_instance_public_ports.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/aws/resource_aws_lightsail_instance_public_ports.go b/aws/resource_aws_lightsail_instance_public_ports.go index 4019948f569..c7552cf43b5 100644 --- a/aws/resource_aws_lightsail_instance_public_ports.go +++ b/aws/resource_aws_lightsail_instance_public_ports.go @@ -34,6 +34,15 @@ func resourceAwsLightsailInstancePublicPorts() *schema.Resource { MinItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "cidrs": { + Type: schema.TypeList, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateCIDRNetworkAddress, + }, + }, "from_port": { Type: schema.TypeInt, Required: true, @@ -52,15 +61,6 @@ func resourceAwsLightsailInstancePublicPorts() *schema.Resource { ForceNew: true, ValidateFunc: validation.IntBetween(0, 65535), }, - "cidrs": { - Type: schema.TypeList, - Optional: true, - Computed: true, - Elem: &schema.Schema{ - Type: schema.TypeString, - ValidateFunc: validateCIDRNetworkAddress, - }, - }, }, }, }, From d8619a40b55671b50ae0b493a4d1304813a65497 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 09:45:00 -0400 Subject: [PATCH 1140/1252] docs/r/lightsail_instance_public_ports: Minor fix --- website/docs/r/lightsail_instance_public_ports.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index c2bbc343363..c53f92b9e61 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -44,10 +44,10 @@ The following arguments are required: ### port_info +* `cidrs` - (Optional) List of CIDR blocks. * `from_port` - (Required) First port in a range of open ports on an instance. * `protocol` - (Required) IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`. * `to_port` - (Required) Last port in a range of open ports on an instance. -* `cidrs` - (Optional) List of CIDR blocks. ## Attributes Reference From 3d5b25ccaed393a38eb08f385f5eefc438c884d9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 10:31:09 -0400 Subject: [PATCH 1141/1252] r/lightsail_instance_public_ports: Change CIDRs to set --- ...rce_aws_lightsail_instance_public_ports.go | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/aws/resource_aws_lightsail_instance_public_ports.go b/aws/resource_aws_lightsail_instance_public_ports.go index c7552cf43b5..4531f19dd9d 100644 --- a/aws/resource_aws_lightsail_instance_public_ports.go +++ b/aws/resource_aws_lightsail_instance_public_ports.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "log" - "sort" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lightsail" @@ -35,7 +34,7 @@ func resourceAwsLightsailInstancePublicPorts() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "cidrs": { - Type: schema.TypeList, + Type: schema.TypeSet, Optional: true, Computed: true, Elem: &schema.Schema{ @@ -161,14 +160,9 @@ func expandLightsailPortInfo(tfMap map[string]interface{}) *lightsail.PortInfo { ToPort: aws.Int64((int64)(tfMap["to_port"].(int))), Protocol: aws.String(tfMap["protocol"].(string)), } - if cidrs, ok := tfMap["cidrs"]; ok { - for _, v := range cidrs.([]interface{}) { - apiObject.Cidrs = append(apiObject.Cidrs, aws.String(v.(string))) - } - sort.Slice(apiObject.Cidrs, func(i, j int) bool { - return *apiObject.Cidrs[i] > *apiObject.Cidrs[j] - }) + if v, ok := tfMap["cidrs"].(*schema.Set); ok && v.Len() > 0 { + apiObject.Cidrs = expandStringSet(v) } return apiObject @@ -211,11 +205,9 @@ func flattenLightsailInstancePortState(apiObject *lightsail.InstancePortState) m tfMap["to_port"] = aws.Int64Value(apiObject.ToPort) tfMap["protocol"] = aws.StringValue(apiObject.Protocol) - cidrs := apiObject.Cidrs - sort.Slice(cidrs, func(i, j int) bool { - return *cidrs[i] > *cidrs[j] - }) - tfMap["cidrs"] = aws.StringValueSlice(cidrs) + if v := apiObject.Cidrs; v != nil { + tfMap["cidrs"] = aws.StringValueSlice(v) + } return tfMap } From bfd07db496026cffdad263ce975a7d9bcb61cbe7 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 10:31:45 -0400 Subject: [PATCH 1142/1252] tests/r/lightsail_instance_public_ports: Nested attr check --- ...ource_aws_lightsail_instance_public_ports_test.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/aws/resource_aws_lightsail_instance_public_ports_test.go b/aws/resource_aws_lightsail_instance_public_ports_test.go index 5907a45c526..c49b810a625 100644 --- a/aws/resource_aws_lightsail_instance_public_ports_test.go +++ b/aws/resource_aws_lightsail_instance_public_ports_test.go @@ -90,11 +90,13 @@ func TestAccAWSLightsailInstancePublicPorts_cidrs(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), resource.TestCheckResourceAttr(resourceName, "port_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "125"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "125"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.cidrs.0", "192.168.1.0/24"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.cidrs.1", "1.1.1.1/32"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "port_info.*", map[string]string{ + "protocol": "tcp", + "from_port": "125", + "to_port": "125", + "cidrs.0": "1.1.1.1/32", + "cidrs.1": "192.168.1.0/24", + }), ), }, }, From 29afc7cd014136e4248185848f8be43616cc7470 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 10:32:10 -0400 Subject: [PATCH 1143/1252] r/lightsail_instance_public_ports: Add changelog --- .changelog/14905.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/14905.txt diff --git a/.changelog/14905.txt b/.changelog/14905.txt new file mode 100644 index 00000000000..55bc3a98001 --- /dev/null +++ b/.changelog/14905.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_light_instance_public_ports: Add `cidrs` argument to `port_info` +``` \ No newline at end of file From 5fce8f950ffe1a0bcf2727264539b4955bc8934b Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 10:35:00 -0400 Subject: [PATCH 1144/1252] docs/r/lightsail_instance_public_ports: Fix docs --- .../docs/r/lightsail_instance_public_ports.html.markdown | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/website/docs/r/lightsail_instance_public_ports.html.markdown b/website/docs/r/lightsail_instance_public_ports.html.markdown index c53f92b9e61..3e9b98ce0f6 100644 --- a/website/docs/r/lightsail_instance_public_ports.html.markdown +++ b/website/docs/r/lightsail_instance_public_ports.html.markdown @@ -44,11 +44,16 @@ The following arguments are required: ### port_info -* `cidrs` - (Optional) List of CIDR blocks. +The following arguments are required: + * `from_port` - (Required) First port in a range of open ports on an instance. * `protocol` - (Required) IP protocol name. Valid values are `tcp`, `all`, `udp`, and `icmp`. * `to_port` - (Required) Last port in a range of open ports on an instance. +The following arguments are optional: + +* `cidrs` - (Optional) Set of CIDR blocks. + ## Attributes Reference In addition to all arguments above, the following attributes are exported: From 4d8517094d4e7e1760a6d233ef0278ff5f8ee70e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 11:04:56 -0400 Subject: [PATCH 1145/1252] tests/r/lightsail_instance_public_ports: Use set testing --- ...ws_lightsail_instance_public_ports_test.go | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/aws/resource_aws_lightsail_instance_public_ports_test.go b/aws/resource_aws_lightsail_instance_public_ports_test.go index c49b810a625..ac152a39cba 100644 --- a/aws/resource_aws_lightsail_instance_public_ports_test.go +++ b/aws/resource_aws_lightsail_instance_public_ports_test.go @@ -31,9 +31,11 @@ func TestAccAWSLightsailInstancePublicPorts_basic(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), resource.TestCheckResourceAttr(resourceName, "port_info.#", "1"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "80"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "80"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "port_info.*", map[string]string{ + "protocol": "tcp", + "from_port": "80", + "to_port": "80", + }), ), }, }, @@ -59,12 +61,16 @@ func TestAccAWSLightsailInstancePublicPorts_multiple(t *testing.T) { Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLightsailInstancePublicPortsExists(resourceName), resource.TestCheckResourceAttr(resourceName, "port_info.#", "2"), - resource.TestCheckResourceAttr(resourceName, "port_info.1.protocol", "tcp"), - resource.TestCheckResourceAttr(resourceName, "port_info.1.from_port", "80"), - resource.TestCheckResourceAttr(resourceName, "port_info.1.to_port", "80"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.protocol", "tcp"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.from_port", "443"), - resource.TestCheckResourceAttr(resourceName, "port_info.0.to_port", "443"), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "port_info.*", map[string]string{ + "protocol": "tcp", + "from_port": "80", + "to_port": "80", + }), + resource.TestCheckTypeSetElemNestedAttrs(resourceName, "port_info.*", map[string]string{ + "protocol": "tcp", + "from_port": "443", + "to_port": "443", + }), ), }, }, @@ -94,9 +100,10 @@ func TestAccAWSLightsailInstancePublicPorts_cidrs(t *testing.T) { "protocol": "tcp", "from_port": "125", "to_port": "125", - "cidrs.0": "1.1.1.1/32", - "cidrs.1": "192.168.1.0/24", + "cidrs.#": "2", }), + resource.TestCheckTypeSetElemAttr(resourceName, "port_info.*.cidrs.*", "1.1.1.1/32"), + resource.TestCheckTypeSetElemAttr(resourceName, "port_info.*.cidrs.*", "192.168.1.0/24"), ), }, }, From 4c344565a0484d0fbadb85b2544d306abd36d4be Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Jun 2020 16:07:29 -0400 Subject: [PATCH 1146/1252] r/aws_route: Refactor acceptance tests in preparation for future fixes/enhancements. --- aws/data_source_aws_route_test.go | 5 - aws/resource_aws_route_test.go | 1988 +++++++++++++++++++---------- 2 files changed, 1295 insertions(+), 698 deletions(-) diff --git a/aws/data_source_aws_route_test.go b/aws/data_source_aws_route_test.go index 29fede2dc29..c61351e3300 100644 --- a/aws/data_source_aws_route_test.go +++ b/aws/data_source_aws_route_test.go @@ -4,7 +4,6 @@ import ( "fmt" "testing" - "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -48,7 +47,6 @@ func TestAccAWSRouteDataSource_basic(t *testing.T) { } func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) { - var route ec2.Route dataSourceName := "data.aws_route.test" resourceName := "aws_route.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -62,7 +60,6 @@ func TestAccAWSRouteDataSource_TransitGatewayID(t *testing.T) { { Config: testAccAWSRouteDataSourceConfigIpv4TransitGateway(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttrPair(resourceName, "destination_cidr_block", dataSourceName, "destination_cidr_block"), resource.TestCheckResourceAttrPair(resourceName, "route_table_id", dataSourceName, "route_table_id"), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", dataSourceName, "transit_gateway_id"), @@ -95,7 +92,6 @@ func TestAccAWSRouteDataSource_IPv6DestinationCidr(t *testing.T) { } func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) { - var route ec2.Route dataSourceName := "data.aws_route.by_local_gateway_id" resourceName := "aws_route.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -109,7 +105,6 @@ func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) { { Config: testAccAWSRouteDataSourceConfigIpv4LocalGateway(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttrPair(resourceName, "destination_cidr_block", dataSourceName, "destination_cidr_block"), resource.TestCheckResourceAttrPair(resourceName, "route_table_id", dataSourceName, "route_table_id"), resource.TestCheckResourceAttrPair(resourceName, "local_gateway_id", dataSourceName, "local_gateway_id"), diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index fc284ca32bc..49db7905fb4 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -10,45 +10,46 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +// IPv4 to Internet Gateway. func TestAccAWSRoute_basic(t *testing.T) { - var route ec2.Route - - //aws creates a default route - testCheck := func(s *terraform.State) error { - if *route.DestinationCidrBlock != "10.3.0.0/16" { - return fmt.Errorf("Destination Cidr (Expected=%s, Actual=%s)\n", "10.3.0.0/16", *route.DestinationCidrBlock) - } - - name := "aws_internet_gateway.foo" - gwres, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s\n", name) - } - - if *route.GatewayId != gwres.Primary.ID { - return fmt.Errorf("Internet Gateway Id (Expected=%s, Actual=%s)\n", gwres.Primary.ID, *route.GatewayId) - } - - return nil - } + var routeTable ec2.RouteTable + resourceName := "aws_route.test" + igwResourceName := "aws_internet_gateway.test" + rtResourceName := "aws_route_table.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteBasicConfig(), + Config: testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), - testCheck, + testAccCheckRouteTableExists(rtResourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", igwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.bar", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.bar"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, @@ -56,19 +57,19 @@ func TestAccAWSRoute_basic(t *testing.T) { } func TestAccAWSRoute_disappears(t *testing.T) { - var route ec2.Route + resourceName := "aws_route.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteBasicConfig(), + Config: testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), - testAccCheckResourceDisappears(testAccProvider, resourceAwsRoute(), "aws_route.bar"), + testAccCheckResourceDisappears(testAccProvider, resourceAwsRoute(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -76,348 +77,733 @@ func TestAccAWSRoute_disappears(t *testing.T) { }) } -func TestAccAWSRoute_ipv6Support(t *testing.T) { - var route ec2.Route - - //aws creates a default route - testCheck := func(s *terraform.State) error { - name := "aws_egress_only_internet_gateway.foo" - gwres, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s\n", name) - } +func TestAccAWSRoute_disappears_RouteTable(t *testing.T) { + rtResourceName := "aws_route_table.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" - if *route.EgressOnlyInternetGatewayId != gwres.Primary.ID { - return fmt.Errorf("Egress Only Internet Gateway Id (Expected=%s, Actual=%s)\n", gwres.Primary.ID, *route.EgressOnlyInternetGatewayId) - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + testAccCheckResourceDisappears(testAccProvider, resourceAwsRouteTable(), rtResourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} - return nil - } +func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { + resourceName := "aws_route.test" + eoigwResourceName := "aws_egress_only_internet_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6(), + Config: testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), - testCheck, - resource.TestCheckResourceAttr("aws_route.bar", "destination_ipv6_cidr_block", "::/0"), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "egress_only_gateway_id", eoigwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.bar", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.bar"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, { - Config: testAccAWSRouteConfigIpv6Expanded(), + // Verify that expanded form of the destination CIDR causes no diff. + Config: testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, "::0/0"), PlanOnly: true, }, }, }) } -func TestAccAWSRoute_ipv6ToInternetGateway(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { + resourceName := "aws_route.test" + igwResourceName := "aws_internet_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6InternetGateway(), + Config: testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.igw", &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", igwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.igw", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.igw"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_ipv6ToInstance(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { + resourceName := "aws_route.test" + instanceResourceName := "aws_instance.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6Instance(), + Config: testAccAWSRouteConfigIpv6Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.internal-default-route-ipv6", &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.internal-default-route-ipv6", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.internal-default-route-ipv6"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, + }, + }) +} + +func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { + resourceName := "aws_route.test" + eniResourceName := "aws_network_interface.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6InstanceExpanded(), - PlanOnly: true, + Config: testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eniResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_ipv6ToNetworkInterface(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { + resourceName := "aws_route.test" + pcxResourceName := "aws_vpc_peering_connection.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6NetworkInterface(), + Config: testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.internal-default-route-ipv6", &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), ), }, { - ResourceName: "aws_route.internal-default-route-ipv6", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.internal-default-route-ipv6"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_ipv6ToPeeringConnection(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { + resourceName := "aws_route.test" + vgwResourceName := "aws_vpn_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigIpv6PeeringConnection(), + Config: testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.pc", &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", vgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.pc", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.pc"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_changeRouteTable(t *testing.T) { - var before ec2.Route - var after ec2.Route +func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { + resourceName := "aws_route.test" + vgwResourceName := "aws_vpn_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteBasicConfig(), + Config: testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &before), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", vgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - Config: testAccAWSRouteNewRouteTable(), + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { + resourceName := "aws_route.test" + instanceResourceName := "aws_instance.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &after), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.bar", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.bar"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_changeCidr(t *testing.T) { - var route ec2.Route - var routeTable ec2.RouteTable - - //aws creates a default route - testCheck := func(s *terraform.State) error { - if *route.DestinationCidrBlock != "10.3.0.0/16" { - return fmt.Errorf("Destination Cidr (Expected=%s, Actual=%s)\n", "10.3.0.0/16", *route.DestinationCidrBlock) - } - - name := "aws_internet_gateway.foo" - gwres, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s\n", name) - } - - if *route.GatewayId != gwres.Primary.ID { - return fmt.Errorf("Internet Gateway Id (Expected=%s, Actual=%s)\n", gwres.Primary.ID, *route.GatewayId) - } +func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { + resourceName := "aws_route.test" + eniResourceName := "aws_network_interface.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" - return nil - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eniResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} - testCheckChange := func(s *terraform.State) error { - if *route.DestinationCidrBlock != "10.2.0.0/16" { - return fmt.Errorf("Destination Cidr (Expected=%s, Actual=%s)\n", "10.2.0.0/16", *route.DestinationCidrBlock) - } +func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { + resourceName := "aws_route.test" + eniResourceName := "aws_network_interface.test" + instanceResourceName := "aws_instance.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" - name := "aws_internet_gateway.foo" - gwres, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s\n", name) - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eniResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} - if *route.GatewayId != gwres.Primary.ID { - return fmt.Errorf("Internet Gateway Id (Expected=%s, Actual=%s)\n", gwres.Primary.ID, *route.GatewayId) - } +/* +func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { + resourceName := "aws_route.test" + eni1ResourceName := "aws_network_interface.test1" + eni2ResourceName := "aws_network_interface.test2" + instanceResourceName := "aws_instance.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" - if rtlen := len(routeTable.Routes); rtlen != 2 { - return fmt.Errorf("Route Table has too many routes (Expected=%d, Actual=%d)\n", rtlen, 2) - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni1ResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eni1ResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni2ResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eni2ResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} +*/ - return nil - } +func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { + resourceName := "aws_route.test" + pcxResourceName := "aws_vpc_peering_connection.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteBasicConfig(), + Config: testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), - testCheck, + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), ), }, { - Config: testAccAWSRouteBasicConfigChangeCidr(), + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { + resourceName := "aws_route.test" + ngwResourceName := "aws_nat_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), - testAccCheckRouteTableExists("aws_route_table.foo", &routeTable), - testCheckChange, + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "nat_gateway_id", ngwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.bar", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.bar"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_noopdiff(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_DoesNotCrashWithVpcEndpoint(t *testing.T) { var routeTable ec2.RouteTable - - testCheck := func(s *terraform.State) error { - return nil - } - - testCheckChange := func(s *terraform.State) error { - return nil - } + resourceName := "aws_route.test" + rtResourceName := "aws_route_table.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteNoopChange(), + Config: testAccAWSRouteConfigWithVpcEndpoint(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.test", &route), - testCheck, + testAccCheckRouteTableExists(rtResourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), ), }, { - Config: testAccAWSRouteNoopChange(), + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { + resourceName := "aws_route.test" + tgwResourceName := "aws_ec2_transit_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.test", &route), - testAccCheckRouteTableExists("aws_route_table.test", &routeTable), - testCheckChange, + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", tgwResourceName, "id"), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.test", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.test"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_doesNotCrashWithVPCEndpoint(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { + resourceName := "aws_route.test" + tgwResourceName := "aws_ec2_transit_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteWithVPCEndpoint(), + Config: testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists("aws_route.bar", &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", tgwResourceName, "id"), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { - ResourceName: "aws_route.bar", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSRouteImportStateIdFunc("aws_route.bar"), + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func TestAccAWSRoute_TransitGatewayID_DestinationCidrBlock(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { resourceName := "aws_route.test" - transitGatewayResourceName := "aws_ec2_transit_gateway.test" + localGatewayDataSourceName := "data.aws_ec2_local_gateway.first" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "172.16.1.0/24" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigTransitGatewayIDDestinatationCidrBlock(), + Config: testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), - resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", transitGatewayResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "local_gateway_id", localGatewayDataSourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { @@ -430,22 +816,35 @@ func TestAccAWSRoute_TransitGatewayID_DestinationCidrBlock(t *testing.T) { }) } -func TestAccAWSRoute_LocalGatewayID(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { resourceName := "aws_route.test" localGatewayDataSourceName := "data.aws_ec2_local_gateway.first" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "2002:bc9:1234:1a00::/56" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteResourceConfigLocalGatewayID(), + Config: testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), resource.TestCheckResourceAttrPair(resourceName, "local_gateway_id", localGatewayDataSourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { @@ -459,30 +858,28 @@ func TestAccAWSRoute_LocalGatewayID(t *testing.T) { } func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { - var route ec2.Route resourceName := "aws_route.test" rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.2.0.0/16" + destinationIpv6Cidr := "::/0" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, false), + Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), - resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", "0.0.0.0/0"), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), ), }, { - Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, true), + Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr, true), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), - resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", "::/0"), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationIpv6Cidr), ), }, { @@ -495,23 +892,35 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { }) } -func TestAccAWSRoute_VpcEndpointId(t *testing.T) { - var route ec2.Route +func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_route.test" vpcEndpointResourceName := "aws_vpc_endpoint.test" + destinationCidr := "172.16.1.0/24" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteResourceConfigVpcEndpointId(rName), + Config: testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + // TODO resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), resource.TestCheckResourceAttrPair(resourceName, "vpc_endpoint_id", vpcEndpointResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, { @@ -524,39 +933,6 @@ func TestAccAWSRoute_VpcEndpointId(t *testing.T) { }) } -func testAccCheckAWSRouteExists(n string, res *ec2.Route) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[n] - if !ok { - return fmt.Errorf("Not found: %s\n", n) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No ID is set") - } - - conn := testAccProvider.Meta().(*AWSClient).ec2conn - r, err := resourceAwsRouteFindRoute( - conn, - rs.Primary.Attributes["route_table_id"], - rs.Primary.Attributes["destination_cidr_block"], - rs.Primary.Attributes["destination_ipv6_cidr_block"], - ) - - if err != nil { - return err - } - - if r == nil { - return fmt.Errorf("Route not found") - } - - *res = *r - - return nil - } -} - func testAccCheckAWSRouteDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_route" { @@ -595,682 +971,946 @@ func testAccAWSRouteImportStateIdFunc(resourceName string) resource.ImportStateI } } -func testAccAWSRouteBasicConfig() string { - return ` -resource "aws_vpc" "foo" { +func testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-route-basic" + Name = %[1]q } } -resource "aws_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-basic" + Name = %[1]q } } -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_route" "bar" { - route_table_id = aws_route_table.foo.id - destination_cidr_block = "10.3.0.0/16" - gateway_id = aws_internet_gateway.foo.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + gateway_id = aws_internet_gateway.test.id } -` +`, rName, destinationCidr) } -func testAccAWSRouteConfigIpv6InternetGateway() string { - return ` -resource "aws_vpc" "foo" { +func testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true tags = { - Name = "terraform-testacc-route-ipv6-igw" + Name = %[1]q } } -resource "aws_egress_only_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_egress_only_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-ipv6-igw" + Name = %[1]q } } -resource "aws_route_table" "external" { - vpc_id = aws_vpc.foo.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_route" "igw" { - route_table_id = aws_route_table.external.id - destination_ipv6_cidr_block = "::/0" - gateway_id = aws_internet_gateway.foo.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + gateway_id = aws_internet_gateway.test.id } -` +`, rName, destinationCidr) } -func testAccAWSRouteConfigIpv6NetworkInterface() string { +func testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr string) string { return composeConfig( - testAccAvailableEc2InstanceTypeForAvailabilityZone("aws_subnet.router-network.availability_zone", "t2.small", "t3.small"), - testAccLatestAmazonLinuxHvmEbsAmiConfig(), ` -resource "aws_vpc" "examplevpc" { - cidr_block = "10.100.0.0/16" - enable_dns_hostnames = true + testAccAvailableAZsNoOptInConfig(), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true tags = { - Name = "terraform-testacc-route-ipv6-network-interface" + Name = %[1]q } } -data "aws_availability_zones" "available" { - state = "available" +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] + tags = { + Name = %[1]q } } -resource "aws_internet_gateway" "internet" { - vpc_id = aws_vpc.examplevpc.id +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id tags = { - Name = "terraform-testacc-route-ipv6-network-interface" + Name = %[1]q } } -resource "aws_route" "igw" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.internet.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_route" "igw-ipv6" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_ipv6_cidr_block = "::/0" - gateway_id = aws_internet_gateway.internet.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id +} +`, rName, destinationCidr)) } -resource "aws_subnet" "router-network" { - cidr_block = "10.100.1.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 1) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = true - availability_zone = data.aws_availability_zones.available.names[0] +func testAccAWSRouteConfigIpv6Instance(rName, destinationCidr string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true tags = { - Name = "tf-acc-route-ipv6-network-interface-router" + Name = %[1]q } } -resource "aws_subnet" "client-network" { - cidr_block = "10.100.10.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 2) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = false - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) tags = { - Name = "tf-acc-route-ipv6-network-interface-client" + Name = %[1]q } } -resource "aws_route_table" "client-routes" { - vpc_id = aws_vpc.examplevpc.id +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.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 + } } -resource "aws_route_table_association" "client-routes" { - route_table_id = aws_route_table.client-routes.id - subnet_id = aws_subnet.client-network.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_instance" "test-router" { - 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.router-network.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + instance_id = aws_instance.test.id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_vpc" "target" { + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } } -resource "aws_network_interface" "router-internal" { - subnet_id = aws_subnet.client-network.id - source_dest_check = false +resource "aws_vpc_peering_connection" "test" { + vpc_id = aws_vpc.test.id + peer_vpc_id = aws_vpc.target.id + auto_accept = true + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -resource "aws_network_interface_attachment" "router-internal" { - device_index = 1 - instance_id = aws_instance.test-router.id - network_interface_id = aws_network_interface.router-internal.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + vpc_peering_connection_id = aws_vpc_peering_connection.test.id +} +`, rName, destinationCidr) } -resource "aws_route" "internal-default-route" { - route_table_id = aws_route_table.client-routes.id - destination_cidr_block = "0.0.0.0/0" - network_interface_id = aws_network_interface.router-internal.id +func testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } } -resource "aws_route" "internal-default-route-ipv6" { - route_table_id = aws_route_table.client-routes.id - destination_ipv6_cidr_block = "::/0" - network_interface_id = aws_network_interface.router-internal.id +resource "aws_egress_only_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -`) + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -func testAccAWSRouteConfigIpv6Instance() string { +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + egress_only_gateway_id = aws_egress_only_internet_gateway.test.id +} +`, rName, destinationCidr) +} + +func testAccAWSRouteConfigWithVpcEndpoint(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = "10.3.0.0/16" + gateway_id = aws_internet_gateway.test.id + + # Forcing endpoint to create before route - without this the crash is a race. + depends_on = [aws_vpc_endpoint.test] +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = aws_vpc.test.id + service_name = "com.amazonaws.${data.aws_region.current.name}.s3" + route_table_ids = [aws_route_table.test.id] +} +`, rName) +} + +func testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr string) string { return composeConfig( - testAccAvailableEc2InstanceTypeForAvailabilityZone("aws_subnet.router-network.availability_zone", "t2.small", "t3.small"), - testAccLatestAmazonLinuxHvmEbsAmiConfig(), ` -resource "aws_vpc" "examplevpc" { - cidr_block = "10.100.0.0/16" - enable_dns_hostnames = true + testAccAvailableAZsNoOptInDefaultExcludeConfig(), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_transit_gateway" "test" { + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_transit_gateway_vpc_attachment" "test" { + subnet_ids = [aws_subnet.test.id] + transit_gateway_id = aws_ec2_transit_gateway.test.id + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + destination_cidr_block = %[2]q + route_table_id = aws_route_table.test.id + transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr string) string { + return composeConfig( + testAccAvailableAZsNoOptInDefaultExcludeConfig(), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true tags = { - Name = "terraform-testacc-route-ipv6-instance" + Name = %[1]q } } -data "aws_availability_zones" "available" { - state = "available" +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_transit_gateway" "test" { + tags = { + Name = %[1]q } } -resource "aws_internet_gateway" "internet" { - vpc_id = aws_vpc.examplevpc.id +resource "aws_ec2_transit_gateway_vpc_attachment" "test" { + subnet_ids = [aws_subnet.test.id] + transit_gateway_id = aws_ec2_transit_gateway.test.id + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + destination_ipv6_cidr_block = %[2]q + route_table_id = aws_route_table.test.id + transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr string, ipv6Route bool) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +locals { + ipv6 = %[4]t + destination = %[2]q + destination_ipv6 = %[3]q +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + gateway_id = aws_internet_gateway.test.id + + destination_cidr_block = local.ipv6 ? "" : local.destination + destination_ipv6_cidr_block = local.ipv6 ? local.destination_ipv6 : "" +} +`, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) +} + +func testAccAWSRouteConfigIpv4Instance(rName, destinationCidr string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + + tags = { + Name = %[1]q + } +} + +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type + subnet_id = aws_subnet.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + instance_id = aws_instance.test.id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr string) string { + return composeConfig( + testAccAvailableAZsNoOptInConfig(), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + + tags = { + Name = %[1]q + } +} + +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +data "aws_ec2_local_gateways" "all" {} + +data "aws_ec2_local_gateway" "first" { + id = tolist(data.aws_ec2_local_gateways.all.ids)[0] +} + +data "aws_ec2_local_gateway_route_tables" "all" {} + +data "aws_ec2_local_gateway_route_table" "first" { + local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" tags = { - Name = "terraform-testacc-route-ipv6-instance" + Name = %[1]q } } -resource "aws_route" "igw" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.internet.id -} - -resource "aws_route" "igw-ipv6" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_ipv6_cidr_block = "::/0" - gateway_id = aws_internet_gateway.internet.id -} - -resource "aws_subnet" "router-network" { - cidr_block = "10.100.1.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 1) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = true - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { + local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id + vpc_id = aws_vpc.test.id tags = { - Name = "tf-acc-route-ipv6-instance-router" + Name = %[1]q } } -resource "aws_subnet" "client-network" { - cidr_block = "10.100.10.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 2) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = false - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "tf-acc-route-ipv6-instance-client" + Name = %[1]q } -} -resource "aws_route_table" "client-routes" { - vpc_id = aws_vpc.examplevpc.id + depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] } -resource "aws_route_table_association" "client-routes" { - route_table_id = aws_route_table.client-routes.id - subnet_id = aws_subnet.client-network.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + local_gateway_id = data.aws_ec2_local_gateway.first.id } - -resource "aws_instance" "test-router" { - 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.router-network.id +`, rName, destinationCidr) } -resource "aws_route" "internal-default-route" { - route_table_id = aws_route_table.client-routes.id - destination_cidr_block = "0.0.0.0/0" - instance_id = aws_instance.test-router.id -} +func testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +data "aws_ec2_local_gateways" "all" {} -resource "aws_route" "internal-default-route-ipv6" { - route_table_id = aws_route_table.client-routes.id - destination_ipv6_cidr_block = "::/0" - instance_id = aws_instance.test-router.id +data "aws_ec2_local_gateway" "first" { + id = tolist(data.aws_ec2_local_gateways.all.ids)[0] } -`) + +data "aws_ec2_local_gateway_route_tables" "all" {} + +data "aws_ec2_local_gateway_route_table" "first" { + local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] } -func testAccAWSRouteConfigIpv6InstanceExpanded() string { - return composeConfig( - testAccAvailableEc2InstanceTypeForAvailabilityZone("aws_subnet.router-network.availability_zone", "t2.small", "t3.small"), - testAccLatestAmazonLinuxHvmEbsAmiConfig(), ` -resource "aws_vpc" "examplevpc" { - cidr_block = "10.100.0.0/16" - enable_dns_hostnames = true +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" assign_generated_ipv6_cidr_block = true tags = { - Name = "terraform-testacc-route-ipv6-instance" + Name = %[1]q } } -data "aws_availability_zones" "available" { - state = "available" +resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { + local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id + vpc_id = aws_vpc.test.id - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] + tags = { + Name = %[1]q } } -resource "aws_internet_gateway" "internet" { - vpc_id = aws_vpc.examplevpc.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-ipv6-instance" + Name = %[1]q } -} -resource "aws_route" "igw" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_cidr_block = "0.0.0.0/0" - gateway_id = aws_internet_gateway.internet.id + depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] } -resource "aws_route" "igw-ipv6" { - route_table_id = aws_vpc.examplevpc.main_route_table_id - destination_ipv6_cidr_block = "::0/0" - gateway_id = aws_internet_gateway.internet.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + local_gateway_id = data.aws_ec2_local_gateway.first.id +} +`, rName, destinationCidr) } -resource "aws_subnet" "router-network" { - cidr_block = "10.100.1.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 1) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = true - availability_zone = data.aws_availability_zones.available.names[0] +func testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" tags = { - Name = "tf-acc-route-ipv6-instance-router" + Name = %[1]q } } -resource "aws_subnet" "client-network" { - cidr_block = "10.100.10.0/24" - vpc_id = aws_vpc.examplevpc.id - ipv6_cidr_block = cidrsubnet(aws_vpc.examplevpc.ipv6_cidr_block, 8, 2) - assign_ipv6_address_on_creation = true - map_public_ip_on_launch = false - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] tags = { - Name = "tf-acc-route-ipv6-instance-client" + Name = %[1]q } } -resource "aws_route_table" "client-routes" { - vpc_id = aws_vpc.examplevpc.id -} +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id -resource "aws_route_table_association" "client-routes" { - route_table_id = aws_route_table.client-routes.id - subnet_id = aws_subnet.client-network.id + tags = { + Name = %[1]q + } } -resource "aws_instance" "test-router" { - ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id instance_type = data.aws_ec2_instance_type_offering.available.instance_type - subnet_id = aws_subnet.router-network.id -} - -resource "aws_route" "internal-default-route" { - route_table_id = aws_route_table.client-routes.id - destination_cidr_block = "0.0.0.0/0" - instance_id = aws_instance.test-router.id -} -resource "aws_route" "internal-default-route-ipv6" { - route_table_id = aws_route_table.client-routes.id - destination_ipv6_cidr_block = "::0/0" - instance_id = aws_instance.test-router.id -} -`) -} - -func testAccAWSRouteConfigIpv6PeeringConnection() string { - return ` -resource "aws_vpc" "foo" { - cidr_block = "10.0.0.0/16" - assign_generated_ipv6_cidr_block = true + network_interface { + device_index = 0 + network_interface_id = aws_network_interface.test.id + } tags = { - Name = "terraform-testacc-route-ipv6-peering-connection" + Name = %[1]q } } -resource "aws_vpc" "bar" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true -} - -resource "aws_vpc_peering_connection" "foo" { - vpc_id = aws_vpc.foo.id - peer_vpc_id = aws_vpc.bar.id - auto_accept = true -} - -resource "aws_route_table" "peering" { - vpc_id = aws_vpc.foo.id -} - -resource "aws_route" "pc" { - route_table_id = aws_route_table.peering.id - destination_ipv6_cidr_block = aws_vpc.bar.ipv6_cidr_block - vpc_peering_connection_id = aws_vpc_peering_connection.foo.id -} -` -} - -func testAccAWSRouteConfigIpv6() string { - return ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-ipv6" + Name = %[1]q } } -resource "aws_egress_only_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id -} - -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id -} +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id -resource "aws_route" "bar" { - route_table_id = aws_route_table.foo.id - destination_ipv6_cidr_block = "::/0" - egress_only_gateway_id = aws_egress_only_internet_gateway.foo.id + # Wait for the ENI attachment. + depends_on = [aws_instance.test] } -` +`, rName, destinationCidr)) } -func testAccAWSRouteConfigIpv6Expanded() string { - return ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true +/* +func testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, targetResourceName string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-route-ipv6" + Name = %[1]q } } -resource "aws_egress_only_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id -} - -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id -} - -resource "aws_route" "bar" { - route_table_id = aws_route_table.foo.id - destination_ipv6_cidr_block = "::0/0" - egress_only_gateway_id = aws_egress_only_internet_gateway.foo.id -} -` -} - -func testAccAWSRouteBasicConfigChangeCidr() string { - return ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] tags = { - Name = "terraform-testacc-route-change-cidr" + Name = %[1]q } } -resource "aws_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_network_interface" "test1" { + subnet_id = aws_subnet.test.id tags = { - Name = "terraform-testacc-route-change-cidr" + Name = %[1]q } } -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id -} +resource "aws_network_interface" "test2" { + subnet_id = aws_subnet.test.id -resource "aws_route" "bar" { - route_table_id = aws_route_table.foo.id - destination_cidr_block = "10.2.0.0/16" - gateway_id = aws_internet_gateway.foo.id -} -` + tags = { + Name = %[1]q + } } -func testAccAWSRouteNoopChange() string { - return composeConfig( - testAccAvailableEc2InstanceTypeForAvailabilityZone("aws_subnet.test.availability_zone", "t2.nano", "t3.nano"), - testAccLatestAmazonLinuxHvmEbsAmiConfig(), ` -data "aws_availability_zones" "available" { - state = "available" +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type - filter { - name = "opt-in-status" - values = ["opt-in-not-required"] + network_interface { + device_index = 0 + network_interface_id = aws_network_interface.test1.id } -} -resource "aws_vpc" "test" { - cidr_block = "10.10.0.0/16" + network_interface { + device_index = 1 + network_interface_id = aws_network_interface.test2.id + } tags = { - Name = "terraform-testacc-route-noop-change" + Name = %[1]q } } resource "aws_route_table" "test" { vpc_id = aws_vpc.test.id -} - -resource "aws_subnet" "test" { - availability_zone = data.aws_availability_zones.available.names[0] - vpc_id = aws_vpc.test.id - cidr_block = "10.10.10.0/24" tags = { - Name = "tf-acc-route-noop-change" + Name = %[1]q } } resource "aws_route" "test" { route_table_id = aws_route_table.test.id - destination_cidr_block = "0.0.0.0/0" - instance_id = aws_instance.nat.id -} + destination_cidr_block = %[2]q + network_interface_id = %[3]s.id -resource "aws_instance" "nat" { - 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 + # Wait for the ENI attachment. + depends_on = [aws_instance.test] } -`) +`, rName, destinationCidr, targetResourceName)) } +*/ -func testAccAWSRouteWithVPCEndpoint() string { - return ` -data "aws_region" "current" {} - -resource "aws_vpc" "foo" { +func testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-route-with-vpc-endpoint" + Name = %[1]q } } -resource "aws_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_vpc" "target" { + cidr_block = "10.0.0.0/16" tags = { - Name = "terraform-testacc-route-with-vpc-endpoint" + Name = %[1]q } } -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_vpc_peering_connection" "test" { + vpc_id = aws_vpc.test.id + peer_vpc_id = aws_vpc.target.id + auto_accept = true + + tags = { + Name = %[1]q + } } -resource "aws_route" "bar" { - route_table_id = aws_route_table.foo.id - destination_cidr_block = "10.3.0.0/16" - gateway_id = aws_internet_gateway.foo.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id - # Forcing endpoint to create before route - without this the crash is a race. - depends_on = [aws_vpc_endpoint.baz] + tags = { + Name = %[1]q + } } -resource "aws_vpc_endpoint" "baz" { - vpc_id = aws_vpc.foo.id - service_name = "com.amazonaws.${data.aws_region.current.name}.s3" - route_table_ids = [aws_route_table.foo.id] +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + vpc_peering_connection_id = aws_vpc_peering_connection.test.id } -` +`, rName, destinationCidr) } -func testAccAWSRouteNewRouteTable() string { - return ` -resource "aws_vpc" "foo" { +func testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-route-basic" + Name = %[1]q } } -resource "aws_vpc" "bar" { - cidr_block = "10.2.0.0/16" +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + + map_public_ip_on_launch = true tags = { - Name = "terraform-testacc-route-new-route-table" + Name = %[1]q } } -resource "aws_internet_gateway" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-basic" + Name = %[1]q } } -resource "aws_internet_gateway" "bar" { - vpc_id = aws_vpc.bar.id +resource "aws_eip" "test" { + vpc = true tags = { - Name = "terraform-testacc-route-new-route-table" + Name = %[1]q } } -resource "aws_route_table" "foo" { - vpc_id = aws_vpc.foo.id +resource "aws_nat_gateway" "test" { + allocation_id = aws_eip.test.id + subnet_id = aws_subnet.test.id tags = { - Name = "terraform-testacc-route-basic" + Name = %[1]q } + + depends_on = [aws_internet_gateway.test] } -resource "aws_route_table" "bar" { - vpc_id = aws_vpc.bar.id +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "terraform-testacc-route-new-route-table" + Name = %[1]q } } -resource "aws_route" "bar" { - route_table_id = aws_route_table.bar.id - destination_cidr_block = "10.4.0.0/16" - gateway_id = aws_internet_gateway.bar.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + nat_gateway_id = aws_nat_gateway.test.id } -` +`, rName, destinationCidr) } -func testAccAWSRouteConfigTransitGatewayIDDestinatationCidrBlock() string { - return composeConfig(testAccAvailableAZsNoOptInDefaultExcludeConfig(), - ` -# IncorrectState: Transit Gateway is not available in availability zone usw2-az4 - +func testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" + cidr_block = "10.1.0.0/16" tags = { - Name = "tf-acc-test-ec2-route-transit-gateway-id" + Name = %[1]q } } -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_vpn_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { - Name = "tf-acc-test-ec2-route-transit-gateway-id" + Name = %[1]q } } -resource "aws_ec2_transit_gateway" "test" {} +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id -resource "aws_ec2_transit_gateway_vpc_attachment" "test" { - subnet_ids = [aws_subnet.test.id] - transit_gateway_id = aws_ec2_transit_gateway.test.id - vpc_id = aws_vpc.test.id + tags = { + Name = %[1]q + } } resource "aws_route" "test" { - destination_cidr_block = "0.0.0.0/0" - route_table_id = aws_vpc.test.default_route_table_id - transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + gateway_id = aws_vpn_gateway.test.id } -`) +`, rName, destinationCidr) } -func testAccAWSRouteConfigConditionalIpv4Ipv6(rName string, ipv6Route bool) string { +func testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr string) string { return fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1281,15 +1921,7 @@ resource "aws_vpc" "test" { } } -resource "aws_egress_only_internet_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_internet_gateway" "test" { +resource "aws_vpn_gateway" "test" { vpc_id = aws_vpc.test.id tags = { @@ -1305,57 +1937,15 @@ resource "aws_route_table" "test" { } } -locals { - ipv6 = %[2]t - destination = "0.0.0.0/0" - destination_ipv6 = "::/0" -} - -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - gateway_id = aws_internet_gateway.test.id - - destination_cidr_block = local.ipv6 ? "" : local.destination - destination_ipv6_cidr_block = local.ipv6 ? local.destination_ipv6 : "" -} -`, rName, ipv6Route) -} - -func testAccAWSRouteResourceConfigLocalGatewayID() string { - return ` -data "aws_ec2_local_gateways" "all" {} -data "aws_ec2_local_gateway" "first" { - id = tolist(data.aws_ec2_local_gateways.all.ids)[0] -} - -data "aws_ec2_local_gateway_route_tables" "all" {} -data "aws_ec2_local_gateway_route_table" "first" { - local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] -} - -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" -} - -resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { - local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id - vpc_id = aws_vpc.test.id -} - -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id - depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] -} - resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = "172.16.1.0/24" - local_gateway_id = data.aws_ec2_local_gateway.first.id + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + gateway_id = aws_vpn_gateway.test.id } -` +`, rName, destinationCidr) } -func testAccAWSRouteResourceConfigVpcEndpointId(rName string) string { +func testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr string) string { return composeConfig( testAccAvailableAZsNoOptInConfig(), fmt.Sprintf(` @@ -1365,7 +1955,7 @@ resource "aws_vpc" "test" { cidr_block = "10.10.10.0/25" tags = { - Name = "tf-acc-test-load-balancer" + Name = %[1]q } } @@ -1375,7 +1965,7 @@ resource "aws_subnet" "test" { vpc_id = aws_vpc.test.id tags = { - Name = "tf-acc-test-load-balancer" + Name = %[1]q } } @@ -1392,6 +1982,10 @@ resource "aws_vpc_endpoint_service" "test" { acceptance_required = false allowed_principals = [data.aws_caller_identity.current.arn] gateway_load_balancer_arns = [aws_lb.test.arn] + + tags = { + Name = %[1]q + } } resource "aws_vpc_endpoint" "test" { @@ -1399,16 +1993,24 @@ resource "aws_vpc_endpoint" "test" { subnet_ids = [aws_subnet.test.id] vpc_endpoint_type = aws_vpc_endpoint_service.test.service_type vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } resource "aws_route_table" "test" { vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } resource "aws_route" "test" { route_table_id = aws_route_table.test.id - destination_cidr_block = "172.16.1.0/24" + destination_cidr_block = %[2]q vpc_endpoint_id = aws_vpc_endpoint.test.id } -`, rName)) +`, rName, destinationCidr)) } From 44063390239703ed73683528670a326eff4747db Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 20 Mar 2021 18:43:27 -0400 Subject: [PATCH 1147/1252] Fixes after rebase. --- aws/data_source_aws_route_test.go | 1 + aws/resource_aws_route_test.go | 34 +++++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/aws/data_source_aws_route_test.go b/aws/data_source_aws_route_test.go index c61351e3300..9bcba44af9f 100644 --- a/aws/data_source_aws_route_test.go +++ b/aws/data_source_aws_route_test.go @@ -4,6 +4,7 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index 49db7905fb4..eec6ed53cd3 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -21,6 +21,7 @@ func TestAccAWSRoute_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -63,6 +64,7 @@ func TestAccAWSRoute_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -84,6 +86,7 @@ func TestAccAWSRoute_disappears_RouteTable(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -106,6 +109,7 @@ func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -152,6 +156,7 @@ func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -193,6 +198,7 @@ func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -233,9 +239,8 @@ func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { destinationCidr := "::/0" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -277,6 +282,7 @@ func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -318,6 +324,7 @@ func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -359,6 +366,7 @@ func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -400,6 +408,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -440,9 +449,8 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -484,9 +492,8 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -591,6 +598,7 @@ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -632,6 +640,7 @@ func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -673,6 +682,7 @@ func TestAccAWSRoute_DoesNotCrashWithVpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -701,6 +711,7 @@ func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -742,6 +753,7 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -783,6 +795,7 @@ func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -824,6 +837,7 @@ func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -865,6 +879,7 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -900,6 +915,7 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From e80ca2f2dd62e8d6276f4dac0b2adab616efb337 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Thu, 25 Mar 2021 18:20:28 +0200 Subject: [PATCH 1148/1252] resource/aws_pinpoint_email_channel: Support using SES configuration set and add plan time validations (#18314) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSPinpointEmailChannel_disappears (19.13s) --- PASS: TestAccAWSPinpointEmailChannel_configurationSet (22.62s) --- PASS: TestAccAWSPinpointEmailChannel_basic (34.66s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSPinpointEmailChannel_disappears (27.30s) --- PASS: TestAccAWSPinpointEmailChannel_configurationSet (33.09s) --- PASS: TestAccAWSPinpointEmailChannel_basic (53.08s) ``` --- .changelog/18314.txt | 7 + aws/resource_aws_pinpoint_email_channel.go | 40 +++-- ...esource_aws_pinpoint_email_channel_test.go | 137 ++++++++++++++++-- .../docs/r/pinpoint_email_channel.markdown | 1 + 4 files changed, 161 insertions(+), 24 deletions(-) create mode 100644 .changelog/18314.txt diff --git a/.changelog/18314.txt b/.changelog/18314.txt new file mode 100644 index 00000000000..579cda25c12 --- /dev/null +++ b/.changelog/18314.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_pinpoint_email_channel: Add `configuration_set` argument +``` + +```release-note:enhancement +resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` +``` \ No newline at end of file diff --git a/aws/resource_aws_pinpoint_email_channel.go b/aws/resource_aws_pinpoint_email_channel.go index b77e9ec458d..41ddb56470c 100644 --- a/aws/resource_aws_pinpoint_email_channel.go +++ b/aws/resource_aws_pinpoint_email_channel.go @@ -25,6 +25,11 @@ func resourceAwsPinpointEmailChannel() *schema.Resource { Required: true, ForceNew: true, }, + "configuration_set": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateArn, + }, "enabled": { Type: schema.TypeBool, Optional: true, @@ -35,12 +40,14 @@ func resourceAwsPinpointEmailChannel() *schema.Resource { Required: true, }, "identity": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, }, "role_arn": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, }, "messages_per_second": { Type: schema.TypeInt, @@ -62,6 +69,10 @@ func resourceAwsPinpointEmailChannelUpsert(d *schema.ResourceData, meta interfac params.Identity = aws.String(d.Get("identity").(string)) params.RoleArn = aws.String(d.Get("role_arn").(string)) + if v, ok := d.GetOk("configuration_set"); ok { + params.ConfigurationSet = aws.String(v.(string)) + } + req := pinpoint.UpdateEmailChannelInput{ ApplicationId: aws.String(applicationId), EmailChannelRequest: params, @@ -69,7 +80,7 @@ func resourceAwsPinpointEmailChannelUpsert(d *schema.ResourceData, meta interfac _, err := conn.UpdateEmailChannel(&req) if err != nil { - return fmt.Errorf("error updating Pinpoint Email Channel for application %s: %s", applicationId, err) + return fmt.Errorf("error updating Pinpoint Email Channel for application %s: %w", applicationId, err) } d.SetId(applicationId) @@ -92,15 +103,18 @@ func resourceAwsPinpointEmailChannelRead(d *schema.ResourceData, meta interface{ return nil } - return fmt.Errorf("error getting Pinpoint Email Channel for application %s: %s", d.Id(), err) + return fmt.Errorf("error getting Pinpoint Email Channel for application %s: %w", d.Id(), err) } - d.Set("application_id", output.EmailChannelResponse.ApplicationId) - d.Set("enabled", output.EmailChannelResponse.Enabled) - d.Set("from_address", output.EmailChannelResponse.FromAddress) - d.Set("identity", output.EmailChannelResponse.Identity) - d.Set("role_arn", output.EmailChannelResponse.RoleArn) - d.Set("messages_per_second", aws.Int64Value(output.EmailChannelResponse.MessagesPerSecond)) + res := output.EmailChannelResponse + d.Set("application_id", res.ApplicationId) + d.Set("enabled", res.Enabled) + d.Set("from_address", res.FromAddress) + d.Set("identity", res.Identity) + d.Set("role_arn", res.RoleArn) + d.Set("configuration_set", res.ConfigurationSet) + d.Set("messages_per_second", aws.Int64Value(res.MessagesPerSecond)) + return nil } @@ -117,7 +131,7 @@ func resourceAwsPinpointEmailChannelDelete(d *schema.ResourceData, meta interfac } if err != nil { - return fmt.Errorf("error deleting Pinpoint Email Channel for application %s: %s", d.Id(), err) + return fmt.Errorf("error deleting Pinpoint Email Channel for application %s: %w", d.Id(), err) } return nil } diff --git a/aws/resource_aws_pinpoint_email_channel_test.go b/aws/resource_aws_pinpoint_email_channel_test.go index bcc2c84b72e..63127fcdd73 100644 --- a/aws/resource_aws_pinpoint_email_channel_test.go +++ b/aws/resource_aws_pinpoint_email_channel_test.go @@ -6,13 +6,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) func TestAccAWSPinpointEmailChannel_basic(t *testing.T) { var channel pinpoint.EmailChannelResponse - resourceName := "aws_pinpoint_email_channel.test_email_channel" + resourceName := "aws_pinpoint_email_channel.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, @@ -27,6 +28,8 @@ func TestAccAWSPinpointEmailChannel_basic(t *testing.T) { testAccCheckAWSPinpointEmailChannelExists(resourceName, &channel), resource.TestCheckResourceAttr(resourceName, "enabled", "false"), resource.TestCheckResourceAttrSet(resourceName, "messages_per_second"), + resource.TestCheckResourceAttrPair(resourceName, "role_arn", "aws_iam_role.test", "arn"), + resource.TestCheckResourceAttrPair(resourceName, "identity", "aws_ses_domain_identity.test", "arn"), ), }, { @@ -46,6 +49,56 @@ func TestAccAWSPinpointEmailChannel_basic(t *testing.T) { }) } +func TestAccAWSPinpointEmailChannel_configurationSet(t *testing.T) { + var channel pinpoint.EmailChannelResponse + resourceName := "aws_pinpoint_email_channel.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + IDRefreshName: resourceName, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPinpointEmailChannelDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPinpointEmailChannelConfigConfigurationSet("user@example.com", rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPinpointEmailChannelExists(resourceName, &channel), + resource.TestCheckResourceAttrPair(resourceName, "configuration_set", "aws_ses_configuration_set.test", "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} +func TestAccAWSPinpointEmailChannel_disappears(t *testing.T) { + var channel pinpoint.EmailChannelResponse + resourceName := "aws_pinpoint_email_channel.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSPinpointApp(t) }, + ErrorCheck: testAccErrorCheck(t, pinpoint.EndpointsID), + IDRefreshName: resourceName, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPinpointEmailChannelDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPinpointEmailChannelConfig_FromAddress("user@example.com"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPinpointEmailChannelExists(resourceName, &channel), + testAccCheckResourceDisappears(testAccProvider, resourceAwsPinpointEmailChannel(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSPinpointEmailChannelExists(n string, channel *pinpoint.EmailChannelResponse) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -77,21 +130,21 @@ func testAccCheckAWSPinpointEmailChannelExists(n string, channel *pinpoint.Email func testAccAWSPinpointEmailChannelConfig_FromAddress(fromAddress string) string { return fmt.Sprintf(` -resource "aws_pinpoint_app" "test_app" {} +resource "aws_pinpoint_app" "test" {} -resource "aws_pinpoint_email_channel" "test_email_channel" { - application_id = aws_pinpoint_app.test_app.application_id +resource "aws_pinpoint_email_channel" "test" { + application_id = aws_pinpoint_app.test.application_id enabled = "false" from_address = %[1]q - identity = aws_ses_domain_identity.test_identity.arn - role_arn = aws_iam_role.test_role.arn + identity = aws_ses_domain_identity.test.arn + role_arn = aws_iam_role.test.arn } -resource "aws_ses_domain_identity" "test_identity" { +resource "aws_ses_domain_identity" "test" { domain = "example.com" } -resource "aws_iam_role" "test_role" { +resource "aws_iam_role" "test" { assume_role_policy = < Date: Thu, 25 Mar 2021 16:25:19 +0000 Subject: [PATCH 1149/1252] Update CHANGELOG.md for #18042 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5112fbe4193..7320d1ce567 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,16 @@ FEATURES: * **New Data Source:** `aws_codestarconnections_connection` ([#18129](https://github.com/hashicorp/terraform-provider-aws/issues/18129)) * **New Resource:** `aws_lightsail_instance_public_ports` ([#8611](https://github.com/hashicorp/terraform-provider-aws/issues/8611)) +ENHANCEMENTS: + +* resource/aws_light_instance_public_ports: Add `cidrs` argument to `port_info` ([#14905](https://github.com/hashicorp/terraform-provider-aws/issues/14905)) +* resource/aws_pinpoint_email_channel: Add `configuration_set` argument ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) +* resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) + BUG FIXES: * resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state ([#18382](https://github.com/hashicorp/terraform-provider-aws/issues/18382)) +* resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set ([#18042](https://github.com/hashicorp/terraform-provider-aws/issues/18042)) * resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) From 3dbe1025943306911a89de81d3d07e49ec89ff37 Mon Sep 17 00:00:00 2001 From: bill-rich Date: Thu, 25 Mar 2021 09:39:31 -0700 Subject: [PATCH 1150/1252] Add missing parameter on test config --- aws/resource_aws_cloudfront_distribution_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index 961d360a2ed..13aaac24f12 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -387,6 +387,7 @@ func TestAccAWSCloudFrontDistribution_orderedCacheBehaviorCachePolicy(t *testing func TestAccAWSCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) { var distribution cloudfront.Distribution + rInt := acctest.RandInt() resourceName := "aws_cloudfront_distribution.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, @@ -394,13 +395,13 @@ func TestAccAWSCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudFrontDistributionOrderedCacheBehavior, + Config: testAccAWSCloudFrontDistributionOrderedCacheBehavior(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckCloudFrontDistributionExists(resourceName, &distribution), ), }, { - Config: testAccAWSCloudFrontDistributionOrderedCacheBehaviorCachePolicy, + Config: testAccAWSCloudFrontDistributionOrderedCacheBehaviorCachePolicy(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckCloudFrontDistributionExists(resourceName, &distribution), ), From 935f8a2e2d6b73f9f9fda2e67e064a8c4352f60c Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 12:40:30 -0400 Subject: [PATCH 1151/1252] resource/aws_pinpoint_event_stream: Update IAM error retry logic to match Contributing Guide Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSPinpointEventStream_disappears (71.12s) --- PASS: TestAccAWSPinpointEventStream_basic (143.79s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSPinpointEventStream_disappears (69.10s) --- PASS: TestAccAWSPinpointEventStream_basic (148.10s) ``` --- aws/resource_aws_pinpoint_event_stream.go | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_pinpoint_event_stream.go b/aws/resource_aws_pinpoint_event_stream.go index 14624161dbb..5fff883003e 100644 --- a/aws/resource_aws_pinpoint_event_stream.go +++ b/aws/resource_aws_pinpoint_event_stream.go @@ -6,7 +6,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/pinpoint" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsPinpointEventStream() *schema.Resource { @@ -55,9 +59,24 @@ func resourceAwsPinpointEventStreamUpsert(d *schema.ResourceData, meta interface } // Retry for IAM eventual consistency - _, err := retryOnAwsCode("BadRequestException", func() (interface{}, error) { - return conn.PutEventStream(&req) + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { + _, err := conn.PutEventStream(&req) + + if tfawserr.ErrMessageContains(err, pinpoint.ErrCodeBadRequestException, "make sure the IAM Role is configured correctly") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil }) + + if tfresource.TimedOut(err) { + _, err = conn.PutEventStream(&req) + } + if err != nil { return fmt.Errorf("error putting Pinpoint Event Stream for application %s: %w", applicationId, err) } From a50ada30e8b52e98b8ebbd378c8d81a65dadc574 Mon Sep 17 00:00:00 2001 From: bill-rich Date: Thu, 25 Mar 2021 10:09:52 -0700 Subject: [PATCH 1152/1252] Add ErrorCheck to test --- aws/resource_aws_cloudfront_distribution_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index 13aaac24f12..4a89668ea73 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -391,6 +391,7 @@ func TestAccAWSCloudFrontDistribution_forwardedValuesToCachePolicy(t *testing.T) resourceName := "aws_cloudfront_distribution.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(cloudfront.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, cloudfront.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckCloudFrontDistributionDestroy, Steps: []resource.TestStep{ From 2cb9e61ef777f3543143f5b34b2b1ff62aef0fc6 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Thu, 25 Mar 2021 19:36:43 +0200 Subject: [PATCH 1153/1252] Update aws/resource_aws_iam_server_certificate.go Co-authored-by: Brian Flad --- aws/resource_aws_iam_server_certificate.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_iam_server_certificate.go b/aws/resource_aws_iam_server_certificate.go index ef979904e3c..3c95305659f 100644 --- a/aws/resource_aws_iam_server_certificate.go +++ b/aws/resource_aws_iam_server_certificate.go @@ -161,8 +161,17 @@ func resourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interface{ d.Set("certificate_chain", cert.CertificateChain) d.Set("path", metadata.Path) d.Set("arn", metadata.Arn) - d.Set("expiration", aws.TimeValue(metadata.Expiration).Format(time.RFC3339)) - d.Set("upload_date", aws.TimeValue(metadata.UploadDate).Format(time.RFC3339)) + if metadata.Expiration != nil { + d.Set("expiration", aws.TimeValue(metadata.Expiration).Format(time.RFC3339)) + } else { + d.Set("expiration", nil) + } + + if metadata.UploadDate != nil { + d.Set("upload_date", aws.TimeValue(metadata.UploadDate).Format(time.RFC3339)) + } else { + d.Set("upload_date", nil) + } if err := d.Set("tags", keyvaluetags.IamKeyValueTags(cert.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { return fmt.Errorf("error setting tags: %w", err) From a736b9930ad67599fd492110dc9767cb3406ca40 Mon Sep 17 00:00:00 2001 From: Adam Tyler Date: Mon, 1 Feb 2021 16:12:56 -0500 Subject: [PATCH 1154/1252] Add ForceNew to ecs_service service_registries --- aws/resource_aws_ecs_service.go | 4 + aws/resource_aws_ecs_service_test.go | 135 +++++++++++++++++++++++++++ 2 files changed, 139 insertions(+) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 147946bb222..4ab7cb3dbbb 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -340,24 +340,28 @@ func resourceAwsEcsService() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, + ForceNew: true, }, "container_port": { Type: schema.TypeInt, ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), + ForceNew: true, }, "port": { Type: schema.TypeInt, ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), + ForceNew: true, }, "registry_arn": { Type: schema.TypeString, ForceNew: true, Required: true, ValidateFunc: validateArn, + ForceNew: true, }, }, }, diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 1ba8a542e20..75c36aab1e6 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -1165,6 +1165,40 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { }) } +// Regression for +func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { + var service ecs.Service + rString := acctest.RandString(8) + + serviceDiscoveryName := fmt.Sprintf("tf-acc-sd-%s", rString) + updatedServiceDiscoveryName := fmt.Sprintf("tf-acc-sd-%s-updated", rString) + clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) + tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) + svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, serviceDiscoveryName, clusterName, tdName, svcName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), + resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + ), + }, + { + Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, updatedServiceDiscoveryName, clusterName, tdName, svcName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), + resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + ), + }, + }, + }) +} + func TestAccAWSEcsService_Tags(t *testing.T) { var service ecs.Service rName := acctest.RandomWithPrefix("tf-acc-test") @@ -3491,6 +3525,107 @@ resource "aws_ecs_service" "test" { `, rName, rName, rName, clusterName, tdName, svcName) } +func testAccAWSEcsService_withServiceRegistriesChanges(rName, discoveryName, clusterName, tdName, svcName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "test" { + state = "available" + + filter { + name = "opt-in-status" + values = ["opt-in-not-required"] + } +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "tf-acc-with-svc-reg" + } +} + +resource "aws_subnet" "test" { + count = 2 + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) + availability_zone = data.aws_availability_zones.test.names[count.index] + vpc_id = aws_vpc.test.id + + tags = { + Name = "tf-acc-with-svc-reg" + } +} + +resource "aws_security_group" "test" { + name = "tf-acc-sg-%s" + vpc_id = aws_vpc.test.id + + ingress { + protocol = "-1" + from_port = 0 + to_port = 0 + cidr_blocks = [aws_vpc.test.cidr_block] + } +} + +resource "aws_service_discovery_private_dns_namespace" "test" { + name = "%s.terraform.local" + description = "test" + vpc = aws_vpc.test.id +} + +resource "aws_service_discovery_service" "test" { + name = "%s" + + dns_config { + namespace_id = aws_service_discovery_private_dns_namespace.test.id + + dns_records { + ttl = 5 + type = "SRV" + } + } +} + +resource "aws_ecs_cluster" "test" { + name = "%s" +} + +resource "aws_ecs_task_definition" "test" { + family = "%s" + network_mode = "awsvpc" + + container_definitions = < Date: Fri, 12 Feb 2021 15:45:00 -0500 Subject: [PATCH 1155/1252] Create CHANGELOG entry --- .changelog/17387.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17387.txt diff --git a/.changelog/17387.txt b/.changelog/17387.txt new file mode 100644 index 00000000000..6d944e503fc --- /dev/null +++ b/.changelog/17387.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_ecs_service: Re-create service when service_registries changed +``` From d4669495c00de0e809a7e3e4d19e9171a4671c0c Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 13:16:45 -0400 Subject: [PATCH 1156/1252] r/ecs_service: Remove duplicate fields --- aws/resource_aws_ecs_service.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 4ab7cb3dbbb..147946bb222 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -340,28 +340,24 @@ func resourceAwsEcsService() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, - ForceNew: true, }, "container_port": { Type: schema.TypeInt, ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), - ForceNew: true, }, "port": { Type: schema.TypeInt, ForceNew: true, Optional: true, ValidateFunc: validation.IntBetween(0, 65536), - ForceNew: true, }, "registry_arn": { Type: schema.TypeString, ForceNew: true, Required: true, ValidateFunc: validateArn, - ForceNew: true, }, }, }, From 12a6d2b9a75ddfa13d9ff3df061f9d25c70565bf Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 13:26:04 -0400 Subject: [PATCH 1157/1252] tests/r/ecs_service: Add ErrorCheck --- aws/resource_aws_ecs_service_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 75c36aab1e6..7f0f60fac09 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -1178,6 +1178,7 @@ func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ From 1281fe3909f41b9c1062801efd796928133472e9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 13:41:19 -0400 Subject: [PATCH 1158/1252] ecs_service: Update changelog, tests --- .changelog/17387.txt | 2 +- aws/resource_aws_ecs_service_test.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.changelog/17387.txt b/.changelog/17387.txt index 6d944e503fc..ad02895c6e8 100644 --- a/.changelog/17387.txt +++ b/.changelog/17387.txt @@ -1,3 +1,3 @@ ```release-note:bug -resource/aws_ecs_service: Re-create service when service_registries changed +resource/aws_ecs_service: Re-create service when `service_registries` changes ``` diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 7f0f60fac09..8d57b8627f3 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -1165,7 +1165,6 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { }) } -// Regression for func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { var service ecs.Service rString := acctest.RandString(8) From b2ea95addfe785ccbbbf92408dbf7b33c5ae4d9e Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 25 Mar 2021 17:42:13 +0000 Subject: [PATCH 1159/1252] Update CHANGELOG.md for #18408 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7320d1ce567..cf479ecffe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ENHANCEMENTS: * resource/aws_light_instance_public_ports: Add `cidrs` argument to `port_info` ([#14905](https://github.com/hashicorp/terraform-provider-aws/issues/14905)) * resource/aws_pinpoint_email_channel: Add `configuration_set` argument ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) * resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) +* resource/aws_pinpoint_event_stream: Plan time validations for `destination_stream_arn` and `role_arn` ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) BUG FIXES: @@ -17,6 +18,7 @@ BUG FIXES: * resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set ([#18042](https://github.com/hashicorp/terraform-provider-aws/issues/18042)) * resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) +* resource/aws_pinpoint_event_stream: Retry on eventual consistency error ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) * resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument ([#18384](https://github.com/hashicorp/terraform-provider-aws/issues/18384)) From f107b89b44ad5ddd4528ee968708907355117d59 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 13:53:12 -0400 Subject: [PATCH 1160/1252] docs/resource/aws_iam_server_certificate: Move tags documentation to arguments Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSIAMServerCertificate_disappears (14.13s) --- PASS: TestAccAWSIAMServerCertificate_name_prefix (15.89s) --- PASS: TestAccAWSIAMServerCertificate_Path (18.27s) --- PASS: TestAccAWSIAMServerCertificate_basic (18.19s) --- PASS: TestAccAWSIAMServerCertificate_file (31.71s) --- PASS: TestAccAWSIAMServerCertificate_tags (40.61s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSIAMServerCertificate_disappears (17.41s) --- PASS: TestAccAWSIAMServerCertificate_name_prefix (20.05s) --- PASS: TestAccAWSIAMServerCertificate_basic (22.42s) --- PASS: TestAccAWSIAMServerCertificate_Path (22.36s) --- PASS: TestAccAWSIAMServerCertificate_file (37.52s) --- PASS: TestAccAWSIAMServerCertificate_tags (51.54s) ``` --- website/docs/r/iam_server_certificate.html.markdown | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/website/docs/r/iam_server_certificate.html.markdown b/website/docs/r/iam_server_certificate.html.markdown index 5c1d790947e..15d6d9c9474 100644 --- a/website/docs/r/iam_server_certificate.html.markdown +++ b/website/docs/r/iam_server_certificate.html.markdown @@ -107,6 +107,7 @@ The following arguments are supported: included, it defaults to a slash (/). If this certificate is for use with AWS CloudFront, the path must be in format `/cloudfront/your_path_here`. See [IAM Identifiers][1] for more details on IAM Paths. +* `tags` - (Optional) Map of resource tags for the server certificate. ~> **NOTE:** AWS performs behind-the-scenes modifications to some certificate files if they do not adhere to a specific format. These modifications will result in terraform forever believing that it needs to update the resources since the local and AWS file contents will not match after theses modifications occur. In order to prevent this from happening you must ensure that all your PEM-encoded files use UNIX line-breaks and that `certificate_body` contains only one certificate. All other certificates should go in `certificate_chain`. It is common for some Certificate Authorities to issue certificate files that have DOS line-breaks and that are actually multiple certificates concatenated together in order to form a full certificate chain. @@ -114,12 +115,11 @@ The following arguments are supported: In addition to all arguments above, the following attributes are exported: +* `arn` - The Amazon Resource Name (ARN) specifying the server certificate. +* `expiration` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) on which the certificate is set to expire. * `id` - The unique Server Certificate name * `name` - The name of the Server Certificate -* `arn` - The Amazon Resource Name (ARN) specifying the server certificate. -* `tags` - Key-value mapping of tags for the server certificate. -* `expiration` - The date on which the certificate is set to expire. -* `upload_date` - The date when the server certificate was uploaded. +* `upload_date` - Date and time in [RFC3339 format](https://tools.ietf.org/html/rfc3339#section-5.8) when the server certificate was uploaded. ## Import From 5ee95bffdd1b014935d6f61bb66e974fbc014ede Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 13:59:05 -0400 Subject: [PATCH 1161/1252] Update aws/resource_aws_iam_saml_provider_test.go --- aws/resource_aws_iam_saml_provider_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iam_saml_provider_test.go b/aws/resource_aws_iam_saml_provider_test.go index 98d31f50bd9..d6782bf98ca 100644 --- a/aws/resource_aws_iam_saml_provider_test.go +++ b/aws/resource_aws_iam_saml_provider_test.go @@ -102,6 +102,7 @@ func TestAccAWSIAMSamlProvider_tags(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMSamlProviderDestroy, Steps: []resource.TestStep{ From d16a65c1120c3658fdadbb345aabfa6ea92c065f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Jun 2020 16:07:29 -0400 Subject: [PATCH 1162/1252] r/aws_route: Refactor acceptance tests in preparation for future fixes/enhancements. --- aws/resource_aws_route_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index eec6ed53cd3..a5cbd53e85f 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -408,7 +408,6 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From 68ed1bb641b2a84d965c9e9b8e4f0e46cb053e45 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 30 Dec 2020 08:39:53 -0500 Subject: [PATCH 1163/1252] r/aws_route: Incorporate relevant changes from #16219. --- aws/data_source_aws_route.go | 15 + aws/internal/net/cidr.go | 23 + aws/internal/net/cidr_test.go | 26 + aws/internal/service/ec2/errors.go | 8 +- aws/internal/service/ec2/finder/finder.go | 57 + aws/internal/service/ec2/id.go | 5 + aws/resource_aws_route.go | 665 ++++----- aws/resource_aws_route_test.go | 1652 +++++++++++++++------ aws/validators.go | 1 + 9 files changed, 1594 insertions(+), 858 deletions(-) create mode 100644 aws/internal/net/cidr.go create mode 100644 aws/internal/net/cidr_test.go diff --git a/aws/data_source_aws_route.go b/aws/data_source_aws_route.go index 3d34bc11cd9..56bd92e2c56 100644 --- a/aws/data_source_aws_route.go +++ b/aws/data_source_aws_route.go @@ -4,8 +4,10 @@ import ( "fmt" "log" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" ) func dataSourceAwsRoute() *schema.Resource { @@ -202,3 +204,16 @@ func getRoutes(table *ec2.RouteTable, d *schema.ResourceData) []*ec2.Route { } return routes } + +// Helper: Create an ID for a route +func resourceAwsRouteID(d *schema.ResourceData, r *ec2.Route) string { + routeTableID := d.Get("route_table_id").(string) + + if destination := aws.StringValue(r.DestinationCidrBlock); destination != "" { + return tfec2.RouteCreateID(routeTableID, destination) + } else if destination := aws.StringValue(r.DestinationIpv6CidrBlock); destination != "" { + return tfec2.RouteCreateID(routeTableID, destination) + } + + return "" +} diff --git a/aws/internal/net/cidr.go b/aws/internal/net/cidr.go new file mode 100644 index 00000000000..5d4e8db0525 --- /dev/null +++ b/aws/internal/net/cidr.go @@ -0,0 +1,23 @@ +package net + +import ( + "net" +) + +// CIDRBlocksEqual returns whether or not two CIDR blocks are equal: +// - Both CIDR blocks parse to an IP address and network +// - The string representation of the IP addresses are equal +// - The string representation of the networks are equal +// This function is especially useful for IPv6 CIDR blocks which have multiple valid representations. +func CIDRBlocksEqual(cidr1, cidr2 string) bool { + ip1, ipnet1, err := net.ParseCIDR(cidr1) + if err != nil { + return false + } + ip2, ipnet2, err := net.ParseCIDR(cidr2) + if err != nil { + return false + } + + return ip2.String() == ip1.String() && ipnet2.String() == ipnet1.String() +} diff --git a/aws/internal/net/cidr_test.go b/aws/internal/net/cidr_test.go new file mode 100644 index 00000000000..a557b64a579 --- /dev/null +++ b/aws/internal/net/cidr_test.go @@ -0,0 +1,26 @@ +package net + +import ( + "testing" +) + +func Test_CIDRBlocksEqual(t *testing.T) { + for _, ts := range []struct { + cidr1 string + cidr2 string + equal bool + }{ + {"10.2.2.0/24", "10.2.2.0/24", true}, + {"10.2.2.0/1234", "10.2.2.0/24", false}, + {"10.2.2.0/24", "10.2.2.0/1234", false}, + {"2001::/15", "2001::/15", true}, + {"::/0", "2001::/15", false}, + {"::/0", "::0/0", true}, + {"", "", false}, + } { + equal := CIDRBlocksEqual(ts.cidr1, ts.cidr2) + if ts.equal != equal { + t.Fatalf("CIDRBlocksEqual(%q, %q) should be: %t", ts.cidr1, ts.cidr2, ts.equal) + } + } +} diff --git a/aws/internal/service/ec2/errors.go b/aws/internal/service/ec2/errors.go index 0dafebe3f56..4414e732b06 100644 --- a/aws/internal/service/ec2/errors.go +++ b/aws/internal/service/ec2/errors.go @@ -9,7 +9,8 @@ import ( ) const ( - ErrCodeInvalidParameterValue = "InvalidParameterValue" + ErrCodeInvalidParameterException = "InvalidParameterException" + ErrCodeInvalidParameterValue = "InvalidParameterValue" ) const ( @@ -21,9 +22,14 @@ const ( ) const ( + ErrCodeInvalidRouteNotFound = "InvalidRoute.NotFound" ErrCodeInvalidRouteTableIDNotFound = "InvalidRouteTableID.NotFound" ) +const ( + ErrCodeInvalidTransitGatewayIDNotFound = "InvalidTransitGatewayID.NotFound" +) + const ( ErrCodeClientVpnEndpointIdNotFound = "InvalidClientVpnEndpointId.NotFound" ErrCodeClientVpnAuthorizationRuleNotFound = "InvalidClientVpnEndpointAuthorizationRuleNotFound" diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index f3c18a86337..a57d7fdbeeb 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -5,6 +5,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + tfnet "github.com/terraform-providers/terraform-provider-aws/aws/internal/net" tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" ) @@ -95,6 +96,62 @@ func InstanceByID(conn *ec2.EC2, id string) (*ec2.Instance, error) { return output.Reservations[0].Instances[0], nil } +// RouteTableByID returns the route table corresponding to the specified identifier. +// Returns nil if no route table is found. +func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) { + input := &ec2.DescribeRouteTablesInput{ + RouteTableIds: aws.StringSlice([]string{routeTableID}), + } + + output, err := conn.DescribeRouteTables(input) + + if err != nil { + return nil, err + } + + if output == nil || len(output.RouteTables) == 0 || output.RouteTables[0] == nil { + return nil, nil + } + + return output.RouteTables[0], nil +} + +type RouteFinder func(*ec2.EC2, string, string) (*ec2.Route, error) + +// RouteByIpv4Destination returns the route corresponding to the specified IPv4 destination. +// Returns nil if no route is found. +func RouteByIpv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) (*ec2.Route, error) { + routeTable, err := RouteTableByID(conn, routeTableID) + if err != nil { + return nil, err + } + + for _, route := range routeTable.Routes { + if tfnet.CIDRBlocksEqual(aws.StringValue(route.DestinationCidrBlock), destinationCidr) { + return route, nil + } + } + + return nil, nil +} + +// RouteByIpv6Destination returns the route corresponding to the specified IPv6 destination. +// Returns nil if no route is found. +func RouteByIpv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr string) (*ec2.Route, error) { + routeTable, err := RouteTableByID(conn, routeTableID) + if err != nil { + return nil, err + } + + for _, route := range routeTable.Routes { + if tfnet.CIDRBlocksEqual(aws.StringValue(route.DestinationIpv6CidrBlock), destinationIpv6Cidr) { + return route, nil + } + } + + return nil, nil +} + // SecurityGroupByID looks up a security group by ID. When not found, returns nil and potentially an API error. func SecurityGroupByID(conn *ec2.EC2, id string) (*ec2.SecurityGroup, error) { req := &ec2.DescribeSecurityGroupsInput{ diff --git a/aws/internal/service/ec2/id.go b/aws/internal/service/ec2/id.go index 3eb2a65c3e1..c7fa5040e0f 100644 --- a/aws/internal/service/ec2/id.go +++ b/aws/internal/service/ec2/id.go @@ -71,6 +71,11 @@ func ClientVpnRouteParseID(id string) (string, string, string, error) { "target-subnet-id"+clientVpnRouteIDSeparator+"destination-cidr-block", id) } +// RouteCreateID returns a route resource ID. +func RouteCreateID(routeTableID, destination string) string { + return fmt.Sprintf("r-%s%d", routeTableID, hashcode.String(destination)) +} + const transitGatewayPrefixListReferenceSeparator = "_" func TransitGatewayPrefixListReferenceCreateID(transitGatewayRouteTableID string, prefixListID string) string { diff --git a/aws/resource_aws_route.go b/aws/resource_aws_route.go index f0afaa275d5..4fce0f2f130 100644 --- a/aws/resource_aws_route.go +++ b/aws/resource_aws_route.go @@ -1,7 +1,6 @@ package aws import ( - "errors" "fmt" "log" "strings" @@ -9,18 +8,32 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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/terraform-providers/terraform-provider-aws/aws/internal/hashcode" + tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) -// How long to sleep if a limit-exceeded event happens -var routeTargetValidationError = errors.New("Error: more than 1 target specified. Only 1 of gateway_id, " + - "egress_only_gateway_id, nat_gateway_id, instance_id, network_interface_id, local_gateway_id, transit_gateway_id, " + - "vpc_endpoint_id, vpc_peering_connection_id is allowed.") +var routeValidDestinations = []string{ + "destination_cidr_block", + "destination_ipv6_cidr_block", +} + +var routeValidTargets = []string{ + "egress_only_gateway_id", + "gateway_id", + "instance_id", + "local_gateway_id", + "nat_gateway_id", + "network_interface_id", + "transit_gateway_id", + "vpc_endpoint_id", + "vpc_peering_connection_id", +} -// AWS Route resource Schema declaration func resourceAwsRoute() *schema.Resource { return &schema.Resource{ Create: resourceAwsRouteCreate, @@ -28,22 +41,7 @@ func resourceAwsRoute() *schema.Resource { Update: resourceAwsRouteUpdate, Delete: resourceAwsRouteDelete, Importer: &schema.ResourceImporter{ - State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - idParts := strings.Split(d.Id(), "_") - if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { - return nil, fmt.Errorf("unexpected format of ID (%q), expected ROUTETABLEID_DESTINATION", d.Id()) - } - routeTableID := idParts[0] - destination := idParts[1] - d.Set("route_table_id", routeTableID) - if strings.Contains(destination, ":") { - d.Set("destination_ipv6_cidr_block", destination) - } else { - d.Set("destination_cidr_block", destination) - } - d.SetId(fmt.Sprintf("r-%s%d", routeTableID, hashcode.String(destination))) - return []*schema.ResourceData{d}, nil - }, + State: resourceAwsRouteImport, }, Timeouts: &schema.ResourceTimeout{ @@ -52,6 +50,15 @@ func resourceAwsRoute() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "route_table_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + /// + // Destinations. + /// "destination_cidr_block": { Type: schema.TypeString, Optional: true, @@ -73,81 +80,90 @@ func resourceAwsRoute() *schema.Resource { DiffSuppressFunc: suppressEqualCIDRBlockDiffs, }, + // TODO This is a target once we have Managed Prefix List support. "destination_prefix_list_id": { Type: schema.TypeString, Computed: true, }, - "gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - + // + // Targets. + // "egress_only_gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, + ConflictsWith: []string{"destination_cidr_block"}, // IPv6 destinations only. }, - "nat_gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + "gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, }, - "local_gateway_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + "instance_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: routeValidTargets, }, - "instance_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + "local_gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, }, - "instance_owner_id": { - Type: schema.TypeString, - Computed: true, + "nat_gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, + ConflictsWith: []string{"destination_ipv6_cidr_block"}, // IPv4 destinations only. }, "network_interface_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ExactlyOneOf: routeValidTargets, }, - "origin": { - Type: schema.TypeString, - Computed: true, + "transit_gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, }, - "state": { - Type: schema.TypeString, - Computed: true, + "vpc_endpoint_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, + ConflictsWith: []string{"destination_ipv6_cidr_block"}, // IPv4 destinations only. }, - "route_table_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + "vpc_peering_connection_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, }, - "transit_gateway_id": { + // + // Computed attributes. + // + "instance_owner_id": { Type: schema.TypeString, - Optional: true, + Computed: true, }, - "vpc_endpoint_id": { + "origin": { Type: schema.TypeString, - Optional: true, + Computed: true, }, - "vpc_peering_connection_id": { + "state": { Type: schema.TypeString, - Optional: true, + Computed: true, }, }, } @@ -155,153 +171,69 @@ func resourceAwsRoute() *schema.Resource { func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - var numTargets int - var setTarget string - allowedTargets := []string{ - "egress_only_gateway_id", - "gateway_id", - "nat_gateway_id", - "local_gateway_id", - "instance_id", - "network_interface_id", - "transit_gateway_id", - "vpc_peering_connection_id", - "vpc_endpoint_id", - } - - // Check if more than 1 target is specified - for _, target := range allowedTargets { - if len(d.Get(target).(string)) > 0 { - numTargets++ - setTarget = target - } + + destinationAttributeKey, destination, err := routeDestinationAttribute(d) + + if err != nil { + return fmt.Errorf("error creating Route: %w", err) } - if numTargets > 1 { - return routeTargetValidationError + targetAttributeKey, target, err := routeTargetAttribute(d) + + if err != nil { + return fmt.Errorf("error creating Route: %w", err) } - createOpts := &ec2.CreateRouteInput{} - // Formulate CreateRouteInput based on the target type - switch setTarget { - case "gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - GatewayId: aws.String(d.Get("gateway_id").(string)), - } + routeTableID := d.Get("route_table_id").(string) + input := &ec2.CreateRouteInput{ + RouteTableId: aws.String(routeTableID), + } - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } + var routeFinder finder.RouteFinder - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } + switch destination := aws.String(destination); destinationAttributeKey { + case "destination_cidr_block": + input.DestinationCidrBlock = destination + routeFinder = finder.RouteByIpv4Destination + case "destination_ipv6_cidr_block": + input.DestinationIpv6CidrBlock = destination + routeFinder = finder.RouteByIpv6Destination + default: + return fmt.Errorf("error creating Route: unexpected route destination attribute: %q", destinationAttributeKey) + } + switch target := aws.String(target); targetAttributeKey { case "egress_only_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationIpv6CidrBlock: aws.String(d.Get("destination_ipv6_cidr_block").(string)), - EgressOnlyInternetGatewayId: aws.String(d.Get("egress_only_gateway_id").(string)), - } - case "nat_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NatGatewayId: aws.String(d.Get("nat_gateway_id").(string)), - } - case "local_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - LocalGatewayId: aws.String(d.Get("local_gateway_id").(string)), - } + input.EgressOnlyInternetGatewayId = target + case "gateway_id": + input.GatewayId = target case "instance_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - + input.InstanceId = target + case "local_gateway_id": + input.LocalGatewayId = target + case "nat_gateway_id": + input.NatGatewayId = target case "network_interface_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - + input.NetworkInterfaceId = target case "transit_gateway_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - TransitGatewayId: aws.String(d.Get("transit_gateway_id").(string)), - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - + input.TransitGatewayId = target case "vpc_endpoint_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - VpcEndpointId: aws.String(d.Get("vpc_endpoint_id").(string)), - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - + input.VpcEndpointId = target case "vpc_peering_connection_id": - createOpts = &ec2.CreateRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - VpcPeeringConnectionId: aws.String(d.Get("vpc_peering_connection_id").(string)), - } - - if v, ok := d.GetOk("destination_cidr_block"); ok { - createOpts.DestinationCidrBlock = aws.String(v.(string)) - } - - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - createOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) - } - + input.VpcPeeringConnectionId = target default: - return fmt.Errorf("A valid target type is missing. Specify one of the following attributes: %s", strings.Join(allowedTargets, ", ")) + return fmt.Errorf("error creating Route: unexpected route target attribute: %q", targetAttributeKey) } - log.Printf("[DEBUG] Route create config: %s", createOpts) - - // Create the route - var err error + log.Printf("[DEBUG] Creating Route: %s", input) err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - _, err = conn.CreateRoute(createOpts) + _, err = conn.CreateRoute(input) - if isAWSErr(err, "InvalidParameterException", "") { + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidParameterException) { return resource.RetryableError(err) } - if isAWSErr(err, "InvalidTransitGatewayID.NotFound", "") { + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidTransitGatewayIDNotFound) { return resource.RetryableError(err) } @@ -311,64 +243,44 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { return nil }) - if isResourceTimeoutError(err) { - _, err = conn.CreateRoute(createOpts) + + if tfresource.TimedOut(err) { + _, err = conn.CreateRoute(input) } + if err != nil { - return fmt.Errorf("Error creating route: %s", err) + return fmt.Errorf("error creating Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } var route *ec2.Route - if v, ok := d.GetOk("destination_cidr_block"); ok { - err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - route, err = resourceAwsRouteFindRoute(conn, d.Get("route_table_id").(string), v.(string), "") - if err == nil { - if route != nil { - return nil - } else { - err = errors.New("Route not found") - } - } + err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { + route, err = routeFinder(conn, routeTableID, destination) - return resource.RetryableError(err) - }) - if isResourceTimeoutError(err) { - route, err = resourceAwsRouteFindRoute(conn, d.Get("route_table_id").(string), v.(string), "") - } if err != nil { - return fmt.Errorf("Error finding route after creating it: %s", err) + return resource.RetryableError(err) } + if route == nil { - return fmt.Errorf("Unable to find matching route for Route Table (%s) and destination CIDR block (%s).", d.Get("route_table_id").(string), v) + return resource.RetryableError(fmt.Errorf("route not found")) } + + return nil + }) + + if tfresource.TimedOut(err) { + route, err = routeFinder(conn, routeTableID, destination) } - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - route, err = resourceAwsRouteFindRoute(conn, d.Get("route_table_id").(string), "", v.(string)) - if err == nil { - if route != nil { - return nil - } else { - err = errors.New("Route not found") - } - } + if err != nil { + return fmt.Errorf("error reading Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) + } - return resource.RetryableError(err) - }) - if isResourceTimeoutError(err) { - route, err = resourceAwsRouteFindRoute(conn, d.Get("route_table_id").(string), "", v.(string)) - } - if err != nil { - return fmt.Errorf("Error finding route after creating it: %s", err) - } - if route == nil { - return fmt.Errorf("Unable to find matching route for Route Table (%s) and destination IPv6 CIDR block (%s).", d.Get("route_table_id").(string), v) - } + if route == nil { + return fmt.Errorf("Route in Route Table (%s) with destination (%s) not found", routeTableID, destination) } - d.SetId(resourceAwsRouteID(d, route)) + d.SetId(tfec2.RouteCreateID(routeTableID, destination)) return resourceAwsRouteRead(d, meta) } @@ -376,22 +288,39 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - routeTableId := d.Get("route_table_id").(string) - destinationCidrBlock := d.Get("destination_cidr_block").(string) - destinationIpv6CidrBlock := d.Get("destination_ipv6_cidr_block").(string) + destinationAttributeKey, destination, err := routeDestinationAttribute(d) + + if err != nil { + return fmt.Errorf("error reading Route: %w", err) + } + + var routeFinder finder.RouteFinder + + switch destinationAttributeKey { + case "destination_cidr_block": + routeFinder = finder.RouteByIpv4Destination + case "destination_ipv6_cidr_block": + routeFinder = finder.RouteByIpv6Destination + default: + return fmt.Errorf("error reading Route: unexpected route destination attribute: %q", destinationAttributeKey) + } + + routeTableID := d.Get("route_table_id").(string) + + route, err := routeFinder(conn, routeTableID, destination) - route, err := resourceAwsRouteFindRoute(conn, routeTableId, destinationCidrBlock, destinationIpv6CidrBlock) - if isAWSErr(err, "InvalidRouteTableID.NotFound", "") { - log.Printf("[WARN] Route Table (%s) not found, removing from state", routeTableId) + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteTableIDNotFound) { + log.Printf("[WARN] Route Table (%s) not found, removing from state", routeTableID) d.SetId("") return nil } + if err != nil { - return err + return fmt.Errorf("error reading Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } if route == nil { - log.Printf("[WARN] Matching route not found, removing from state") + log.Printf("[WARN] Route in Route Table (%s) with destination (%s) not found, removing from state", routeTableID, destination) d.SetId("") return nil } @@ -401,9 +330,11 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { d.Set("destination_prefix_list_id", route.DestinationPrefixListId) // VPC Endpoint ID is returned in Gateway ID field if strings.HasPrefix(aws.StringValue(route.GatewayId), "vpce-") { + d.Set("gateway_id", "") d.Set("vpc_endpoint_id", route.GatewayId) } else { d.Set("gateway_id", route.GatewayId) + d.Set("vpc_endpoint_id", "") } d.Set("egress_only_gateway_id", route.EgressOnlyInternetGatewayId) d.Set("nat_gateway_id", route.NatGatewayId) @@ -421,200 +352,166 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsRouteUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - var numTargets int - var setTarget string - - allowedTargets := []string{ - "egress_only_gateway_id", - "gateway_id", - "nat_gateway_id", - "local_gateway_id", - "network_interface_id", - "instance_id", - "transit_gateway_id", - "vpc_endpoint_id", - "vpc_peering_connection_id", - } - // Check if more than 1 target is specified - for _, target := range allowedTargets { - if len(d.Get(target).(string)) > 0 { - numTargets++ - setTarget = target - } + + destinationAttributeKey, destination, err := routeDestinationAttribute(d) + + if err != nil { + return fmt.Errorf("error updating Route: %w", err) } - switch setTarget { - //instance_id is a special case due to the fact that AWS will "discover" the network_interface_id - //when it creates the route and return that data. In the case of an update, we should ignore the - //existing network_interface_id - case "instance_id": - if numTargets > 2 || (numTargets == 2 && len(d.Get("network_interface_id").(string)) == 0) { - return routeTargetValidationError - } + targetAttributeKey, target, err := routeTargetAttribute(d) + + if err != nil { + return fmt.Errorf("error updating Route: %w", err) + } + + routeTableID := d.Get("route_table_id").(string) + input := &ec2.ReplaceRouteInput{ + RouteTableId: aws.String(routeTableID), + } + + switch destination := aws.String(destination); destinationAttributeKey { + case "destination_cidr_block": + input.DestinationCidrBlock = destination + case "destination_ipv6_cidr_block": + input.DestinationIpv6CidrBlock = destination default: - if numTargets > 1 { - return routeTargetValidationError - } + return fmt.Errorf("error updating Route: unexpected route destination attribute: %q", destinationAttributeKey) } - var replaceOpts *ec2.ReplaceRouteInput - // Formulate ReplaceRouteInput based on the target type - switch setTarget { - case "gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - GatewayId: aws.String(d.Get("gateway_id").(string)), - } + switch target := aws.String(target); targetAttributeKey { case "egress_only_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationIpv6CidrBlock: aws.String(d.Get("destination_ipv6_cidr_block").(string)), - EgressOnlyInternetGatewayId: aws.String(d.Get("egress_only_gateway_id").(string)), - } - case "nat_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NatGatewayId: aws.String(d.Get("nat_gateway_id").(string)), - } - case "local_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - LocalGatewayId: aws.String(d.Get("local_gateway_id").(string)), - } + input.EgressOnlyInternetGatewayId = target + case "gateway_id": + input.GatewayId = target case "instance_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - InstanceId: aws.String(d.Get("instance_id").(string)), - } + input.InstanceId = target + case "local_gateway_id": + input.LocalGatewayId = target + case "nat_gateway_id": + input.NatGatewayId = target case "network_interface_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), - } + input.NetworkInterfaceId = target case "transit_gateway_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - TransitGatewayId: aws.String(d.Get("transit_gateway_id").(string)), - } + input.TransitGatewayId = target case "vpc_endpoint_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpcEndpointId: aws.String(d.Get("vpc_endpoint_id").(string)), - } + input.VpcEndpointId = target case "vpc_peering_connection_id": - replaceOpts = &ec2.ReplaceRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), - DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), - VpcPeeringConnectionId: aws.String(d.Get("vpc_peering_connection_id").(string)), - } + input.VpcPeeringConnectionId = target default: - return fmt.Errorf("An invalid target type specified: %s", setTarget) + return fmt.Errorf("error updating Route: unexpected route target attribute: %q", targetAttributeKey) } - log.Printf("[DEBUG] Route replace config: %s", replaceOpts) - // Replace the route - _, err := conn.ReplaceRoute(replaceOpts) - return err + log.Printf("[DEBUG] Updating Route: %s", input) + _, err = conn.ReplaceRoute(input) + + if err != nil { + return fmt.Errorf("error updating Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) + } + + return resourceAwsRouteRead(d, meta) } func resourceAwsRouteDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - deleteOpts := &ec2.DeleteRouteInput{ - RouteTableId: aws.String(d.Get("route_table_id").(string)), + destinationAttributeKey, destination, err := routeDestinationAttribute(d) + + if err != nil { + return fmt.Errorf("error deleting Route: %w", err) } - if v, ok := d.GetOk("destination_cidr_block"); ok { - deleteOpts.DestinationCidrBlock = aws.String(v.(string)) + + routeTableID := d.Get("route_table_id").(string) + input := &ec2.DeleteRouteInput{ + RouteTableId: aws.String(routeTableID), } - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - deleteOpts.DestinationIpv6CidrBlock = aws.String(v.(string)) + + switch destination := aws.String(destination); destinationAttributeKey { + case "destination_cidr_block": + input.DestinationCidrBlock = destination + case "destination_ipv6_cidr_block": + input.DestinationIpv6CidrBlock = destination + default: + return fmt.Errorf("error deleting Route: unexpected route destination attribute: %q", destinationAttributeKey) } - log.Printf("[DEBUG] Route delete opts: %s", deleteOpts) - err := resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { - log.Printf("[DEBUG] Trying to delete route with opts %s", deleteOpts) - var err error - _, err = conn.DeleteRoute(deleteOpts) + err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { + log.Printf("[DEBUG] Deleting Route (%s)", d.Id()) + _, err = conn.DeleteRoute(input) if err == nil { return nil } - if isAWSErr(err, "InvalidRoute.NotFound", "") { + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteNotFound) { + return nil + } + + // Local routes (which may have been imported) cannot be deleted. Remove from state. + if tfawserr.ErrMessageContains(err, tfec2.ErrCodeInvalidParameterValue, "cannot remove local route") { return nil } - if isAWSErr(err, "InvalidParameterException", "") { + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidParameterException) { return resource.RetryableError(err) } return resource.NonRetryableError(err) }) - if isResourceTimeoutError(err) { - _, err = conn.DeleteRoute(deleteOpts) + + if tfresource.TimedOut(err) { + log.Printf("[DEBUG] Deleting Route (%s)", d.Id()) + _, err = conn.DeleteRoute(input) } - if isAWSErr(err, "InvalidRoute.NotFound", "") { + + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteNotFound) { return nil } - if err != nil { - return fmt.Errorf("Error deleting route: %s", err) - } - return nil -} -// Helper: Create an ID for a route -func resourceAwsRouteID(d *schema.ResourceData, r *ec2.Route) string { - - if r.DestinationIpv6CidrBlock != nil && *r.DestinationIpv6CidrBlock != "" { - return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationIpv6CidrBlock)) + if err != nil { + return fmt.Errorf("error deleting Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } - return fmt.Sprintf("r-%s%d", d.Get("route_table_id").(string), hashcode.String(*r.DestinationCidrBlock)) + return nil } -// resourceAwsRouteFindRoute returns any route whose destination is the specified IPv4 or IPv6 CIDR block. -// Returns nil if the route table exists but no matching destination is found. -func resourceAwsRouteFindRoute(conn *ec2.EC2, rtbid string, cidr string, ipv6cidr string) (*ec2.Route, error) { - routeTableID := rtbid - - findOpts := &ec2.DescribeRouteTablesInput{ - RouteTableIds: []*string{&routeTableID}, +func resourceAwsRouteImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + idParts := strings.Split(d.Id(), "_") + if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { + return nil, fmt.Errorf("unexpected format of ID (%q), expected ROUTETABLEID_DESTINATION", d.Id()) } - resp, err := conn.DescribeRouteTables(findOpts) - if err != nil { - return nil, err + routeTableID := idParts[0] + destination := idParts[1] + d.Set("route_table_id", routeTableID) + if strings.Contains(destination, ":") { + d.Set("destination_ipv6_cidr_block", destination) + } else { + d.Set("destination_cidr_block", destination) } + d.SetId(tfec2.RouteCreateID(routeTableID, destination)) - if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return nil, nil - } + return []*schema.ResourceData{d}, nil +} - if cidr != "" { - for _, route := range (*resp.RouteTables[0]).Routes { - if route.DestinationCidrBlock != nil && *route.DestinationCidrBlock == cidr { - return route, nil - } +// routeDestinationAttribute returns the attribute key and value of the route's destination. +func routeDestinationAttribute(d *schema.ResourceData) (string, string, error) { + for _, key := range routeValidDestinations { + if v, ok := d.Get(key).(string); ok && v != "" { + return key, v, nil } - - return nil, nil } - if ipv6cidr != "" { - for _, route := range (*resp.RouteTables[0]).Routes { - if cidrBlocksEqual(aws.StringValue(route.DestinationIpv6CidrBlock), ipv6cidr) { - return route, nil - } - } + return "", "", fmt.Errorf("route destination attribute not specified") +} - return nil, nil +// routeTargetAttribute returns the attribute key and value of the route's target. +func routeTargetAttribute(d *schema.ResourceData) (string, string, error) { + for _, key := range routeValidTargets { + // The HasChange check is necessary to handle Computed attributes that will be cleared once they are read back after update. + if v, ok := d.Get(key).(string); ok && v != "" && d.HasChange(key) { + return key, v, nil + } } - return nil, nil + return "", "", fmt.Errorf("route target attribute not specified") } diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index a5cbd53e85f..88fd80613b0 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -4,10 +4,12 @@ import ( "fmt" "testing" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/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/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" ) // IPv4 to Internet Gateway. @@ -43,7 +45,7 @@ func TestAccAWSRoute_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -129,7 +131,7 @@ func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -176,7 +178,7 @@ func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -218,7 +220,7 @@ func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -260,7 +262,7 @@ func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -302,7 +304,7 @@ func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), ), }, @@ -344,7 +346,7 @@ func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -386,7 +388,7 @@ func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -427,7 +429,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -469,7 +471,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -512,7 +514,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -526,7 +528,6 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { }) } -/* func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { resourceName := "aws_route.test" eni1ResourceName := "aws_network_interface.test1" @@ -552,11 +553,13 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eni1ResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -570,11 +573,13 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eni2ResourceName, "id"), resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -587,7 +592,6 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { }, }) } -*/ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { resourceName := "aws_route.test" @@ -617,7 +621,7 @@ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), ), }, @@ -659,7 +663,7 @@ func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -730,7 +734,7 @@ func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", tgwResourceName, "id"), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -772,7 +776,7 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", tgwResourceName, "id"), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -814,7 +818,7 @@ func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -856,7 +860,7 @@ func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, @@ -906,11 +910,18 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { }) } -func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { - rName := acctest.RandomWithPrefix("tf-acc-test") +func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { resourceName := "aws_route.test" + vgwResourceName := "aws_vpn_gateway.test" + instanceResourceName := "aws_instance.test" + igwResourceName := "aws_internet_gateway.test" + eniResourceName := "aws_network_interface.test" + pcxResourceName := "aws_vpc_peering_connection.test" + ngwResourceName := "aws_nat_gateway.test" + tgwResourceName := "aws_ec2_transit_gateway.test" vpcEndpointResourceName := "aws_vpc_endpoint.test" - destinationCidr := "172.16.1.0/24" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, @@ -919,13 +930,134 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr), + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", vgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", igwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "nat_gateway_id", ngwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "nat_gateway_id", ngwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eniResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "transit_gateway_id", tgwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttrPair(resourceName, "transit_gateway_id", tgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_endpoint_id", vpcEndpointResourceName), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), - // TODO resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "instance_id", ""), resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), @@ -938,6 +1070,26 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), ), }, + { + Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), + ), + }, { ResourceName: resourceName, ImportState: true, @@ -948,128 +1100,583 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { }) } -func testAccCheckAWSRouteDestroy(s *terraform.State) error { - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_route" { - continue - } - - conn := testAccProvider.Meta().(*AWSClient).ec2conn - route, err := resourceAwsRouteFindRoute( - conn, - rs.Primary.Attributes["route_table_id"], - rs.Primary.Attributes["destination_cidr_block"], - rs.Primary.Attributes["destination_ipv6_cidr_block"], - ) - - if route == nil && err == nil { - return nil - } - } - - return nil -} - -func testAccAWSRouteImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { - return func(s *terraform.State) (string, error) { - rs, ok := s.RootModule().Resources[resourceName] - if !ok { - return "", fmt.Errorf("not found: %s", resourceName) - } - - destination := rs.Primary.Attributes["destination_cidr_block"] - if v, ok := rs.Primary.Attributes["destination_ipv6_cidr_block"]; ok && v != "" { - destination = v - } - - return fmt.Sprintf("%s_%s", rs.Primary.Attributes["route_table_id"], destination), nil - } -} - -func testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_internet_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - gateway_id = aws_internet_gateway.test.id -} -`, rName, destinationCidr) -} - -func testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true - - tags = { - Name = %[1]q - } -} - -resource "aws_egress_only_internet_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_internet_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} +func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { + resourceName := "aws_route.test" + vgwResourceName := "aws_vpn_gateway.test" + instanceResourceName := "aws_instance.test" + igwResourceName := "aws_internet_gateway.test" + eniResourceName := "aws_network_interface.test" + pcxResourceName := "aws_vpc_peering_connection.test" + eoigwResourceName := "aws_egress_only_internet_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "::/0" -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_ipv6_cidr_block = %[2]q - gateway_id = aws_internet_gateway.test.id + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "instance_id", instanceResourceName, "id"), + testAccCheckResourceAttrAccountID(resourceName, "instance_owner_id"), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", instanceResourceName, "primary_network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", vgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "gateway_id", igwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "egress_only_gateway_id", eoigwResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "egress_only_gateway_id", eoigwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "network_interface_id", eniResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateBlackhole), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "vpc_peering_connection_id", pcxResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_route.test" + vpcEndpointResourceName := "aws_vpc_endpoint.test" + destinationCidr := "172.16.1.0/24" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttrPair(resourceName, "vpc_endpoint_id", vpcEndpointResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +// https://github.com/terraform-providers/terraform-provider-aws/issues/11455. +func TestAccAWSRoute_LocalRoute(t *testing.T) { + var routeTable ec2.RouteTable + var vpc ec2.Vpc + resourceName := "aws_route.test" + rtResourceName := "aws_route_table.test" + vpcResourceName := "aws_vpc.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4NoRoute(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(vpcResourceName, &vpc), + testAccCheckRouteTableExists(rtResourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + ), + }, + { + Config: testAccAWSRouteConfigIpv4LocalRoute(rName), + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: func(rt *ec2.RouteTable, v *ec2.Vpc) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + return fmt.Sprintf("%s_%s", aws.StringValue(rt.RouteTableId), aws.StringValue(v.CidrBlock)), nil + } + }(&routeTable, &vpc), + // Don't verify the state as the local route isn't actually in the pre-import state. + // Just running ImportState verifies that we can import a local route. + ImportStateVerify: false, + }, + }, + }) +} + +func testAccCheckAWSRouteDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_route" { + continue + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + var route *ec2.Route + var err error + if v := rs.Primary.Attributes["destination_cidr_block"]; v != "" { + route, err = finder.RouteByIpv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) + } else if v := rs.Primary.Attributes["destination_ipv6_cidr_block"]; v != "" { + route, err = finder.RouteByIpv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) + } + + if route == nil && err == nil { + return nil + } + } + + return nil +} + +func testAccAWSRouteImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("not found: %s", resourceName) + } + + destination := rs.Primary.Attributes["destination_cidr_block"] + if v, ok := rs.Primary.Attributes["destination_ipv6_cidr_block"]; ok && v != "" { + destination = v + } + + return fmt.Sprintf("%s_%s", rs.Primary.Attributes["route_table_id"], destination), nil + } +} + +func testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + gateway_id = aws_internet_gateway.test.id +} +`, rName, destinationCidr) +} + +func testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_egress_only_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + gateway_id = aws_internet_gateway.test.id +} +`, rName, destinationCidr) +} + +func testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr string) string { + return composeConfig( + testAccAvailableAZsNoOptInConfig(), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) + + tags = { + Name = %[1]q + } +} + +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigIpv6Instance(rName, destinationCidr string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) + + tags = { + Name = %[1]q + } +} + +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.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 + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + instance_id = aws_instance.test.id +} +`, rName, destinationCidr)) +} + +func testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_vpc" "target" { + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_vpc_peering_connection" "test" { + vpc_id = aws_vpc.test.id + peer_vpc_id = aws_vpc.target.id + auto_accept = true + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + vpc_peering_connection_id = aws_vpc_peering_connection.test.id +} +`, rName, destinationCidr) +} + +func testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } +} + +resource "aws_egress_only_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + egress_only_gateway_id = aws_egress_only_internet_gateway.test.id +} +`, rName, destinationCidr) +} + +func testAccAWSRouteConfigWithVpcEndpoint(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -`, rName, destinationCidr) + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } } -func testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr string) string { +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_cidr_block = "10.3.0.0/16" + gateway_id = aws_internet_gateway.test.id + + # Forcing endpoint to create before route - without this the crash is a race. + depends_on = [aws_vpc_endpoint.test] +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = aws_vpc.test.id + service_name = "com.amazonaws.${data.aws_region.current.name}.s3" + route_table_ids = [aws_route_table.test.id] +} +`, rName) +} + +func testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr string) string { return composeConfig( - testAccAvailableAZsNoOptInConfig(), + testAccAvailableAZsNoOptInDefaultExcludeConfig(), fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true + cidr_block = "10.1.0.0/16" tags = { Name = %[1]q @@ -1077,18 +1684,25 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] cidr_block = "10.1.1.0/24" vpc_id = aws_vpc.test.id - availability_zone = data.aws_availability_zones.available.names[0] - ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) tags = { Name = %[1]q } } -resource "aws_network_interface" "test" { - subnet_id = aws_subnet.test.id +resource "aws_ec2_transit_gateway" "test" { + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_transit_gateway_vpc_attachment" "test" { + subnet_ids = [aws_subnet.test.id] + transit_gateway_id = aws_ec2_transit_gateway.test.id + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1104,18 +1718,16 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_ipv6_cidr_block = %[2]q - network_interface_id = aws_network_interface.test.id + destination_cidr_block = %[2]q + route_table_id = aws_route_table.test.id + transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id } `, rName, destinationCidr)) } -func testAccAWSRouteConfigIpv6Instance(rName, destinationCidr string) string { +func testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr string) string { return composeConfig( - testAccLatestAmazonNatInstanceAmiConfig(), testAccAvailableAZsNoOptInConfig(), - testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1127,22 +1739,25 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] cidr_block = "10.1.1.0/24" vpc_id = aws_vpc.test.id - availability_zone = data.aws_availability_zones.available.names[0] - ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) tags = { Name = %[1]q } } -resource "aws_instance" "test" { - ami = data.aws_ami.amzn-ami-nat-instance.id - instance_type = data.aws_ec2_instance_type_offering.available.instance_type - subnet_id = aws_subnet.test.id +resource "aws_ec2_transit_gateway" "test" { + tags = { + Name = %[1]q + } +} - ipv6_address_count = 1 +resource "aws_ec2_transit_gateway_vpc_attachment" "test" { + subnet_ids = [aws_subnet.test.id] + transit_gateway_id = aws_ec2_transit_gateway.test.id + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1158,14 +1773,14 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - route_table_id = aws_route_table.test.id destination_ipv6_cidr_block = %[2]q - instance_id = aws_instance.test.id + route_table_id = aws_route_table.test.id + transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id } `, rName, destinationCidr)) } -func testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr string) string { +func testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr string, ipv6Route bool) string { return fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1176,19 +1791,66 @@ resource "aws_vpc" "test" { } } -resource "aws_vpc" "target" { - cidr_block = "10.0.0.0/16" - assign_generated_ipv6_cidr_block = true +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_vpc_peering_connection" "test" { - vpc_id = aws_vpc.test.id - peer_vpc_id = aws_vpc.target.id - auto_accept = true +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +locals { + ipv6 = %[4]t + destination = %[2]q + destination_ipv6 = %[3]q +} + +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + gateway_id = aws_internet_gateway.test.id + + destination_cidr_block = local.ipv6 ? "" : local.destination + destination_ipv6_cidr_block = local.ipv6 ? local.destination_ipv6 : "" +} +`, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) +} + +func testAccAWSRouteConfigIpv4Instance(rName, destinationCidr string) string { + return composeConfig( + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + + tags = { + Name = %[1]q + } +} + +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type + subnet_id = aws_subnet.test.id tags = { Name = %[1]q @@ -1204,26 +1866,37 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_ipv6_cidr_block = %[2]q - vpc_peering_connection_id = aws_vpc_peering_connection.test.id + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + instance_id = aws_instance.test.id } -`, rName, destinationCidr) +`, rName, destinationCidr)) } -func testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` +func testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr string) string { + return composeConfig( + testAccAvailableAZsNoOptInConfig(), + fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true + cidr_block = "10.1.0.0/16" tags = { Name = %[1]q } } -resource "aws_egress_only_internet_gateway" "test" { - vpc_id = aws_vpc.test.id +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + + tags = { + Name = %[1]q + } +} + +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id tags = { Name = %[1]q @@ -1239,25 +1912,38 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_ipv6_cidr_block = %[2]q - egress_only_gateway_id = aws_egress_only_internet_gateway.test.id + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id } -`, rName, destinationCidr) +`, rName, destinationCidr)) } -func testAccAWSRouteConfigWithVpcEndpoint(rName string) string { +func testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr string) string { return fmt.Sprintf(` +data "aws_ec2_local_gateways" "all" {} + +data "aws_ec2_local_gateway" "first" { + id = tolist(data.aws_ec2_local_gateways.all.ids)[0] +} + +data "aws_ec2_local_gateway_route_tables" "all" {} + +data "aws_ec2_local_gateway_route_table" "first" { + local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] +} + resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" + cidr_block = "10.0.0.0/16" tags = { Name = %[1]q } } -resource "aws_internet_gateway" "test" { - vpc_id = aws_vpc.test.id +resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { + local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1270,30 +1956,73 @@ resource "aws_route_table" "test" { tags = { Name = %[1]q } + + depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] } resource "aws_route" "test" { route_table_id = aws_route_table.test.id - destination_cidr_block = "10.3.0.0/16" - gateway_id = aws_internet_gateway.test.id + destination_cidr_block = %[2]q + local_gateway_id = data.aws_ec2_local_gateway.first.id +} +`, rName, destinationCidr) +} - # Forcing endpoint to create before route - without this the crash is a race. - depends_on = [aws_vpc_endpoint.test] +func testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +data "aws_ec2_local_gateways" "all" {} + +data "aws_ec2_local_gateway" "first" { + id = tolist(data.aws_ec2_local_gateways.all.ids)[0] +} + +data "aws_ec2_local_gateway_route_tables" "all" {} + +data "aws_ec2_local_gateway_route_table" "first" { + local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = %[1]q + } } -data "aws_region" "current" {} +resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { + local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } + + depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] +} -resource "aws_vpc_endpoint" "test" { - vpc_id = aws_vpc.test.id - service_name = "com.amazonaws.${data.aws_region.current.name}.s3" - route_table_ids = [aws_route_table.test.id] +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + local_gateway_id = data.aws_ec2_local_gateway.first.id } -`, rName) +`, rName, destinationCidr) } -func testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr string) string { +func testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr string) string { return composeConfig( - testAccAvailableAZsNoOptInDefaultExcludeConfig(), + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1304,25 +2033,31 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - availability_zone = data.aws_availability_zones.available.names[0] cidr_block = "10.1.1.0/24" vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] tags = { Name = %[1]q } } -resource "aws_ec2_transit_gateway" "test" { +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id + tags = { Name = %[1]q } } -resource "aws_ec2_transit_gateway_vpc_attachment" "test" { - subnet_ids = [aws_subnet.test.id] - transit_gateway_id = aws_ec2_transit_gateway.test.id - vpc_id = aws_vpc.test.id +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type + + network_interface { + device_index = 0 + network_interface_id = aws_network_interface.test.id + } tags = { Name = %[1]q @@ -1338,20 +2073,24 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - destination_cidr_block = %[2]q route_table_id = aws_route_table.test.id - transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id + destination_cidr_block = %[2]q + network_interface_id = aws_network_interface.test.id + + # Wait for the ENI attachment. + depends_on = [aws_instance.test] } `, rName, destinationCidr)) } -func testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr string) string { +func testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, targetResourceName string) string { return composeConfig( - testAccAvailableAZsNoOptInDefaultExcludeConfig(), + testAccLatestAmazonNatInstanceAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true + cidr_block = "10.1.0.0/16" tags = { Name = %[1]q @@ -1359,60 +2098,44 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - availability_zone = data.aws_availability_zones.available.names[0] cidr_block = "10.1.1.0/24" vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] tags = { Name = %[1]q } } -resource "aws_ec2_transit_gateway" "test" { - tags = { - Name = %[1]q - } -} - -resource "aws_ec2_transit_gateway_vpc_attachment" "test" { - subnet_ids = [aws_subnet.test.id] - transit_gateway_id = aws_ec2_transit_gateway.test.id - vpc_id = aws_vpc.test.id +resource "aws_network_interface" "test1" { + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } } -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id +resource "aws_network_interface" "test2" { + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } } -resource "aws_route" "test" { - destination_ipv6_cidr_block = %[2]q - route_table_id = aws_route_table.test.id - transit_gateway_id = aws_ec2_transit_gateway_vpc_attachment.test.transit_gateway_id -} -`, rName, destinationCidr)) -} - -func testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr string, ipv6Route bool) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true +resource "aws_instance" "test" { + ami = data.aws_ami.amzn-ami-nat-instance.id + instance_type = data.aws_ec2_instance_type_offering.available.instance_type - tags = { - Name = %[1]q + network_interface { + device_index = 0 + network_interface_id = aws_network_interface.test1.id } -} -resource "aws_internet_gateway" "test" { - vpc_id = aws_vpc.test.id + network_interface { + device_index = 1 + network_interface_id = aws_network_interface.test2.id + } tags = { Name = %[1]q @@ -1427,28 +2150,19 @@ resource "aws_route_table" "test" { } } -locals { - ipv6 = %[4]t - destination = %[2]q - destination_ipv6 = %[3]q -} - resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - gateway_id = aws_internet_gateway.test.id + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + network_interface_id = %[3]s.id - destination_cidr_block = local.ipv6 ? "" : local.destination - destination_ipv6_cidr_block = local.ipv6 ? local.destination_ipv6 : "" + # Wait for the ENI attachment. + depends_on = [aws_instance.test] } -`, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) +`, rName, destinationCidr, targetResourceName)) } -func testAccAWSRouteConfigIpv4Instance(rName, destinationCidr string) string { - return composeConfig( - testAccLatestAmazonNatInstanceAmiConfig(), - testAccAvailableAZsNoOptInConfig(), - testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), - fmt.Sprintf(` +func testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr string) string { + return fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1457,20 +2171,18 @@ resource "aws_vpc" "test" { } } -resource "aws_subnet" "test" { - cidr_block = "10.1.1.0/24" - vpc_id = aws_vpc.test.id - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_vpc" "target" { + cidr_block = "10.0.0.0/16" tags = { Name = %[1]q } } -resource "aws_instance" "test" { - ami = data.aws_ami.amzn-ami-nat-instance.id - instance_type = data.aws_ec2_instance_type_offering.available.instance_type - subnet_id = aws_subnet.test.id +resource "aws_vpc_peering_connection" "test" { + vpc_id = aws_vpc.test.id + peer_vpc_id = aws_vpc.target.id + auto_accept = true tags = { Name = %[1]q @@ -1486,17 +2198,15 @@ resource "aws_route_table" "test" { } resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - instance_id = aws_instance.test.id + route_table_id = aws_route_table.test.id + destination_cidr_block = %[2]q + vpc_peering_connection_id = aws_vpc_peering_connection.test.id } -`, rName, destinationCidr)) +`, rName, destinationCidr) } -func testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr string) string { - return composeConfig( - testAccAvailableAZsNoOptInConfig(), - fmt.Sprintf(` +func testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1506,21 +2216,41 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - cidr_block = "10.1.1.0/24" - vpc_id = aws_vpc.test.id - availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + + map_public_ip_on_launch = true tags = { Name = %[1]q } } -resource "aws_network_interface" "test" { - subnet_id = aws_subnet.test.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_eip" "test" { + vpc = true + + tags = { + Name = %[1]q + } +} + +resource "aws_nat_gateway" "test" { + allocation_id = aws_eip.test.id + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } + + depends_on = [aws_internet_gateway.test] } resource "aws_route_table" "test" { @@ -1534,36 +2264,23 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q - network_interface_id = aws_network_interface.test.id + nat_gateway_id = aws_nat_gateway.test.id } -`, rName, destinationCidr)) +`, rName, destinationCidr) } -func testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr string) string { +func testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr string) string { return fmt.Sprintf(` -data "aws_ec2_local_gateways" "all" {} - -data "aws_ec2_local_gateway" "first" { - id = tolist(data.aws_ec2_local_gateways.all.ids)[0] -} - -data "aws_ec2_local_gateway_route_tables" "all" {} - -data "aws_ec2_local_gateway_route_table" "first" { - local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] -} - resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" + cidr_block = "10.1.0.0/16" tags = { Name = %[1]q } } -resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { - local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id - vpc_id = aws_vpc.test.id +resource "aws_vpn_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1576,34 +2293,20 @@ resource "aws_route_table" "test" { tags = { Name = %[1]q } - - depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] } resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q - local_gateway_id = data.aws_ec2_local_gateway.first.id + gateway_id = aws_vpn_gateway.test.id } `, rName, destinationCidr) } -func testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr string) string { +func testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr string) string { return fmt.Sprintf(` -data "aws_ec2_local_gateways" "all" {} - -data "aws_ec2_local_gateway" "first" { - id = tolist(data.aws_ec2_local_gateways.all.ids)[0] -} - -data "aws_ec2_local_gateway_route_tables" "all" {} - -data "aws_ec2_local_gateway_route_table" "first" { - local_gateway_route_table_id = tolist(data.aws_ec2_local_gateway_route_tables.all.ids)[0] -} - resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" + cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true tags = { @@ -1611,9 +2314,8 @@ resource "aws_vpc" "test" { } } -resource "aws_ec2_local_gateway_route_table_vpc_association" "example" { - local_gateway_route_table_id = data.aws_ec2_local_gateway_route_table.first.id - vpc_id = aws_vpc.test.id +resource "aws_vpn_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1626,26 +2328,24 @@ resource "aws_route_table" "test" { tags = { Name = %[1]q } - - depends_on = [aws_ec2_local_gateway_route_table_vpc_association.example] } resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_ipv6_cidr_block = %[2]q - local_gateway_id = data.aws_ec2_local_gateway.first.id + gateway_id = aws_vpn_gateway.test.id } `, rName, destinationCidr) } -func testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr string) string { +func testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr string) string { return composeConfig( - testAccLatestAmazonNatInstanceAmiConfig(), testAccAvailableAZsNoOptInConfig(), - testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), fmt.Sprintf(` +data "aws_caller_identity" "current" {} + resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" + cidr_block = "10.10.10.0/25" tags = { Name = %[1]q @@ -1653,31 +2353,39 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - cidr_block = "10.1.1.0/24" - vpc_id = aws_vpc.test.id availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 2, 0) + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_lb" "test" { + load_balancer_type = "gateway" + name = %[1]q - tags = { - Name = %[1]q + subnet_mapping { + subnet_id = aws_subnet.test.id } } -resource "aws_network_interface" "test" { - subnet_id = aws_subnet.test.id +resource "aws_vpc_endpoint_service" "test" { + acceptance_required = false + allowed_principals = [data.aws_caller_identity.current.arn] + gateway_load_balancer_arns = [aws_lb.test.arn] tags = { Name = %[1]q } } -resource "aws_instance" "test" { - ami = data.aws_ami.amzn-ami-nat-instance.id - instance_type = data.aws_ec2_instance_type_offering.available.instance_type - - network_interface { - device_index = 0 - network_interface_id = aws_network_interface.test.id - } +resource "aws_vpc_endpoint" "test" { + service_name = aws_vpc_endpoint_service.test.service_name + subnet_ids = [aws_subnet.test.id] + vpc_endpoint_type = aws_vpc_endpoint_service.test.service_type + vpc_id = aws_vpc.test.id tags = { Name = %[1]q @@ -1695,21 +2403,22 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q - network_interface_id = aws_network_interface.test.id - - # Wait for the ENI attachment. - depends_on = [aws_instance.test] + vpc_endpoint_id = aws_vpc_endpoint.test.id } `, rName, destinationCidr)) } -/* -func testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, targetResourceName string) string { +func testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, targetAttribute, targetValue string) string { return composeConfig( - testAccLatestAmazonNatInstanceAmiConfig(), - testAccAvailableAZsNoOptInConfig(), + testAccLatestAmazonLinuxHvmEbsAmiConfig(), + testAccAvailableAZsNoOptInDefaultExcludeConfig(), testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), fmt.Sprintf(` +locals { + target_attr = %[3]q + target_value = %[4]s.id +} + resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -1718,26 +2427,28 @@ resource "aws_vpc" "test" { } } -resource "aws_subnet" "test" { - cidr_block = "10.1.1.0/24" - vpc_id = aws_vpc.test.id - availability_zone = data.aws_availability_zones.available.names[0] +resource "aws_vpn_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_network_interface" "test1" { - subnet_id = aws_subnet.test.id +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_network_interface" "test2" { - subnet_id = aws_subnet.test.id +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + + map_public_ip_on_launch = true tags = { Name = %[1]q @@ -1745,48 +2456,33 @@ resource "aws_network_interface" "test2" { } resource "aws_instance" "test" { - ami = data.aws_ami.amzn-ami-nat-instance.id + ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id instance_type = data.aws_ec2_instance_type_offering.available.instance_type - - network_interface { - device_index = 0 - network_interface_id = aws_network_interface.test1.id - } - - network_interface { - device_index = 1 - network_interface_id = aws_network_interface.test2.id - } + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } } -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id - +resource "aws_ec2_transit_gateway" "test" { tags = { Name = %[1]q } } -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - network_interface_id = %[3]s.id +resource "aws_ec2_transit_gateway_vpc_attachment" "test" { + subnet_ids = [aws_subnet.test.id] + transit_gateway_id = aws_ec2_transit_gateway.test.id + vpc_id = aws_vpc.test.id - # Wait for the ENI attachment. - depends_on = [aws_instance.test] -} -`, rName, destinationCidr, targetResourceName)) + tags = { + Name = %[1]q + } } -*/ -func testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id tags = { Name = %[1]q @@ -1811,68 +2507,55 @@ resource "aws_vpc_peering_connection" "test" { } } -resource "aws_route_table" "test" { - vpc_id = aws_vpc.test.id +resource "aws_eip" "test" { + vpc = true tags = { Name = %[1]q } } -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - vpc_peering_connection_id = aws_vpc_peering_connection.test.id -} -`, rName, destinationCidr) -} - -func testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" +resource "aws_nat_gateway" "test" { + allocation_id = aws_eip.test.id + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } -} - -resource "aws_subnet" "test" { - cidr_block = "10.1.1.0/24" - vpc_id = aws_vpc.test.id - - map_public_ip_on_launch = true - tags = { - Name = %[1]q - } + depends_on = [aws_internet_gateway.test] } -resource "aws_internet_gateway" "test" { - vpc_id = aws_vpc.test.id +data "aws_caller_identity" "current" {} - tags = { - Name = %[1]q +resource "aws_lb" "test" { + load_balancer_type = "gateway" + name = %[1]q + + subnet_mapping { + subnet_id = aws_subnet.test.id } } -resource "aws_eip" "test" { - vpc = true +resource "aws_vpc_endpoint_service" "test" { + acceptance_required = false + allowed_principals = [data.aws_caller_identity.current.arn] + gateway_load_balancer_arns = [aws_lb.test.arn] tags = { Name = %[1]q } } -resource "aws_nat_gateway" "test" { - allocation_id = aws_eip.test.id - subnet_id = aws_subnet.test.id +resource "aws_vpc_endpoint" "test" { + service_name = aws_vpc_endpoint_service.test.service_name + subnet_ids = [aws_subnet.test.id] + vpc_endpoint_type = aws_vpc_endpoint_service.test.service_type + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } - - depends_on = [aws_internet_gateway.test] } resource "aws_route_table" "test" { @@ -1886,15 +2569,34 @@ resource "aws_route_table" "test" { resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q - nat_gateway_id = aws_nat_gateway.test.id + + egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null + gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null + instance_id = (local.target_attr == "instance_id") ? local.target_value : null + local_gateway_id = (local.target_attr == "local_gateway_id") ? local.target_value : null + nat_gateway_id = (local.target_attr == "nat_gateway_id") ? local.target_value : null + network_interface_id = (local.target_attr == "network_interface_id") ? local.target_value : null + transit_gateway_id = (local.target_attr == "transit_gateway_id") ? local.target_value : null + vpc_endpoint_id = (local.target_attr == "vpc_endpoint_id") ? local.target_value : null + vpc_peering_connection_id = (local.target_attr == "vpc_peering_connection_id") ? local.target_value : null } -`, rName, destinationCidr) +`, rName, destinationCidr, targetAttribute, targetValue)) +} + +func testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, targetAttribute, targetValue string) string { + return composeConfig( + testAccLatestAmazonLinuxHvmEbsAmiConfig(), + testAccAvailableAZsNoOptInConfig(), + testAccAvailableEc2InstanceTypeForAvailabilityZone("data.aws_availability_zones.available.names[0]", "t3.micro", "t2.micro"), + fmt.Sprintf(` +locals { + target_attr = %[3]q + target_value = %[4]s.id } -func testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true tags = { Name = %[1]q @@ -1909,7 +2611,7 @@ resource "aws_vpn_gateway" "test" { } } -resource "aws_route_table" "test" { +resource "aws_internet_gateway" "test" { vpc_id = aws_vpc.test.id tags = { @@ -1917,34 +2619,32 @@ resource "aws_route_table" "test" { } } -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - gateway_id = aws_vpn_gateway.test.id -} -`, rName, destinationCidr) -} +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id + availability_zone = data.aws_availability_zones.available.names[0] + ipv6_cidr_block = cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1) -func testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true + map_public_ip_on_launch = true tags = { Name = %[1]q } } -resource "aws_vpn_gateway" "test" { - vpc_id = aws_vpc.test.id +resource "aws_instance" "test" { + 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 } } -resource "aws_route_table" "test" { +resource "aws_egress_only_internet_gateway" "test" { vpc_id = aws_vpc.test.id tags = { @@ -1952,62 +2652,62 @@ resource "aws_route_table" "test" { } } -resource "aws_route" "test" { - route_table_id = aws_route_table.test.id - destination_ipv6_cidr_block = %[2]q - gateway_id = aws_vpn_gateway.test.id -} -`, rName, destinationCidr) -} - -func testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr string) string { - return composeConfig( - testAccAvailableAZsNoOptInConfig(), - fmt.Sprintf(` -data "aws_caller_identity" "current" {} - -resource "aws_vpc" "test" { - cidr_block = "10.10.10.0/25" +resource "aws_network_interface" "test" { + subnet_id = aws_subnet.test.id tags = { Name = %[1]q } } -resource "aws_subnet" "test" { - availability_zone = data.aws_availability_zones.available.names[0] - cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 2, 0) - vpc_id = aws_vpc.test.id +resource "aws_vpc" "target" { + cidr_block = "10.0.0.0/16" + assign_generated_ipv6_cidr_block = true tags = { Name = %[1]q } } -resource "aws_lb" "test" { - load_balancer_type = "gateway" - name = %[1]q +resource "aws_vpc_peering_connection" "test" { + vpc_id = aws_vpc.test.id + peer_vpc_id = aws_vpc.target.id + auto_accept = true - subnet_mapping { - subnet_id = aws_subnet.test.id + tags = { + Name = %[1]q } } -resource "aws_vpc_endpoint_service" "test" { - acceptance_required = false - allowed_principals = [data.aws_caller_identity.current.arn] - gateway_load_balancer_arns = [aws_lb.test.arn] +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id tags = { Name = %[1]q } } -resource "aws_vpc_endpoint" "test" { - service_name = aws_vpc_endpoint_service.test.service_name - subnet_ids = [aws_subnet.test.id] - vpc_endpoint_type = aws_vpc_endpoint_service.test.service_type - vpc_id = aws_vpc.test.id +resource "aws_route" "test" { + route_table_id = aws_route_table.test.id + destination_ipv6_cidr_block = %[2]q + + egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null + gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null + instance_id = (local.target_attr == "instance_id") ? local.target_value : null + local_gateway_id = (local.target_attr == "local_gateway_id") ? local.target_value : null + nat_gateway_id = (local.target_attr == "nat_gateway_id") ? local.target_value : null + network_interface_id = (local.target_attr == "network_interface_id") ? local.target_value : null + transit_gateway_id = (local.target_attr == "transit_gateway_id") ? local.target_value : null + vpc_endpoint_id = (local.target_attr == "vpc_endpoint_id") ? local.target_value : null + vpc_peering_connection_id = (local.target_attr == "vpc_peering_connection_id") ? local.target_value : null +} +`, rName, destinationCidr, targetAttribute, targetValue)) +} + +func testAccAWSRouteConfigIpv4NoRoute(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" tags = { Name = %[1]q @@ -2021,11 +2721,17 @@ resource "aws_route_table" "test" { Name = %[1]q } } +`, rName) +} +func testAccAWSRouteConfigIpv4LocalRoute(rName string) string { + return composeConfig( + testAccAWSRouteConfigIpv4NoRoute(rName), + fmt.Sprintf(` resource "aws_route" "test" { route_table_id = aws_route_table.test.id - destination_cidr_block = %[2]q - vpc_endpoint_id = aws_vpc_endpoint.test.id + destination_cidr_block = aws_vpc.test.cidr_block + gateway_id = "local" } -`, rName, destinationCidr)) +`)) } diff --git a/aws/validators.go b/aws/validators.go index a09eb20e809..e1b48251f62 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -840,6 +840,7 @@ func validateIpv6CIDRBlock(cidr string) error { return nil } +// TODO Replace with tfnet.CIDRBlocksEqual. // cidrBlocksEqual returns whether or not two CIDR blocks are equal: // - Both CIDR blocks parse to an IP address and network // - The string representation of the IP addresses are equal From a4bf248b16736fa628343762a3e774b23137e575 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 30 Dec 2020 10:29:07 -0500 Subject: [PATCH 1164/1252] r/aws_route: Correct capitalization of 'IPv4' and 'IPv6'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRoute_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_ -timeout 120m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === RUN TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRoute_IPv6_To_InternetGateway === PAUSE TestAccAWSRoute_IPv6_To_InternetGateway === RUN TestAccAWSRoute_IPv6_To_Instance === PAUSE TestAccAWSRoute_IPv6_To_Instance === RUN TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv6_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv6_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv6_To_VpnGateway === PAUSE TestAccAWSRoute_IPv6_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_VpnGateway === PAUSE TestAccAWSRoute_IPv4_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_Instance === PAUSE TestAccAWSRoute_IPv4_To_Instance === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === RUN TestAccAWSRoute_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv4_To_NatGateway === PAUSE TestAccAWSRoute_IPv4_To_NatGateway === RUN TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === PAUSE TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === RUN TestAccAWSRoute_IPv4_To_TransitGateway === PAUSE TestAccAWSRoute_IPv4_To_TransitGateway === RUN TestAccAWSRoute_IPv6_To_TransitGateway === PAUSE TestAccAWSRoute_IPv6_To_TransitGateway === RUN TestAccAWSRoute_IPv4_To_LocalGateway === PAUSE TestAccAWSRoute_IPv4_To_LocalGateway === RUN TestAccAWSRoute_IPv6_To_LocalGateway === PAUSE TestAccAWSRoute_IPv6_To_LocalGateway === RUN TestAccAWSRoute_ConditionalCidrBlock === PAUSE TestAccAWSRoute_ConditionalCidrBlock === RUN TestAccAWSRoute_IPv4_Update_Target === PAUSE TestAccAWSRoute_IPv4_Update_Target === RUN TestAccAWSRoute_IPv6_Update_Target === PAUSE TestAccAWSRoute_IPv6_Update_Target === RUN TestAccAWSRoute_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRoute_IPv4_To_VpcEndpoint === RUN TestAccAWSRoute_LocalRoute === PAUSE TestAccAWSRoute_LocalRoute === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_VpcPeeringConnection (27.43s) === CONT TestAccAWSRoute_LocalRoute --- PASS: TestAccAWSRoute_basic (36.72s) === CONT TestAccAWSRoute_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRoute_LocalRoute (21.98s) === CONT TestAccAWSRoute_IPv6_Update_Target --- PASS: TestAccAWSRoute_IPv6_Update_Target (226.03s) === CONT TestAccAWSRoute_IPv4_Update_Target --- PASS: TestAccAWSRoute_IPv4_To_VpcEndpoint (273.71s) === CONT TestAccAWSRoute_ConditionalCidrBlock === CONT TestAccAWSRoute_IPv6_To_LocalGateway --- PASS: TestAccAWSRoute_ConditionalCidrBlock (51.91s) === CONT TestAccAWSRoute_IPv6_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv6_To_LocalGateway (1.28s) === CONT TestAccAWSRoute_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv4_To_LocalGateway (1.10s) === CONT TestAccAWSRoute_IPv6_To_TransitGateway --- PASS: TestAccAWSRoute_IPv6_To_TransitGateway (357.84s) === CONT TestAccAWSRoute_IPv4_To_TransitGateway --- PASS: TestAccAWSRoute_IPv4_Update_Target (626.78s) === CONT TestAccAWSRoute_DoesNotCrashWithVpcEndpoint --- PASS: TestAccAWSRoute_DoesNotCrashWithVpcEndpoint (43.28s) === CONT TestAccAWSRoute_IPv4_To_NatGateway --- PASS: TestAccAWSRoute_IPv4_To_TransitGateway (399.08s) === CONT TestAccAWSRoute_IPv6_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv6_To_VpcPeeringConnection (25.57s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments --- PASS: TestAccAWSRoute_IPv4_To_NatGateway (228.62s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Attached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments (190.46s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached (57.67s) === CONT TestAccAWSRoute_IPv4_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Attached (340.04s) === CONT TestAccAWSRoute_IPv4_To_VpnGateway --- PASS: TestAccAWSRoute_IPv4_To_VpnGateway (35.60s) === CONT TestAccAWSRoute_IPv6_To_VpnGateway --- PASS: TestAccAWSRoute_IPv6_To_VpnGateway (41.86s) === CONT TestAccAWSRoute_IPv6_To_InternetGateway --- PASS: TestAccAWSRoute_IPv6_To_InternetGateway (34.47s) === CONT TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached (58.80s) === CONT TestAccAWSRoute_IPv6_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_Instance (326.97s) === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_disappears_RouteTable (33.05s) === CONT TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway (37.46s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_disappears (31.77s) --- PASS: TestAccAWSRoute_IPv6_To_Instance (327.89s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 2012.898s --- aws/internal/service/ec2/finder/finder.go | 12 +++++++----- aws/resource_aws_route.go | 8 ++++---- aws/resource_aws_route_test.go | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index a57d7fdbeeb..5d00fb05322 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -109,18 +109,20 @@ func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) return nil, err } - if output == nil || len(output.RouteTables) == 0 || output.RouteTables[0] == nil { + if output == nil || len(output.RouteTables) == 0 { return nil, nil } return output.RouteTables[0], nil } +// RouteFinder returns the route corresponding to the specified destination. +// Returns nil if no route is found. type RouteFinder func(*ec2.EC2, string, string) (*ec2.Route, error) -// RouteByIpv4Destination returns the route corresponding to the specified IPv4 destination. +// RouteByIPv4Destination returns the route corresponding to the specified IPv4 destination. // Returns nil if no route is found. -func RouteByIpv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) (*ec2.Route, error) { +func RouteByIPv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) if err != nil { return nil, err @@ -135,9 +137,9 @@ func RouteByIpv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) return nil, nil } -// RouteByIpv6Destination returns the route corresponding to the specified IPv6 destination. +// RouteByIPv6Destination returns the route corresponding to the specified IPv6 destination. // Returns nil if no route is found. -func RouteByIpv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr string) (*ec2.Route, error) { +func RouteByIPv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) if err != nil { return nil, err diff --git a/aws/resource_aws_route.go b/aws/resource_aws_route.go index 4fce0f2f130..325f2314b9e 100644 --- a/aws/resource_aws_route.go +++ b/aws/resource_aws_route.go @@ -194,10 +194,10 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { switch destination := aws.String(destination); destinationAttributeKey { case "destination_cidr_block": input.DestinationCidrBlock = destination - routeFinder = finder.RouteByIpv4Destination + routeFinder = finder.RouteByIPv4Destination case "destination_ipv6_cidr_block": input.DestinationIpv6CidrBlock = destination - routeFinder = finder.RouteByIpv6Destination + routeFinder = finder.RouteByIPv6Destination default: return fmt.Errorf("error creating Route: unexpected route destination attribute: %q", destinationAttributeKey) } @@ -298,9 +298,9 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { switch destinationAttributeKey { case "destination_cidr_block": - routeFinder = finder.RouteByIpv4Destination + routeFinder = finder.RouteByIPv4Destination case "destination_ipv6_cidr_block": - routeFinder = finder.RouteByIpv6Destination + routeFinder = finder.RouteByIPv6Destination default: return fmt.Errorf("error reading Route: unexpected route destination attribute: %q", destinationAttributeKey) } diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index 88fd80613b0..306f699299b 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -1337,9 +1337,9 @@ func testAccCheckAWSRouteDestroy(s *terraform.State) error { var route *ec2.Route var err error if v := rs.Primary.Attributes["destination_cidr_block"]; v != "" { - route, err = finder.RouteByIpv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) + route, err = finder.RouteByIPv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) } else if v := rs.Primary.Attributes["destination_ipv6_cidr_block"]; v != "" { - route, err = finder.RouteByIpv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) + route, err = finder.RouteByIPv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) } if route == nil && err == nil { From 7c9085579b9b486abbf5e137702a5e0bfcfdd871 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 5 Jan 2021 18:07:29 -0500 Subject: [PATCH 1165/1252] r/aws_route: Fix linter S1039: unnecessary use of fmt.Sprintf. --- aws/resource_aws_route_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index 306f699299b..e3b83f3b199 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -2727,11 +2727,11 @@ resource "aws_route_table" "test" { func testAccAWSRouteConfigIpv4LocalRoute(rName string) string { return composeConfig( testAccAWSRouteConfigIpv4NoRoute(rName), - fmt.Sprintf(` + ` resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = aws_vpc.test.cidr_block gateway_id = "local" } -`)) +`) } From 967b940368f189cbac7522b8d78029cac7741b63 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 7 Jan 2021 10:48:12 -0500 Subject: [PATCH 1166/1252] r/aws_route: Add documentation note on use of the 'gateway_id' attribute. --- website/docs/r/route.html.markdown | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/docs/r/route.html.markdown b/website/docs/r/route.html.markdown index d15cb644372..8d517a674ab 100644 --- a/website/docs/r/route.html.markdown +++ b/website/docs/r/route.html.markdown @@ -16,6 +16,8 @@ defined in-line. At this time you cannot use a Route Table with in-line routes in conjunction with any Route resources. Doing so will cause a conflict of rule settings and will overwrite rules. +~> **NOTE on `gateway_id` attribute:** The AWS API is very forgiving with the resource ID passed in the `gateway_id` attribute. For example an `aws_route` resource can be created with an [`aws_nat_gateway`](nat_gateway.html) or [`aws_egress_only_internet_gateway`](egress_only_internet_gateway.html) ID specified for the `gateway_id` attribute. Specifying anything other than an [`aws_internet_gateway`](internet_gateway.html) or [`aws_vpn_gateway`](vpn_gateway.html) ID will lead to Terraform reporting a permanent diff between your configuration and recorded state, as the AWS API returns the more-specific attribute. If you are experiencing constant diffs with an `aws_route` resource, the first thing to check is that the correct attribute is being specified. + ## Example Usage ```terraform From 1d57fe8c67b505131b7bfa06c8250df941d60861 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 22 Jan 2021 15:32:12 -0500 Subject: [PATCH 1167/1252] Add CHANGELOG entries. --- .changelog/16930.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/16930.txt diff --git a/.changelog/16930.txt b/.changelog/16930.txt new file mode 100644 index 00000000000..7ef478508e8 --- /dev/null +++ b/.changelog/16930.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_route: Validate route destination and target attributes +``` + +```release-note:bug +resource/aws_route: Correctly handle updates to the route target attributes (`egress_only_gateway_id`, `gateway_id`, `instance_id`, `local_gateway_id`, `nat_gateway_id`, `network_interface_id`, `transit_gateway_id`, `vpc_peering_connection_id`) +``` From 88fd905e4f51ba88c0f58484d93215bbb27fe416 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 22 Jan 2021 16:56:08 -0500 Subject: [PATCH 1168/1252] r/aws_route: Return 'NotFoundError' instead of 'nil' when no route found (#15945). r/aws_route: Implement 'd.IsNewResource()' checksin 'resourceAwsRouteRead' (#16796). Acceptance test output: $ make testacc TEST=./aws TESTARGS='-run=TestAccAWSRoute_basic\|TestAccAWSRoute_disappears' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_basic\|TestAccAWSRoute_disappears -timeout 120m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_disappears_RouteTable (34.67s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_basic (36.39s) --- PASS: TestAccAWSRoute_disappears (31.85s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 66.620s --- aws/internal/service/ec2/finder/finder.go | 33 +++++++++++++++++------ aws/resource_aws_route.go | 20 +++++--------- 2 files changed, 31 insertions(+), 22 deletions(-) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index 5d00fb05322..8754c22f2e0 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -5,6 +5,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" tfnet "github.com/terraform-providers/terraform-provider-aws/aws/internal/net" tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" ) @@ -97,31 +99,46 @@ func InstanceByID(conn *ec2.EC2, id string) (*ec2.Instance, error) { } // RouteTableByID returns the route table corresponding to the specified identifier. -// Returns nil if no route table is found. +// Returns NotFoundError if no route table is found. func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) { input := &ec2.DescribeRouteTablesInput{ RouteTableIds: aws.StringSlice([]string{routeTableID}), } + return RouteTable(conn, input) +} + +func RouteTable(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) (*ec2.RouteTable, error) { output, err := conn.DescribeRouteTables(input) + if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteTableIDNotFound) { + return nil, &resource.NotFoundError{ + LastError: err, + LastRequest: input, + } + } + if err != nil { return nil, err } - if output == nil || len(output.RouteTables) == 0 { - return nil, nil + if output == nil || len(output.RouteTables) == 0 || output.RouteTables[0] == nil { + return nil, &resource.NotFoundError{ + Message: "Empty result", + LastRequest: input, + LastResponse: output, + } } return output.RouteTables[0], nil } // RouteFinder returns the route corresponding to the specified destination. -// Returns nil if no route is found. +// Returns NotFoundError if no route is found. type RouteFinder func(*ec2.EC2, string, string) (*ec2.Route, error) // RouteByIPv4Destination returns the route corresponding to the specified IPv4 destination. -// Returns nil if no route is found. +// Returns NotFoundError if no route is found. func RouteByIPv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) if err != nil { @@ -134,11 +151,11 @@ func RouteByIPv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) } } - return nil, nil + return nil, &resource.NotFoundError{} } // RouteByIPv6Destination returns the route corresponding to the specified IPv6 destination. -// Returns nil if no route is found. +// Returns NotFoundError if no route is found. func RouteByIPv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) if err != nil { @@ -151,7 +168,7 @@ func RouteByIPv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr str } } - return nil, nil + return nil, &resource.NotFoundError{} } // SecurityGroupByID looks up a security group by ID. When not found, returns nil and potentially an API error. diff --git a/aws/resource_aws_route.go b/aws/resource_aws_route.go index 325f2314b9e..f319ce3a125 100644 --- a/aws/resource_aws_route.go +++ b/aws/resource_aws_route.go @@ -252,16 +252,14 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error creating Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } - var route *ec2.Route - err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { - route, err = routeFinder(conn, routeTableID, destination) + _, err = routeFinder(conn, routeTableID, destination) if err != nil { return resource.RetryableError(err) } - if route == nil { + if tfresource.NotFound(err) { return resource.RetryableError(fmt.Errorf("route not found")) } @@ -269,14 +267,14 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { }) if tfresource.TimedOut(err) { - route, err = routeFinder(conn, routeTableID, destination) + _, err = routeFinder(conn, routeTableID, destination) } if err != nil { return fmt.Errorf("error reading Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } - if route == nil { + if tfresource.NotFound(err) { return fmt.Errorf("Route in Route Table (%s) with destination (%s) not found", routeTableID, destination) } @@ -309,8 +307,8 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { route, err := routeFinder(conn, routeTableID, destination) - if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteTableIDNotFound) { - log.Printf("[WARN] Route Table (%s) not found, removing from state", routeTableID) + if !d.IsNewResource() && tfresource.NotFound(err) { + log.Printf("[WARN] Route in Route Table (%s) with destination (%s) not found, removing from state", routeTableID, destination) d.SetId("") return nil } @@ -319,12 +317,6 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error reading Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } - if route == nil { - log.Printf("[WARN] Route in Route Table (%s) with destination (%s) not found, removing from state", routeTableID, destination) - d.SetId("") - return nil - } - d.Set("destination_cidr_block", route.DestinationCidrBlock) d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) d.Set("destination_prefix_list_id", route.DestinationPrefixListId) From f4bff31ee7b5d0ebec7e002f891f25129cc156df Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 23 Jan 2021 18:13:11 -0500 Subject: [PATCH 1169/1252] r/aws_route: Change 'finder.RouteTable' to 'finder.RouteTables' to support data source returning multiple route tables. Acceptance test output: $ make testacc TEST=./aws TESTARGS='-run=TestAccAWSRoute_basic\|TestAccAWSRoute_disappears' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_basic\|TestAccAWSRoute_disappears -timeout 120m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_disappears_RouteTable (33.82s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_basic (35.39s) --- PASS: TestAccAWSRoute_disappears (31.99s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 65.901s --- aws/internal/service/ec2/finder/finder.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index 8754c22f2e0..608a58182d8 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -105,10 +105,18 @@ func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) RouteTableIds: aws.StringSlice([]string{routeTableID}), } - return RouteTable(conn, input) + routeTables, err := RouteTables(conn, input) + + if err != nil { + return nil, err + } + + return routeTables[0], nil } -func RouteTable(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) (*ec2.RouteTable, error) { +// RouteTables returns the route tables corresponding to the specified input. +// Returns NotFoundError if no route tables are found. +func RouteTables(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) ([]*ec2.RouteTable, error) { output, err := conn.DescribeRouteTables(input) if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteTableIDNotFound) { @@ -130,7 +138,7 @@ func RouteTable(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) (*ec2.RouteT } } - return output.RouteTables[0], nil + return output.RouteTables, nil } // RouteFinder returns the route corresponding to the specified destination. From 6f9b6e361d995c98b61ef7fa1c3a784be3f110e5 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 24 Jan 2021 15:41:21 -0500 Subject: [PATCH 1170/1252] Revert "r/aws_route: Change 'finder.RouteTable' to 'finder.RouteTables' to support data source returning multiple route tables." This reverts commit 5b93284766f6bea0a044e63ba5bbb5ce8e504424. --- aws/internal/service/ec2/finder/finder.go | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index 608a58182d8..8754c22f2e0 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -105,18 +105,10 @@ func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) RouteTableIds: aws.StringSlice([]string{routeTableID}), } - routeTables, err := RouteTables(conn, input) - - if err != nil { - return nil, err - } - - return routeTables[0], nil + return RouteTable(conn, input) } -// RouteTables returns the route tables corresponding to the specified input. -// Returns NotFoundError if no route tables are found. -func RouteTables(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) ([]*ec2.RouteTable, error) { +func RouteTable(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) (*ec2.RouteTable, error) { output, err := conn.DescribeRouteTables(input) if tfawserr.ErrCodeEquals(err, tfec2.ErrCodeInvalidRouteTableIDNotFound) { @@ -138,7 +130,7 @@ func RouteTables(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) ([]*ec2.Rou } } - return output.RouteTables, nil + return output.RouteTables[0], nil } // RouteFinder returns the route corresponding to the specified destination. From a205744b47825b995167a1a0eaa26ffd22a53631 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 24 Jan 2021 17:00:02 -0500 Subject: [PATCH 1171/1252] r/aws_route: Add 'testAccCheckAWSRouteExists'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRoute_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_ -timeout 120m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === RUN TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRoute_IPv6_To_InternetGateway === PAUSE TestAccAWSRoute_IPv6_To_InternetGateway === RUN TestAccAWSRoute_IPv6_To_Instance === PAUSE TestAccAWSRoute_IPv6_To_Instance === RUN TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv6_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv6_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv6_To_VpnGateway === PAUSE TestAccAWSRoute_IPv6_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_VpnGateway === PAUSE TestAccAWSRoute_IPv4_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_Instance === PAUSE TestAccAWSRoute_IPv4_To_Instance === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === RUN TestAccAWSRoute_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv4_To_NatGateway === PAUSE TestAccAWSRoute_IPv4_To_NatGateway === RUN TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === PAUSE TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === RUN TestAccAWSRoute_IPv4_To_TransitGateway === PAUSE TestAccAWSRoute_IPv4_To_TransitGateway === RUN TestAccAWSRoute_IPv6_To_TransitGateway === PAUSE TestAccAWSRoute_IPv6_To_TransitGateway === RUN TestAccAWSRoute_IPv4_To_LocalGateway === PAUSE TestAccAWSRoute_IPv4_To_LocalGateway === RUN TestAccAWSRoute_IPv6_To_LocalGateway === PAUSE TestAccAWSRoute_IPv6_To_LocalGateway === RUN TestAccAWSRoute_ConditionalCidrBlock === PAUSE TestAccAWSRoute_ConditionalCidrBlock === RUN TestAccAWSRoute_IPv4_Update_Target === PAUSE TestAccAWSRoute_IPv4_Update_Target === RUN TestAccAWSRoute_IPv6_Update_Target === PAUSE TestAccAWSRoute_IPv6_Update_Target === RUN TestAccAWSRoute_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRoute_IPv4_To_VpcEndpoint === RUN TestAccAWSRoute_LocalRoute === PAUSE TestAccAWSRoute_LocalRoute === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_VpcPeeringConnection (27.59s) === CONT TestAccAWSRoute_LocalRoute --- PASS: TestAccAWSRoute_basic (36.97s) === CONT TestAccAWSRoute_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRoute_LocalRoute (22.34s) === CONT TestAccAWSRoute_IPv6_Update_Target === CONT TestAccAWSRoute_IPv4_To_VpcEndpoint resource_aws_route_test.go:1305: Step 1/2 error: Error running apply: 2021/01/24 16:28:27 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.12.0 Error: error waiting for VPC Endpoint (vpce-0467b8bc3339b49d3) to become available: VPC Endpoint is in a failed state --- FAIL: TestAccAWSRoute_IPv4_To_VpcEndpoint (117.58s) === CONT TestAccAWSRoute_IPv4_Update_Target --- PASS: TestAccAWSRoute_IPv6_Update_Target (240.69s) === CONT TestAccAWSRoute_ConditionalCidrBlock === CONT TestAccAWSRoute_IPv4_Update_Target resource_aws_route_test.go:961: Step 1/9 error: Error running apply: 2021/01/24 16:30:26 [DEBUG] Using modified User-Agent: Terraform/0.12.26 HashiCorp-terraform-exec/0.12.0 Error: error waiting for VPC Endpoint (vpce-00b5c230eaa0bb041) to become available: VPC Endpoint is in a failed state --- PASS: TestAccAWSRoute_ConditionalCidrBlock (53.83s) === CONT TestAccAWSRoute_IPv6_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv6_To_LocalGateway (1.20s) === CONT TestAccAWSRoute_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv4_To_LocalGateway (1.09s) === CONT TestAccAWSRoute_IPv6_To_TransitGateway --- FAIL: TestAccAWSRoute_IPv4_Update_Target (293.81s) === CONT TestAccAWSRoute_IPv4_To_TransitGateway --- PASS: TestAccAWSRoute_IPv6_To_TransitGateway (398.85s) === CONT TestAccAWSRoute_DoesNotCrashWithVpcEndpoint --- PASS: TestAccAWSRoute_DoesNotCrashWithVpcEndpoint (43.25s) === CONT TestAccAWSRoute_IPv4_To_NatGateway --- PASS: TestAccAWSRoute_IPv4_To_TransitGateway (357.85s) === CONT TestAccAWSRoute_IPv6_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv6_To_VpcPeeringConnection (25.91s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments --- PASS: TestAccAWSRoute_IPv4_To_NatGateway (198.68s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Attached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments (188.15s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached (58.13s) === CONT TestAccAWSRoute_IPv4_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Attached (350.41s) === CONT TestAccAWSRoute_IPv4_To_VpnGateway --- PASS: TestAccAWSRoute_IPv4_To_VpnGateway (55.38s) === CONT TestAccAWSRoute_IPv6_To_VpnGateway --- PASS: TestAccAWSRoute_IPv4_To_Instance (326.27s) === CONT TestAccAWSRoute_IPv6_To_InternetGateway --- PASS: TestAccAWSRoute_IPv6_To_VpnGateway (41.21s) === CONT TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv6_To_InternetGateway (35.53s) === CONT TestAccAWSRoute_IPv6_To_Instance --- PASS: TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached (58.52s) === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_disappears_RouteTable (33.04s) === CONT TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway (37.15s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_disappears (32.57s) --- PASS: TestAccAWSRoute_IPv6_To_Instance (349.57s) FAIL FAIL github.com/terraform-providers/terraform-provider-aws/aws 1789.890s FAIL GNUmakefile:27: recipe for target 'testacc' failed make: *** [testacc] Error 1 Failures are unrelated to this change. --- aws/resource_aws_route_test.go | 112 +++++++++++++++++++++++++++++++-- 1 file changed, 107 insertions(+), 5 deletions(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index e3b83f3b199..ec221cefe0f 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -10,10 +10,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) // IPv4 to Internet Gateway. func TestAccAWSRoute_basic(t *testing.T) { + var route ec2.Route var routeTable ec2.RouteTable resourceName := "aws_route.test" igwResourceName := "aws_internet_gateway.test" @@ -32,6 +34,7 @@ func TestAccAWSRoute_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(rtResourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -60,6 +63,7 @@ func TestAccAWSRoute_basic(t *testing.T) { } func TestAccAWSRoute_disappears(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" rName := acctest.RandomWithPrefix("tf-acc-test") destinationCidr := "10.3.0.0/16" @@ -73,6 +77,7 @@ func TestAccAWSRoute_disappears(t *testing.T) { { Config: testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), testAccCheckResourceDisappears(testAccProvider, resourceAwsRoute(), resourceName), ), ExpectNonEmptyPlan: true, @@ -82,6 +87,8 @@ func TestAccAWSRoute_disappears(t *testing.T) { } func TestAccAWSRoute_disappears_RouteTable(t *testing.T) { + var route ec2.Route + resourceName := "aws_route.test" rtResourceName := "aws_route_table.test" rName := acctest.RandomWithPrefix("tf-acc-test") destinationCidr := "10.3.0.0/16" @@ -95,6 +102,7 @@ func TestAccAWSRoute_disappears_RouteTable(t *testing.T) { { Config: testAccAWSRouteConfigIpv4InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), testAccCheckResourceDisappears(testAccProvider, resourceAwsRouteTable(), rtResourceName), ), ExpectNonEmptyPlan: true, @@ -104,6 +112,7 @@ func TestAccAWSRoute_disappears_RouteTable(t *testing.T) { } func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" eoigwResourceName := "aws_egress_only_internet_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -118,6 +127,7 @@ func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -151,6 +161,7 @@ func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { } func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" igwResourceName := "aws_internet_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -165,6 +176,7 @@ func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -193,6 +205,7 @@ func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { } func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" instanceResourceName := "aws_instance.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -207,6 +220,7 @@ func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { { Config: testAccAWSRouteConfigIpv6Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -235,6 +249,7 @@ func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { } func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" eniResourceName := "aws_network_interface.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -249,6 +264,7 @@ func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { { Config: testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -277,6 +293,7 @@ func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { } func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" pcxResourceName := "aws_vpc_peering_connection.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -291,6 +308,7 @@ func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { { Config: testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -319,6 +337,7 @@ func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { } func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -333,6 +352,7 @@ func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -361,6 +381,7 @@ func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { } func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -375,6 +396,7 @@ func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -403,6 +425,7 @@ func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { } func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" instanceResourceName := "aws_instance.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -416,6 +439,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { { Config: testAccAWSRouteConfigIpv4Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -444,6 +468,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { } func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" eniResourceName := "aws_network_interface.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -458,6 +483,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { { Config: testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -486,6 +512,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { } func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" eniResourceName := "aws_network_interface.test" instanceResourceName := "aws_instance.test" @@ -501,6 +528,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { { Config: testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -529,6 +557,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { } func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" eni1ResourceName := "aws_network_interface.test1" eni2ResourceName := "aws_network_interface.test2" @@ -546,6 +575,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { { Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni1ResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -566,6 +596,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { { Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni2ResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -594,6 +625,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { } func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" pcxResourceName := "aws_vpc_peering_connection.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -608,6 +640,7 @@ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { { Config: testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -636,6 +669,7 @@ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { } func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" ngwResourceName := "aws_nat_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -650,6 +684,7 @@ func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -678,6 +713,7 @@ func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { } func TestAccAWSRoute_DoesNotCrashWithVpcEndpoint(t *testing.T) { + var route ec2.Route var routeTable ec2.RouteTable resourceName := "aws_route.test" rtResourceName := "aws_route_table.test" @@ -694,6 +730,7 @@ func TestAccAWSRoute_DoesNotCrashWithVpcEndpoint(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(rtResourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccCheckAWSRouteExists(resourceName, &route), ), }, { @@ -707,6 +744,7 @@ func TestAccAWSRoute_DoesNotCrashWithVpcEndpoint(t *testing.T) { } func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" tgwResourceName := "aws_ec2_transit_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -721,6 +759,7 @@ func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -749,6 +788,7 @@ func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { } func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" tgwResourceName := "aws_ec2_transit_gateway.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -763,6 +803,7 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { { Config: testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -791,6 +832,7 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { } func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" localGatewayDataSourceName := "data.aws_ec2_local_gateway.first" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -805,6 +847,7 @@ func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { { Config: testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -833,6 +876,7 @@ func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { } func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" localGatewayDataSourceName := "data.aws_ec2_local_gateway.first" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -847,6 +891,7 @@ func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { { Config: testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -875,6 +920,7 @@ func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { } func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" rName := acctest.RandomWithPrefix("tf-acc-test") destinationCidr := "10.2.0.0/16" @@ -889,6 +935,7 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { { Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr, false), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), ), @@ -896,6 +943,7 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { { Config: testAccAWSRouteConfigConditionalIpv4Ipv6(rName, destinationCidr, destinationIpv6Cidr, true), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationIpv6Cidr), ), @@ -911,6 +959,7 @@ func TestAccAWSRoute_ConditionalCidrBlock(t *testing.T) { } func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" instanceResourceName := "aws_instance.test" @@ -932,6 +981,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -952,6 +1002,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -972,6 +1023,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -992,6 +1044,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "nat_gateway_id", ngwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1012,6 +1065,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1033,6 +1087,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "transit_gateway_id", tgwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1053,6 +1108,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_endpoint_id", vpcEndpointResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1073,6 +1129,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1101,6 +1158,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { } func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { + var route ec2.Route resourceName := "aws_route.test" vgwResourceName := "aws_vpn_gateway.test" instanceResourceName := "aws_instance.test" @@ -1119,6 +1177,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1139,6 +1198,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1159,6 +1219,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1179,6 +1240,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "egress_only_gateway_id", eoigwResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1199,6 +1261,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1219,6 +1282,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1247,6 +1311,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { } func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { + var route ec2.Route rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_route.test" vpcEndpointResourceName := "aws_vpc_endpoint.test" @@ -1260,6 +1325,7 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { { Config: testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1326,6 +1392,37 @@ func TestAccAWSRoute_LocalRoute(t *testing.T) { }) } +func testAccCheckAWSRouteExists(n string, v *ec2.Route) 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 ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + var route *ec2.Route + var err error + if v := rs.Primary.Attributes["destination_cidr_block"]; v != "" { + route, err = finder.RouteByIPv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) + } else if v := rs.Primary.Attributes["destination_ipv6_cidr_block"]; v != "" { + route, err = finder.RouteByIPv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) + } + + if err != nil { + return err + } + + *v = *route + + return nil + } +} + func testAccCheckAWSRouteDestroy(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_route" { @@ -1334,17 +1431,22 @@ func testAccCheckAWSRouteDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn - var route *ec2.Route var err error if v := rs.Primary.Attributes["destination_cidr_block"]; v != "" { - route, err = finder.RouteByIPv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) + _, err = finder.RouteByIPv4Destination(conn, rs.Primary.Attributes["route_table_id"], v) } else if v := rs.Primary.Attributes["destination_ipv6_cidr_block"]; v != "" { - route, err = finder.RouteByIPv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) + _, err = finder.RouteByIPv6Destination(conn, rs.Primary.Attributes["route_table_id"], v) } - if route == nil && err == nil { - return nil + if tfresource.NotFound(err) { + continue } + + if err != nil { + return err + } + + return fmt.Errorf("Route still exists") } return nil From 5e96236ecd51c2875c00b61935f26988414367c8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 10 Feb 2021 16:50:20 -0500 Subject: [PATCH 1172/1252] Minor tweak to 'finder.RouteTable'. --- aws/internal/service/ec2/finder/finder.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index 8754c22f2e0..c1a9fcde62a 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -124,9 +124,8 @@ func RouteTable(conn *ec2.EC2, input *ec2.DescribeRouteTablesInput) (*ec2.RouteT if output == nil || len(output.RouteTables) == 0 || output.RouteTables[0] == nil { return nil, &resource.NotFoundError{ - Message: "Empty result", - LastRequest: input, - LastResponse: output, + Message: "Empty result", + LastRequest: input, } } From b48ef53b0fae4aabe91a70e2a9ba4a30e65c8c78 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 15 Feb 2021 17:40:17 -0500 Subject: [PATCH 1173/1252] Remove 'tflint' check as aws_route targets are now validated by the resource itself. --- scripts/validate-terraform.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/validate-terraform.sh b/scripts/validate-terraform.sh index 41bcb859347..08c54d82f95 100755 --- a/scripts/validate-terraform.sh +++ b/scripts/validate-terraform.sh @@ -25,8 +25,6 @@ rules=( "--only=aws_instance_previous_type" "--only=aws_db_instance_previous_type" "--only=aws_elasticache_cluster_previous_type" - # Prevent some configuration errors - "--only=aws_route_specified_multiple_targets" ) while read -r filename ; do block_number=0 From 1fd401d224c746549722a82ec0f5243928ca62e4 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 14:09:11 -0400 Subject: [PATCH 1174/1252] docs/resource/aws_iam_saml_provider: Move tags to arguments section --- website/docs/r/iam_saml_provider.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/iam_saml_provider.html.markdown b/website/docs/r/iam_saml_provider.html.markdown index 218a29ecccf..568f9276ba5 100644 --- a/website/docs/r/iam_saml_provider.html.markdown +++ b/website/docs/r/iam_saml_provider.html.markdown @@ -25,6 +25,7 @@ The following arguments are supported: * `name` - (Required) The name of the provider to create. * `saml_metadata_document` - (Required) An XML document generated by an identity provider that supports SAML 2.0. +* `tags` - (Optional) Map of resource tags for the IAM SAML provider. ## Attributes Reference @@ -32,7 +33,6 @@ In addition to all arguments above, the following attributes are exported: * `arn` - The ARN assigned by AWS for this provider. * `valid_until` - The expiration date and time for the SAML provider in RFC1123 format, e.g. `Mon, 02 Jan 2006 15:04:05 MST`. -* `tags` - Key-value map of tags for the IAM SAML provider. ## Import From 914c9a14ca8cb264f6e791e348f21c0968fa72c5 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 14:32:38 -0400 Subject: [PATCH 1175/1252] tests/resource/aws_iam_server_certificate: Add missing ErrorCheck (#18413) Previously: ``` aws/resource_aws_iam_server_certificate_test.go:154:36: XAT001: missing ErrorCheck 153 154 resource.ParallelTest(t, resource.TestCase{ 155 PreCheck: func() { testAccPreCheck(t) }, ``` Output from acceptance testing: ``` --- PASS: TestAccAWSIAMServerCertificate_name_prefix (15.33s) ``` --- aws/resource_aws_iam_server_certificate_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_iam_server_certificate_test.go b/aws/resource_aws_iam_server_certificate_test.go index ec22ee91f35..e1703423877 100644 --- a/aws/resource_aws_iam_server_certificate_test.go +++ b/aws/resource_aws_iam_server_certificate_test.go @@ -153,6 +153,7 @@ func TestAccAWSIAMServerCertificate_name_prefix(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ From 93658ed9b7b0aae088750e37220d9a63920eb2c4 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 25 Mar 2021 18:34:32 +0000 Subject: [PATCH 1176/1252] Update CHANGELOG.md for #18413 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf479ecffe0..061f3dd8e74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ FEATURES: ENHANCEMENTS: +* resource/aws_iam_saml_provider: Add plan time validation for `name` and `saml_metadata_document` ([#17965](https://github.com/hashicorp/terraform-provider-aws/issues/17965)) +* resource/aws_iam_saml_provider: Add tagging support ([#17965](https://github.com/hashicorp/terraform-provider-aws/issues/17965)) +* resource/aws_iam_server_certificate: Add `expiration` and `upload_date` attributes ([#17967](https://github.com/hashicorp/terraform-provider-aws/issues/17967)) +* resource/aws_iam_server_certificate: Add tagging support ([#17967](https://github.com/hashicorp/terraform-provider-aws/issues/17967)) * resource/aws_light_instance_public_ports: Add `cidrs` argument to `port_info` ([#14905](https://github.com/hashicorp/terraform-provider-aws/issues/14905)) * resource/aws_pinpoint_email_channel: Add `configuration_set` argument ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) * resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) From 0dee7b56b29f8260ee2c786ee13269ba83f0e3a6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Mar 2021 14:35:33 -0400 Subject: [PATCH 1177/1252] r/aws_route: Add 'ErrorCheck' to new acceptance tests. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRoute_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_ -timeout 180m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === RUN TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRoute_IPv6_To_InternetGateway === PAUSE TestAccAWSRoute_IPv6_To_InternetGateway === RUN TestAccAWSRoute_IPv6_To_Instance === PAUSE TestAccAWSRoute_IPv6_To_Instance === RUN TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv6_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv6_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv6_To_VpnGateway === PAUSE TestAccAWSRoute_IPv6_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_VpnGateway === PAUSE TestAccAWSRoute_IPv4_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_Instance === PAUSE TestAccAWSRoute_IPv4_To_Instance === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === RUN TestAccAWSRoute_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv4_To_NatGateway === PAUSE TestAccAWSRoute_IPv4_To_NatGateway === RUN TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === PAUSE TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === RUN TestAccAWSRoute_IPv4_To_TransitGateway === PAUSE TestAccAWSRoute_IPv4_To_TransitGateway === RUN TestAccAWSRoute_IPv6_To_TransitGateway === PAUSE TestAccAWSRoute_IPv6_To_TransitGateway === RUN TestAccAWSRoute_IPv4_To_LocalGateway === PAUSE TestAccAWSRoute_IPv4_To_LocalGateway === RUN TestAccAWSRoute_IPv6_To_LocalGateway === PAUSE TestAccAWSRoute_IPv6_To_LocalGateway === RUN TestAccAWSRoute_ConditionalCidrBlock === PAUSE TestAccAWSRoute_ConditionalCidrBlock === RUN TestAccAWSRoute_IPv4_Update_Target === PAUSE TestAccAWSRoute_IPv4_Update_Target === RUN TestAccAWSRoute_IPv6_Update_Target === PAUSE TestAccAWSRoute_IPv6_Update_Target === RUN TestAccAWSRoute_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRoute_IPv4_To_VpcEndpoint === RUN TestAccAWSRoute_LocalRoute === PAUSE TestAccAWSRoute_LocalRoute === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_VpcPeeringConnection (28.45s) === CONT TestAccAWSRoute_LocalRoute --- PASS: TestAccAWSRoute_basic (38.00s) === CONT TestAccAWSRoute_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRoute_LocalRoute (22.59s) === CONT TestAccAWSRoute_IPv6_Update_Target --- PASS: TestAccAWSRoute_IPv6_Update_Target (232.50s) === CONT TestAccAWSRoute_IPv4_Update_Target --- PASS: TestAccAWSRoute_IPv4_To_VpcEndpoint (338.09s) === CONT TestAccAWSRoute_ConditionalCidrBlock --- PASS: TestAccAWSRoute_ConditionalCidrBlock (53.66s) === CONT TestAccAWSRoute_IPv6_To_LocalGateway data_source_aws_outposts_outposts_test.go:67: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv6_To_LocalGateway (0.67s) === CONT TestAccAWSRoute_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:67: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv4_To_LocalGateway (0.53s) === CONT TestAccAWSRoute_IPv6_To_TransitGateway --- PASS: TestAccAWSRoute_IPv6_To_TransitGateway (379.86s) === CONT TestAccAWSRoute_IPv4_To_TransitGateway --- PASS: TestAccAWSRoute_IPv4_Update_Target (649.40s) === CONT TestAccAWSRoute_DoesNotCrashWithVpcEndpoint --- PASS: TestAccAWSRoute_DoesNotCrashWithVpcEndpoint (44.09s) === CONT TestAccAWSRoute_IPv4_To_NatGateway --- PASS: TestAccAWSRoute_IPv4_To_NatGateway (188.51s) === CONT TestAccAWSRoute_IPv6_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_TransitGateway (368.92s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments --- PASS: TestAccAWSRoute_IPv6_To_VpcPeeringConnection (26.92s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Attached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Attached (109.80s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments (155.70s) === CONT TestAccAWSRoute_IPv4_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached (58.67s) === CONT TestAccAWSRoute_IPv4_To_VpnGateway --- PASS: TestAccAWSRoute_IPv4_To_VpnGateway (45.64s) === CONT TestAccAWSRoute_IPv6_To_VpnGateway --- PASS: TestAccAWSRoute_IPv6_To_VpnGateway (60.67s) === CONT TestAccAWSRoute_IPv6_To_InternetGateway --- PASS: TestAccAWSRoute_IPv6_To_InternetGateway (35.74s) === CONT TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached (59.67s) === CONT TestAccAWSRoute_IPv6_To_Instance --- PASS: TestAccAWSRoute_IPv6_To_Instance (76.28s) === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_IPv4_To_Instance (306.09s) === CONT TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRoute_disappears_RouteTable (34.85s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway (40.15s) --- PASS: TestAccAWSRoute_disappears (33.21s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 1707.091s --- aws/resource_aws_route_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index ec221cefe0f..ba3d0d6b451 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -433,6 +433,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -566,9 +567,8 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { destinationCidr := "10.3.0.0/16" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -1171,6 +1171,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -1319,6 +1320,7 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -1364,6 +1366,7 @@ func TestAccAWSRoute_LocalRoute(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From 9bdfe01b68f58c23d76e3476dd37141d989e8770 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Thu, 25 Mar 2021 21:01:22 +0200 Subject: [PATCH 1178/1252] resource/aws_iam_oidc_provider: Add tagging support + validations + sweeper (#17964) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSIAMOpenIDConnectProvider_disappears (10.03s) --- PASS: TestAccAWSIAMOpenIDConnectProvider_basic (20.50s) --- PASS: TestAccAWSIAMOpenIDConnectProvider_tags (32.26s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSIAMOpenIDConnectProvider_disappears (15.58s) --- PASS: TestAccAWSIAMOpenIDConnectProvider_basic (36.70s) --- PASS: TestAccAWSIAMOpenIDConnectProvider_tags (47.27s) ``` --- .changelog/17964.txt | 7 + aws/internal/keyvaluetags/iam_tags.go | 35 ++++ ...esource_aws_iam_openid_connect_provider.go | 43 +++-- ...ce_aws_iam_openid_connect_provider_test.go | 167 +++++++++++++++--- .../iam_openid_connect_provider.html.markdown | 1 + 5 files changed, 216 insertions(+), 37 deletions(-) create mode 100644 .changelog/17964.txt diff --git a/.changelog/17964.txt b/.changelog/17964.txt new file mode 100644 index 00000000000..f762457c64a --- /dev/null +++ b/.changelog/17964.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_iam_openid_connect_provider: Add tagging support +``` + +```release-note:enhancement +resource/aws_iam_openid_connect_provider: Add plan time validation for `client_id_list` and `thumbprint_list` +``` diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go index 3da7f9366a7..279377398f8 100644 --- a/aws/internal/keyvaluetags/iam_tags.go +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -81,6 +81,41 @@ func IamUserUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, return nil } +// IamOpenIDConnectProviderUpdateTags updates IAM OpenID Connect Provider tags. +// The identifier is the OpenID Connect Provider ARN. +func IamOpenIDConnectProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagOpenIDConnectProviderInput{ + OpenIDConnectProviderArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagOpenIDConnectProvider(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagOpenIDConnectProviderInput{ + OpenIDConnectProviderArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagOpenIDConnectProvider(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + // IamSAMLProviderUpdateTags updates IAM SAML Provider tags. // The identifier is the SAML Provider ARN. func IamSAMLProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { diff --git a/aws/resource_aws_iam_openid_connect_provider.go b/aws/resource_aws_iam_openid_connect_provider.go index ed97ba7176e..dadae698b74 100644 --- a/aws/resource_aws_iam_openid_connect_provider.go +++ b/aws/resource_aws_iam_openid_connect_provider.go @@ -7,6 +7,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsIamOpenIDConnectProvider() *schema.Resource { @@ -32,30 +34,38 @@ func resourceAwsIamOpenIDConnectProvider() *schema.Resource { DiffSuppressFunc: suppressOpenIdURL, }, "client_id_list": { - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 255), + }, Type: schema.TypeList, Required: true, ForceNew: true, }, "thumbprint_list": { - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(40, 40), + }, Type: schema.TypeList, Required: true, }, + "tags": tagsSchema(), }, } } func resourceAwsIamOpenIDConnectProviderCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn input := &iam.CreateOpenIDConnectProviderInput{ Url: aws.String(d.Get("url").(string)), ClientIDList: expandStringList(d.Get("client_id_list").([]interface{})), ThumbprintList: expandStringList(d.Get("thumbprint_list").([]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().IamTags(), } - out, err := iamconn.CreateOpenIDConnectProvider(input) + out, err := conn.CreateOpenIDConnectProvider(input) if err != nil { return fmt.Errorf("error creating IAM OIDC Provider: %w", err) } @@ -66,12 +76,13 @@ func resourceAwsIamOpenIDConnectProviderCreate(d *schema.ResourceData, meta inte } func resourceAwsIamOpenIDConnectProviderRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig input := &iam.GetOpenIDConnectProviderInput{ OpenIDConnectProviderArn: aws.String(d.Id()), } - out, err := iamconn.GetOpenIDConnectProvider(input) + out, err := conn.GetOpenIDConnectProvider(input) if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { log.Printf("[WARN] IAM OIDC Provider (%s) not found, removing from state", d.Id()) d.SetId("") @@ -86,11 +97,15 @@ func resourceAwsIamOpenIDConnectProviderRead(d *schema.ResourceData, meta interf d.Set("client_id_list", flattenStringList(out.ClientIDList)) d.Set("thumbprint_list", flattenStringList(out.ThumbprintList)) + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(out.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + return nil } func resourceAwsIamOpenIDConnectProviderUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn if d.HasChange("thumbprint_list") { input := &iam.UpdateOpenIDConnectProviderThumbprintInput{ @@ -98,22 +113,30 @@ func resourceAwsIamOpenIDConnectProviderUpdate(d *schema.ResourceData, meta inte ThumbprintList: expandStringList(d.Get("thumbprint_list").([]interface{})), } - _, err := iamconn.UpdateOpenIDConnectProviderThumbprint(input) + _, err := conn.UpdateOpenIDConnectProviderThumbprint(input) if err != nil { return fmt.Errorf("error updating IAM OIDC Provider (%s) thumbprint: %w", d.Id(), err) } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.IamOpenIDConnectProviderUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM OIDC Provider (%s): %w", d.Id(), err) + } + } + return resourceAwsIamOpenIDConnectProviderRead(d, meta) } func resourceAwsIamOpenIDConnectProviderDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn input := &iam.DeleteOpenIDConnectProviderInput{ OpenIDConnectProviderArn: aws.String(d.Id()), } - _, err := iamconn.DeleteOpenIDConnectProvider(input) + _, err := conn.DeleteOpenIDConnectProvider(input) if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { return nil } diff --git a/aws/resource_aws_iam_openid_connect_provider_test.go b/aws/resource_aws_iam_openid_connect_provider_test.go index c34cdba9bc6..6a476a3b3d4 100644 --- a/aws/resource_aws_iam_openid_connect_provider_test.go +++ b/aws/resource_aws_iam_openid_connect_provider_test.go @@ -2,16 +2,63 @@ package aws import ( "fmt" + "log" "testing" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/iam" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +func init() { + resource.AddTestSweepers("aws_iam_openid_connect_provider", &resource.Sweeper{ + Name: "aws_iam_openid_connect_provider", + F: testSweepIamOpenIDConnectProvider, + }) +} + +func testSweepIamOpenIDConnectProvider(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %w", err) + } + conn := client.(*AWSClient).iamconn + + var sweeperErrs *multierror.Error + + out, err := conn.ListOpenIDConnectProviders(&iam.ListOpenIDConnectProvidersInput{}) + + for _, oidcProvider := range out.OpenIDConnectProviderList { + arn := aws.StringValue(oidcProvider.Arn) + + r := resourceAwsIamOpenIDConnectProvider() + d := r.Data(nil) + d.SetId(arn) + err := r.Delete(d, client) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting IAM OIDC Provider (%s): %w", arn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping IAM OIDC Provider sweep for %s: %s", region, err) + return sweeperErrs.ErrorOrNil() // In case we have completed some pages, but had errors + } + + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error describing IAM OIDC Providers: %w", err)) + } + + return sweeperErrs.ErrorOrNil() +} + func TestAccAWSIAMOpenIDConnectProvider_basic(t *testing.T) { rString := acctest.RandString(5) url := "accounts.testle.com/" + rString @@ -27,11 +74,13 @@ func TestAccAWSIAMOpenIDConnectProvider_basic(t *testing.T) { Config: testAccIAMOpenIDConnectProviderConfig(rString), Check: resource.ComposeTestCheckFunc( testAccCheckIAMOpenIDConnectProvider(resourceName), + testAccCheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("oidc-provider/%s", url)), resource.TestCheckResourceAttr(resourceName, "url", url), resource.TestCheckResourceAttr(resourceName, "client_id_list.#", "1"), resource.TestCheckResourceAttr(resourceName, "client_id_list.0", "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com"), resource.TestCheckResourceAttr(resourceName, "thumbprint_list.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -50,6 +99,52 @@ func TestAccAWSIAMOpenIDConnectProvider_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "thumbprint_list.#", "2"), resource.TestCheckResourceAttr(resourceName, "thumbprint_list.0", "cf23df2207d99a74fbe169e3eba035e633b65d94"), resource.TestCheckResourceAttr(resourceName, "thumbprint_list.1", "c784713d6f9cb67b55dd84f4e4af7832d42b8f55"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + }, + }) +} + +func TestAccAWSIAMOpenIDConnectProvider_tags(t *testing.T) { + rString := acctest.RandString(5) + resourceName := "aws_iam_openid_connect_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSInstanceProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccIAMOpenIDConnectProviderConfigTags1(rString, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMOpenIDConnectProvider(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, + { + Config: testAccIAMOpenIDConnectProviderConfigTags2(rString, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMOpenIDConnectProvider(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccIAMOpenIDConnectProviderConfigTags1(rString, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckIAMOpenIDConnectProvider(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -70,7 +165,7 @@ func TestAccAWSIAMOpenIDConnectProvider_disappears(t *testing.T) { Config: testAccIAMOpenIDConnectProviderConfig(rString), Check: resource.ComposeTestCheckFunc( testAccCheckIAMOpenIDConnectProvider(resourceName), - testAccCheckIAMOpenIDConnectProviderDisappears(resourceName), + testAccCheckResourceDisappears(testAccProvider, resourceAwsIamOpenIDConnectProvider(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -79,7 +174,7 @@ func TestAccAWSIAMOpenIDConnectProvider_disappears(t *testing.T) { } func testAccCheckIAMOpenIDConnectProviderDestroy(s *terraform.State) error { - iamconn := testAccProvider.Meta().(*AWSClient).iamconn + conn := testAccProvider.Meta().(*AWSClient).iamconn for _, rs := range s.RootModule().Resources { if rs.Type != "aws_iam_openid_connect_provider" { @@ -89,13 +184,13 @@ func testAccCheckIAMOpenIDConnectProviderDestroy(s *terraform.State) error { input := &iam.GetOpenIDConnectProviderInput{ OpenIDConnectProviderArn: aws.String(rs.Primary.ID), } - out, err := iamconn.GetOpenIDConnectProvider(input) + out, err := conn.GetOpenIDConnectProvider(input) if err != nil { - if iamerr, ok := err.(awserr.Error); ok && iamerr.Code() == "NoSuchEntity" { + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { // none found, that's good return nil } - return fmt.Errorf("Error reading IAM OpenID Connect Provider, out: %s, err: %s", out, err) + return fmt.Errorf("Error reading IAM OpenID Connect Provider, out: %s, err: %w", out, err) } if out != nil { @@ -106,25 +201,6 @@ func testAccCheckIAMOpenIDConnectProviderDestroy(s *terraform.State) error { return nil } -func testAccCheckIAMOpenIDConnectProviderDisappears(id string) resource.TestCheckFunc { - return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[id] - if !ok { - return fmt.Errorf("Not Found: %s", id) - } - - if rs.Primary.ID == "" { - return fmt.Errorf("No ID is set") - } - - iamconn := testAccProvider.Meta().(*AWSClient).iamconn - _, err := iamconn.DeleteOpenIDConnectProvider(&iam.DeleteOpenIDConnectProviderInput{ - OpenIDConnectProviderArn: aws.String(rs.Primary.ID), - }) - return err - } -} - func testAccCheckIAMOpenIDConnectProvider(id string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[id] @@ -136,8 +212,8 @@ func testAccCheckIAMOpenIDConnectProvider(id string) resource.TestCheckFunc { return fmt.Errorf("No ID is set") } - iamconn := testAccProvider.Meta().(*AWSClient).iamconn - _, err := iamconn.GetOpenIDConnectProvider(&iam.GetOpenIDConnectProviderInput{ + conn := testAccProvider.Meta().(*AWSClient).iamconn + _, err := conn.GetOpenIDConnectProvider(&iam.GetOpenIDConnectProviderInput{ OpenIDConnectProviderArn: aws.String(rs.Primary.ID), }) @@ -172,3 +248,40 @@ resource "aws_iam_openid_connect_provider" "test" { } `, rString) } + +func testAccIAMOpenIDConnectProviderConfigTags1(rString, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = [] + + tags = { + %[2]q = %[3]q + } +} +`, rString, tagKey1, tagValue1) +} + +func testAccIAMOpenIDConnectProviderConfigTags2(rString, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_iam_openid_connect_provider" "test" { + url = "https://accounts.testle.com/%s" + + client_id_list = [ + "266362248691-re108qaeld573ia0l6clj2i5ac7r7291.apps.testleusercontent.com", + ] + + thumbprint_list = [] + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rString, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/website/docs/r/iam_openid_connect_provider.html.markdown b/website/docs/r/iam_openid_connect_provider.html.markdown index 7ce78dd022f..720dd94a793 100644 --- a/website/docs/r/iam_openid_connect_provider.html.markdown +++ b/website/docs/r/iam_openid_connect_provider.html.markdown @@ -31,6 +31,7 @@ The following arguments are supported: * `url` - (Required) The URL of the identity provider. Corresponds to the _iss_ claim. * `client_id_list` - (Required) A list of client IDs (also known as audiences). When a mobile or web app registers with an OpenID Connect provider, they establish a value that identifies the application. (This is the value that's sent as the client_id parameter on OAuth requests.) * `thumbprint_list` - (Required) A list of server certificate thumbprints for the OpenID Connect (OIDC) identity provider's server certificate(s). +* `tags` - (Optional) Map of resource tags for the IAM OIDC provider. ## Attributes Reference From 7cf80e110343ed78379919d0880779b0534553ce Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 15:46:00 -0400 Subject: [PATCH 1179/1252] r/aws_lb: Add service ErrorCheck --- aws/resource_aws_lb_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aws/resource_aws_lb_test.go b/aws/resource_aws_lb_test.go index 4f9248fbcb0..6090f094412 100644 --- a/aws/resource_aws_lb_test.go +++ b/aws/resource_aws_lb_test.go @@ -15,6 +15,8 @@ import ( ) func init() { + RegisterServiceErrorCheckFunc(elbv2.EndpointsID, testAccErrorCheckSkipELBv2) + resource.AddTestSweepers("aws_lb", &resource.Sweeper{ Name: "aws_lb", F: testSweepLBs, @@ -25,6 +27,12 @@ func init() { }) } +func testAccErrorCheckSkipELBv2(t *testing.T) resource.ErrorCheckFunc { + return testAccErrorCheckSkipMessagesContaining(t, + "ValidationError: Type must be one of: 'application, network'", + ) +} + func testSweepLBs(region string) error { client, err := sharedClientForRegion(region) if err != nil { From 5e0d0f6e918a9b1192186f3e99ad3e0b92a7cf31 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 15:46:31 -0400 Subject: [PATCH 1180/1252] tests/r/route: Use ELB ErrorCheck --- aws/resource_aws_route_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index ba3d0d6b451..f9bd8d57937 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -974,7 +974,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckElbv2GatewayLoadBalancer(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ @@ -1320,7 +1320,7 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From 82cc1be8ee8fafd6f954ac4e6fa7ca97ad5584ea Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Thu, 25 Mar 2021 21:58:20 +0200 Subject: [PATCH 1181/1252] resource/aws_iam_instance_profile: Add tagging support + sweeper (#17962) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSIAMInstanceProfile_withoutRole (24.71s) --- PASS: TestAccAWSIAMInstanceProfile_disappears_role (25.87s) --- PASS: TestAccAWSIAMInstanceProfile_disappears (26.09s) --- PASS: TestAccAWSIAMInstanceProfile_namePrefix (28.30s) --- PASS: TestAccAWSIAMInstanceProfile_basic (31.35s) --- PASS: TestAccAWSIAMInstanceProfile_tags (44.67s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSIAMInstanceProfile_withoutRole (32.70s) --- PASS: TestAccAWSIAMInstanceProfile_disappears_role (34.17s) --- PASS: TestAccAWSIAMInstanceProfile_disappears (34.40s) --- PASS: TestAccAWSIAMInstanceProfile_basic (39.09s) --- PASS: TestAccAWSIAMInstanceProfile_namePrefix (41.02s) --- PASS: TestAccAWSIAMInstanceProfile_tags (69.02s) ``` --- .changelog/17962.txt | 3 + aws/internal/keyvaluetags/iam_tags.go | 35 ++++ aws/resource_aws_iam_instance_profile.go | 23 ++- aws/resource_aws_iam_instance_profile_test.go | 152 +++++++++++++++--- .../docs/r/iam_instance_profile.html.markdown | 1 + 5 files changed, 187 insertions(+), 27 deletions(-) create mode 100644 .changelog/17962.txt diff --git a/.changelog/17962.txt b/.changelog/17962.txt new file mode 100644 index 00000000000..b906cde0dbe --- /dev/null +++ b/.changelog/17962.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_iam_instance_profile: Add tagging support +``` \ No newline at end of file diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go index 279377398f8..a7af6a8c6e5 100644 --- a/aws/internal/keyvaluetags/iam_tags.go +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -81,6 +81,41 @@ func IamUserUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, return nil } +// IamInstanceProfileUpdateTags updates IAM Instance Profile tags. +// The identifier is the Instance Profile name. +func IamInstanceProfileUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagInstanceProfileInput{ + InstanceProfileName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagInstanceProfile(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagInstanceProfileInput{ + InstanceProfileName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagInstanceProfile(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + // IamOpenIDConnectProviderUpdateTags updates IAM OpenID Connect Provider tags. // The identifier is the OpenID Connect Provider ARN. func IamOpenIDConnectProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { diff --git a/aws/resource_aws_iam_instance_profile.go b/aws/resource_aws_iam_instance_profile.go index 33e15b2a8bc..4a0f5217a0c 100644 --- a/aws/resource_aws_iam_instance_profile.go +++ b/aws/resource_aws_iam_instance_profile.go @@ -11,6 +11,7 @@ import ( "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsIamInstanceProfile() *schema.Resource { @@ -67,6 +68,7 @@ func resourceAwsIamInstanceProfile() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tagsSchema(), }, } } @@ -86,12 +88,13 @@ func resourceAwsIamInstanceProfileCreate(d *schema.ResourceData, meta interface{ request := &iam.CreateInstanceProfileInput{ InstanceProfileName: aws.String(name), Path: aws.String(d.Get("path").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().IamTags(), } var err error response, err := conn.CreateInstanceProfile(request) if err == nil { - err = instanceProfileReadResult(d, response.InstanceProfile) + err = instanceProfileReadResult(d, response.InstanceProfile, meta) } if err != nil { return fmt.Errorf("creating IAM instance profile %s: %w", name, err) @@ -186,6 +189,14 @@ func resourceAwsIamInstanceProfileUpdate(d *schema.ResourceData, meta interface{ } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.IamInstanceProfileUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM Instance Profile (%s): %w", d.Id(), err) + } + } + return nil } @@ -225,7 +236,7 @@ func resourceAwsIamInstanceProfileRead(d *schema.ResourceData, meta interface{}) } } - return instanceProfileReadResult(d, instanceProfile) + return instanceProfileReadResult(d, instanceProfile, meta) } func resourceAwsIamInstanceProfileDelete(d *schema.ResourceData, meta interface{}) error { @@ -249,7 +260,9 @@ func resourceAwsIamInstanceProfileDelete(d *schema.ResourceData, meta interface{ return nil } -func instanceProfileReadResult(d *schema.ResourceData, result *iam.InstanceProfile) error { +func instanceProfileReadResult(d *schema.ResourceData, result *iam.InstanceProfile, meta interface{}) error { + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig + d.SetId(aws.StringValue(result.InstanceProfileName)) if err := d.Set("name", result.InstanceProfileName); err != nil { return err @@ -269,5 +282,9 @@ func instanceProfileReadResult(d *schema.ResourceData, result *iam.InstanceProfi d.Set("role", result.Roles[0].RoleName) //there will only be 1 role returned } + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(result.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } + return nil } diff --git a/aws/resource_aws_iam_instance_profile_test.go b/aws/resource_aws_iam_instance_profile_test.go index a4ba742994d..d2781996ec7 100644 --- a/aws/resource_aws_iam_instance_profile_test.go +++ b/aws/resource_aws_iam_instance_profile_test.go @@ -2,16 +2,65 @@ package aws import ( "fmt" + "log" "strings" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" ) +func init() { + resource.AddTestSweepers("aws_iam_instance_profile", &resource.Sweeper{ + Name: "aws_iam_instance_profile", + F: testSweepIamInstanceProfile, + Dependencies: []string{"aws_iam_role"}, + }) +} + +func testSweepIamInstanceProfile(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %w", err) + } + conn := client.(*AWSClient).iamconn + + var sweeperErrs *multierror.Error + + out, err := conn.ListInstanceProfiles(&iam.ListInstanceProfilesInput{}) + + for _, instanceProfile := range out.InstanceProfiles { + name := aws.StringValue(instanceProfile.InstanceProfileName) + + r := resourceAwsIamInstanceProfile() + d := r.Data(nil) + d.SetId(name) + err := r.Delete(d, client) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting IAM Instance Profile (%s): %w", name, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping IAM Instance Profile sweep for %s: %s", region, err) + return sweeperErrs.ErrorOrNil() // In case we have completed some pages, but had errors + } + + if err != nil { + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error describing IAM Instance Profiles: %w", err)) + } + + return sweeperErrs.ErrorOrNil() +} + func TestAccAWSIAMInstanceProfile_basic(t *testing.T) { var conf iam.GetInstanceProfileOutput resourceName := "aws_iam_instance_profile.test" @@ -30,6 +79,7 @@ func TestAccAWSIAMInstanceProfile_basic(t *testing.T) { testAccCheckResourceAttrGlobalARN(resourceName, "arn", "iam", fmt.Sprintf("instance-profile/test-%s", rName)), resource.TestCheckResourceAttrPair(resourceName, "role", "aws_iam_role.test", "name"), resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("test-%s", rName)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -67,6 +117,52 @@ func TestAccAWSIAMInstanceProfile_withoutRole(t *testing.T) { }) } +func TestAccAWSIAMInstanceProfile_tags(t *testing.T) { + var conf iam.GetInstanceProfileOutput + resourceName := "aws_iam_instance_profile.test" + rName := acctest.RandString(5) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSInstanceProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsIamInstanceProfileConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSInstanceProfileExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, + { + Config: testAccAwsIamInstanceProfileConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSInstanceProfileExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAwsIamInstanceProfileConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSInstanceProfileExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSIAMInstanceProfile_namePrefix(t *testing.T) { var conf iam.GetInstanceProfileOutput rName := acctest.RandString(5) @@ -213,7 +309,7 @@ func testAccCheckAWSInstanceProfileExists(n string, res *iam.GetInstanceProfileO } } -func testAccAwsIamInstanceProfileConfig(rName string) string { +func testAccAwsIamInstanceProfileBaseConfig(rName string) string { return fmt.Sprintf(` resource "aws_iam_role" "test" { name = "test-%s" @@ -237,7 +333,11 @@ resource "aws_iam_role" "test" { } EOF } +`, rName) +} +func testAccAwsIamInstanceProfileConfig(rName string) string { + return testAccAwsIamInstanceProfileBaseConfig(rName) + fmt.Sprintf(` resource "aws_iam_instance_profile" "test" { name = "test-%[1]s" role = aws_iam_role.test.name @@ -254,33 +354,37 @@ resource "aws_iam_instance_profile" "test" { } func testAccAWSInstanceProfilePrefixNameConfig(rName string) string { - return fmt.Sprintf(` -resource "aws_iam_role" "test" { - name = "test-%s" + return testAccAwsIamInstanceProfileBaseConfig(rName) + ` +resource "aws_iam_instance_profile" "test" { + name_prefix = "test-" + role = aws_iam_role.test.name +} +` +} - assume_role_policy = < Date: Thu, 25 Mar 2021 21:59:45 +0200 Subject: [PATCH 1182/1252] resource/aws_ami_from_instance: Tag on create (#17968) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSAMIFromInstance_disappears (259.64s) --- PASS: TestAccAWSAMIFromInstance_basic (276.96s) --- PASS: TestAccAWSAMIFromInstance_tags (309.87s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSAMIFromInstance_disappears (289.51s) --- PASS: TestAccAWSAMIFromInstance_basic (307.13s) --- PASS: TestAccAWSAMIFromInstance_tags (356.92s) ``` --- .changelog/17968.txt | 3 +++ aws/resource_aws_ami_from_instance.go | 16 +++++---------- aws/resource_aws_ami_from_instance_test.go | 24 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 11 deletions(-) create mode 100644 .changelog/17968.txt diff --git a/.changelog/17968.txt b/.changelog/17968.txt new file mode 100644 index 00000000000..daf69ea76e6 --- /dev/null +++ b/.changelog/17968.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ami_from_instance: Tag on create. +``` \ No newline at end of file diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index 693b3069e31..f5da16dd874 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -8,7 +8,6 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAmiFromInstance() *schema.Resource { @@ -223,10 +222,11 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) client := meta.(*AWSClient).ec2conn req := &ec2.CreateImageInput{ - Description: aws.String(d.Get("description").(string)), - InstanceId: aws.String(d.Get("source_instance_id").(string)), - Name: aws.String(d.Get("name").(string)), - NoReboot: aws.Bool(d.Get("snapshot_without_reboot").(bool)), + Description: aws.String(d.Get("description").(string)), + InstanceId: aws.String(d.Get("source_instance_id").(string)), + Name: aws.String(d.Get("name").(string)), + NoReboot: aws.Bool(d.Get("snapshot_without_reboot").(bool)), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeImage), } res, err := client.CreateImage(req) @@ -237,12 +237,6 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) d.SetId(aws.StringValue(res.ImageId)) d.Set("manage_ebs_snapshots", true) - if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { - if err := keyvaluetags.Ec2CreateTags(client, d.Id(), v); err != nil { - return fmt.Errorf("error adding tags: %s", err) - } - } - _, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), d.Id(), client) if err != nil { return err diff --git a/aws/resource_aws_ami_from_instance_test.go b/aws/resource_aws_ami_from_instance_test.go index 3a35cfdc919..98cc9c5a9ed 100644 --- a/aws/resource_aws_ami_from_instance_test.go +++ b/aws/resource_aws_ami_from_instance_test.go @@ -34,6 +34,7 @@ func TestAccAWSAMIFromInstance_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "image_type", "machine"), resource.TestCheckResourceAttr(resourceName, "hypervisor", "xen"), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, @@ -80,6 +81,29 @@ func TestAccAWSAMIFromInstance_tags(t *testing.T) { }) } +func TestAccAWSAMIFromInstance_disappears(t *testing.T) { + var image ec2.Image + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ami_from_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAMIFromInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAMIFromInstanceConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMIFromInstanceExists(resourceName, &image), + testAccCheckResourceDisappears(testAccProvider, resourceAwsAmiFromInstance(), resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSAMIFromInstanceExists(resourceName string, image *ec2.Image) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] From e09b03c97e77efb44e2492fd965f84b47946c0b4 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Fri, 1 Jan 2021 17:21:18 +0900 Subject: [PATCH 1183/1252] Add support for deployment_circuit_breaker block --- aws/resource_aws_ecs_service.go | 76 +++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 147946bb222..cf2a05c71f6 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -145,6 +145,31 @@ func resourceAwsEcsService() *schema.Resource { Computed: true, }, + "deployment_circuit_breaker": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + // Ignore missing configuration block + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + if old == "1" && new == "0" { + return true + } + return false + }, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enable": { + Type: schema.TypeBool, + Required: true, + }, + "rollback": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, + "deployment_controller": { Type: schema.TypeList, Optional: true, @@ -420,9 +445,18 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error MaximumPercent: aws.Int64(int64(d.Get("deployment_maximum_percent").(int))), MinimumHealthyPercent: aws.Int64(int64(deploymentMinimumHealthyPercent)), } + input.DesiredCount = aws.Int64(int64(d.Get("desired_count").(int))) } + if v, ok := d.GetOk("deployment_circuit_breaker"); ok { + if input.DeploymentConfiguration == nil { + input.DeploymentConfiguration = &ecs.DeploymentConfiguration{} + } + + input.DeploymentConfiguration.DeploymentCircuitBreaker = expandEcsDeploymentCircuitBreaker(v.([]interface{})) + } + if v, ok := d.GetOk("cluster"); ok { input.Cluster = aws.String(v.(string)) } @@ -672,6 +706,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { if service.DeploymentConfiguration != nil { d.Set("deployment_maximum_percent", service.DeploymentConfiguration.MaximumPercent) d.Set("deployment_minimum_healthy_percent", service.DeploymentConfiguration.MinimumHealthyPercent) + d.Set("deployment_circuit_breaker", flattenEcsDeploymentCircuitBreaker(service.DeploymentConfiguration.DeploymentCircuitBreaker)) } if err := d.Set("deployment_controller", flattenEcsDeploymentController(service.DeploymentController)); err != nil { @@ -737,6 +772,32 @@ func flattenEcsDeploymentController(deploymentController *ecs.DeploymentControll return []interface{}{m} } +func expandEcsDeploymentCircuitBreaker(l []interface{}) *ecs.DeploymentCircuitBreaker { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + return &ecs.DeploymentCircuitBreaker{ + Enable: aws.Bool(m["enable"].(bool)), + Rollback: aws.Bool(m["rollback"].(bool)), + } +} + +func flattenEcsDeploymentCircuitBreaker(dc *ecs.DeploymentCircuitBreaker) []interface{} { + if dc == nil { + return nil + } + + result := make(map[string]interface{}) + + result["enable"] = dc.Enable + result["rollback"] = dc.Rollback + + return []interface{}{result} +} + func flattenEcsNetworkConfiguration(nc *ecs.NetworkConfiguration) []interface{} { if nc == nil { return nil @@ -983,6 +1044,21 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error } } + if d.HasChange("deployment_circuit_breaker") { + updateService = true + + if input.DeploymentConfiguration == nil { + input.DeploymentConfiguration = &ecs.DeploymentConfiguration{} + } + + // To remove an existing deployment circuit breaker, specify an empty object. + input.DeploymentConfiguration.DeploymentCircuitBreaker = &ecs.DeploymentCircuitBreaker{} + + if v, ok := d.GetOk("deployment_circuit_breaker"); ok { + input.DeploymentConfiguration.DeploymentCircuitBreaker = expandEcsDeploymentCircuitBreaker(v.([]interface{})) + } + } + if d.HasChange("ordered_placement_strategy") { updateService = true // Reference: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_UpdateService.html#ECS-UpdateService-request-placementStrategy From af889b09fa28ddbe6a0083affe2f7288ed8813b1 Mon Sep 17 00:00:00 2001 From: shuheiktgw Date: Fri, 1 Jan 2021 17:21:32 +0900 Subject: [PATCH 1184/1252] Add a test for deployment_circuit_breaker block --- aws/resource_aws_ecs_service_test.go | 59 ++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 8d57b8627f3..3ac7cc581c3 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -556,6 +556,29 @@ func TestAccAWSEcsService_withDeploymentMinimumZeroMaximumOneHundred(t *testing. }) } +func TestAccAWSEcsService_withDeploymentCircuitBreaker(t *testing.T) { + var service ecs.Service + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_service.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsServiceConfigDeploymentCircuitBreaker(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "deployment_circuit_breaker.#", "1"), + resource.TestCheckResourceAttr(resourceName, "deployment_circuit_breaker.0.enable", "true"), + resource.TestCheckResourceAttr(resourceName, "deployment_circuit_breaker.0.rollback", "true"), + ), + }, + }, + }) +} + // Regression for https://github.com/hashicorp/terraform/issues/3444 func TestAccAWSEcsService_withLbChanges(t *testing.T) { var service ecs.Service @@ -3840,6 +3863,42 @@ resource "aws_ecs_service" "test" { `, rName, rName, deploymentMaximumPercent, deploymentMinimumHealthyPercent, rName) } +func testAccAWSEcsServiceConfigDeploymentCircuitBreaker(rName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %q +} + +resource "aws_ecs_task_definition" "test" { + family = %q + + container_definitions = < Date: Fri, 1 Jan 2021 17:21:50 +0900 Subject: [PATCH 1185/1252] Add document for deployment_circuit_breaker block --- website/docs/r/ecs_service.html.markdown | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/website/docs/r/ecs_service.html.markdown b/website/docs/r/ecs_service.html.markdown index 2b1755e2a2b..2d1cf47afac 100644 --- a/website/docs/r/ecs_service.html.markdown +++ b/website/docs/r/ecs_service.html.markdown @@ -92,6 +92,7 @@ The following arguments are supported: * `name` - (Required) The name of the service (up to 255 letters, numbers, hyphens, and underscores) * `capacity_provider_strategy` - (Optional) The capacity provider strategy to use for the service. Can be one or more. Defined below. * `cluster` - (Optional) ARN of an ECS cluster +* `deployment_circuit_breaker` - (Optional) Configuration block containing deployment circuit breaker. Defined below. * `deployment_controller` - (Optional) Configuration block containing deployment controller configuration. Defined below. * `deployment_maximum_percent` - (Optional) The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy. * `deployment_minimum_healthy_percent` - (Optional) The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. @@ -122,6 +123,13 @@ The `capacity_provider_strategy` configuration block supports the following: * `weight` - (Required) The relative percentage of the total number of launched tasks that should use the specified capacity provider. * `base` - (Optional) The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. +## deployment_circuit_breaker + +The `deployment_circuit_breaker` configuration block supports the following: + +* `enable` - (Required) Whether to enable the deployment circuit breaker logic for the service. +* `rollback` - (Required) Whether to enable Amazon ECS to roll back the service if a service deployment fails. If rollback is enabled, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. + ## deployment_controller The `deployment_controller` configuration block supports the following: From f596ac68436e276b6672121e106d86f52e45bfdd Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 13:54:12 -0400 Subject: [PATCH 1186/1252] r/ecs_service: Add ErrorCheck --- aws/resource_aws_ecs_service_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 3ac7cc581c3..0febeea555c 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -563,6 +563,7 @@ func TestAccAWSEcsService_withDeploymentCircuitBreaker(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ From d6b7d2bc503bfe7fc27593f0efa7335f50df7eed Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 14:06:43 -0400 Subject: [PATCH 1187/1252] r/ecs_service: Error wrapping --- aws/resource_aws_ecs_service.go | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index cf2a05c71f6..59ecc07b447 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -571,7 +571,7 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error out, err = conn.CreateService(&input) } if err != nil { - return fmt.Errorf("%s %q", err, d.Get("name").(string)) + return fmt.Errorf("error creating %s service: %w", d.Get("name").(string), err) } service := *out.Service @@ -637,7 +637,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("Error reading ECS service: %s", err) + return fmt.Errorf("Error reading ECS service: %w", err) } if len(out.Services) < 1 { @@ -710,7 +710,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("deployment_controller", flattenEcsDeploymentController(service.DeploymentController)); err != nil { - return fmt.Errorf("Error setting deployment_controller for (%s): %s", d.Id(), err) + return fmt.Errorf("Error setting deployment_controller for (%s): %w", d.Id(), err) } if service.LoadBalancers != nil { @@ -718,11 +718,11 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("capacity_provider_strategy", flattenEcsCapacityProviderStrategy(service.CapacityProviderStrategy)); err != nil { - return fmt.Errorf("error setting capacity_provider_strategy: %s", err) + return fmt.Errorf("error setting capacity_provider_strategy: %w", err) } if err := d.Set("ordered_placement_strategy", flattenPlacementStrategy(service.PlacementStrategy)); err != nil { - return fmt.Errorf("error setting ordered_placement_strategy: %s", err) + return fmt.Errorf("error setting ordered_placement_strategy: %w", err) } if err := d.Set("placement_constraints", flattenServicePlacementConstraints(service.PlacementConstraints)); err != nil { @@ -730,15 +730,15 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("network_configuration", flattenEcsNetworkConfiguration(service.NetworkConfiguration)); err != nil { - return fmt.Errorf("Error setting network_configuration for (%s): %s", d.Id(), err) + return fmt.Errorf("Error setting network_configuration for (%s): %w", d.Id(), err) } if err := d.Set("service_registries", flattenServiceRegistries(service.ServiceRegistries)); err != nil { - return fmt.Errorf("Error setting service_registries for (%s): %s", d.Id(), err) + return fmt.Errorf("Error setting service_registries for (%s): %w", d.Id(), err) } if err := d.Set("tags", keyvaluetags.EcsKeyValueTags(service.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) } return nil @@ -1143,7 +1143,7 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error _, err = conn.UpdateService(&input) } if err != nil { - return fmt.Errorf("Error updating ECS Service (%s): %s", d.Id(), err) + return fmt.Errorf("Error updating ECS Service (%s): %w", d.Id(), err) } } @@ -1157,7 +1157,7 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error o, n := d.GetChange("tags") if err := keyvaluetags.EcsUpdateTags(conn, d.Id(), o, n); err != nil { - return fmt.Errorf("error updating ECS Service (%s) tags: %s", d.Id(), err) + return fmt.Errorf("error updating ECS Service (%s) tags: %w", d.Id(), err) } } @@ -1224,7 +1224,7 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error _, err = conn.DeleteService(&input) } if err != nil { - return fmt.Errorf("Error deleting ECS service: %s", err) + return fmt.Errorf("Error deleting ECS service (%s): %w", d.Id(), err) } // Wait until it's deleted From ace84dc984b90b27229272bf4e56cf0338d305d4 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 14:12:27 -0400 Subject: [PATCH 1188/1252] r/ecs_service: Fix Errorfs --- aws/resource_aws_ecs_service.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 59ecc07b447..6fb99c329e3 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -400,7 +400,7 @@ func resourceAwsEcsService() *schema.Resource { func resourceAwsEcsServiceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { if len(strings.Split(d.Id(), "/")) != 2 { - return []*schema.ResourceData{}, fmt.Errorf("Wrong format of resource: %s. Please follow 'cluster-name/service-name'", d.Id()) + return []*schema.ResourceData{}, fmt.Errorf("wrong format of resource: %s, expecting 'cluster-name/service-name'", d.Id()) } cluster := strings.Split(d.Id(), "/")[0] name := strings.Split(d.Id(), "/")[1] @@ -637,7 +637,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("Error reading ECS service: %w", err) + return fmt.Errorf("error reading ECS service: %w", err) } if len(out.Services) < 1 { @@ -710,7 +710,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("deployment_controller", flattenEcsDeploymentController(service.DeploymentController)); err != nil { - return fmt.Errorf("Error setting deployment_controller for (%s): %w", d.Id(), err) + return fmt.Errorf("error setting deployment_controller for (%s): %w", d.Id(), err) } if service.LoadBalancers != nil { @@ -730,11 +730,11 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { } if err := d.Set("network_configuration", flattenEcsNetworkConfiguration(service.NetworkConfiguration)); err != nil { - return fmt.Errorf("Error setting network_configuration for (%s): %w", d.Id(), err) + return fmt.Errorf("error setting network_configuration for (%s): %w", d.Id(), err) } if err := d.Set("service_registries", flattenServiceRegistries(service.ServiceRegistries)); err != nil { - return fmt.Errorf("Error setting service_registries for (%s): %w", d.Id(), err) + return fmt.Errorf("error setting service_registries for (%s): %w", d.Id(), err) } if err := d.Set("tags", keyvaluetags.EcsKeyValueTags(service.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { @@ -1143,7 +1143,7 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error _, err = conn.UpdateService(&input) } if err != nil { - return fmt.Errorf("Error updating ECS Service (%s): %w", d.Id(), err) + return fmt.Errorf("error updating ECS Service (%s): %w", d.Id(), err) } } @@ -1224,7 +1224,7 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error _, err = conn.DeleteService(&input) } if err != nil { - return fmt.Errorf("Error deleting ECS service (%s): %w", d.Id(), err) + return fmt.Errorf("error deleting ECS service (%s): %w", d.Id(), err) } // Wait until it's deleted From 8947ecad33927fde9df3738f3029e3bec686859f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 14:28:06 -0400 Subject: [PATCH 1189/1252] r/ecs_service: Order arguments --- aws/resource_aws_ecs_service.go | 183 ++++++++++++-------------------- 1 file changed, 69 insertions(+), 114 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 6fb99c329e3..35e9963874d 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -33,12 +33,6 @@ func resourceAwsEcsService() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - }, - "capacity_provider_strategy": { Type: schema.TypeSet, Optional: true, @@ -73,78 +67,6 @@ func resourceAwsEcsService() *schema.Resource { Computed: true, ForceNew: true, }, - - "task_definition": { - Type: schema.TypeString, - Optional: true, - }, - - "desired_count": { - Type: schema.TypeInt, - Optional: true, - DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { - return d.Get("scheduling_strategy").(string) == ecs.SchedulingStrategyDaemon - }, - }, - - "enable_ecs_managed_tags": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "enable_execute_command": { - Type: schema.TypeBool, - Optional: true, - Default: false, - }, - - "force_new_deployment": { - Type: schema.TypeBool, - Optional: true, - }, - - "health_check_grace_period_seconds": { - Type: schema.TypeInt, - Optional: true, - ValidateFunc: validation.IntBetween(0, math.MaxInt32), - }, - - "launch_type": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - ecs.LaunchTypeEc2, - ecs.LaunchTypeFargate, - }, false), - }, - - "platform_version": { - Type: schema.TypeString, - Optional: true, - Computed: true, - }, - - "scheduling_strategy": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Default: ecs.SchedulingStrategyReplica, - ValidateFunc: validation.StringInSlice([]string{ - ecs.SchedulingStrategyDaemon, - ecs.SchedulingStrategyReplica, - }, false), - }, - - "iam_role": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - Computed: true, - }, - "deployment_circuit_breaker": { Type: schema.TypeList, Optional: true, @@ -169,7 +91,6 @@ func resourceAwsEcsService() *schema.Resource { }, }, }, - "deployment_controller": { Type: schema.TypeList, Optional: true, @@ -197,7 +118,6 @@ func resourceAwsEcsService() *schema.Resource { }, }, }, - "deployment_maximum_percent": { Type: schema.TypeInt, Optional: true, @@ -209,7 +129,6 @@ func resourceAwsEcsService() *schema.Resource { return false }, }, - "deployment_minimum_healthy_percent": { Type: schema.TypeInt, Optional: true, @@ -221,7 +140,48 @@ func resourceAwsEcsService() *schema.Resource { return false }, }, - + "desired_count": { + Type: schema.TypeInt, + Optional: true, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + return d.Get("scheduling_strategy").(string) == ecs.SchedulingStrategyDaemon + }, + }, + "enable_ecs_managed_tags": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "enable_execute_command": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "force_new_deployment": { + Type: schema.TypeBool, + Optional: true, + }, + "health_check_grace_period_seconds": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, math.MaxInt32), + }, + "iam_role": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Computed: true, + }, + "launch_type": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.LaunchTypeEc2, + ecs.LaunchTypeFargate, + }, false), + }, "load_balancer": { Type: schema.TypeSet, Optional: true, @@ -257,31 +217,10 @@ func resourceAwsEcsService() *schema.Resource { }, Set: resourceAwsEcsLoadBalancerHash, }, - "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, - }, - }, - }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "ordered_placement_strategy": { Type: schema.TypeList, @@ -321,6 +260,10 @@ func resourceAwsEcsService() *schema.Resource { MaxItems: 10, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "expression": { + Type: schema.TypeString, + Optional: true, + }, "type": { Type: schema.TypeString, Required: true, @@ -329,14 +272,14 @@ func resourceAwsEcsService() *schema.Resource { ecs.PlacementConstraintTypeMemberOf, }, false), }, - "expression": { - Type: schema.TypeString, - Optional: true, - }, }, }, }, - + "platform_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "propagate_tags": { Type: schema.TypeString, Optional: true, @@ -353,7 +296,16 @@ func resourceAwsEcsService() *schema.Resource { "", }, false), }, - + "scheduling_strategy": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Default: ecs.SchedulingStrategyReplica, + ValidateFunc: validation.StringInSlice([]string{ + ecs.SchedulingStrategyDaemon, + ecs.SchedulingStrategyReplica, + }, false), + }, "service_registries": { Type: schema.TypeList, Optional: true, @@ -388,7 +340,10 @@ func resourceAwsEcsService() *schema.Resource { }, }, "tags": tagsSchema(), - + "task_definition": { + Type: schema.TypeString, + Optional: true, + }, "wait_for_steady_state": { Type: schema.TypeBool, Optional: true, From 1fbee286385891c60682b7670c8be70b428a0522 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Thu, 25 Mar 2021 15:17:29 -0400 Subject: [PATCH 1190/1252] r/ecs_service: Cleanup resource --- aws/resource_aws_ecs_service.go | 74 +++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 35e9963874d..4d68f6c0386 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -222,6 +222,32 @@ func resourceAwsEcsService() *schema.Resource { Required: true, ForceNew: true, }, + "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, + }, + }, + }, + }, "ordered_placement_strategy": { Type: schema.TypeList, Optional: true, @@ -404,12 +430,9 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error input.DesiredCount = aws.Int64(int64(d.Get("desired_count").(int))) } - if v, ok := d.GetOk("deployment_circuit_breaker"); ok { - if input.DeploymentConfiguration == nil { - input.DeploymentConfiguration = &ecs.DeploymentConfiguration{} - } - - input.DeploymentConfiguration.DeploymentCircuitBreaker = expandEcsDeploymentCircuitBreaker(v.([]interface{})) + if v, ok := d.GetOk("deployment_circuit_breaker"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + input.DeploymentConfiguration = &ecs.DeploymentConfiguration{} + input.DeploymentConfiguration.DeploymentCircuitBreaker = expandECSDeploymentCircuitBreaker(v.([]interface{})[0].(map[string]interface{})) } if v, ok := d.GetOk("cluster"); ok { @@ -661,7 +684,14 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { if service.DeploymentConfiguration != nil { d.Set("deployment_maximum_percent", service.DeploymentConfiguration.MaximumPercent) d.Set("deployment_minimum_healthy_percent", service.DeploymentConfiguration.MinimumHealthyPercent) - d.Set("deployment_circuit_breaker", flattenEcsDeploymentCircuitBreaker(service.DeploymentConfiguration.DeploymentCircuitBreaker)) + + if service.DeploymentConfiguration.DeploymentCircuitBreaker != nil { + if err := d.Set("deployment_circuit_breaker", []interface{}{flattenECSDeploymentCircuitBreaker(service.DeploymentConfiguration.DeploymentCircuitBreaker)}); err != nil { + return fmt.Errorf("error setting deployment_circuit_break: %w", err) + } + } else { + d.Set("deployment_circuit_breaker", nil) + } } if err := d.Set("deployment_controller", flattenEcsDeploymentController(service.DeploymentController)); err != nil { @@ -727,30 +757,30 @@ func flattenEcsDeploymentController(deploymentController *ecs.DeploymentControll return []interface{}{m} } -func expandEcsDeploymentCircuitBreaker(l []interface{}) *ecs.DeploymentCircuitBreaker { - if len(l) == 0 || l[0] == nil { +func expandECSDeploymentCircuitBreaker(tfMap map[string]interface{}) *ecs.DeploymentCircuitBreaker { + if tfMap == nil { return nil } - m := l[0].(map[string]interface{}) + apiObject := &ecs.DeploymentCircuitBreaker{} - return &ecs.DeploymentCircuitBreaker{ - Enable: aws.Bool(m["enable"].(bool)), - Rollback: aws.Bool(m["rollback"].(bool)), - } + apiObject.Enable = aws.Bool(tfMap["enable"].(bool)) + apiObject.Rollback = aws.Bool(tfMap["rollback"].(bool)) + + return apiObject } -func flattenEcsDeploymentCircuitBreaker(dc *ecs.DeploymentCircuitBreaker) []interface{} { - if dc == nil { +func flattenECSDeploymentCircuitBreaker(apiObject *ecs.DeploymentCircuitBreaker) map[string]interface{} { + if apiObject == nil { return nil } - result := make(map[string]interface{}) + tfMap := map[string]interface{}{} - result["enable"] = dc.Enable - result["rollback"] = dc.Rollback + tfMap["enable"] = aws.BoolValue(apiObject.Enable) + tfMap["rollback"] = aws.BoolValue(apiObject.Rollback) - return []interface{}{result} + return tfMap } func flattenEcsNetworkConfiguration(nc *ecs.NetworkConfiguration) []interface{} { @@ -1009,8 +1039,8 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error // To remove an existing deployment circuit breaker, specify an empty object. input.DeploymentConfiguration.DeploymentCircuitBreaker = &ecs.DeploymentCircuitBreaker{} - if v, ok := d.GetOk("deployment_circuit_breaker"); ok { - input.DeploymentConfiguration.DeploymentCircuitBreaker = expandEcsDeploymentCircuitBreaker(v.([]interface{})) + if v, ok := d.GetOk("deployment_circuit_breaker"); ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + input.DeploymentConfiguration.DeploymentCircuitBreaker = expandECSDeploymentCircuitBreaker(v.([]interface{})[0].(map[string]interface{})) } } From 12912ee70ef587f698cde360c73cda15d8078716 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 17:37:28 -0400 Subject: [PATCH 1191/1252] resource/aws_vpc: Handle read-after-create eventual consistency (#18391) * resource/aws_vpc: Handle read-after-create eventual consistency Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16796 Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (82.88s) --- PASS: TestAccAWSVpc_basic (41.94s) --- PASS: TestAccAWSVpc_bothDnsOptionsSet (50.15s) --- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (42.24s) --- PASS: TestAccAWSVpc_classiclinkOptionSet (42.26s) --- PASS: TestAccAWSVpc_coreMismatchedDiffs (29.27s) --- PASS: TestAccAWSVpc_defaultAndIgnoreTags (62.73s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (4.83s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (70.21s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (69.97s) --- PASS: TestAccAWSVpc_defaultTags_providerOnly (65.84s) --- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (55.23s) --- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (50.23s) --- PASS: TestAccAWSVpc_DisabledDnsSupport (49.90s) --- PASS: TestAccAWSVpc_disappears (22.42s) --- PASS: TestAccAWSVpc_ignoreTags (64.60s) --- PASS: TestAccAWSVpc_tags (82.89s) --- PASS: TestAccAWSVpc_Tenancy (84.83s) --- PASS: TestAccAWSVpc_update (67.73s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (85.77s) --- PASS: TestAccAWSVpc_basic (36.99s) --- PASS: TestAccAWSVpc_bothDnsOptionsSet (48.65s) --- PASS: TestAccAWSVpc_coreMismatchedDiffs (32.11s) --- PASS: TestAccAWSVpc_defaultAndIgnoreTags (63.25s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (4.70s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (59.36s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (59.09s) --- PASS: TestAccAWSVpc_defaultTags_providerOnly (60.21s) --- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (46.79s) --- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (48.55s) --- PASS: TestAccAWSVpc_DisabledDnsSupport (47.71s) --- PASS: TestAccAWSVpc_disappears (23.64s) --- PASS: TestAccAWSVpc_ignoreTags (62.21s) --- PASS: TestAccAWSVpc_tags (82.23s) --- PASS: TestAccAWSVpc_Tenancy (83.42s) --- PASS: TestAccAWSVpc_update (66.22s) --- SKIP: TestAccAWSVpc_classiclinkDnsSupportOptionSet (15.15s) --- SKIP: TestAccAWSVpc_classiclinkOptionSet (15.15s) ``` * Update CHANGELOG for #18391 --- .changelog/18391.txt | 3 ++ aws/internal/service/ec2/finder/finder.go | 31 ++++++++++++++ aws/internal/service/ec2/waiter/waiter.go | 1 + aws/resource_aws_vpc.go | 50 ++++++++++++++++++++--- 4 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 .changelog/18391.txt diff --git a/.changelog/18391.txt b/.changelog/18391.txt new file mode 100644 index 00000000000..e7a0ee19eff --- /dev/null +++ b/.changelog/18391.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_vpc: Handle EC2 eventual consistency errors on creation +``` diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index c1a9fcde62a..9749e368a44 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -285,6 +285,37 @@ func VpcAttribute(conn *ec2.EC2, vpcID string, attribute string) (*bool, error) return nil, fmt.Errorf("unimplemented VPC attribute: %s", attribute) } +// VpcByID looks up a Vpc by ID. When not found, returns nil and potentially an API error. +func VpcByID(conn *ec2.EC2, id string) (*ec2.Vpc, error) { + input := &ec2.DescribeVpcsInput{ + VpcIds: aws.StringSlice([]string{id}), + } + + output, err := conn.DescribeVpcs(input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + for _, vpc := range output.Vpcs { + if vpc == nil { + continue + } + + if aws.StringValue(vpc.VpcId) != id { + continue + } + + return vpc, nil + } + + return nil, nil +} + // VpcPeeringConnectionByID returns the VPC peering connection corresponding to the specified identifier. // Returns nil and potentially an error if no VPC peering connection is found. func VpcPeeringConnectionByID(conn *ec2.EC2, id string) (*ec2.VpcPeeringConnection, error) { diff --git a/aws/internal/service/ec2/waiter/waiter.go b/aws/internal/service/ec2/waiter/waiter.go index 503210314bf..7c3a06ebf89 100644 --- a/aws/internal/service/ec2/waiter/waiter.go +++ b/aws/internal/service/ec2/waiter/waiter.go @@ -369,6 +369,7 @@ func TransitGatewayPrefixListReferenceStateUpdated(conn *ec2.EC2, transitGateway } const ( + VpcPropagationTimeout = 2 * time.Minute VpcAttributePropagationTimeout = 5 * time.Minute ) diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index b01bcbddf87..6fe280b4cf8 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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" @@ -17,6 +18,7 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsVpc() *schema.Resource { @@ -250,18 +252,54 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - // Refresh the VPC state - vpcRaw, _, err := VPCStateRefreshFunc(conn, d.Id())() + var vpc *ec2.Vpc + + err := resource.Retry(waiter.VpcPropagationTimeout, func() *resource.RetryError { + var err error + + vpc, err = finder.VpcByID(conn, d.Id()) + + if d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidVpcID.NotFound") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + if d.IsNewResource() && vpc == nil { + return resource.RetryableError(&resource.NotFoundError{ + LastError: fmt.Errorf("EC2 VPC (%s) not found", d.Id()), + }) + } + + return nil + }) + + if tfresource.TimedOut(err) { + vpc, err = finder.VpcByID(conn, d.Id()) + } + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidVpcID.NotFound") { + log.Printf("[WARN] EC2 VPC (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { - return err + return fmt.Errorf("error reading EC2 VPC (%s): %w", d.Id(), err) } - if vpcRaw == nil { + + if vpc == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 VPC (%s): not found after creation", d.Id()) + } + + log.Printf("[WARN] EC2 VPC (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - // VPC stuff - vpc := vpcRaw.(*ec2.Vpc) vpcid := d.Id() d.Set("cidr_block", vpc.CidrBlock) d.Set("dhcp_options_id", vpc.DhcpOptionsId) From 0016fc83d5424ea40c92102d3629f3e9490fd24a Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 17:38:30 -0400 Subject: [PATCH 1192/1252] resource/aws_subnet: Handle read-after-create eventual consistency (#18392) * resource/aws_subnet: Handle read-after-create eventual consistency Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12829 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16796 Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSubnet_availabilityZoneId (53.74s) --- PASS: TestAccAWSSubnet_basic (52.50s) --- PASS: TestAccAWSSubnet_defaultAndIgnoreTags (80.26s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag (6.45s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag (84.84s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag (86.61s) --- PASS: TestAccAWSSubnet_defaultTags_providerOnly (87.99s) --- PASS: TestAccAWSSubnet_defaultTags_updateToProviderOnly (69.48s) --- PASS: TestAccAWSSubnet_defaultTags_updateToResourceOnly (72.12s) --- PASS: TestAccAWSSubnet_disappears (41.08s) --- PASS: TestAccAWSSubnet_enableIpv6 (109.36s) --- PASS: TestAccAWSSubnet_ignoreTags (81.13s) --- PASS: TestAccAWSSubnet_ipv6 (118.69s) --- PASS: TestAccAWSSubnet_MapPublicIpOnLaunch (118.55s) --- PASS: TestAccAWSSubnet_tags (106.25s) --- SKIP: TestAccAWSSubnet_CustomerOwnedIpv4Pool (1.44s) --- SKIP: TestAccAWSSubnet_MapCustomerOwnedIpOnLaunch (1.40s) --- SKIP: TestAccAWSSubnet_outpost (1.70s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSubnet_availabilityZoneId (55.41s) --- PASS: TestAccAWSSubnet_basic (55.46s) --- PASS: TestAccAWSSubnet_defaultAndIgnoreTags (85.95s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_duplicateTag (6.64s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_nonOverlappingTag (82.23s) --- PASS: TestAccAWSSubnet_defaultTags_providerAndResource_overlappingTag (84.95s) --- PASS: TestAccAWSSubnet_defaultTags_providerOnly (86.26s) --- PASS: TestAccAWSSubnet_defaultTags_updateToProviderOnly (69.05s) --- PASS: TestAccAWSSubnet_defaultTags_updateToResourceOnly (73.74s) --- PASS: TestAccAWSSubnet_disappears (42.78s) --- PASS: TestAccAWSSubnet_enableIpv6 (117.40s) --- PASS: TestAccAWSSubnet_ignoreTags (83.74s) --- PASS: TestAccAWSSubnet_ipv6 (126.25s) --- PASS: TestAccAWSSubnet_MapPublicIpOnLaunch (124.27s) --- PASS: TestAccAWSSubnet_tags (115.31s) --- SKIP: TestAccAWSSubnet_CustomerOwnedIpv4Pool (6.95s) --- SKIP: TestAccAWSSubnet_MapCustomerOwnedIpOnLaunch (2.60s) --- SKIP: TestAccAWSSubnet_outpost (2.14s) ``` * Update CHANGELOG for #18392 --- .changelog/18392.txt | 3 ++ aws/internal/service/ec2/waiter/waiter.go | 1 + aws/resource_aws_subnet.go | 55 ++++++++++++++++++----- 3 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 .changelog/18392.txt diff --git a/.changelog/18392.txt b/.changelog/18392.txt new file mode 100644 index 00000000000..34bcc004200 --- /dev/null +++ b/.changelog/18392.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_subnet: Handle EC2 eventual consistency errors on creation +``` diff --git a/aws/internal/service/ec2/waiter/waiter.go b/aws/internal/service/ec2/waiter/waiter.go index 7c3a06ebf89..07bf6682c73 100644 --- a/aws/internal/service/ec2/waiter/waiter.go +++ b/aws/internal/service/ec2/waiter/waiter.go @@ -270,6 +270,7 @@ func SecurityGroupCreated(conn *ec2.EC2, id string, timeout time.Duration) (*ec2 } const ( + SubnetPropagationTimeout = 2 * time.Minute SubnetAttributePropagationTimeout = 5 * time.Minute ) diff --git a/aws/resource_aws_subnet.go b/aws/resource_aws_subnet.go index 46e98235d3c..c36de8b53b0 100644 --- a/aws/resource_aws_subnet.go +++ b/aws/resource_aws_subnet.go @@ -7,10 +7,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsSubnet() *schema.Resource { @@ -232,23 +235,53 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { defaultTagsConfig := meta.(*AWSClient).DefaultTagsConfig ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{ - SubnetIds: []*string{aws.String(d.Id())}, - }) + var subnet *ec2.Subnet - if err != nil { - if isAWSErr(err, "InvalidSubnetID.NotFound", "") { - log.Printf("[WARN] Subnet (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil + err := resource.Retry(waiter.SubnetPropagationTimeout, func() *resource.RetryError { + var err error + + subnet, err = finder.SubnetByID(conn, d.Id()) + + if d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidSubnetID.NotFound") { + return resource.RetryableError(err) } - return err + + if err != nil { + return resource.NonRetryableError(err) + } + + if d.IsNewResource() && subnet == nil { + return resource.RetryableError(&resource.NotFoundError{ + LastError: fmt.Errorf("EC2 Subnet (%s) not found", d.Id()), + }) + } + + return nil + }) + + if tfresource.TimedOut(err) { + subnet, err = finder.SubnetByID(conn, d.Id()) } - if resp == nil { + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidSubnetID.NotFound") { + log.Printf("[WARN] EC2 Subnet (%s) not found, removing from state", d.Id()) + d.SetId("") return nil } - subnet := resp.Subnets[0] + if err != nil { + return fmt.Errorf("error reading EC2 Subnet (%s): %w", d.Id(), err) + } + + if subnet == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 Subnet (%s): not found after creation", d.Id()) + } + + log.Printf("[WARN] EC2 Subnet (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } d.Set("vpc_id", subnet.VpcId) d.Set("availability_zone", subnet.AvailabilityZone) From c103c41e421d41bec5ac6c729f577ec99d0d5fc2 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Thu, 25 Mar 2021 21:40:28 +0000 Subject: [PATCH 1193/1252] Update CHANGELOG.md for #18392 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 061f3dd8e74..2a466288206 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ FEATURES: ENHANCEMENTS: +* resource/aws_ami_from_instance: Tag on create. ([#17968](https://github.com/hashicorp/terraform-provider-aws/issues/17968)) +* resource/aws_iam_instance_profile: Add tagging support ([#17962](https://github.com/hashicorp/terraform-provider-aws/issues/17962)) +* resource/aws_iam_openid_connect_provider: Add plan time validation for `client_id_list` and `thumbprint_list` ([#17964](https://github.com/hashicorp/terraform-provider-aws/issues/17964)) +* resource/aws_iam_openid_connect_provider: Add tagging support ([#17964](https://github.com/hashicorp/terraform-provider-aws/issues/17964)) * resource/aws_iam_saml_provider: Add plan time validation for `name` and `saml_metadata_document` ([#17965](https://github.com/hashicorp/terraform-provider-aws/issues/17965)) * resource/aws_iam_saml_provider: Add tagging support ([#17965](https://github.com/hashicorp/terraform-provider-aws/issues/17965)) * resource/aws_iam_server_certificate: Add `expiration` and `upload_date` attributes ([#17967](https://github.com/hashicorp/terraform-provider-aws/issues/17967)) @@ -15,15 +19,20 @@ ENHANCEMENTS: * resource/aws_pinpoint_email_channel: Add `configuration_set` argument ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) * resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) * resource/aws_pinpoint_event_stream: Plan time validations for `destination_stream_arn` and `role_arn` ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) +* resource/aws_route: Validate route destination and target attributes ([#16930](https://github.com/hashicorp/terraform-provider-aws/issues/16930)) BUG FIXES: * resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state ([#18382](https://github.com/hashicorp/terraform-provider-aws/issues/18382)) * resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set ([#18042](https://github.com/hashicorp/terraform-provider-aws/issues/18042)) +* resource/aws_ecs_service: Re-create service when `service_registries` changes ([#17387](https://github.com/hashicorp/terraform-provider-aws/issues/17387)) * resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_event_stream: Retry on eventual consistency error ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) +* resource/aws_route: Correctly handle updates to the route target attributes (`egress_only_gateway_id`, `gateway_id`, `instance_id`, `local_gateway_id`, `nat_gateway_id`, `network_interface_id`, `transit_gateway_id`, `vpc_peering_connection_id`) ([#16930](https://github.com/hashicorp/terraform-provider-aws/issues/16930)) +* resource/aws_subnet: Handle EC2 eventual consistency errors on creation ([#18392](https://github.com/hashicorp/terraform-provider-aws/issues/18392)) +* resource/aws_vpc: Handle EC2 eventual consistency errors on creation ([#18391](https://github.com/hashicorp/terraform-provider-aws/issues/18391)) * resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument ([#18384](https://github.com/hashicorp/terraform-provider-aws/issues/18384)) ## 3.33.0 (March 18, 2021) From 4f38bb77da09a23befddd5e9cf4a36024af47fdc Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Jun 2020 16:07:29 -0400 Subject: [PATCH 1194/1252] r/aws_route: Refactor acceptance tests in preparation for future fixes/enhancements. --- aws/resource_aws_route_test.go | 114 +++++++++++++++++++++++++++++++++ 1 file changed, 114 insertions(+) diff --git a/aws/resource_aws_route_test.go b/aws/resource_aws_route_test.go index f9bd8d57937..ae7025293bb 100644 --- a/aws/resource_aws_route_test.go +++ b/aws/resource_aws_route_test.go @@ -35,6 +35,7 @@ func TestAccAWSRoute_basic(t *testing.T) { testAccCheckRouteTableExists(rtResourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -128,6 +129,7 @@ func TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv6EgressOnlyInternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -177,6 +179,7 @@ func TestAccAWSRoute_IPv6_To_InternetGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv6InternetGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -221,6 +224,7 @@ func TestAccAWSRoute_IPv6_To_Instance(t *testing.T) { Config: testAccAWSRouteConfigIpv6Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -265,6 +269,7 @@ func TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached(t *testing.T) { Config: testAccAWSRouteConfigIpv6NetworkInterfaceUnattached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -309,6 +314,7 @@ func TestAccAWSRoute_IPv6_To_VpcPeeringConnection(t *testing.T) { Config: testAccAWSRouteConfigIpv6VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -353,6 +359,7 @@ func TestAccAWSRoute_IPv6_To_VpnGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv6VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -397,6 +404,7 @@ func TestAccAWSRoute_IPv4_To_VpnGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv4VpnGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -441,6 +449,7 @@ func TestAccAWSRoute_IPv4_To_Instance(t *testing.T) { Config: testAccAWSRouteConfigIpv4Instance(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -485,6 +494,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached(t *testing.T) { Config: testAccAWSRouteConfigIpv4NetworkInterfaceUnattached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -530,6 +540,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_Attached(t *testing.T) { Config: testAccAWSRouteConfigIpv4NetworkInterfaceAttached(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -576,6 +587,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni1ResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -597,6 +609,7 @@ func TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments(t *testing.T) { Config: testAccAWSRouteConfigIpv4NetworkInterfaceTwoAttachments(rName, destinationCidr, eni2ResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -641,6 +654,7 @@ func TestAccAWSRoute_IPv4_To_VpcPeeringConnection(t *testing.T) { Config: testAccAWSRouteConfigIpv4VpcPeeringConnection(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -685,6 +699,7 @@ func TestAccAWSRoute_IPv4_To_NatGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv4NatGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -760,6 +775,7 @@ func TestAccAWSRoute_IPv4_To_TransitGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv4TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -804,6 +820,7 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { Config: testAccAWSRouteConfigIpv6TransitGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -830,6 +847,50 @@ func TestAccAWSRoute_IPv6_To_TransitGateway(t *testing.T) { }, }) } +func TestAccAWSRoute_IPv4_To_CarrierGateway(t *testing.T) { + var route ec2.Route + resourceName := "aws_route.test" + cgwResourceName := "aws_ec2_carrier_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "172.16.1.0/24" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteConfigIpv4CarrierGateway(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttrPair(resourceName, "carrier_gateway_id", cgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), + resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), + resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), + resource.TestCheckResourceAttr(resourceName, "egress_only_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_id", ""), + resource.TestCheckResourceAttr(resourceName, "instance_owner_id", ""), + resource.TestCheckResourceAttr(resourceName, "local_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "nat_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "network_interface_id", ""), + resource.TestCheckResourceAttr(resourceName, "origin", ec2.RouteOriginCreateRoute), + resource.TestCheckResourceAttr(resourceName, "state", ec2.RouteStateActive), + resource.TestCheckResourceAttr(resourceName, "transit_gateway_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_endpoint_id", ""), + resource.TestCheckResourceAttr(resourceName, "vpc_peering_connection_id", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { var route ec2.Route @@ -848,6 +909,7 @@ func TestAccAWSRoute_IPv4_To_LocalGateway(t *testing.T) { Config: testAccAWSRouteResourceConfigIpv4LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -892,6 +954,7 @@ func TestAccAWSRoute_IPv6_To_LocalGateway(t *testing.T) { Config: testAccAWSRouteResourceConfigIpv6LocalGateway(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -982,6 +1045,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1003,6 +1067,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1024,6 +1089,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1045,6 +1111,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "nat_gateway_id", ngwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1066,6 +1133,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1088,6 +1156,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "transit_gateway_id", tgwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1109,6 +1178,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_endpoint_id", vpcEndpointResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1130,6 +1200,7 @@ func TestAccAWSRoute_IPv4_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv4FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1179,6 +1250,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "instance_id", instanceResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1200,6 +1272,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", vgwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1221,6 +1294,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "gateway_id", igwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1242,6 +1316,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "egress_only_gateway_id", eoigwResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1263,6 +1338,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "network_interface_id", eniResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1284,6 +1360,7 @@ func TestAccAWSRoute_IPv6_Update_Target(t *testing.T) { Config: testAccAWSRouteConfigIpv6FlexiTarget(rName, destinationCidr, "vpc_peering_connection_id", pcxResourceName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -1328,6 +1405,7 @@ func TestAccAWSRoute_IPv4_To_VpcEndpoint(t *testing.T) { Config: testAccAWSRouteResourceConfigIpv4VpcEndpoint(rName, destinationCidr), Check: resource.ComposeTestCheckFunc( testAccCheckAWSRouteExists(resourceName, &route), + resource.TestCheckResourceAttr(resourceName, "carrier_gateway_id", ""), resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", destinationCidr), resource.TestCheckResourceAttr(resourceName, "destination_ipv6_cidr_block", ""), resource.TestCheckResourceAttr(resourceName, "destination_prefix_list_id", ""), @@ -2675,6 +2753,7 @@ resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_cidr_block = %[2]q + carrier_gateway_id = (local.target_attr == "carrier_gateway_id") ? local.target_value : null egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null instance_id = (local.target_attr == "instance_id") ? local.target_value : null @@ -2796,6 +2875,7 @@ resource "aws_route" "test" { route_table_id = aws_route_table.test.id destination_ipv6_cidr_block = %[2]q + carrier_gateway_id = (local.target_attr == "carrier_gateway_id") ? local.target_value : null egress_only_gateway_id = (local.target_attr == "egress_only_gateway_id") ? local.target_value : null gateway_id = (local.target_attr == "gateway_id") ? local.target_value : null instance_id = (local.target_attr == "instance_id") ? local.target_value : null @@ -2840,3 +2920,37 @@ resource "aws_route" "test" { } `) } + +func testAccAWSRouteConfigIpv4CarrierGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_carrier_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + destination_cidr_block = %[2]q + route_table_id = aws_route_table.test.id + carrier_gateway_id = aws_ec2_carrier_gateway.test.id +} +`, rName, destinationCidr) +} From 2201b15b7e4d5ebe18f9474eb8f24ef213080109 Mon Sep 17 00:00:00 2001 From: Angie Pinilla Date: Thu, 25 Mar 2021 18:19:45 -0400 Subject: [PATCH 1195/1252] move time-boxed retry logic to AWS SDK GO service client retry handling --- aws/config.go | 10 ++++++++++ ...s_securityhub_organization_admin_account.go | 18 +----------------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/aws/config.go b/aws/config.go index 08215dd8e64..aafe9fbe891 100644 --- a/aws/config.go +++ b/aws/config.go @@ -771,6 +771,16 @@ func (c *Config) Client() (interface{}, error) { } }) + // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17996 + client.securityhubconn.Handlers.Retry.PushBack(func(r *request.Request) { + switch r.Operation.Name { + case "EnableOrganizationAdminAccount": + if tfawserr.ErrCodeEquals(r.Error, securityhub.ErrCodeResourceConflictException) { + r.Retryable = aws.Bool(true) + } + } + }) + client.storagegatewayconn.Handlers.Retry.PushBack(func(r *request.Request) { // InvalidGatewayRequestException: The specified gateway proxy network connection is busy. if isAWSErr(r.Error, storagegateway.ErrCodeInvalidGatewayRequestException, "The specified gateway proxy network connection is busy") { diff --git a/aws/resource_aws_securityhub_organization_admin_account.go b/aws/resource_aws_securityhub_organization_admin_account.go index cec3e044478..0f1846c37f5 100644 --- a/aws/resource_aws_securityhub_organization_admin_account.go +++ b/aws/resource_aws_securityhub_organization_admin_account.go @@ -7,11 +7,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/hashicorp/aws-sdk-go-base/tfawserr" - "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/securityhub/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/securityhub/waiter" - "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsSecurityHubOrganizationAdminAccount() *schema.Resource { @@ -44,21 +42,7 @@ func resourceAwsSecurityHubOrganizationAdminAccountCreate(d *schema.ResourceData AdminAccountId: aws.String(adminAccountID), } - err := resource.Retry(waiter.AdminAccountEnabledTimeout, func() *resource.RetryError { - _, err := conn.EnableOrganizationAdminAccount(input) - - if err != nil { - if tfawserr.ErrCodeEquals(err, securityhub.ErrCodeResourceConflictException) { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - - if tfresource.TimedOut(err) { - _, err = conn.EnableOrganizationAdminAccount(input) - } + _, err := conn.EnableOrganizationAdminAccount(input) if err != nil { return fmt.Errorf("error enabling Security Hub Organization Admin Account (%s): %w", adminAccountID, err) From 328a3decf8f875c9e651d9bac0d1bdc46e609777 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Mon, 4 Jan 2021 15:26:11 -0500 Subject: [PATCH 1196/1252] r/aws_route: AWS Wavelength support. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRoute_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRoute_ -timeout 120m === RUN TestAccAWSRoute_basic === PAUSE TestAccAWSRoute_basic === RUN TestAccAWSRoute_disappears === PAUSE TestAccAWSRoute_disappears === RUN TestAccAWSRoute_disappears_RouteTable === PAUSE TestAccAWSRoute_disappears_RouteTable === RUN TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRoute_IPv6_To_InternetGateway === PAUSE TestAccAWSRoute_IPv6_To_InternetGateway === RUN TestAccAWSRoute_IPv6_To_Instance === PAUSE TestAccAWSRoute_IPv6_To_Instance === RUN TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv6_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv6_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv6_To_VpnGateway === PAUSE TestAccAWSRoute_IPv6_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_VpnGateway === PAUSE TestAccAWSRoute_IPv4_To_VpnGateway === RUN TestAccAWSRoute_IPv4_To_Instance === PAUSE TestAccAWSRoute_IPv4_To_Instance === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_Attached === RUN TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === PAUSE TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments === RUN TestAccAWSRoute_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRoute_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRoute_IPv4_To_NatGateway === PAUSE TestAccAWSRoute_IPv4_To_NatGateway === RUN TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === PAUSE TestAccAWSRoute_DoesNotCrashWithVpcEndpoint === RUN TestAccAWSRoute_IPv4_To_TransitGateway === PAUSE TestAccAWSRoute_IPv4_To_TransitGateway === RUN TestAccAWSRoute_IPv6_To_TransitGateway === PAUSE TestAccAWSRoute_IPv6_To_TransitGateway === RUN TestAccAWSRoute_IPv4_To_CarrierGateway === PAUSE TestAccAWSRoute_IPv4_To_CarrierGateway === RUN TestAccAWSRoute_IPv4_To_LocalGateway === PAUSE TestAccAWSRoute_IPv4_To_LocalGateway === RUN TestAccAWSRoute_IPv6_To_LocalGateway === PAUSE TestAccAWSRoute_IPv6_To_LocalGateway === RUN TestAccAWSRoute_ConditionalCidrBlock === PAUSE TestAccAWSRoute_ConditionalCidrBlock === RUN TestAccAWSRoute_IPv4_Update_Target === PAUSE TestAccAWSRoute_IPv4_Update_Target === RUN TestAccAWSRoute_IPv6_Update_Target === PAUSE TestAccAWSRoute_IPv6_Update_Target === RUN TestAccAWSRoute_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRoute_IPv4_To_VpcEndpoint === RUN TestAccAWSRoute_LocalRoute === PAUSE TestAccAWSRoute_LocalRoute === CONT TestAccAWSRoute_basic === CONT TestAccAWSRoute_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_VpcPeeringConnection (27.86s) === CONT TestAccAWSRoute_LocalRoute --- PASS: TestAccAWSRoute_basic (37.05s) === CONT TestAccAWSRoute_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRoute_LocalRoute (22.22s) === CONT TestAccAWSRoute_IPv6_Update_Target --- PASS: TestAccAWSRoute_IPv6_Update_Target (217.77s) === CONT TestAccAWSRoute_IPv4_Update_Target --- PASS: TestAccAWSRoute_IPv4_To_VpcEndpoint (314.58s) === CONT TestAccAWSRoute_ConditionalCidrBlock --- PASS: TestAccAWSRoute_ConditionalCidrBlock (54.25s) === CONT TestAccAWSRoute_IPv6_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv6_To_LocalGateway (1.28s) === CONT TestAccAWSRoute_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRoute_IPv4_To_LocalGateway (1.16s) === CONT TestAccAWSRoute_IPv4_To_CarrierGateway --- PASS: TestAccAWSRoute_IPv4_To_CarrierGateway (25.48s) === CONT TestAccAWSRoute_IPv6_To_TransitGateway --- PASS: TestAccAWSRoute_IPv6_To_TransitGateway (378.71s) === CONT TestAccAWSRoute_IPv4_To_TransitGateway --- PASS: TestAccAWSRoute_IPv4_Update_Target (682.34s) === CONT TestAccAWSRoute_DoesNotCrashWithVpcEndpoint --- PASS: TestAccAWSRoute_DoesNotCrashWithVpcEndpoint (42.49s) === CONT TestAccAWSRoute_IPv4_To_NatGateway --- PASS: TestAccAWSRoute_IPv4_To_NatGateway (187.94s) === CONT TestAccAWSRoute_IPv6_To_VpcPeeringConnection --- PASS: TestAccAWSRoute_IPv4_To_TransitGateway (378.19s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments --- PASS: TestAccAWSRoute_IPv6_To_VpcPeeringConnection (26.27s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Attached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_TwoAttachments (173.10s) === CONT TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Unattached (58.15s) === CONT TestAccAWSRoute_IPv4_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_NetworkInterface_Attached (330.77s) === CONT TestAccAWSRoute_IPv4_To_VpnGateway --- PASS: TestAccAWSRoute_IPv4_To_VpnGateway (38.73s) === CONT TestAccAWSRoute_IPv6_To_VpnGateway --- PASS: TestAccAWSRoute_IPv6_To_VpnGateway (37.37s) === CONT TestAccAWSRoute_IPv6_To_InternetGateway --- PASS: TestAccAWSRoute_IPv6_To_InternetGateway (34.74s) === CONT TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRoute_IPv6_To_NetworkInterface_Unattached (58.78s) === CONT TestAccAWSRoute_IPv6_To_Instance --- PASS: TestAccAWSRoute_IPv4_To_Instance (310.07s) === CONT TestAccAWSRoute_disappears_RouteTable --- PASS: TestAccAWSRoute_disappears_RouteTable (34.49s) === CONT TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRoute_IPv6_To_EgressOnlyInternetGateway (37.65s) === CONT TestAccAWSRoute_disappears --- PASS: TestAccAWSRoute_disappears (32.07s) --- PASS: TestAccAWSRoute_IPv6_To_Instance (328.50s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 2035.886s --- aws/internal/service/ec2/finder/finder.go | 2 ++ aws/resource_aws_route.go | 13 +++++++++++++ website/docs/r/route.html.markdown | 1 + 3 files changed, 16 insertions(+) diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index c1a9fcde62a..168bffab51c 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -140,6 +140,7 @@ type RouteFinder func(*ec2.EC2, string, string) (*ec2.Route, error) // Returns NotFoundError if no route is found. func RouteByIPv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) + if err != nil { return nil, err } @@ -157,6 +158,7 @@ func RouteByIPv4Destination(conn *ec2.EC2, routeTableID, destinationCidr string) // Returns NotFoundError if no route is found. func RouteByIPv6Destination(conn *ec2.EC2, routeTableID, destinationIpv6Cidr string) (*ec2.Route, error) { routeTable, err := RouteTableByID(conn, routeTableID) + if err != nil { return nil, err } diff --git a/aws/resource_aws_route.go b/aws/resource_aws_route.go index f319ce3a125..b5eaaecde79 100644 --- a/aws/resource_aws_route.go +++ b/aws/resource_aws_route.go @@ -23,6 +23,7 @@ var routeValidDestinations = []string{ } var routeValidTargets = []string{ + "carrier_gateway_id", "egress_only_gateway_id", "gateway_id", "instance_id", @@ -89,6 +90,13 @@ func resourceAwsRoute() *schema.Resource { // // Targets. // + "carrier_gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: routeValidTargets, + ConflictsWith: []string{"destination_ipv6_cidr_block"}, // IPv4 destinations only. + }, + "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -203,6 +211,8 @@ func resourceAwsRouteCreate(d *schema.ResourceData, meta interface{}) error { } switch target := aws.String(target); targetAttributeKey { + case "carrier_gateway_id": + input.CarrierGatewayId = target case "egress_only_gateway_id": input.EgressOnlyInternetGatewayId = target case "gateway_id": @@ -317,6 +327,7 @@ func resourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error reading Route for Route Table (%s) with destination (%s): %w", routeTableID, destination, err) } + d.Set("carrier_gateway_id", route.CarrierGatewayId) d.Set("destination_cidr_block", route.DestinationCidrBlock) d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) d.Set("destination_prefix_list_id", route.DestinationPrefixListId) @@ -372,6 +383,8 @@ func resourceAwsRouteUpdate(d *schema.ResourceData, meta interface{}) error { } switch target := aws.String(target); targetAttributeKey { + case "carrier_gateway_id": + input.CarrierGatewayId = target case "egress_only_gateway_id": input.EgressOnlyInternetGatewayId = target case "gateway_id": diff --git a/website/docs/r/route.html.markdown b/website/docs/r/route.html.markdown index 8d517a674ab..a3fab4fd1a9 100644 --- a/website/docs/r/route.html.markdown +++ b/website/docs/r/route.html.markdown @@ -61,6 +61,7 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: +* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. From 05975617b51a0bc349bffd89dbb929eb12771d28 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 22 Jan 2021 17:03:00 -0500 Subject: [PATCH 1197/1252] Add CHANGELOG entry. --- .changelog/16961.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/16961.txt diff --git a/.changelog/16961.txt b/.changelog/16961.txt new file mode 100644 index 00000000000..0d8a128b921 --- /dev/null +++ b/.changelog/16961.txt @@ -0,0 +1,3 @@ +```release-notes:enhancement +resource/aws_route: Add `carrier_gateway_id` attribute +``` From 1b79641ebbf4208abd08cc20e3e2b61b2fdeabb1 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 25 Mar 2021 16:51:43 -0700 Subject: [PATCH 1198/1252] Update CHANGELOG --- .changelog/17596.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/17596.txt diff --git a/.changelog/17596.txt b/.changelog/17596.txt new file mode 100644 index 00000000000..7847b72d61d --- /dev/null +++ b/.changelog/17596.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_fms_admin_account: Extend creation timeout to 10 minutes +``` From 21916eaaa4a3344c9ca117bf017f7b122612dd4d Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 20:06:20 -0400 Subject: [PATCH 1199/1252] service/storagegateway: Support Cached and VTL gateway upload buffers (#18313) * service/storagegateway: Support Cached and VTL gateway upload buffers Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17809 The referenced issue contains the context, but the gist of this issue is that the Storage Gateway API canonicalizes the Cached and VTL disk identifiers only after first cache or upload buffer use, which means that this resource must accept the path first, then perform its own lookup after creation. This also fixes the `aws_storagegateway_local_disk` data source, which was missing `Computed` on the `disk_node` and `disk_path` attributes, which prevented it for being used to lookup one for the value of the other. Previously: ``` === CONT TestAccAWSStorageGatewayUploadBuffer_DiskPath resource_aws_storagegateway_upload_buffer_test.go:107: Step 1/2 error: Error running apply: exit status 1 Error: error reading Storage Gateway Upload Buffer (arn:aws:storagegateway:us-west-2:187416307283:gateway/sgw-D0A941B9:/dev/nvme1n1): not found on terraform_plugin_test.tf line 129, in resource "aws_storagegateway_upload_buffer" "test": 129: resource "aws_storagegateway_upload_buffer" "test" { --- FAIL: TestAccAWSStorageGatewayUploadBuffer_DiskPath (418.35s) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSStorageGatewayLocalDiskDataSource_DiskNode (288.52s) --- PASS: TestAccAWSStorageGatewayLocalDiskDataSource_DiskPath (300.60s) --- PASS: TestAccAWSStorageGatewayUploadBuffer_basic (418.26s) --- PASS: TestAccAWSStorageGatewayUploadBuffer_DiskPath (444.33s) ``` * Update CHANGELOG for #18313 --- .changelog/18313.txt | 11 +++ ...ta_source_aws_storagegateway_local_disk.go | 2 + ...urce_aws_storagegateway_local_disk_test.go | 8 +- .../service/storagegateway/finder/finder.go | 48 ++++++++++++ ...source_aws_storagegateway_upload_buffer.go | 74 ++++++++++++++++--- ...e_aws_storagegateway_upload_buffer_test.go | 70 +++++++++++++++++- ...storagegateway_upload_buffer.html.markdown | 24 +++++- 7 files changed, 220 insertions(+), 17 deletions(-) create mode 100644 .changelog/18313.txt diff --git a/.changelog/18313.txt b/.changelog/18313.txt new file mode 100644 index 00000000000..b64ff580aba --- /dev/null +++ b/.changelog/18313.txt @@ -0,0 +1,11 @@ +```release-note:note +resource/aws_storagegateway_upload_buffer: The Storage Gateway `ListLocalDisks` API operation has been implemented to support the `disk_path` attribute for Cached and VTL gateway types. Environments using restrictive IAM permissions may require updates. +``` + +```release-note:bug +data-source/aws_storagegateway_local_disk: Allow `disk_path` reference on `disk_node` lookup and vice-versa +``` + +```release-note:enhancement +resource/aws_storagegateway_upload_buffer: Add `disk_path` argument for Cached and VTL gateways +``` diff --git a/aws/data_source_aws_storagegateway_local_disk.go b/aws/data_source_aws_storagegateway_local_disk.go index 61ea759a453..247d83c6684 100644 --- a/aws/data_source_aws_storagegateway_local_disk.go +++ b/aws/data_source_aws_storagegateway_local_disk.go @@ -22,10 +22,12 @@ func dataSourceAwsStorageGatewayLocalDisk() *schema.Resource { "disk_node": { Type: schema.TypeString, Optional: true, + Computed: true, }, "disk_path": { Type: schema.TypeString, Optional: true, + Computed: true, }, "gateway_arn": { Type: schema.TypeString, diff --git a/aws/data_source_aws_storagegateway_local_disk_test.go b/aws/data_source_aws_storagegateway_local_disk_test.go index 989f8d98218..6ca557cf330 100644 --- a/aws/data_source_aws_storagegateway_local_disk_test.go +++ b/aws/data_source_aws_storagegateway_local_disk_test.go @@ -29,7 +29,9 @@ func TestAccAWSStorageGatewayLocalDiskDataSource_DiskNode(t *testing.T) { Config: testAccAWSStorageGatewayLocalDiskDataSourceConfig_DiskNode(rName), Check: resource.ComposeTestCheckFunc( testAccAWSStorageGatewayLocalDiskDataSourceExists(dataSourceName), - resource.TestCheckResourceAttrSet(dataSourceName, "disk_id"), + resource.TestMatchResourceAttr(dataSourceName, "disk_id", regexp.MustCompile(`.+`)), + resource.TestMatchResourceAttr(dataSourceName, "disk_node", regexp.MustCompile(`.+`)), + resource.TestMatchResourceAttr(dataSourceName, "disk_path", regexp.MustCompile(`.+`)), ), }, }, @@ -54,7 +56,9 @@ func TestAccAWSStorageGatewayLocalDiskDataSource_DiskPath(t *testing.T) { Config: testAccAWSStorageGatewayLocalDiskDataSourceConfig_DiskPath(rName), Check: resource.ComposeTestCheckFunc( testAccAWSStorageGatewayLocalDiskDataSourceExists(dataSourceName), - resource.TestCheckResourceAttrSet(dataSourceName, "disk_id"), + resource.TestMatchResourceAttr(dataSourceName, "disk_id", regexp.MustCompile(`.+`)), + resource.TestMatchResourceAttr(dataSourceName, "disk_node", regexp.MustCompile(`.+`)), + resource.TestMatchResourceAttr(dataSourceName, "disk_path", regexp.MustCompile(`.+`)), ), }, }, diff --git a/aws/internal/service/storagegateway/finder/finder.go b/aws/internal/service/storagegateway/finder/finder.go index 986d73fd63b..c0269abda39 100644 --- a/aws/internal/service/storagegateway/finder/finder.go +++ b/aws/internal/service/storagegateway/finder/finder.go @@ -5,6 +5,54 @@ import ( "github.com/aws/aws-sdk-go/service/storagegateway" ) +func LocalDiskByDiskId(conn *storagegateway.StorageGateway, gatewayARN string, diskID string) (*storagegateway.Disk, error) { + input := &storagegateway.ListLocalDisksInput{ + GatewayARN: aws.String(gatewayARN), + } + + output, err := conn.ListLocalDisks(input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + for _, disk := range output.Disks { + if aws.StringValue(disk.DiskId) == diskID { + return disk, nil + } + } + + return nil, nil +} + +func LocalDiskByDiskPath(conn *storagegateway.StorageGateway, gatewayARN string, diskPath string) (*storagegateway.Disk, error) { + input := &storagegateway.ListLocalDisksInput{ + GatewayARN: aws.String(gatewayARN), + } + + output, err := conn.ListLocalDisks(input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + for _, disk := range output.Disks { + if aws.StringValue(disk.DiskPath) == diskPath { + return disk, nil + } + } + + return nil, nil +} + func UploadBufferDisk(conn *storagegateway.StorageGateway, gatewayARN string, diskID string) (*string, error) { input := &storagegateway.DescribeUploadBufferInput{ GatewayARN: aws.String(gatewayARN), diff --git a/aws/resource_aws_storagegateway_upload_buffer.go b/aws/resource_aws_storagegateway_upload_buffer.go index a07ef527efa..19d932f119e 100644 --- a/aws/resource_aws_storagegateway_upload_buffer.go +++ b/aws/resource_aws_storagegateway_upload_buffer.go @@ -23,9 +23,18 @@ func resourceAwsStorageGatewayUploadBuffer() *schema.Resource { Schema: map[string]*schema.Schema{ "disk_id": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ExactlyOneOf: []string{"disk_id", "disk_path"}, + }, + "disk_path": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ExactlyOneOf: []string{"disk_id", "disk_path"}, }, "gateway_arn": { Type: schema.TypeString, @@ -40,21 +49,48 @@ func resourceAwsStorageGatewayUploadBuffer() *schema.Resource { func resourceAwsStorageGatewayUploadBufferCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).storagegatewayconn - diskID := d.Get("disk_id").(string) - gatewayARN := d.Get("gateway_arn").(string) + input := &storagegateway.AddUploadBufferInput{} + + if v, ok := d.GetOk("disk_id"); ok { + input.DiskIds = aws.StringSlice([]string{v.(string)}) + } + + // Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17809 + if v, ok := d.GetOk("disk_path"); ok { + input.DiskIds = aws.StringSlice([]string{v.(string)}) + } + + if v, ok := d.GetOk("gateway_arn"); ok { + input.GatewayARN = aws.String(v.(string)) + } + + output, err := conn.AddUploadBuffer(input) + + if err != nil { + return fmt.Errorf("error adding Storage Gateway upload buffer: %w", err) + } + + if output == nil { + return fmt.Errorf("error adding Storage Gateway upload buffer: empty response") + } + + if v, ok := d.GetOk("disk_id"); ok { + d.SetId(fmt.Sprintf("%s:%s", aws.StringValue(output.GatewayARN), v.(string))) - input := &storagegateway.AddUploadBufferInput{ - DiskIds: []*string{aws.String(diskID)}, - GatewayARN: aws.String(gatewayARN), + return resourceAwsStorageGatewayUploadBufferRead(d, meta) } - log.Printf("[DEBUG] Adding Storage Gateway upload buffer: %s", input) - _, err := conn.AddUploadBuffer(input) + disk, err := finder.LocalDiskByDiskPath(conn, aws.StringValue(output.GatewayARN), aws.StringValue(input.DiskIds[0])) + if err != nil { - return fmt.Errorf("error adding Storage Gateway upload buffer: %s", err) + return fmt.Errorf("error listing Storage Gateway Local Disks after creating Upload Buffer: %w", err) + } + + if disk == nil { + return fmt.Errorf("error listing Storage Gateway Local Disks after creating Upload Buffer: disk not found") } - d.SetId(fmt.Sprintf("%s:%s", gatewayARN, diskID)) + d.SetId(fmt.Sprintf("%s:%s", aws.StringValue(output.GatewayARN), aws.StringValue(disk.DiskId))) return resourceAwsStorageGatewayUploadBufferRead(d, meta) } @@ -92,6 +128,20 @@ func resourceAwsStorageGatewayUploadBufferRead(d *schema.ResourceData, meta inte d.Set("disk_id", foundDiskID) d.Set("gateway_arn", gatewayARN) + if _, ok := d.GetOk("disk_path"); !ok { + disk, err := finder.LocalDiskByDiskId(conn, gatewayARN, aws.StringValue(foundDiskID)) + + if err != nil { + return fmt.Errorf("error listing Storage Gateway Local Disks: %w", err) + } + + if disk == nil { + return fmt.Errorf("error listing Storage Gateway Local Disks: disk not found") + } + + d.Set("disk_path", disk.DiskPath) + } + return nil } diff --git a/aws/resource_aws_storagegateway_upload_buffer_test.go b/aws/resource_aws_storagegateway_upload_buffer_test.go index a1c8d939665..80e5502e262 100644 --- a/aws/resource_aws_storagegateway_upload_buffer_test.go +++ b/aws/resource_aws_storagegateway_upload_buffer_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/service/storagegateway" @@ -82,10 +83,44 @@ func TestAccAWSStorageGatewayUploadBuffer_basic(t *testing.T) { CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSStorageGatewayUploadBufferConfig_Basic(rName), + Config: testAccAWSStorageGatewayUploadBufferConfigDiskId(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayUploadBufferExists(resourceName), resource.TestCheckResourceAttrPair(resourceName, "disk_id", localDiskDataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "disk_path", localDiskDataSourceName, "disk_path"), + resource.TestCheckResourceAttrPair(resourceName, "gateway_arn", gatewayResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// Reference: https://github.com/hashicorp/terraform-provider-aws/issues/17809 +func TestAccAWSStorageGatewayUploadBuffer_DiskPath(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_upload_buffer.test" + localDiskDataSourceName := "data.aws_storagegateway_local_disk.test" + gatewayResourceName := "aws_storagegateway_gateway.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, storagegateway.EndpointsID), + Providers: testAccProviders, + // Storage Gateway API does not support removing upload buffers, + // but we want to ensure other resources are removed. + CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayUploadBufferConfigDiskPath(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayUploadBufferExists(resourceName), + resource.TestMatchResourceAttr(resourceName, "disk_id", regexp.MustCompile(`.+`)), + resource.TestCheckResourceAttrPair(resourceName, "disk_path", localDiskDataSourceName, "disk_path"), resource.TestCheckResourceAttrPair(resourceName, "gateway_arn", gatewayResourceName, "arn"), ), }, @@ -126,7 +161,7 @@ func testAccCheckAWSStorageGatewayUploadBufferExists(resourceName string) resour } } -func testAccAWSStorageGatewayUploadBufferConfig_Basic(rName string) string { +func testAccAWSStorageGatewayUploadBufferConfigDiskId(rName string) string { return testAccAWSStorageGatewayGatewayConfig_GatewayType_Stored(rName) + fmt.Sprintf(` resource "aws_ebs_volume" "test" { availability_zone = aws_instance.test.availability_zone @@ -156,3 +191,34 @@ resource "aws_storagegateway_upload_buffer" "test" { } `, rName) } + +func testAccAWSStorageGatewayUploadBufferConfigDiskPath(rName string) string { + return testAccAWSStorageGatewayGatewayConfig_GatewayType_Cached(rName) + fmt.Sprintf(` +resource "aws_ebs_volume" "test" { + availability_zone = aws_instance.test.availability_zone + size = "10" + type = "gp2" + + tags = { + Name = %[1]q + } +} + +resource "aws_volume_attachment" "test" { + device_name = "/dev/xvdc" + force_detach = true + instance_id = aws_instance.test.id + volume_id = aws_ebs_volume.test.id +} + +data "aws_storagegateway_local_disk" "test" { + disk_node = aws_volume_attachment.test.device_name + gateway_arn = aws_storagegateway_gateway.test.arn +} + +resource "aws_storagegateway_upload_buffer" "test" { + disk_path = data.aws_storagegateway_local_disk.test.disk_path + gateway_arn = aws_storagegateway_gateway.test.arn +} +`, rName) +} diff --git a/website/docs/r/storagegateway_upload_buffer.html.markdown b/website/docs/r/storagegateway_upload_buffer.html.markdown index 7eb8c0e21be..c3f1dc4f223 100644 --- a/website/docs/r/storagegateway_upload_buffer.html.markdown +++ b/website/docs/r/storagegateway_upload_buffer.html.markdown @@ -14,7 +14,28 @@ Manages an AWS Storage Gateway upload buffer. ## Example Usage +### Cached and VTL Gateway Type + +```terraform +data "aws_storagegateway_local_disk" "test" { + disk_node = aws_volume_attachment.test.device_name + gateway_arn = aws_storagegateway_gateway.test.arn +} + +resource "aws_storagegateway_upload_buffer" "test" { + disk_path = data.aws_storagegateway_local_disk.test.disk_path + gateway_arn = aws_storagegateway_gateway.test.arn +} +``` + +### Stored Gateway Type + ```terraform +data "aws_storagegateway_local_disk" "test" { + disk_node = aws_volume_attachment.test.device_name + gateway_arn = aws_storagegateway_gateway.test.arn +} + resource "aws_storagegateway_upload_buffer" "example" { disk_id = data.aws_storagegateway_local_disk.example.id gateway_arn = aws_storagegateway_gateway.example.arn @@ -25,7 +46,8 @@ resource "aws_storagegateway_upload_buffer" "example" { The following arguments are supported: -* `disk_id` - (Required) Local disk identifier. For example, `pci-0000:03:00.0-scsi-0:0:0:0`. +* `disk_id` - (Optional) Local disk identifier. For example, `pci-0000:03:00.0-scsi-0:0:0:0`. +* `disk_path` - (Optional) Local disk path. For example, `/dev/nvme1n1`. * `gateway_arn` - (Required) The Amazon Resource Name (ARN) of the gateway. ## Attributes Reference From 7d367120718e5cf34d6187039935ce841216767d Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 26 Mar 2021 00:08:06 +0000 Subject: [PATCH 1200/1252] Update CHANGELOG.md for #18313 --- CHANGELOG.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a466288206..57b443be4f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 3.34.0 (Unreleased) +NOTES: + +* resource/aws_storagegateway_upload_buffer: The Storage Gateway `ListLocalDisks` API operation has been implemented to support the `disk_path` attribute for Cached and VTL gateway types. Environments using restrictive IAM permissions may require updates. ([#18313](https://github.com/hashicorp/terraform-provider-aws/issues/18313)) + FEATURES: * **New Data Source:** `aws_codestarconnections_connection` ([#18129](https://github.com/hashicorp/terraform-provider-aws/issues/18129)) @@ -8,6 +12,8 @@ FEATURES: ENHANCEMENTS: * resource/aws_ami_from_instance: Tag on create. ([#17968](https://github.com/hashicorp/terraform-provider-aws/issues/17968)) +* resource/aws_ecr_repository_policy: Add plan time validation for `policy` ([#14193](https://github.com/hashicorp/terraform-provider-aws/issues/14193)) +* resource/aws_fms_admin_account: Extend creation timeout to 10 minutes ([#17596](https://github.com/hashicorp/terraform-provider-aws/issues/17596)) * resource/aws_iam_instance_profile: Add tagging support ([#17962](https://github.com/hashicorp/terraform-provider-aws/issues/17962)) * resource/aws_iam_openid_connect_provider: Add plan time validation for `client_id_list` and `thumbprint_list` ([#17964](https://github.com/hashicorp/terraform-provider-aws/issues/17964)) * resource/aws_iam_openid_connect_provider: Add tagging support ([#17964](https://github.com/hashicorp/terraform-provider-aws/issues/17964)) @@ -20,17 +26,26 @@ ENHANCEMENTS: * resource/aws_pinpoint_email_channel: Add plan time validation for `identity` and `role_arn` ([#18314](https://github.com/hashicorp/terraform-provider-aws/issues/18314)) * resource/aws_pinpoint_event_stream: Plan time validations for `destination_stream_arn` and `role_arn` ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) * resource/aws_route: Validate route destination and target attributes ([#16930](https://github.com/hashicorp/terraform-provider-aws/issues/16930)) +* resource/aws_sns_topic_subscription: Add plan time validation for `subscription_role_arn` and `topic_arn` ([#14101](https://github.com/hashicorp/terraform-provider-aws/issues/14101)) +* resource/aws_storagegateway_upload_buffer: Add `disk_path` argument for Cached and VTL gateways ([#18313](https://github.com/hashicorp/terraform-provider-aws/issues/18313)) BUG FIXES: +* data-source/aws_storagegateway_local_disk: Allow `disk_path` reference on `disk_node` lookup and vice-versa ([#18313](https://github.com/hashicorp/terraform-provider-aws/issues/18313)) * resource/aws_api_gateway_vpc_link: Persist ID of failed VPC Link to state ([#18382](https://github.com/hashicorp/terraform-provider-aws/issues/18382)) +* resource/aws_apigatewayv2_domain_name: Allow update of mutual TLS S3 object version ([#18351](https://github.com/hashicorp/terraform-provider-aws/issues/18351)) * resource/aws_cloudfront_distribution: Allow `forwarded_values` to be set to empty when values were previously set ([#18042](https://github.com/hashicorp/terraform-provider-aws/issues/18042)) +* resource/aws_cloudwatch_event_permission: Fix error in Event Bridge/CloudWatch Events bus name validation ([#16815](https://github.com/hashicorp/terraform-provider-aws/issues/16815)) +* resource/aws_cloudwatch_event_rule: Fix error in Event Bridge/CloudWatch Events bus name validation ([#16815](https://github.com/hashicorp/terraform-provider-aws/issues/16815)) +* resource/aws_cloudwatch_event_target: Fix error in Event Bridge/CloudWatch Events bus name validation ([#16815](https://github.com/hashicorp/terraform-provider-aws/issues/16815)) +* resource/aws_config_configuration_aggregator: Allow name to have uppercase characters ([#14247](https://github.com/hashicorp/terraform-provider-aws/issues/14247)) * resource/aws_ecs_service: Re-create service when `service_registries` changes ([#17387](https://github.com/hashicorp/terraform-provider-aws/issues/17387)) * resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) * resource/aws_pinpoint_event_stream: Retry on eventual consistency error ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) * resource/aws_route: Correctly handle updates to the route target attributes (`egress_only_gateway_id`, `gateway_id`, `instance_id`, `local_gateway_id`, `nat_gateway_id`, `network_interface_id`, `transit_gateway_id`, `vpc_peering_connection_id`) ([#16930](https://github.com/hashicorp/terraform-provider-aws/issues/16930)) +* resource/aws_sns_topic_subscription: recreate subscription if topic is deleted ([#14101](https://github.com/hashicorp/terraform-provider-aws/issues/14101)) * resource/aws_subnet: Handle EC2 eventual consistency errors on creation ([#18392](https://github.com/hashicorp/terraform-provider-aws/issues/18392)) * resource/aws_vpc: Handle EC2 eventual consistency errors on creation ([#18391](https://github.com/hashicorp/terraform-provider-aws/issues/18391)) * resource/aws_wafv2_web_acl_logging_configuration: Remove deprecation warning for `redacted_fields` `single_header` argument ([#18384](https://github.com/hashicorp/terraform-provider-aws/issues/18384)) From 43a4da287e59ec693b595fe886a28e9d8ac24de2 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 20:20:26 -0400 Subject: [PATCH 1201/1252] service/ec2: Handle read-after-write eventual consistency issues in Network ACL resources (#18388) * service/ec2: Handle read-after-write eventual consistency issues in Network ACL resources Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16796 Reference: https://github.com/hashicorp/terraform-provider-aws/blob/main/docs/contributing/retries-and-waiters.md#resource-lifecycle-retries Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSNetworkAcl_basic (55.36s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (49.96s) --- PASS: TestAccAWSNetworkAcl_disappears (32.88s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (86.30s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (43.19s) --- PASS: TestAccAWSNetworkAcl_espProtocol (44.05s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (83.59s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (40.67s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (64.78s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (52.74s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (43.49s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (50.78s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (72.14s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (74.65s) --- PASS: TestAccAWSNetworkAcl_Subnets (87.92s) --- PASS: TestAccAWSNetworkAcl_SubnetsDelete (81.74s) --- PASS: TestAccAWSNetworkAcl_tags (74.60s) --- PASS: TestAccAWSNetworkAclRule_allProtocol (69.48s) --- PASS: TestAccAWSNetworkAclRule_basic (54.04s) --- PASS: TestAccAWSNetworkAclRule_disappears (30.99s) --- PASS: TestAccAWSNetworkAclRule_disappears_IngressEgressSameNumber (41.45s) --- PASS: TestAccAWSNetworkAclRule_disappears_NetworkAcl (40.04s) --- PASS: TestAccAWSNetworkAclRule_ipv6 (45.12s) --- PASS: TestAccAWSNetworkAclRule_ipv6ICMP (47.00s) --- PASS: TestAccAWSNetworkAclRule_ipv6VpcAssignGeneratedIpv6CidrBlockUpdate (72.25s) --- PASS: TestAccAWSNetworkAclRule_tcpProtocol (61.69s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSNetworkAcl_basic (58.57s) --- PASS: TestAccAWSNetworkAcl_CaseSensitivityNoChanges (94.47s) --- PASS: TestAccAWSNetworkAcl_disappears (60.54s) --- PASS: TestAccAWSNetworkAcl_Egress_ConfigMode (99.32s) --- PASS: TestAccAWSNetworkAcl_EgressAndIngressRules (74.30s) --- PASS: TestAccAWSNetworkAcl_espProtocol (63.01s) --- PASS: TestAccAWSNetworkAcl_Ingress_ConfigMode (129.73s) --- PASS: TestAccAWSNetworkAcl_ipv6ICMPRules (64.84s) --- PASS: TestAccAWSNetworkAcl_ipv6Rules (95.18s) --- PASS: TestAccAWSNetworkAcl_ipv6VpcRules (61.43s) --- PASS: TestAccAWSNetworkAcl_OnlyEgressRules (86.34s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_basic (87.57s) --- PASS: TestAccAWSNetworkAcl_OnlyIngressRules_update (129.92s) --- PASS: TestAccAWSNetworkAcl_SubnetChange (144.88s) --- PASS: TestAccAWSNetworkAcl_Subnets (144.73s) --- PASS: TestAccAWSNetworkAcl_SubnetsDelete (120.00s) --- PASS: TestAccAWSNetworkAcl_tags (122.44s) --- PASS: TestAccAWSNetworkAclRule_allProtocol (72.14s) --- PASS: TestAccAWSNetworkAclRule_basic (95.37s) --- PASS: TestAccAWSNetworkAclRule_disappears (61.95s) --- PASS: TestAccAWSNetworkAclRule_disappears_IngressEgressSameNumber (56.73s) --- PASS: TestAccAWSNetworkAclRule_disappears_NetworkAcl (65.84s) --- PASS: TestAccAWSNetworkAclRule_ipv6 (89.03s) --- PASS: TestAccAWSNetworkAclRule_ipv6ICMP (81.90s) --- PASS: TestAccAWSNetworkAclRule_ipv6VpcAssignGeneratedIpv6CidrBlockUpdate (123.78s) --- PASS: TestAccAWSNetworkAclRule_missingParam (27.16s) --- PASS: TestAccAWSNetworkAclRule_tcpProtocol (88.83s) ``` * Update CHANGELOG for #18388 --- .changelog/18388.txt | 7 + aws/internal/service/ec2/finder/finder.go | 82 ++++++++++++ aws/internal/service/ec2/waiter/waiter.go | 5 + aws/resource_aws_network_acl.go | 116 ++++++++++++++--- aws/resource_aws_network_acl_rule.go | 149 +++++++++------------- aws/resource_aws_network_acl_rule_test.go | 2 +- 6 files changed, 255 insertions(+), 106 deletions(-) create mode 100644 .changelog/18388.txt diff --git a/.changelog/18388.txt b/.changelog/18388.txt new file mode 100644 index 00000000000..ea024aa9ef5 --- /dev/null +++ b/.changelog/18388.txt @@ -0,0 +1,7 @@ +```release-note:bug +resource/aws_network_acl: Handle EC2 eventual consistency errors on creation +``` + +```release-note:bug +resource/aws_network_acl_rule: Handle EC2 eventual consistency errors on creation +``` diff --git a/aws/internal/service/ec2/finder/finder.go b/aws/internal/service/ec2/finder/finder.go index 9749e368a44..79fe3a9678e 100644 --- a/aws/internal/service/ec2/finder/finder.go +++ b/aws/internal/service/ec2/finder/finder.go @@ -98,6 +98,88 @@ func InstanceByID(conn *ec2.EC2, id string) (*ec2.Instance, error) { return output.Reservations[0].Instances[0], nil } +// NetworkAclByID looks up a NetworkAcl by ID. When not found, returns nil and potentially an API error. +func NetworkAclByID(conn *ec2.EC2, id string) (*ec2.NetworkAcl, error) { + input := &ec2.DescribeNetworkAclsInput{ + NetworkAclIds: aws.StringSlice([]string{id}), + } + + output, err := conn.DescribeNetworkAcls(input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + for _, networkAcl := range output.NetworkAcls { + if networkAcl == nil { + continue + } + + if aws.StringValue(networkAcl.NetworkAclId) != id { + continue + } + + return networkAcl, nil + } + + return nil, nil +} + +// NetworkAclEntry looks up a NetworkAclEntry by Network ACL ID, Egress, and Rule Number. When not found, returns nil and potentially an API error. +func NetworkAclEntry(conn *ec2.EC2, networkAclID string, egress bool, ruleNumber int) (*ec2.NetworkAclEntry, error) { + input := &ec2.DescribeNetworkAclsInput{ + Filters: []*ec2.Filter{ + { + Name: aws.String("entry.egress"), + Values: aws.StringSlice([]string{fmt.Sprintf("%t", egress)}), + }, + { + Name: aws.String("entry.rule-number"), + Values: aws.StringSlice([]string{fmt.Sprintf("%d", ruleNumber)}), + }, + }, + NetworkAclIds: aws.StringSlice([]string{networkAclID}), + } + + output, err := conn.DescribeNetworkAcls(input) + + if err != nil { + return nil, err + } + + if output == nil { + return nil, nil + } + + for _, networkAcl := range output.NetworkAcls { + if networkAcl == nil { + continue + } + + if aws.StringValue(networkAcl.NetworkAclId) != networkAclID { + continue + } + + for _, entry := range output.NetworkAcls[0].Entries { + if entry == nil { + continue + } + + if aws.BoolValue(entry.Egress) != egress || aws.Int64Value(entry.RuleNumber) != int64(ruleNumber) { + continue + } + + return entry, nil + } + } + + return nil, nil +} + // RouteTableByID returns the route table corresponding to the specified identifier. // Returns NotFoundError if no route table is found. func RouteTableByID(conn *ec2.EC2, routeTableID string) (*ec2.RouteTable, error) { diff --git a/aws/internal/service/ec2/waiter/waiter.go b/aws/internal/service/ec2/waiter/waiter.go index 07bf6682c73..a7385d40cef 100644 --- a/aws/internal/service/ec2/waiter/waiter.go +++ b/aws/internal/service/ec2/waiter/waiter.go @@ -252,6 +252,11 @@ func InstanceIamInstanceProfileUpdated(conn *ec2.EC2, instanceID string, expecte return nil, err } +const ( + NetworkAclPropagationTimeout = 2 * time.Minute + NetworkAclEntryPropagationTimeout = 5 * time.Minute +) + func SecurityGroupCreated(conn *ec2.EC2, id string, timeout time.Duration) (*ec2.SecurityGroup, error) { stateConf := &resource.StateChangeConf{ Pending: []string{SecurityGroupStatusNotFound}, diff --git a/aws/resource_aws_network_acl.go b/aws/resource_aws_network_acl.go index 706b64f65f7..39066878935 100644 --- a/aws/resource_aws_network_acl.go +++ b/aws/resource_aws_network_acl.go @@ -11,11 +11,15 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsNetworkAcl() *schema.Resource { @@ -196,39 +200,119 @@ func resourceAwsNetworkAclCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Network Acl create config: %#v", createOpts) resp, err := conn.CreateNetworkAcl(createOpts) + if err != nil { - return fmt.Errorf("Error creating network acl: %s", err) + return fmt.Errorf("error creating EC2 Network ACL: %w", err) + } + + if resp == nil || resp.NetworkAcl == nil { + return fmt.Errorf("error creating EC2 Network ACL: empty response") + } + + d.SetId(aws.StringValue(resp.NetworkAcl.NetworkAclId)) + + if v, ok := d.GetOk("egress"); ok && v.(*schema.Set).Len() > 0 { + err := updateNetworkAclEntries(d, "egress", conn) + + if err != nil { + return fmt.Errorf("error updating EC2 Network ACL (%s) Egress Entries: %w", d.Id(), err) + } + } + + if v, ok := d.GetOk("ingress"); ok && v.(*schema.Set).Len() > 0 { + err := updateNetworkAclEntries(d, "ingress", conn) + + if err != nil { + return fmt.Errorf("error updating EC2 Network ACL (%s) Ingress Entries: %w", d.Id(), err) + } } - // Get the ID and store it - networkAcl := resp.NetworkAcl - d.SetId(aws.StringValue(networkAcl.NetworkAclId)) + if v, ok := d.GetOk("subnet_ids"); ok && v.(*schema.Set).Len() > 0 { + for _, subnetIDRaw := range v.(*schema.Set).List() { + subnetID, ok := subnetIDRaw.(string) + + if !ok { + continue + } + + association, err := findNetworkAclAssociation(subnetID, conn) + + if err != nil { + return fmt.Errorf("error finding existing EC2 Network ACL association for Subnet (%s): %w", subnetID, err) + } - // Update rules and subnet association once acl is created - return resourceAwsNetworkAclUpdate(d, meta) + if association == nil { + return fmt.Errorf("error finding existing EC2 Network ACL association for Subnet (%s): empty response", subnetID) + } + + input := &ec2.ReplaceNetworkAclAssociationInput{ + AssociationId: association.NetworkAclAssociationId, + NetworkAclId: aws.String(d.Id()), + } + + _, err = conn.ReplaceNetworkAclAssociation(input) + + if err != nil { + return fmt.Errorf("error replacing existing EC2 Network ACL association for Subnet (%s): %w", subnetID, err) + } + } + } + + return resourceAwsNetworkAclRead(d, meta) } func resourceAwsNetworkAclRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig - resp, err := conn.DescribeNetworkAcls(&ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(d.Id())}, + var networkAcl *ec2.NetworkAcl + + err := resource.Retry(waiter.NetworkAclPropagationTimeout, func() *resource.RetryError { + var err error + + networkAcl, err = finder.NetworkAclByID(conn, d.Id()) + + if d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidNetworkAclID.NotFound") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + if d.IsNewResource() && networkAcl == nil { + return resource.RetryableError(&resource.NotFoundError{ + LastError: fmt.Errorf("EC2 Network ACL (%s) not found", d.Id()), + }) + } + + return nil }) + if tfresource.TimedOut(err) { + networkAcl, err = finder.NetworkAclByID(conn, d.Id()) + } + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidNetworkAclID.NotFound") { + log.Printf("[WARN] EC2 Network ACL (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { - if isAWSErr(err, "InvalidNetworkAclID.NotFound", "") { - log.Printf("[WARN] Network ACL (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return err + return fmt.Errorf("error reading EC2 Network ACL (%s): %w", d.Id(), err) } - if resp == nil { + + if networkAcl == nil { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 Network ACL (%s): not found after creation", d.Id()) + } + + log.Printf("[WARN] EC2 Network ACL (%s) not found, removing from state", d.Id()) + d.SetId("") return nil } - networkAcl := resp.NetworkAcls[0] var ingressEntries []*ec2.NetworkAclEntry var egressEntries []*ec2.NetworkAclEntry diff --git a/aws/resource_aws_network_acl_rule.go b/aws/resource_aws_network_acl_rule.go index ca11f71b304..36dd1686fa6 100644 --- a/aws/resource_aws_network_acl_rule.go +++ b/aws/resource_aws_network_acl_rule.go @@ -6,13 +6,16 @@ import ( "log" "strconv" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsNetworkAclRule() *schema.Resource { @@ -123,6 +126,9 @@ func resourceAwsNetworkAclRule() *schema.Resource { func resourceAwsNetworkAclRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + egress := d.Get("egress").(bool) + networkAclID := d.Get("network_acl_id").(string) + ruleNumber := d.Get("rule_number").(int) protocol := d.Get("protocol").(string) p, protocolErr := strconv.Atoi(protocol) @@ -136,9 +142,9 @@ func resourceAwsNetworkAclRuleCreate(d *schema.ResourceData, meta interface{}) e log.Printf("[INFO] Transformed Protocol %s into %d", protocol, p) params := &ec2.CreateNetworkAclEntryInput{ - NetworkAclId: aws.String(d.Get("network_acl_id").(string)), - Egress: aws.Bool(d.Get("egress").(bool)), - RuleNumber: aws.Int64(int64(d.Get("rule_number").(int))), + NetworkAclId: aws.String(networkAclID), + Egress: aws.Bool(egress), + RuleNumber: aws.Int64(int64(ruleNumber)), Protocol: aws.String(strconv.Itoa(p)), RuleAction: aws.String(d.Get("rule_action").(string)), PortRange: &ec2.PortRange{ @@ -169,63 +175,83 @@ func resourceAwsNetworkAclRuleCreate(d *schema.ResourceData, meta interface{}) e if v, ok := d.GetOk("icmp_type"); ok { icmpType, err := strconv.Atoi(v.(string)) if err != nil { - return fmt.Errorf("Unable to parse ICMP type %s for rule %d", v, d.Get("rule_number").(int)) + return fmt.Errorf("Unable to parse ICMP type %s for rule %d", v, ruleNumber) } params.IcmpTypeCode.Type = aws.Int64(int64(icmpType)) - log.Printf("[DEBUG] Got ICMP type %d for rule %d", icmpType, d.Get("rule_number").(int)) + log.Printf("[DEBUG] Got ICMP type %d for rule %d", icmpType, ruleNumber) } if v, ok := d.GetOk("icmp_code"); ok { icmpCode, err := strconv.Atoi(v.(string)) if err != nil { - return fmt.Errorf("Unable to parse ICMP code %s for rule %d", v, d.Get("rule_number").(int)) + return fmt.Errorf("Unable to parse ICMP code %s for rule %d", v, ruleNumber) } params.IcmpTypeCode.Code = aws.Int64(int64(icmpCode)) - log.Printf("[DEBUG] Got ICMP code %d for rule %d", icmpCode, d.Get("rule_number").(int)) + log.Printf("[DEBUG] Got ICMP code %d for rule %d", icmpCode, ruleNumber) } } - log.Printf("[INFO] Creating Network Acl Rule: %d (%t)", d.Get("rule_number").(int), d.Get("egress").(bool)) + log.Printf("[INFO] Creating Network Acl Rule: %d (%t)", ruleNumber, egress) _, err := conn.CreateNetworkAclEntry(params) + if err != nil { - return fmt.Errorf("Error Creating Network Acl Rule: %s", err.Error()) + return fmt.Errorf("error creating Network ACL (%s) Egress (%t) Rule (%d): %w", networkAclID, egress, ruleNumber, err) } - d.SetId(networkAclIdRuleNumberEgressHash(d.Get("network_acl_id").(string), d.Get("rule_number").(int), d.Get("egress").(bool), d.Get("protocol").(string))) - - // It appears it might be a while until the newly created rule is visible via the - // API (see issue GH-4721). Retry the `findNetworkAclRule` function until it is - // visible (which in most cases is likely immediately). - var r *ec2.NetworkAclEntry - err = resource.Retry(3*time.Minute, func() *resource.RetryError { - r, err = findNetworkAclRule(d, meta) + + d.SetId(networkAclIdRuleNumberEgressHash(networkAclID, ruleNumber, egress, d.Get("protocol").(string))) + + return resourceAwsNetworkAclRuleRead(d, meta) +} + +func resourceAwsNetworkAclRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + egress := d.Get("egress").(bool) + networkAclID := d.Get("network_acl_id").(string) + ruleNumber := d.Get("rule_number").(int) + + var resp *ec2.NetworkAclEntry + + err := resource.Retry(waiter.NetworkAclEntryPropagationTimeout, func() *resource.RetryError { + var err error + + resp, err = finder.NetworkAclEntry(conn, networkAclID, egress, ruleNumber) + + if d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidNetworkAclID.NotFound") { + return resource.RetryableError(err) + } + if err != nil { return resource.NonRetryableError(err) } - if r == nil { - return resource.RetryableError(fmt.Errorf("Network ACL rule (%s) not found", d.Id())) + + if d.IsNewResource() && resp == nil { + return resource.RetryableError(&resource.NotFoundError{ + LastError: fmt.Errorf("EC2 Network ACL (%s) Egress (%t) Rule (%d) not found", networkAclID, egress, ruleNumber), + }) } return nil }) - if isResourceTimeoutError(err) { - r, err = findNetworkAclRule(d, meta) - if r == nil { - return fmt.Errorf("Network ACL rule (%s) not found", d.Id()) - } - } - if err != nil { - return fmt.Errorf("Created Network ACL Rule was not visible in API within 3 minute period. Running 'terraform apply' again will resume infrastructure creation.") + + if tfresource.TimedOut(err) { + resp, err = finder.NetworkAclEntry(conn, networkAclID, egress, ruleNumber) } - return resourceAwsNetworkAclRuleRead(d, meta) -} + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, "InvalidNetworkAclID.NotFound") { + log.Printf("[WARN] EC2 Network ACL (%s) not found, removing from state", networkAclID) + d.SetId("") + return nil + } -func resourceAwsNetworkAclRuleRead(d *schema.ResourceData, meta interface{}) error { - resp, err := findNetworkAclRule(d, meta) if err != nil { - return err + return fmt.Errorf("error reading EC2 Network ACL (%s) Egress (%t) Rule (%d): %w", networkAclID, egress, ruleNumber, err) } + if resp == nil { - log.Printf("[DEBUG] Network ACL rule (%s) not found", d.Id()) + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 Network ACL (%s) Egress (%t) Rule (%d): not found after creation", networkAclID, egress, ruleNumber) + } + + log.Printf("[WARN] EC2 Network ACL (%s) Egress (%t) Rule (%d) not found, removing from state", networkAclID, egress, ruleNumber) d.SetId("") return nil } @@ -278,61 +304,6 @@ func resourceAwsNetworkAclRuleDelete(d *schema.ResourceData, meta interface{}) e return nil } -func findNetworkAclRule(d *schema.ResourceData, meta interface{}) (*ec2.NetworkAclEntry, error) { - conn := meta.(*AWSClient).ec2conn - - filters := make([]*ec2.Filter, 0, 2) - ruleNumberFilter := &ec2.Filter{ - Name: aws.String("entry.rule-number"), - Values: []*string{aws.String(fmt.Sprintf("%d", d.Get("rule_number").(int)))}, - } - filters = append(filters, ruleNumberFilter) - egressFilter := &ec2.Filter{ - Name: aws.String("entry.egress"), - Values: []*string{aws.String(fmt.Sprintf("%v", d.Get("egress").(bool)))}, - } - filters = append(filters, egressFilter) - params := &ec2.DescribeNetworkAclsInput{ - NetworkAclIds: []*string{aws.String(d.Get("network_acl_id").(string))}, - Filters: filters, - } - - log.Printf("[INFO] Describing Network Acl: %s", d.Get("network_acl_id").(string)) - log.Printf("[INFO] Describing Network Acl with the Filters %#v", params) - resp, err := conn.DescribeNetworkAcls(params) - - if isAWSErr(err, "InvalidNetworkAclID.NotFound", "") { - return nil, nil - } - - if err != nil { - return nil, fmt.Errorf("Error Finding Network Acl Rule %d: %s", d.Get("rule_number").(int), err.Error()) - } - - if resp == nil || len(resp.NetworkAcls) == 0 || resp.NetworkAcls[0] == nil { - // Missing NACL rule. - return nil, nil - } - if len(resp.NetworkAcls) > 1 { - return nil, fmt.Errorf( - "Expected to find one Network ACL, got: %#v", - resp.NetworkAcls) - } - networkAcl := resp.NetworkAcls[0] - if networkAcl.Entries != nil { - for _, i := range networkAcl.Entries { - if *i.RuleNumber == int64(d.Get("rule_number").(int)) && *i.Egress == d.Get("egress").(bool) { - return i, nil - } - } - return nil, nil - } - return nil, fmt.Errorf( - "Expected the Network ACL to have Entries, got: %#v", - networkAcl) - -} - func networkAclIdRuleNumberEgressHash(networkAclId string, ruleNumber int, egress bool, protocol string) string { var buf bytes.Buffer buf.WriteString(fmt.Sprintf("%s-", networkAclId)) diff --git a/aws/resource_aws_network_acl_rule_test.go b/aws/resource_aws_network_acl_rule_test.go index 3df9748e3b2..54feb50745f 100644 --- a/aws/resource_aws_network_acl_rule_test.go +++ b/aws/resource_aws_network_acl_rule_test.go @@ -234,7 +234,7 @@ func TestAccAWSNetworkAclRule_allProtocol(t *testing.T) { } func TestAccAWSNetworkAclRule_tcpProtocol(t *testing.T) { - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, From d732881dc0a780640da765b8228962eab6b8effa Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 26 Mar 2021 00:23:39 +0000 Subject: [PATCH 1202/1252] Update CHANGELOG.md for #18388 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57b443be4f2..1eefffdcbb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,8 @@ BUG FIXES: * resource/aws_ecs_service: Re-create service when `service_registries` changes ([#17387](https://github.com/hashicorp/terraform-provider-aws/issues/17387)) * resource/aws_elasticache_replication_group: Prevents re-creation of secondary replication groups when encryption is enabled ([#18361](https://github.com/hashicorp/terraform-provider-aws/issues/18361)) * resource/aws_mq_configuration: Add `ldap` as an `authentication_strategy` and `RabbitMQ` as an `engine_type` ([#18070](https://github.com/hashicorp/terraform-provider-aws/issues/18070)) +* resource/aws_network_acl: Handle EC2 eventual consistency errors on creation ([#18388](https://github.com/hashicorp/terraform-provider-aws/issues/18388)) +* resource/aws_network_acl_rule: Handle EC2 eventual consistency errors on creation ([#18388](https://github.com/hashicorp/terraform-provider-aws/issues/18388)) * resource/aws_pinpoint_event_stream: Retry on eventual consistency error ([#18305](https://github.com/hashicorp/terraform-provider-aws/issues/18305)) * resource/aws_pinpoint_sms_channel: Set all params on update ([#18281](https://github.com/hashicorp/terraform-provider-aws/issues/18281)) * resource/aws_route: Correctly handle updates to the route target attributes (`egress_only_gateway_id`, `gateway_id`, `instance_id`, `local_gateway_id`, `nat_gateway_id`, `network_interface_id`, `transit_gateway_id`, `vpc_peering_connection_id`) ([#16930](https://github.com/hashicorp/terraform-provider-aws/issues/16930)) From c646ad6e8099aa6a72d162c52824570db97691ad Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 20:23:55 -0400 Subject: [PATCH 1203/1252] tests/provider: Add missing ErrorCheck Previously: ``` Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/resource_aws_config_configuration_aggregator_test.go:209:36: XAT001: missing ErrorCheck 208 209 resource.ParallelTest(t, resource.TestCase{ 210 PreCheck: func() { testAccPreCheck(t) }, Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/resource_aws_ecr_repository_policy_test.go:84:36: XAT001: missing ErrorCheck 83 84 resource.ParallelTest(t, resource.TestCase{ 85 PreCheck: func() { testAccPreCheck(t) }, Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/resource_aws_ecr_repository_policy_test.go:105:36: XAT001: missing ErrorCheck 104 105 resource.ParallelTest(t, resource.TestCase{ 106 PreCheck: func() { testAccPreCheck(t) }, Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/resource_aws_sns_topic_subscription_test.go:444:36: XAT001: missing ErrorCheck 443 444 resource.ParallelTest(t, resource.TestCase{ 445 PreCheck: func() { testAccPreCheck(t) }, Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/resource_aws_sns_topic_subscription_test.go:466:36: XAT001: missing ErrorCheck 465 466 resource.ParallelTest(t, resource.TestCase{ 467 PreCheck: func() { testAccPreCheck(t) }, make: *** [GNUmakefile:92: awsproviderlint] Error 3 ``` --- aws/resource_aws_config_configuration_aggregator_test.go | 1 + aws/resource_aws_ecr_repository_policy_test.go | 2 ++ aws/resource_aws_sns_topic_subscription_test.go | 2 ++ 3 files changed, 5 insertions(+) diff --git a/aws/resource_aws_config_configuration_aggregator_test.go b/aws/resource_aws_config_configuration_aggregator_test.go index 3a35fb2e3f1..a7efa74d30e 100644 --- a/aws/resource_aws_config_configuration_aggregator_test.go +++ b/aws/resource_aws_config_configuration_aggregator_test.go @@ -208,6 +208,7 @@ func TestAccAWSConfigConfigurationAggregator_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, configservice.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSConfigConfigurationAggregatorDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_ecr_repository_policy_test.go b/aws/resource_aws_ecr_repository_policy_test.go index 7027c5a693b..e04a2559a65 100644 --- a/aws/resource_aws_ecr_repository_policy_test.go +++ b/aws/resource_aws_ecr_repository_policy_test.go @@ -83,6 +83,7 @@ func TestAccAWSEcrRepositoryPolicy_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ @@ -104,6 +105,7 @@ func TestAccAWSEcrRepositoryPolicy_disappears_repository(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, ecr.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSEcrRepositoryPolicyDestroy, Steps: []resource.TestStep{ diff --git a/aws/resource_aws_sns_topic_subscription_test.go b/aws/resource_aws_sns_topic_subscription_test.go index 96acaa1e0c2..607cd64bef0 100644 --- a/aws/resource_aws_sns_topic_subscription_test.go +++ b/aws/resource_aws_sns_topic_subscription_test.go @@ -443,6 +443,7 @@ func TestAccAWSSNSTopicSubscription_disappears(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ @@ -465,6 +466,7 @@ func TestAccAWSSNSTopicSubscription_disappears_topic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, sns.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy, Steps: []resource.TestStep{ From bf230a0d3debf5f769b7a238f7af451f34a320db Mon Sep 17 00:00:00 2001 From: tf-release-bot Date: Fri, 26 Mar 2021 00:32:38 +0000 Subject: [PATCH 1204/1252] v3.34.0 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eefffdcbb4..057f04653cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -## 3.34.0 (Unreleased) +## 3.34.0 (March 26, 2021) NOTES: From 33560da3c5f86f0c9778f7984ecbcab07836d2a5 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 25 Mar 2021 20:48:08 -0400 Subject: [PATCH 1205/1252] Update CHANGELOG after release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 057f04653cb..c9f2d0a549c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +## 3.35.0 (Unreleased) + ## 3.34.0 (March 26, 2021) NOTES: From 271f7dbd3be5494dfa80d4c2b56dbbdac5560dbe Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 10:52:36 -0400 Subject: [PATCH 1206/1252] r/ecs_service: Move to consts --- aws/internal/service/ecs/waiter/waiter.go | 1 + aws/resource_aws_ecs_service.go | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aws/internal/service/ecs/waiter/waiter.go b/aws/internal/service/ecs/waiter/waiter.go index dd4a3ca4895..265d0ed28ba 100644 --- a/aws/internal/service/ecs/waiter/waiter.go +++ b/aws/internal/service/ecs/waiter/waiter.go @@ -10,6 +10,7 @@ import ( const ( // Maximum amount of time to wait for a Capacity Provider to return INACTIVE CapacityProviderInactiveTimeout = 20 * time.Minute + ServiceCreateTimeout = 2 * time.Minute ) // CapacityProviderInactive waits for a Capacity Provider to return INACTIVE diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 4d68f6c0386..d0389a0e370 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ecs/waiter" ) func resourceAwsEcsService() *schema.Resource { @@ -523,7 +524,7 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error // Retry due to AWS IAM & ECS eventual consistency var out *ecs.CreateServiceOutput var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(waiter.ServiceCreateTimeout, func() *resource.RetryError { out, err = conn.CreateService(&input) if err != nil { From f17c81ebe264ea314afbffb25ba1e9770f82134f Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 26 Mar 2021 11:29:11 -0400 Subject: [PATCH 1207/1252] provider: Migrate to iamwaiter.PropagationTimeout constant and begin enabling go-mnd linter (#17811) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/13199 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16752 Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16753 IAM eventual consistency handling has long been the source of needing retries in resource logic. Due to the lack of a consistent implementation (e.g. static constant) for how long to retry for these types of errors, there have been varying retry durations. The `iamwaiter.PropagationTimeout` constant was introduced for this purpose. This change begins by introducing the `go-mnd` linter to enforce the usage of constants in function arguments. Example reports below. The rest of the changes are the minimum required to ensure `iamwaiter.PropagationTimeout` with its 2 minute duration is applied. You will note that this is fixing the duration in some cases to slightly increase it to the standard value. Any higher durations are ignored to reduce changes for now. As such, this can be reviewed by validating that a lower duration was not introduced and skipping acceptance testing since no logic changes should be introduced. One caveat to `go-mnd` is that it currently ignores `1` as a magic number, which is possible in usage such as `1*time.Minute`, and that ignored number cannot be overriden. An upstream issue will be created to ask the `ignore-number` configuration to overwrite instead of append. Example previous report: ``` aws/resource_aws_api_gateway_account.go:99:23: mnd: Magic number: 2, in detected (gomnd) err = resource.Retry(2*time.Minute, func() *resource.RetryError { ^ ``` --- .golangci.yml | 127 ++++++++++++++++++ aws/resource_aws_api_gateway_account.go | 4 +- aws/resource_aws_appautoscaling_policy.go | 7 +- aws/resource_aws_appautoscaling_target.go | 3 +- aws/resource_aws_autoscaling_group.go | 3 +- aws/resource_aws_backup_selection.go | 4 +- aws/resource_aws_cloud9_environment_ec2.go | 3 +- aws/resource_aws_cloudtrail.go | 6 +- aws/resource_aws_codebuild_project.go | 3 +- aws/resource_aws_cognito_user_pool.go | 9 +- aws/resource_aws_config_config_rule.go | 3 +- aws/resource_aws_config_delivery_channel.go | 3 +- aws/resource_aws_datasync_location_s3.go | 4 +- aws/resource_aws_dax_cluster.go | 3 +- aws/resource_aws_db_instance.go | 5 +- aws/resource_aws_db_option_group.go | 3 +- aws/resource_aws_docdb_cluster.go | 5 +- aws/resource_aws_docdb_cluster_instance.go | 5 +- aws/resource_aws_ecr_repository_policy.go | 6 +- aws/resource_aws_eks_cluster.go | 3 +- aws/resource_aws_elasticsearch_domain.go | 3 +- aws/resource_aws_emr_cluster.go | 3 +- aws/resource_aws_iam_instance_profile.go | 3 +- aws/resource_aws_iam_policy.go | 6 +- aws/resource_aws_iam_role.go | 2 +- aws/resource_aws_iam_user.go | 4 +- aws/resource_aws_iam_user_login_profile.go | 4 +- aws/resource_aws_instance.go | 7 +- ...ce_aws_lakeformation_data_lake_settings.go | 4 +- aws/resource_aws_lakeformation_permissions.go | 5 +- aws/resource_aws_launch_configuration.go | 3 +- aws/resource_aws_neptune_cluster.go | 3 +- aws/resource_aws_neptune_cluster_instance.go | 5 +- aws/resource_aws_opsworks_permission.go | 4 +- aws/resource_aws_rds_cluster.go | 5 +- aws/resource_aws_rds_cluster_instance.go | 5 +- aws/resource_aws_sns_platform_application.go | 4 +- aws/resource_aws_spot_instance_request.go | 3 +- 38 files changed, 217 insertions(+), 65 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8a6b2d0e9fd..49c3405dbe2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -18,6 +18,7 @@ linters: - deadcode - errcheck - gofmt + - gomnd - gosimple - ineffassign - makezero @@ -34,6 +35,132 @@ linters: linters-settings: errcheck: ignore: github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema:ForceNew|Set,fmt:.*,io:Close + gomnd: + settings: + mnd: + checks: + - argument + ignored-files: + # Needing constants, comment ignores, switching to customizable timeouts, or retries moved to aws/config.go + - awserr.go + - data_source_aws_cognito_user_pools.go + - data_source_aws_lakeformation_permissions.go + - resource_aws_api_gateway_base_path_mapping.go + - resource_aws_appautoscaling_policy.go + - resource_aws_appautoscaling_scheduled_action.go + - resource_aws_appautoscaling_target.go + - resource_aws_autoscaling_lifecycle_hook.go + - resource_aws_backup_plan.go + - resource_aws_cloud9_environment_ec2.go + - resource_aws_cloudfront_distribution.go + - resource_aws_cloudhsm2_cluster.go + - resource_aws_cloudhsm2_hsm.go + - resource_aws_cloudwatch_event_target.go + - resource_aws_cloudwatch_log_destination.go + - resource_aws_cloudwatch_log_stream.go + - resource_aws_cloudwatch_log_subscription_filter.go + - resource_aws_codebuild_project.go + - resource_aws_codedeploy_deployment_group.go + - resource_aws_codepipeline_webhook.go + - resource_aws_config_config_rule.go + - resource_aws_config_delivery_channel.go + - resource_aws_customer_gateway.ogresource_aws_elasticsearch_domain + - resource_aws_datapipeline_pipeline.go + - resource_aws_db_instance.go + - resource_aws_db_parameter_group.go + - resource_aws_dms_endpoint.go + - resource_aws_docdb_cluster.go + - resource_aws_docdb_cluster_parameter_group.go + - resource_aws_docdb_subnet_group.go + - resource_aws_dynamodb_table.go + - resource_aws_ebs_snapshot_copy.go + - resource_aws_ebs_volume.go + - resource_aws_ec2_transit_gateway.go + - resource_aws_ecs_cluster.go + - resource_aws_ecs_service.go + - resource_aws_efs_file_system.go + - resource_aws_efs_mount_target.go + - resource_aws_elastic_beanstalk_application.go + - resource_aws_elasticache_cluster.go + - resource_aws_elasticache_parameter_group.go + - resource_aws_elasticache_replication_group.go + - resource_aws_elasticache_security_group.go + - resource_aws_elasticache_subnet_group.go + - resource_aws_elasticsearch_domain.go + - resource_aws_elasticsearch_domain_policy.go + - resource_aws_elb.go + - resource_aws_elb_attachment.go + - resource_aws_gamelift_build.go + - resource_aws_gamelift_fleet.go + - resource_aws_glue_dev_endpoint.go + - resource_aws_iam_access_key.go + - resource_aws_iam_server_certificate.go + - resource_aws_inspector_assessment_target.go + - resource_aws_instance.go + - resource_aws_internet_gateway.go + - resource_aws_iot_thing_type.go + - resource_aws_kms_external_key.go + - resource_aws_kms_grant.go + - resource_aws_kms_key.go + - resource_aws_lakeformation_data_lake_settings.go + - resource_aws_lakeformation_permissions.go + - resource_aws_lambda_event_source_mapping.go + - resource_aws_lambda_function_event_invoke_config.go + - resource_aws_lambda_permission.go + - resource_aws_lb_listener.go + - resource_aws_lb_listener_rule.go + - resource_aws_lb_target_group_attachment.go + - resource_aws_media_package_channel.go + - resource_aws_media_store_container.go + - resource_aws_msk_cluster.go + - resource_aws_neptune_cluster.go + - resource_aws_neptune_parameter_group.go + - resource_aws_network_acl.go + - resource_aws_network_acl_rule.go + - resource_aws_opsworks_stack.go + - resource_aws_organizations_account.go + - resource_aws_organizations_organizational_unit.go + - resource_aws_organizations_policy.go + - resource_aws_organizations_policy_attachment.go + - resource_aws_qldb_ledger.go + - resource_aws_ram_resource_share_accepter.go + - resource_aws_rds_cluster.go + - resource_aws_rds_cluster_parameter_group.go + - resource_aws_redshift_cluster.go + - resource_aws_redshift_snapshot_copy_grant.go + - resource_aws_redshift_snapshot_schedule.go + - resource_aws_redshift_snapshot_schedule_association.go + - resource_aws_route_table.go + - resource_aws_route_table_association.go + - resource_aws_s3_bucket.go + - resource_aws_sagemaker_model.go + - resource_aws_sagemaker_notebook_instance.go + - resource_aws_security_group_rule.go + - resource_aws_sfn_state_machine.go + - resource_aws_sqs_queue.go + - resource_aws_storagegateway_cached_iscsi_volume.go + - resource_aws_storagegateway_stored_iscsi_volume.go + - resource_aws_transfer_server.go + - resource_aws_vpc.go + - resource_aws_vpc_dhcp_options.go + - resource_aws_vpc_peering_connection_options.go + - resource_aws_vpn_gateway.go + - resource_aws_wafregional_web_acl_association.go + - resource_aws_wafv2_ip_set.go + - resource_aws_wafv2_regex_pattern_set.go + - resource_aws_wafv2_rule_group.go + - resource_aws_wafv2_web_acl.go + - tls.go + - waf_token_handlers.go + - wafregional_token_handlers.go + ignored-functions: + # AWS Go SDK + - aws.Int64 + - request.ConstantWaiterDelay + - request.WithWaiterMaxAttempts + # Terraform Plugin SDK + - schema.DefaultTimeout + - validation.* run: timeout: 10m diff --git a/aws/resource_aws_api_gateway_account.go b/aws/resource_aws_api_gateway_account.go index d37b831bf93..ffa32fb3a46 100644 --- a/aws/resource_aws_api_gateway_account.go +++ b/aws/resource_aws_api_gateway_account.go @@ -3,12 +3,12 @@ package aws import ( "fmt" "log" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsApiGatewayAccount() *schema.Resource { @@ -96,7 +96,7 @@ func resourceAwsApiGatewayAccountUpdate(d *schema.ResourceData, meta interface{} otherErrMsg := "API Gateway could not successfully write to CloudWatch Logs using the ARN specified" var out *apigateway.Account var err error - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { out, err = conn.UpdateAccount(&input) if err != nil { diff --git a/aws/resource_aws_appautoscaling_policy.go b/aws/resource_aws_appautoscaling_policy.go index 351ef2239e3..4142fcd6e57 100644 --- a/aws/resource_aws_appautoscaling_policy.go +++ b/aws/resource_aws_appautoscaling_policy.go @@ -12,6 +12,7 @@ import ( "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" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsAppautoscalingPolicy() *schema.Resource { @@ -209,7 +210,7 @@ func resourceAwsAppautoscalingPolicyCreate(d *schema.ResourceData, meta interfac log.Printf("[DEBUG] ApplicationAutoScaling PutScalingPolicy: %#v", params) var resp *applicationautoscaling.PutScalingPolicyOutput - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.PutScalingPolicy(¶ms) if err != nil { @@ -301,7 +302,7 @@ func resourceAwsAppautoscalingPolicyUpdate(d *schema.ResourceData, meta interfac } log.Printf("[DEBUG] Application Autoscaling Update Scaling Policy: %#v", params) - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.PutScalingPolicy(¶ms) if err != nil { if isAWSErr(err, applicationautoscaling.ErrCodeFailedResourceAccessException, "") { @@ -341,7 +342,7 @@ func resourceAwsAppautoscalingPolicyDelete(d *schema.ResourceData, meta interfac ServiceNamespace: aws.String(d.Get("service_namespace").(string)), } log.Printf("[DEBUG] Deleting Application AutoScaling Policy opts: %#v", params) - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err = conn.DeleteScalingPolicy(¶ms) if isAWSErr(err, applicationautoscaling.ErrCodeFailedResourceAccessException, "") { diff --git a/aws/resource_aws_appautoscaling_target.go b/aws/resource_aws_appautoscaling_target.go index edda7e57d1a..b82bbfca54e 100644 --- a/aws/resource_aws_appautoscaling_target.go +++ b/aws/resource_aws_appautoscaling_target.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/applicationautoscaling" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsAppautoscalingTarget() *schema.Resource { @@ -72,7 +73,7 @@ func resourceAwsAppautoscalingTargetPut(d *schema.ResourceData, meta interface{} log.Printf("[DEBUG] Application autoscaling target create configuration %s", targetOpts) var err error - err = resource.Retry(1*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err = conn.RegisterScalableTarget(&targetOpts) if err != nil { diff --git a/aws/resource_aws_autoscaling_group.go b/aws/resource_aws_autoscaling_group.go index 7e8f76d5a9d..2bc6b442d98 100644 --- a/aws/resource_aws_autoscaling_group.go +++ b/aws/resource_aws_autoscaling_group.go @@ -26,6 +26,7 @@ import ( "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/autoscaling/waiter" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) const ( @@ -735,7 +736,7 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Auto Scaling Group create configuration: %#v", createOpts) // Retry for IAM eventual consistency - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.CreateAutoScalingGroup(&createOpts) // ValidationError: You must use a valid fully-formed launch template. Value (tf-acc-test-6643732652421074386) for parameter iamInstanceProfile.name is invalid. Invalid IAM Instance Profile name diff --git a/aws/resource_aws_backup_selection.go b/aws/resource_aws_backup_selection.go index 483ddf0d8bd..3aa4358e645 100644 --- a/aws/resource_aws_backup_selection.go +++ b/aws/resource_aws_backup_selection.go @@ -5,13 +5,13 @@ import ( "log" "regexp" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" "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" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsBackupSelection() *schema.Resource { @@ -98,7 +98,7 @@ func resourceAwsBackupSelectionCreate(d *schema.ResourceData, meta interface{}) // Retry for IAM eventual consistency var output *backup.CreateBackupSelectionOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error output, err = conn.CreateBackupSelection(input) diff --git a/aws/resource_aws_cloud9_environment_ec2.go b/aws/resource_aws_cloud9_environment_ec2.go index 7913cd01403..f6c0be29615 100644 --- a/aws/resource_aws_cloud9_environment_ec2.go +++ b/aws/resource_aws_cloud9_environment_ec2.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsCloud9EnvironmentEc2() *schema.Resource { @@ -91,7 +92,7 @@ func resourceAwsCloud9EnvironmentEc2Create(d *schema.ResourceData, meta interfac } var out *cloud9.CreateEnvironmentEC2Output - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error out, err = conn.CreateEnvironmentEC2(params) if err != nil { diff --git a/aws/resource_aws_cloudtrail.go b/aws/resource_aws_cloudtrail.go index 7f06c7786ab..c7ead9cd092 100644 --- a/aws/resource_aws_cloudtrail.go +++ b/aws/resource_aws_cloudtrail.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudtrail" @@ -11,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsCloudTrail() *schema.Resource { @@ -192,7 +192,7 @@ func resourceAwsCloudTrailCreate(d *schema.ResourceData, meta interface{}) error } var t *cloudtrail.CreateTrailOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error t, err = conn.CreateTrail(&input) if err != nil { @@ -377,7 +377,7 @@ func resourceAwsCloudTrailUpdate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Updating CloudTrail: %s", input) var t *cloudtrail.UpdateTrailOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error t, err = conn.UpdateTrail(&input) if err != nil { diff --git a/aws/resource_aws_codebuild_project.go b/aws/resource_aws_codebuild_project.go index e082891d3a9..ea7bdb8d66c 100644 --- a/aws/resource_aws_codebuild_project.go +++ b/aws/resource_aws_codebuild_project.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsCodeBuildProject() *schema.Resource { @@ -1232,7 +1233,7 @@ func resourceAwsCodeBuildProjectUpdate(d *schema.ResourceData, meta interface{}) params.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CodebuildTags() // Handle IAM eventual consistency - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error _, err = conn.UpdateProject(params) diff --git a/aws/resource_aws_cognito_user_pool.go b/aws/resource_aws_cognito_user_pool.go index d4c62a7f92f..87a63e637f5 100644 --- a/aws/resource_aws_cognito_user_pool.go +++ b/aws/resource_aws_cognito_user_pool.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsCognitoUserPool() *schema.Resource { @@ -692,7 +693,7 @@ func resourceAwsCognitoUserPoolCreate(d *schema.ResourceData, meta interface{}) // IAM roles & policies can take some time to propagate and be attached // to the User Pool var resp *cognitoidentityprovider.CreateUserPoolOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateUserPool(params) if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { @@ -735,7 +736,7 @@ func resourceAwsCognitoUserPoolCreate(d *schema.ResourceData, meta interface{}) } // IAM Roles and Policies can take some time to propagate - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.SetUserPoolMfaConfig(input) if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { @@ -923,7 +924,7 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{}) } // IAM Roles and Policies can take some time to propagate - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.SetUserPoolMfaConfig(input) if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { @@ -1124,7 +1125,7 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{}) // IAM roles & policies can take some time to propagate and be attached // to the User Pool. - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error _, err = conn.UpdateUserPool(params) if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { diff --git a/aws/resource_aws_config_config_rule.go b/aws/resource_aws_config_config_rule.go index bb0e37e1df7..603dcc3ce34 100644 --- a/aws/resource_aws_config_config_rule.go +++ b/aws/resource_aws_config_config_rule.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsConfigConfigRule() *schema.Resource { @@ -166,7 +167,7 @@ func resourceAwsConfigConfigRulePut(d *schema.ResourceData, meta interface{}) er Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ConfigserviceTags(), } log.Printf("[DEBUG] Creating AWSConfig config rule: %s", input) - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.PutConfigRule(&input) if err != nil { if awsErr, ok := err.(awserr.Error); ok { diff --git a/aws/resource_aws_config_delivery_channel.go b/aws/resource_aws_config_delivery_channel.go index 3aa759362a9..de55d601472 100644 --- a/aws/resource_aws_config_delivery_channel.go +++ b/aws/resource_aws_config_delivery_channel.go @@ -11,6 +11,7 @@ import ( "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" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsConfigDeliveryChannel() *schema.Resource { @@ -92,7 +93,7 @@ func resourceAwsConfigDeliveryChannelPut(d *schema.ResourceData, meta interface{ input := configservice.PutDeliveryChannelInput{DeliveryChannel: &channel} - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.PutDeliveryChannel(&input) if err == nil { return nil diff --git a/aws/resource_aws_datasync_location_s3.go b/aws/resource_aws_datasync_location_s3.go index 68a348abf6c..472fdc34d8e 100644 --- a/aws/resource_aws_datasync_location_s3.go +++ b/aws/resource_aws_datasync_location_s3.go @@ -4,7 +4,6 @@ import ( "fmt" "log" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" @@ -12,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDataSyncLocationS3() *schema.Resource { @@ -88,7 +88,7 @@ func resourceAwsDataSyncLocationS3Create(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Creating DataSync Location S3: %s", input) var output *datasync.CreateLocationS3Output - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error output, err = conn.CreateLocationS3(input) diff --git a/aws/resource_aws_dax_cluster.go b/aws/resource_aws_dax_cluster.go index dc9cded4b39..7382a03c3b2 100644 --- a/aws/resource_aws_dax_cluster.go +++ b/aws/resource_aws_dax_cluster.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDaxCluster() *schema.Resource { @@ -224,7 +225,7 @@ func resourceAwsDaxClusterCreate(d *schema.ResourceData, meta interface{}) error // IAM roles take some time to propagate var resp *dax.CreateClusterOutput - err := resource.Retry(30*time.Second, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateCluster(req) if err != nil { diff --git a/aws/resource_aws_db_instance.go b/aws/resource_aws_db_instance.go index 47cb831d8c0..58a62640689 100644 --- a/aws/resource_aws_db_instance.go +++ b/aws/resource_aws_db_instance.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDbInstance() *schema.Resource { @@ -832,7 +833,7 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] DB Instance S3 Restore configuration: %#v", opts) var err error // Retry for IAM eventual consistency - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err = conn.RestoreDBInstanceFromS3(&opts) if err != nil { if isAWSErr(err, "InvalidParameterValue", "ENHANCED_MONITORING") { @@ -1758,7 +1759,7 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error if requestUpdate { log.Printf("[DEBUG] DB Instance Modification request: %s", req) - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.ModifyDBInstance(req) // Retry for IAM eventual consistency diff --git a/aws/resource_aws_db_option_group.go b/aws/resource_aws_db_option_group.go index 8be2e0e2cc9..067cbd8a54c 100644 --- a/aws/resource_aws_db_option_group.go +++ b/aws/resource_aws_db_option_group.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDbOptionGroup() *schema.Resource { @@ -268,7 +269,7 @@ func resourceAwsDbOptionGroupUpdate(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Modify DB Option Group: %s", modifyOpts) - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error _, err = rdsconn.ModifyOptionGroup(modifyOpts) diff --git a/aws/resource_aws_docdb_cluster.go b/aws/resource_aws_docdb_cluster.go index 9170efd0acf..0fc7936aa54 100644 --- a/aws/resource_aws_docdb_cluster.go +++ b/aws/resource_aws_docdb_cluster.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDocDBCluster() *schema.Resource { @@ -336,7 +337,7 @@ func resourceAwsDocDBClusterCreate(d *schema.ResourceData, meta interface{}) err } log.Printf("[DEBUG] DocDB Cluster restore from snapshot configuration: %s", opts) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.RestoreDBClusterFromSnapshot(&opts) if err != nil { if isAWSErr(err, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") { @@ -420,7 +421,7 @@ func resourceAwsDocDBClusterCreate(d *schema.ResourceData, meta interface{}) err log.Printf("[DEBUG] DocDB Cluster create options: %s", createOpts) var resp *docdb.CreateDBClusterOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateDBCluster(createOpts) if err != nil { diff --git a/aws/resource_aws_docdb_cluster_instance.go b/aws/resource_aws_docdb_cluster_instance.go index ba2fff4205d..0aeb939cab3 100644 --- a/aws/resource_aws_docdb_cluster_instance.go +++ b/aws/resource_aws_docdb_cluster_instance.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsDocDBClusterInstance() *schema.Resource { @@ -208,7 +209,7 @@ func resourceAwsDocDBClusterInstanceCreate(d *schema.ResourceData, meta interfac log.Printf("[DEBUG] Creating DocDB Instance opts: %s", createOpts) var resp *docdb.CreateDBInstanceOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateDBInstance(createOpts) if err != nil { @@ -366,7 +367,7 @@ func resourceAwsDocDBClusterInstanceUpdate(d *schema.ResourceData, meta interfac log.Printf("[DEBUG] Send DB Instance Modification request: %#v", requestUpdate) if requestUpdate { log.Printf("[DEBUG] DB Instance Modification request: %#v", req) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.ModifyDBInstance(req) if err != nil { if isAWSErr(err, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") { diff --git a/aws/resource_aws_ecr_repository_policy.go b/aws/resource_aws_ecr_repository_policy.go index 53d0c2e9859..f5d9e92eef8 100644 --- a/aws/resource_aws_ecr_repository_policy.go +++ b/aws/resource_aws_ecr_repository_policy.go @@ -3,13 +3,13 @@ package aws import ( "fmt" "log" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "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" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsEcrRepositoryPolicy() *schema.Resource { @@ -55,7 +55,7 @@ func resourceAwsEcrRepositoryPolicyPut(d *schema.ResourceData, meta interface{}) // Retry due to IAM eventual consistency var err error var out *ecr.SetRepositoryPolicyOutput - err = resource.Retry(2*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { out, err = conn.SetRepositoryPolicy(&input) if isAWSErr(err, ecr.ErrCodeInvalidParameterException, "Invalid repository policy provided") { @@ -97,7 +97,7 @@ func resourceAwsEcrRepositoryPolicyRead(d *schema.ResourceData, meta interface{} return err } - log.Printf("[DEBUG] Received repository policy %#v", out) + log.Printf("[DEBUG] Received repository policy %s", out) d.Set("repository", out.RepositoryName) d.Set("registry_id", out.RegistryId) diff --git a/aws/resource_aws_eks_cluster.go b/aws/resource_aws_eks_cluster.go index 845a95646f0..6bacbd44ded 100644 --- a/aws/resource_aws_eks_cluster.go +++ b/aws/resource_aws_eks_cluster.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsEksCluster() *schema.Resource { @@ -250,7 +251,7 @@ func resourceAwsEksClusterCreate(d *schema.ResourceData, meta interface{}) error } log.Printf("[DEBUG] Creating EKS Cluster: %s", input) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.CreateCluster(input) if err != nil { // InvalidParameterException: roleArn, arn:aws:iam::123456789012:role/XXX, does not exist diff --git a/aws/resource_aws_elasticsearch_domain.go b/aws/resource_aws_elasticsearch_domain.go index 83c38f2bde5..2918414b37d 100644 --- a/aws/resource_aws_elasticsearch_domain.go +++ b/aws/resource_aws_elasticsearch_domain.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsElasticSearchDomain() *schema.Resource { @@ -551,7 +552,7 @@ func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface // IAM Roles can take some time to propagate if set in AccessPolicies and created in the same terraform var out *elasticsearch.CreateElasticsearchDomainOutput - err = resource.Retry(30*time.Second, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error out, err = conn.CreateElasticsearchDomain(&input) if err != nil { diff --git a/aws/resource_aws_emr_cluster.go b/aws/resource_aws_emr_cluster.go index 0d171a2d31c..0b028fa250c 100644 --- a/aws/resource_aws_emr_cluster.go +++ b/aws/resource_aws_emr_cluster.go @@ -20,6 +20,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsEMRCluster() *schema.Resource { @@ -901,7 +902,7 @@ func resourceAwsEMRClusterCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] EMR Cluster create options: %s", params) var resp *emr.RunJobFlowOutput - err := resource.Retry(30*time.Second, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.RunJobFlow(params) if err != nil { diff --git a/aws/resource_aws_iam_instance_profile.go b/aws/resource_aws_iam_instance_profile.go index 4a0f5217a0c..0dc6969d953 100644 --- a/aws/resource_aws_iam_instance_profile.go +++ b/aws/resource_aws_iam_instance_profile.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsIamInstanceProfile() *schema.Resource { @@ -120,7 +121,7 @@ func instanceProfileAddRole(conn *iam.IAM, profileName, roleName string) error { RoleName: aws.String(roleName), } - err := resource.Retry(30*time.Second, func() *resource.RetryError { + err := resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error _, err = conn.AddRoleToInstanceProfile(request) // IAM unfortunately does not provide a better error code or message for eventual consistency diff --git a/aws/resource_aws_iam_policy.go b/aws/resource_aws_iam_policy.go index 0a44f36cabc..6feee9a8cbe 100644 --- a/aws/resource_aws_iam_policy.go +++ b/aws/resource_aws_iam_policy.go @@ -5,13 +5,13 @@ import ( "log" "net/url" "regexp" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" "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/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsIamPolicy() *schema.Resource { @@ -110,7 +110,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { // Handle IAM eventual consistency var getPolicyResponse *iam.GetPolicyOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error getPolicyResponse, err = iamconn.GetPolicy(getPolicyRequest) @@ -158,7 +158,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { // Handle IAM eventual consistency var getPolicyVersionResponse *iam.GetPolicyVersionOutput - err = resource.Retry(1*time.Minute, func() *resource.RetryError { + err = resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error getPolicyVersionResponse, err = iamconn.GetPolicyVersion(getPolicyVersionRequest) diff --git a/aws/resource_aws_iam_role.go b/aws/resource_aws_iam_role.go index b2451459085..7283032dd8e 100644 --- a/aws/resource_aws_iam_role.go +++ b/aws/resource_aws_iam_role.go @@ -187,7 +187,7 @@ func resourceAwsIamRoleCreate(d *schema.ResourceData, meta interface{}) error { } var createResp *iam.CreateRoleOutput - err := resource.Retry(30*time.Second, func() *resource.RetryError { + err := resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error createResp, err = iamconn.CreateRole(request) // IAM users (referenced in Principal field of assume policy) diff --git a/aws/resource_aws_iam_user.go b/aws/resource_aws_iam_user.go index d5b3fa4d5b9..e0797d0685c 100644 --- a/aws/resource_aws_iam_user.go +++ b/aws/resource_aws_iam_user.go @@ -4,7 +4,6 @@ import ( "fmt" "log" "regexp" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" @@ -12,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsIamUser() *schema.Resource { @@ -381,7 +381,7 @@ func deleteAwsIamUserLoginProfile(svc *iam.IAM, username string) error { input := &iam.DeleteLoginProfileInput{ UserName: aws.String(username), } - err = resource.Retry(1*time.Minute, func() *resource.RetryError { + err = resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { _, err = svc.DeleteLoginProfile(input) if err != nil { if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { diff --git a/aws/resource_aws_iam_user_login_profile.go b/aws/resource_aws_iam_user_login_profile.go index 45373c73985..da557e85d36 100644 --- a/aws/resource_aws_iam_user_login_profile.go +++ b/aws/resource_aws_iam_user_login_profile.go @@ -8,7 +8,6 @@ import ( "log" "math/big" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" @@ -16,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/encryption" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" ) func resourceAwsIamUserLoginProfile() *schema.Resource { @@ -199,7 +199,7 @@ func resourceAwsIamUserLoginProfileDelete(d *schema.ResourceData, meta interface log.Printf("[DEBUG] Deleting IAM User Login Profile (%s): %s", d.Id(), input) // Handle IAM eventual consistency - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.DeleteLoginProfile(input) if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { diff --git a/aws/resource_aws_instance.go b/aws/resource_aws_instance.go index 9e4678df182..712e905e27d 100644 --- a/aws/resource_aws_instance.go +++ b/aws/resource_aws_instance.go @@ -24,6 +24,7 @@ import ( tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" tfiam "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) @@ -628,7 +629,7 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Run configuration: %s", runOpts) var runResp *ec2.Reservation - err = resource.Retry(30*time.Second, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error runResp, err = conn.RunInstances(runOpts) // IAM instance profiles can take ~10 seconds to propagate in AWS: @@ -1092,7 +1093,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { return err } } else { - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.ReplaceIamInstanceProfileAssociation(input) if err != nil { if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { @@ -1716,7 +1717,7 @@ func associateInstanceProfile(d *schema.ResourceData, conn *ec2.EC2) error { Name: aws.String(d.Get("iam_instance_profile").(string)), }, } - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.AssociateIamInstanceProfile(input) if err != nil { if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { diff --git a/aws/resource_aws_lakeformation_data_lake_settings.go b/aws/resource_aws_lakeformation_data_lake_settings.go index 9ba78871847..6ea8926796e 100644 --- a/aws/resource_aws_lakeformation_data_lake_settings.go +++ b/aws/resource_aws_lakeformation_data_lake_settings.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lakeformation" @@ -12,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsLakeFormationDataLakeSettings() *schema.Resource { @@ -132,7 +132,7 @@ func resourceAwsLakeFormationDataLakeSettingsCreate(d *schema.ResourceData, meta input.DataLakeSettings = settings var output *lakeformation.PutDataLakeSettingsOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error output, err = conn.PutDataLakeSettings(input) if err != nil { diff --git a/aws/resource_aws_lakeformation_permissions.go b/aws/resource_aws_lakeformation_permissions.go index d350782e6a3..1a4ed699153 100644 --- a/aws/resource_aws_lakeformation_permissions.go +++ b/aws/resource_aws_lakeformation_permissions.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsLakeFormationPermissions() *schema.Resource { @@ -200,7 +201,7 @@ func resourceAwsLakeFormationPermissionsCreate(d *schema.ResourceData, meta inte input.Resource = expandLakeFormationResource(d, false) var output *lakeformation.GrantPermissionsOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error output, err = conn.GrantPermissions(input) if err != nil { @@ -263,7 +264,7 @@ func resourceAwsLakeFormationPermissionsRead(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Reading Lake Formation permissions: %v", input) var principalResourcePermissions []*lakeformation.PrincipalResourcePermissions - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { err := conn.ListPermissionsPages(input, func(resp *lakeformation.ListPermissionsOutput, lastPage bool) bool { for _, permission := range resp.PrincipalResourcePermissions { if permission == nil { diff --git a/aws/resource_aws_launch_configuration.go b/aws/resource_aws_launch_configuration.go index d01e25da7ec..c4d7bc8c525 100644 --- a/aws/resource_aws_launch_configuration.go +++ b/aws/resource_aws_launch_configuration.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/hashcode" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsLaunchConfiguration() *schema.Resource { @@ -515,7 +516,7 @@ func resourceAwsLaunchConfigurationCreate(d *schema.ResourceData, meta interface // IAM profiles can take ~10 seconds to propagate in AWS: // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console - err = resource.Retry(90*time.Second, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := autoscalingconn.CreateLaunchConfiguration(&createLaunchConfigurationOpts) if err != nil { if isAWSErr(err, "ValidationError", "Invalid IamInstanceProfile") { diff --git a/aws/resource_aws_neptune_cluster.go b/aws/resource_aws_neptune_cluster.go index 3272ff27702..dae385de1e9 100644 --- a/aws/resource_aws_neptune_cluster.go +++ b/aws/resource_aws_neptune_cluster.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) const ( @@ -372,7 +373,7 @@ func resourceAwsNeptuneClusterCreate(d *schema.ResourceData, meta interface{}) e log.Printf("[DEBUG] Neptune Cluster create options: %s", createDbClusterInput) } - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error if restoreDBClusterFromSnapshot { _, err = conn.RestoreDBClusterFromSnapshot(restoreDBClusterFromSnapshotInput) diff --git a/aws/resource_aws_neptune_cluster_instance.go b/aws/resource_aws_neptune_cluster_instance.go index e1ea9f1ce66..29364e81309 100644 --- a/aws/resource_aws_neptune_cluster_instance.go +++ b/aws/resource_aws_neptune_cluster_instance.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsNeptuneClusterInstance() *schema.Resource { @@ -237,7 +238,7 @@ func resourceAwsNeptuneClusterInstanceCreate(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Creating Neptune Instance: %s", createOpts) var resp *neptune.CreateDBInstanceOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateDBInstance(createOpts) if err != nil { @@ -405,7 +406,7 @@ func resourceAwsNeptuneClusterInstanceUpdate(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Send Neptune Instance Modification request: %#v", requestUpdate) if requestUpdate { log.Printf("[DEBUG] Neptune Instance Modification request: %#v", req) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.ModifyDBInstance(req) if err != nil { if isAWSErr(err, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") { diff --git a/aws/resource_aws_opsworks_permission.go b/aws/resource_aws_opsworks_permission.go index 03b0700717f..3a9a73ae1f5 100644 --- a/aws/resource_aws_opsworks_permission.go +++ b/aws/resource_aws_opsworks_permission.go @@ -2,7 +2,6 @@ package aws import ( "log" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -10,6 +9,7 @@ import ( "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" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsOpsworksPermission() *schema.Resource { @@ -120,7 +120,7 @@ func resourceAwsOpsworksSetPermission(d *schema.ResourceData, meta interface{}) req.Level = aws.String(d.Get("level").(string)) } - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := client.SetPermission(req) if err != nil { diff --git a/aws/resource_aws_rds_cluster.go b/aws/resource_aws_rds_cluster.go index 0c31295da32..db0ea10ffb4 100644 --- a/aws/resource_aws_rds_cluster.go +++ b/aws/resource_aws_rds_cluster.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) const ( @@ -569,7 +570,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error } log.Printf("[DEBUG] RDS Cluster restore from snapshot configuration: %s", opts) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.RestoreDBClusterFromSnapshot(&opts) if err != nil { if isAWSErr(err, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") { @@ -899,7 +900,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] RDS Cluster create options: %s", createOpts) var resp *rds.CreateDBClusterOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateDBCluster(createOpts) if err != nil { diff --git a/aws/resource_aws_rds_cluster_instance.go b/aws/resource_aws_rds_cluster_instance.go index da8ba953b0c..7db2fa2759c 100644 --- a/aws/resource_aws_rds_cluster_instance.go +++ b/aws/resource_aws_rds_cluster_instance.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsRDSClusterInstance() *schema.Resource { @@ -282,7 +283,7 @@ func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Creating RDS DB Instance opts: %s", createOpts) var resp *rds.CreateDBInstanceOutput - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { var err error resp, err = conn.CreateDBInstance(createOpts) if err != nil { @@ -548,7 +549,7 @@ func resourceAwsRDSClusterInstanceUpdate(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Send DB Instance Modification request: %#v", requestUpdate) if requestUpdate { log.Printf("[DEBUG] DB Instance Modification request: %#v", req) - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := conn.ModifyDBInstance(req) if err != nil { if isAWSErr(err, "InvalidParameterValue", "IAM role ARN value is invalid or does not include the required permissions") { diff --git a/aws/resource_aws_sns_platform_application.go b/aws/resource_aws_sns_platform_application.go index ce5628222ff..a017c3df893 100644 --- a/aws/resource_aws_sns_platform_application.go +++ b/aws/resource_aws_sns_platform_application.go @@ -6,13 +6,13 @@ import ( "fmt" "log" "strings" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/sns" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) var snsPlatformRequiresPlatformPrincipal = map[string]bool{ @@ -180,7 +180,7 @@ func resourceAwsSnsPlatformApplicationUpdate(d *schema.ResourceData, meta interf Attributes: attributes, } - err := resource.Retry(1*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { _, err := snsconn.SetPlatformApplicationAttributes(req) if err != nil { if isAWSErr(err, sns.ErrCodeInvalidParameterException, "is not a valid role to allow SNS to write to Cloudwatch Logs") { diff --git a/aws/resource_aws_spot_instance_request.go b/aws/resource_aws_spot_instance_request.go index 9a140e94acb..dbd94290211 100644 --- a/aws/resource_aws_spot_instance_request.go +++ b/aws/resource_aws_spot_instance_request.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) func resourceAwsSpotInstanceRequest() *schema.Resource { @@ -188,7 +189,7 @@ func resourceAwsSpotInstanceRequestCreate(d *schema.ResourceData, meta interface log.Printf("[DEBUG] Requesting spot bid opts: %s", spotOpts) var resp *ec2.RequestSpotInstancesOutput - err = resource.Retry(1*time.Minute, func() *resource.RetryError { + err = resource.Retry(iamwaiter.PropagationTimeout, func() *resource.RetryError { resp, err = conn.RequestSpotInstances(spotOpts) // IAM instance profiles can take ~10 seconds to propagate in AWS: // http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html#launch-instance-with-role-console From a59bcfaafa6f64a94b9afa2357c9ba7403153987 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 26 Mar 2021 11:29:58 -0400 Subject: [PATCH 1208/1252] tests/provider: Fix and enable AWS SDK Go pointer conversion linting (T-W resources) (#18353) Reference: https://github.com/hashicorp/terraform-provider-aws/issues/12992 Previously: ``` aws/resource_aws_transfer_ssh_key.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 101: body = *s.SshPublicKeyBody -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 100: if sshKeyID == *s.SshPublicKeyId { aws/resource_aws_volume_attachment.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 179: if a.InstanceId != nil && *a.InstanceId == instanceID { -------------------------------------------------------------------------------- 215: if len(vols.Volumes) == 0 || *vols.Volumes[0].State == ec2.VolumeStateAvailable { aws/resource_aws_vpc.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 339: classiclink_enabled = *v.ClassicLinkEnabled -------------------------------------------------------------------------------- 364: classiclinkdns_enabled = *v.ClassicLinkDnsSupported -------------------------------------------------------------------------------- severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 337: if *v.VpcId == vpcid { -------------------------------------------------------------------------------- 362: if *v.VpcId == vpcid { aws/resource_aws_vpc_peering_connection.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 146: if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) { -------------------------------------------------------------------------------- 146: if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) { aws/resource_aws_vpn_connection_route.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 158: if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" { -------------------------------------------------------------------------------- 158: if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" { aws/resource_aws_vpn_gateway_route_propagation.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-conditional: Prefer AWS Go SDK pointer conversion functions for dereferencing during conditionals, e.g. aws.StringValue() 90: if *vgw.GatewayId == gwID { aws/resource_aws_waf_sql_injection_match_set.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 179: m["text_transformation"] = *t.TextTransformation aws/resource_aws_wafregional_rule.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 228: m["negated"] = *p.Negated -------------------------------------------------------------------------------- 229: m["type"] = *p.Type -------------------------------------------------------------------------------- 230: m["data_id"] = *p.DataId aws/resource_aws_workspaces_ip_group.go severity:warning rule:prefer-aws-go-sdk-pointer-conversion-assignment: Prefer AWS Go SDK pointer conversion functions for dereferencing during assignment, e.g. aws.StringValue() 219: r["description"] = *rule.RuleDesc ran 15 rules on 2163 files: 18 findings ``` Output from acceptance testing: ``` --- PASS: TestAccAWSTransferSshKey_basic (172.65s) --- PASS: TestAccAWSVolumeAttachment_attachStopped (379.45s) --- PASS: TestAccAWSVolumeAttachment_basic (137.33s) --- PASS: TestAccAWSVolumeAttachment_disappears (127.64s) --- PASS: TestAccAWSVolumeAttachment_skipDestroy (106.70s) --- PASS: TestAccAWSVolumeAttachment_update (117.94s) --- PASS: TestAccAWSVpc_AssignGeneratedIpv6CidrBlock (96.85s) --- PASS: TestAccAWSVpc_basic (35.87s) --- PASS: TestAccAWSVpc_bothDnsOptionsSet (45.41s) --- PASS: TestAccAWSVpc_classiclinkDnsSupportOptionSet (39.09s) --- PASS: TestAccAWSVpc_classiclinkOptionSet (38.76s) --- PASS: TestAccAWSVpc_coreMismatchedDiffs (30.39s) --- PASS: TestAccAWSVpc_defaultAndIgnoreTags (69.04s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_duplicateTag (5.12s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_nonOverlappingTag (74.60s) --- PASS: TestAccAWSVpc_defaultTags_providerAndResource_overlappingTag (77.40s) --- PASS: TestAccAWSVpc_defaultTags_providerOnly (74.67s) --- PASS: TestAccAWSVpc_defaultTags_updateToProviderOnly (53.56s) --- PASS: TestAccAWSVpc_defaultTags_updateToResourceOnly (54.07s) --- PASS: TestAccAWSVpc_DisabledDnsSupport (44.39s) --- PASS: TestAccAWSVpc_disappears (21.95s) --- PASS: TestAccAWSVpc_ignoreTags (69.04s) --- PASS: TestAccAWSVpc_tags (79.06s) --- PASS: TestAccAWSVpc_Tenancy (77.06s) --- PASS: TestAccAWSVpc_update (58.54s) --- FAIL: TestAccAWSVPCPeeringConnection_region (39.86s) # https://github.com/hashicorp/terraform-provider-aws/issues/18348 --- PASS: TestAccAWSVPCPeeringConnection_accept (81.01s) --- PASS: TestAccAWSVPCPeeringConnection_basic (43.58s) --- PASS: TestAccAWSVPCPeeringConnection_failedState (18.09s) --- PASS: TestAccAWSVPCPeeringConnection_options (78.71s) --- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (30.00s) --- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (16.39s) --- PASS: TestAccAWSVPCPeeringConnection_plan (31.03s) --- PASS: TestAccAWSVPCPeeringConnection_tags (85.86s) --- PASS: TestAccAWSVpnConnectionRoute_basic (457.75s) --- PASS: TestAccAWSVPNGatewayRoutePropagation_basic (55.88s) --- PASS: TestAccAWSWafRegionalRule_basic (61.65s) --- PASS: TestAccAWSWafRegionalRule_changeNameForceNew (107.77s) --- PASS: TestAccAWSWafRegionalRule_changePredicates (103.24s) --- PASS: TestAccAWSWafRegionalRule_disappears (64.90s) --- PASS: TestAccAWSWafRegionalRule_noPredicates (44.78s) --- PASS: TestAccAWSWafRegionalRule_tags (97.70s) --- PASS: TestAccAWSWafSqlInjectionMatchSet_basic (21.90s) --- PASS: TestAccAWSWafSqlInjectionMatchSet_changeNameForceNew (38.62s) --- PASS: TestAccAWSWafSqlInjectionMatchSet_changeTuples (35.26s) --- PASS: TestAccAWSWafSqlInjectionMatchSet_disappears (16.76s) --- PASS: TestAccAWSWafSqlInjectionMatchSet_noTuples (20.81s) --- FAIL: TestAccAwsWorkspacesIpGroup_MultipleDirectories (612.05s) # https://github.com/hashicorp/terraform-provider-aws/issues/18352 --- PASS: TestAccAwsWorkspacesIpGroup_basic (44.84s) --- PASS: TestAccAwsWorkspacesIpGroup_disappears (24.70s) --- PASS: TestAccAwsWorkspacesIpGroup_tags (69.57s) ``` --- .semgrep.yml | 6 ------ aws/resource_aws_transfer_ssh_key.go | 4 ++-- aws/resource_aws_volume_attachment.go | 6 +++--- aws/resource_aws_vpc.go | 8 ++++---- aws/resource_aws_vpc_peering_connection.go | 2 +- aws/resource_aws_vpn_connection_route.go | 2 +- aws/resource_aws_vpn_gateway_route_propagation.go | 2 +- aws/resource_aws_waf_sql_injection_match_set.go | 2 +- aws/resource_aws_wafregional_rule.go | 6 +++--- aws/resource_aws_workspaces_ip_group.go | 12 ++++++++---- 10 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.semgrep.yml b/.semgrep.yml index 9fe7fe430bd..0a8c8c4a7e1 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -67,9 +67,6 @@ rules: - aws/resource_aws_o* - aws/resource_aws_r* - aws/resource_aws_s* - - aws/resource_aws_transfer_ssh_key.go - - aws/resource_aws_vpc.go - - aws/resource_aws_w* - aws/structure.go - aws/waf_helpers.go - aws/internal/generators/ @@ -104,9 +101,6 @@ rules: - aws/resource_aws_o*.go - aws/resource_aws_r*.go - aws/resource_aws_s*.go - - aws/resource_aws_transfer_ssh_key.go - - aws/resource_aws_v*.go - - aws/resource_aws_w* - aws/resource*_test.go - aws/structure.go - aws/internal/generators/ diff --git a/aws/resource_aws_transfer_ssh_key.go b/aws/resource_aws_transfer_ssh_key.go index 0711e41cd07..6689fc9e4fd 100644 --- a/aws/resource_aws_transfer_ssh_key.go +++ b/aws/resource_aws_transfer_ssh_key.go @@ -97,8 +97,8 @@ func resourceAwsTransferSshKeyRead(d *schema.ResourceData, meta interface{}) err var body string for _, s := range resp.User.SshPublicKeys { - if sshKeyID == *s.SshPublicKeyId { - body = *s.SshPublicKeyBody + if sshKeyID == aws.StringValue(s.SshPublicKeyId) { + body = aws.StringValue(s.SshPublicKeyBody) } } diff --git a/aws/resource_aws_volume_attachment.go b/aws/resource_aws_volume_attachment.go index 6f3bdc1a428..8d0514c9e4a 100644 --- a/aws/resource_aws_volume_attachment.go +++ b/aws/resource_aws_volume_attachment.go @@ -176,8 +176,8 @@ func volumeAttachmentStateRefreshFunc(conn *ec2.EC2, name, volumeID, instanceID if len(resp.Volumes) > 0 { v := resp.Volumes[0] for _, a := range v.Attachments { - if a.InstanceId != nil && *a.InstanceId == instanceID { - return a, *a.State, nil + if aws.StringValue(a.InstanceId) == instanceID { + return a, aws.StringValue(a.State), nil } } } @@ -212,7 +212,7 @@ func resourceAwsVolumeAttachmentRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error reading EC2 volume %s for instance: %s: %#v", d.Get("volume_id").(string), d.Get("instance_id").(string), err) } - if len(vols.Volumes) == 0 || *vols.Volumes[0].State == ec2.VolumeStateAvailable { + if len(vols.Volumes) == 0 || aws.StringValue(vols.Volumes[0].State) == ec2.VolumeStateAvailable { log.Printf("[DEBUG] Volume Attachment (%s) not found, removing from state", d.Id()) d.SetId("") } diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index 6fe280b4cf8..d27f34f4363 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -372,9 +372,9 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { } else { classiclink_enabled := false for _, v := range respClassiclink.Vpcs { - if *v.VpcId == vpcid { + if aws.StringValue(v.VpcId) == vpcid { if v.ClassicLinkEnabled != nil { - classiclink_enabled = *v.ClassicLinkEnabled + classiclink_enabled = aws.BoolValue(v.ClassicLinkEnabled) } break } @@ -397,9 +397,9 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { } else { classiclinkdns_enabled := false for _, v := range respClassiclinkDnsSupport.Vpcs { - if *v.VpcId == vpcid { + if aws.StringValue(v.VpcId) == vpcid { if v.ClassicLinkDnsSupported != nil { - classiclinkdns_enabled = *v.ClassicLinkDnsSupported + classiclinkdns_enabled = aws.BoolValue(v.ClassicLinkDnsSupported) } break } diff --git a/aws/resource_aws_vpc_peering_connection.go b/aws/resource_aws_vpc_peering_connection.go index 61a861903e5..430ba6a1202 100644 --- a/aws/resource_aws_vpc_peering_connection.go +++ b/aws/resource_aws_vpc_peering_connection.go @@ -143,7 +143,7 @@ func resourceAwsVPCPeeringRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Account ID %s, VPC PeerConn Requester %s, Accepter %s", client.accountid, *pc.RequesterVpcInfo.OwnerId, *pc.AccepterVpcInfo.OwnerId) - if (client.accountid == *pc.AccepterVpcInfo.OwnerId) && (client.accountid != *pc.RequesterVpcInfo.OwnerId) { + if (client.accountid == aws.StringValue(pc.AccepterVpcInfo.OwnerId)) && (client.accountid != aws.StringValue(pc.RequesterVpcInfo.OwnerId)) { // We're the accepter d.Set("peer_owner_id", pc.RequesterVpcInfo.OwnerId) d.Set("peer_vpc_id", pc.RequesterVpcInfo.VpcId) diff --git a/aws/resource_aws_vpn_connection_route.go b/aws/resource_aws_vpn_connection_route.go index 876e0543ec9..53a34d864bc 100644 --- a/aws/resource_aws_vpn_connection_route.go +++ b/aws/resource_aws_vpn_connection_route.go @@ -155,7 +155,7 @@ func findConnectionRoute(conn *ec2.EC2, cidrBlock, vpnConnectionId string) (*ec2 vpnConnection := resp.VpnConnections[0] for _, r := range vpnConnection.Routes { - if *r.DestinationCidrBlock == cidrBlock && *r.State != "deleted" { + if aws.StringValue(r.DestinationCidrBlock) == cidrBlock && aws.StringValue(r.State) != "deleted" { return r, nil } } diff --git a/aws/resource_aws_vpn_gateway_route_propagation.go b/aws/resource_aws_vpn_gateway_route_propagation.go index b1cc68b6fec..93d3031e78d 100644 --- a/aws/resource_aws_vpn_gateway_route_propagation.go +++ b/aws/resource_aws_vpn_gateway_route_propagation.go @@ -87,7 +87,7 @@ func resourceAwsVpnGatewayRoutePropagationRead(d *schema.ResourceData, meta inte rt := rtRaw.(*ec2.RouteTable) exists := false for _, vgw := range rt.PropagatingVgws { - if *vgw.GatewayId == gwID { + if aws.StringValue(vgw.GatewayId) == gwID { exists = true } } diff --git a/aws/resource_aws_waf_sql_injection_match_set.go b/aws/resource_aws_waf_sql_injection_match_set.go index 249d3781447..3322fbf6285 100644 --- a/aws/resource_aws_waf_sql_injection_match_set.go +++ b/aws/resource_aws_waf_sql_injection_match_set.go @@ -176,7 +176,7 @@ func flattenWafSqlInjectionMatchTuples(ts []*waf.SqlInjectionMatchTuple) []inter out := make([]interface{}, len(ts)) for i, t := range ts { m := make(map[string]interface{}) - m["text_transformation"] = *t.TextTransformation + m["text_transformation"] = aws.StringValue(t.TextTransformation) m["field_to_match"] = flattenFieldToMatch(t.FieldToMatch) out[i] = m } diff --git a/aws/resource_aws_wafregional_rule.go b/aws/resource_aws_wafregional_rule.go index 07febe60d2e..30786c36ff0 100644 --- a/aws/resource_aws_wafregional_rule.go +++ b/aws/resource_aws_wafregional_rule.go @@ -225,9 +225,9 @@ func flattenWafPredicates(ts []*waf.Predicate) []interface{} { out := make([]interface{}, len(ts)) for i, p := range ts { m := make(map[string]interface{}) - m["negated"] = *p.Negated - m["type"] = *p.Type - m["data_id"] = *p.DataId + m["negated"] = aws.BoolValue(p.Negated) + m["type"] = aws.StringValue(p.Type) + m["data_id"] = aws.StringValue(p.DataId) out[i] = m } return out diff --git a/aws/resource_aws_workspaces_ip_group.go b/aws/resource_aws_workspaces_ip_group.go index a4e813ebbae..01752026d87 100644 --- a/aws/resource_aws_workspaces_ip_group.go +++ b/aws/resource_aws_workspaces_ip_group.go @@ -212,12 +212,16 @@ func expandIpGroupRules(rules []interface{}) []*workspaces.IpRuleItem { func flattenIpGroupRules(rules []*workspaces.IpRuleItem) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(rules)) for _, rule := range rules { - r := map[string]interface{}{ - "source": *rule.IpRule, + r := map[string]interface{}{} + + if v := rule.IpRule; v != nil { + r["source"] = aws.StringValue(v) } - if rule.RuleDesc != nil { - r["description"] = *rule.RuleDesc + + if v := rule.RuleDesc; v != nil { + r["description"] = aws.StringValue(rule.RuleDesc) } + result = append(result, r) } return result From b02094faf2623d5774051f1527992113d5dd2bc7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 5 Jan 2021 17:11:20 -0500 Subject: [PATCH 1209/1252] r/aws_route_table: AWS Wavelength support. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteTable_ -timeout 120m === RUN TestAccAWSRouteTable_basic === PAUSE TestAccAWSRouteTable_basic === RUN TestAccAWSRouteTable_disappears === PAUSE TestAccAWSRouteTable_disappears === RUN TestAccAWSRouteTable_disappears_SubnetAssociation === PAUSE TestAccAWSRouteTable_disappears_SubnetAssociation === RUN TestAccAWSRouteTable_IPv4_To_InternetGateway === PAUSE TestAccAWSRouteTable_IPv4_To_InternetGateway === RUN TestAccAWSRouteTable_IPv4_To_Instance === PAUSE TestAccAWSRouteTable_IPv4_To_Instance === RUN TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRouteTable_tags === PAUSE TestAccAWSRouteTable_tags === RUN TestAccAWSRouteTable_RequireRouteDestination === PAUSE TestAccAWSRouteTable_RequireRouteDestination === RUN TestAccAWSRouteTable_RequireRouteTarget === PAUSE TestAccAWSRouteTable_RequireRouteTarget === RUN TestAccAWSRouteTable_Route_ConfigMode === PAUSE TestAccAWSRouteTable_Route_ConfigMode === RUN TestAccAWSRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSRouteTable_IPv4_To_TransitGateway === RUN TestAccAWSRouteTable_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRouteTable_IPv4_To_VpcEndpoint === RUN TestAccAWSRouteTable_IPv4_To_CarrierGateway === PAUSE TestAccAWSRouteTable_IPv4_To_CarrierGateway === RUN TestAccAWSRouteTable_IPv4_To_LocalGateway === PAUSE TestAccAWSRouteTable_IPv4_To_LocalGateway === RUN TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRouteTable_vgwRoutePropagation === PAUSE TestAccAWSRouteTable_vgwRoutePropagation === RUN TestAccAWSRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSRouteTable_ConditionalCidrBlock === RUN TestAccAWSRouteTable_IPv4_To_NatGateway === PAUSE TestAccAWSRouteTable_IPv4_To_NatGateway === RUN TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRouteTable_VpcMultipleCidrs === PAUSE TestAccAWSRouteTable_VpcMultipleCidrs === RUN TestAccAWSRouteTable_VpcClassicLink === PAUSE TestAccAWSRouteTable_VpcClassicLink === RUN TestAccAWSRouteTable_GatewayVpcEndpoint === PAUSE TestAccAWSRouteTable_GatewayVpcEndpoint === RUN TestAccAWSRouteTable_MultipleRoutes === PAUSE TestAccAWSRouteTable_MultipleRoutes === CONT TestAccAWSRouteTable_basic === CONT TestAccAWSRouteTable_IPv4_To_CarrierGateway --- PASS: TestAccAWSRouteTable_basic (22.53s) === CONT TestAccAWSRouteTable_MultipleRoutes --- PASS: TestAccAWSRouteTable_IPv4_To_CarrierGateway (27.08s) === CONT TestAccAWSRouteTable_GatewayVpcEndpoint --- PASS: TestAccAWSRouteTable_GatewayVpcEndpoint (38.31s) === CONT TestAccAWSRouteTable_VpcClassicLink --- PASS: TestAccAWSRouteTable_VpcClassicLink (22.43s) === CONT TestAccAWSRouteTable_VpcMultipleCidrs --- PASS: TestAccAWSRouteTable_VpcMultipleCidrs (44.06s) === CONT TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRouteTable_MultipleRoutes (167.25s) === CONT TestAccAWSRouteTable_IPv4_To_NatGateway --- PASS: TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached (64.25s) === CONT TestAccAWSRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSRouteTable_ConditionalCidrBlock (52.89s) === CONT TestAccAWSRouteTable_vgwRoutePropagation --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (65.65s) === CONT TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection (26.92s) === CONT TestAccAWSRouteTable_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRouteTable_IPv4_To_LocalGateway (1.76s) === CONT TestAccAWSRouteTable_tags --- PASS: TestAccAWSRouteTable_IPv4_To_NatGateway (216.05s) === CONT TestAccAWSRouteTable_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRouteTable_tags (69.02s) === CONT TestAccAWSRouteTable_IPv4_To_TransitGateway --- PASS: TestAccAWSRouteTable_IPv4_To_VpcEndpoint (297.37s) === CONT TestAccAWSRouteTable_Route_ConfigMode --- PASS: TestAccAWSRouteTable_Route_ConfigMode (70.12s) === CONT TestAccAWSRouteTable_RequireRouteTarget --- PASS: TestAccAWSRouteTable_RequireRouteTarget (11.79s) === CONT TestAccAWSRouteTable_RequireRouteDestination === CONT TestAccAWSRouteTable_IPv4_To_InternetGateway --- PASS: TestAccAWSRouteTable_IPv4_To_TransitGateway (411.37s) --- PASS: TestAccAWSRouteTable_IPv4_To_InternetGateway (64.50s) === CONT TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway --- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (47.10s) === CONT TestAccAWSRouteTable_IPv4_To_Instance --- PASS: TestAccAWSRouteTable_RequireRouteDestination (314.49s) === CONT TestAccAWSRouteTable_disappears_SubnetAssociation --- PASS: TestAccAWSRouteTable_disappears_SubnetAssociation (24.60s) === CONT TestAccAWSRouteTable_disappears --- PASS: TestAccAWSRouteTable_disappears (19.61s) --- PASS: TestAccAWSRouteTable_IPv4_To_Instance (324.26s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 1259.709s --- aws/resource_aws_route_table.go | 52 +++++++++++-- aws/resource_aws_route_table_test.go | 93 +++++++++++++++++++++++- website/docs/r/route_table.html.markdown | 4 +- 3 files changed, 140 insertions(+), 9 deletions(-) diff --git a/aws/resource_aws_route_table.go b/aws/resource_aws_route_table.go index 89e1c27cbee..3918c8b0837 100644 --- a/aws/resource_aws_route_table.go +++ b/aws/resource_aws_route_table.go @@ -8,6 +8,7 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -22,6 +23,7 @@ var routeTableValidDestinations = []string{ } var routeTableValidTargets = []string{ + "carrier_gateway_id", "egress_only_gateway_id", "gateway_id", "instance_id", @@ -67,6 +69,9 @@ func resourceAwsRouteTable() *schema.Resource { ConfigMode: schema.SchemaConfigModeAttr, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + /// + // Destinations. + /// "cidr_block": { Type: schema.TypeString, Optional: true, @@ -85,6 +90,14 @@ func resourceAwsRouteTable() *schema.Resource { ), }, + // + // Targets. + // + "carrier_gateway_id": { + Type: schema.TypeString, + Optional: true, + }, + "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -100,32 +113,32 @@ func resourceAwsRouteTable() *schema.Resource { Optional: true, }, - "nat_gateway_id": { + "local_gateway_id": { Type: schema.TypeString, Optional: true, }, - "local_gateway_id": { + "nat_gateway_id": { Type: schema.TypeString, Optional: true, }, - "transit_gateway_id": { + "network_interface_id": { Type: schema.TypeString, Optional: true, }, - "vpc_endpoint_id": { + "transit_gateway_id": { Type: schema.TypeString, Optional: true, }, - "vpc_peering_connection_id": { + "vpc_endpoint_id": { Type: schema.TypeString, Optional: true, }, - "network_interface_id": { + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, }, @@ -134,6 +147,11 @@ func resourceAwsRouteTable() *schema.Resource { Set: resourceAwsRouteTableHash, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "owner_id": { Type: schema.TypeString, Computed: true, @@ -231,6 +249,9 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { if r.DestinationIpv6CidrBlock != nil { m["ipv6_cidr_block"] = aws.StringValue(r.DestinationIpv6CidrBlock) } + if r.CarrierGatewayId != nil { + m["carrier_gateway_id"] = aws.StringValue(r.CarrierGatewayId) + } if r.EgressOnlyInternetGatewayId != nil { m["egress_only_gateway_id"] = aws.StringValue(r.EgressOnlyInternetGatewayId) } @@ -269,7 +290,16 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting tags: %w", err) } - d.Set("owner_id", rt.OwnerId) + ownerID := aws.StringValue(rt.OwnerId) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "ec2", + Region: meta.(*AWSClient).region, + AccountID: ownerID, + Resource: fmt.Sprintf("route-table/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("owner_id", ownerID) return nil } @@ -422,6 +452,10 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error opts.GatewayId = aws.String(s) } + if s, ok := m["carrier_gateway_id"].(string); ok && s != "" { + opts.CarrierGatewayId = aws.String(s) + } + if s, ok := m["egress_only_gateway_id"].(string); ok && s != "" { opts.EgressOnlyInternetGatewayId = aws.String(s) } @@ -559,6 +593,10 @@ func resourceAwsRouteTableHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } + if v, ok := m["carrier_gateway_id"]; ok { + buf.WriteString(fmt.Sprintf("%s-", v.(string))) + } + if v, ok := m["egress_only_gateway_id"]; ok { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } diff --git a/aws/resource_aws_route_table_test.go b/aws/resource_aws_route_table_test.go index c29749f0cc1..836c78fb46c 100644 --- a/aws/resource_aws_route_table_test.go +++ b/aws/resource_aws_route_table_test.go @@ -158,6 +158,7 @@ func TestAccAWSRouteTable_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -240,6 +241,7 @@ func TestAccAWSRouteTable_IPv4_To_InternetGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "2"), @@ -254,6 +256,7 @@ func TestAccAWSRouteTable_IPv4_To_InternetGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "2"), @@ -291,6 +294,7 @@ func TestAccAWSRouteTable_IPv4_To_Instance(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -327,6 +331,7 @@ func TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -427,7 +432,7 @@ func TestAccAWSRouteTable_RequireRouteTarget(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccRouteTableConfigNoTarget(rName), - ExpectError: regexp.MustCompile("error creating route: one of `egress_only_gateway_id"), + ExpectError: regexp.MustCompile(`error creating route: one of .*\begress_only_gateway_id\b`), }, }, }) @@ -452,6 +457,7 @@ func TestAccAWSRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "2"), @@ -471,6 +477,7 @@ func TestAccAWSRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "2"), @@ -490,6 +497,7 @@ func TestAccAWSRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -524,6 +532,7 @@ func TestAccAWSRouteTable_IPv4_To_TransitGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -559,6 +568,7 @@ func TestAccAWSRouteTable_IPv4_To_VpcEndpoint(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -576,6 +586,41 @@ func TestAccAWSRouteTable_IPv4_To_VpcEndpoint(t *testing.T) { }) } +func TestAccAWSRouteTable_IPv4_To_CarrierGateway(t *testing.T) { + var routeTable ec2.RouteTable + resourceName := "aws_route_table.test" + cgwResourceName := "aws_ec2_carrier_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "0.0.0.0/0" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteTableConfigIpv4CarrierGateway(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableExists(resourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), + resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), + resource.TestCheckResourceAttr(resourceName, "route.#", "1"), + testAccCheckAWSRouteTableRoute(resourceName, "cidr_block", destinationCidr, "carrier_gateway_id", cgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSRouteTable_IPv4_To_LocalGateway(t *testing.T) { var routeTable ec2.RouteTable resourceName := "aws_route_table.test" @@ -594,6 +639,7 @@ func TestAccAWSRouteTable_IPv4_To_LocalGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -629,6 +675,7 @@ func TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -664,6 +711,7 @@ func TestAccAWSRouteTable_vgwRoutePropagation(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "1"), resource.TestCheckTypeSetElemAttrPair(resourceName, "propagating_vgws.*", vgwResourceName1, "id"), @@ -677,6 +725,7 @@ func TestAccAWSRouteTable_vgwRoutePropagation(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "1"), resource.TestCheckTypeSetElemAttrPair(resourceName, "propagating_vgws.*", vgwResourceName2, "id"), @@ -750,6 +799,7 @@ func TestAccAWSRouteTable_IPv4_To_NatGateway(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -786,6 +836,7 @@ func TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 3), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -819,6 +870,7 @@ func TestAccAWSRouteTable_VpcMultipleCidrs(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -851,6 +903,7 @@ func TestAccAWSRouteTable_VpcClassicLink(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -889,6 +942,7 @@ func TestAccAWSRouteTable_GatewayVpcEndpoint(t *testing.T) { // Refresh the route table once the VPC endpoint route is present. testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -933,6 +987,7 @@ func TestAccAWSRouteTable_MultipleRoutes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 5), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "3"), @@ -951,6 +1006,7 @@ func TestAccAWSRouteTable_MultipleRoutes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 5), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "3"), @@ -969,6 +1025,7 @@ func TestAccAWSRouteTable_MultipleRoutes(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 5), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "3"), @@ -1664,6 +1721,39 @@ resource "aws_route_table" "test" { `, rName, destinationCidr)) } +func testAccAWSRouteTableConfigIpv4CarrierGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_carrier_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + route { + cidr_block = %[2]q + carrier_gateway_id = aws_ec2_carrier_gateway.test.id + } + + tags = { + Name = %[1]q + } +} +`, rName, destinationCidr) +} + func testAccAWSRouteTableConfigRouteIpv4LocalGateway(rName, destinationCidr string) string { return fmt.Sprintf(` data "aws_ec2_local_gateways" "all" {} @@ -2050,6 +2140,7 @@ resource "aws_route_table" "test" { ipv6_cidr_block = (route.value["destination_attr"] == "ipv6_cidr_block") ? route.value["destination_value"] : null # Target. + carrier_gateway_id = (route.value["target_attr"] == "carrier_gateway_id") ? route.value["target_value"] : null egress_only_gateway_id = (route.value["target_attr"] == "egress_only_gateway_id") ? route.value["target_value"] : null gateway_id = (route.value["target_attr"] == "gateway_id") ? route.value["target_value"] : null instance_id = (route.value["target_attr"] == "instance_id") ? route.value["target_value"] : null diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index 06e9d9b3492..f87bf98ddf2 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -69,11 +69,12 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: +* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. -* `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `local_gateway_id` - (Optional) Identifier of a Outpost local gateway. +* `nat_gateway_id` - (Optional) Identifier of a VPC NAT gateway. * `network_interface_id` - (Optional) Identifier of an EC2 network interface. * `transit_gateway_id` - (Optional) Identifier of an EC2 Transit Gateway. * `vpc_endpoint_id` - (Optional) Identifier of a VPC Endpoint. @@ -89,6 +90,7 @@ In addition to all arguments above, the following attributes are exported: attribute once the route resource is created. * `id` - The ID of the routing table. +* `arn` - The ARN of the route table. * `owner_id` - The ID of the AWS account that owns the route table. ## Import From e5440665c719066fdcccf794d0080fb6c9905721 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 17:50:17 -0500 Subject: [PATCH 1210/1252] r/aws_default_route_table: AWS Wavelength support. --- aws/resource_aws_default_route_table.go | 24 +++++- aws/resource_aws_default_route_table_test.go | 73 +++++++++++++++++++ .../docs/r/default_route_table.html.markdown | 2 + 3 files changed, 95 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index c27960876f0..e4fb553a54d 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -50,6 +50,9 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + /// + // Destinations. + /// "cidr_block": { Type: schema.TypeString, Optional: true, @@ -68,6 +71,14 @@ func resourceAwsDefaultRouteTable() *schema.Resource { ), }, + // + // Targets. + // + "carrier_gateway_id": { + Type: schema.TypeString, + Optional: true, + }, + "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -88,22 +99,22 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, }, - "transit_gateway_id": { + "network_interface_id": { Type: schema.TypeString, Optional: true, }, - "vpc_endpoint_id": { + "transit_gateway_id": { Type: schema.TypeString, Optional: true, }, - "vpc_peering_connection_id": { + "vpc_endpoint_id": { Type: schema.TypeString, Optional: true, }, - "network_interface_id": { + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, }, @@ -114,6 +125,11 @@ func resourceAwsDefaultRouteTable() *schema.Resource { "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "owner_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index f26e1c1383b..79c0e4db643 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -38,6 +38,7 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { Config: testAccDefaultRouteTableConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -100,6 +101,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -119,6 +121,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // The route block from the previous step should still be @@ -134,6 +137,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // This config uses attribute syntax to set zero routes @@ -168,6 +172,7 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -399,6 +404,41 @@ func TestAccAWSDefaultRouteTable_ConditionalCidrBlock(t *testing.T) { }) } +func TestAccAWSDefaultRouteTable_IPv4_To_CarrierGateway(t *testing.T) { + var routeTable ec2.RouteTable + resourceName := "aws_default_route_table.test" + cgwResourceName := "aws_ec2_carrier_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "0.0.0.0/0" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableExists(resourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), + resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), + resource.TestCheckResourceAttr(resourceName, "route.#", "1"), + testAccCheckDefaultRouteTableRoute(resourceName, "cidr_block", destinationCidr, "carrier_gateway_id", cgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckDefaultRouteTableDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -950,6 +990,39 @@ resource "aws_default_route_table" "test" { `, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) } +func testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_carrier_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_default_route_table" "test" { + default_route_table_id = aws_vpc.test.default_route_table_id + + route { + cidr_block = %[2]q + carrier_gateway_id = aws_ec2_carrier_gateway.test.id + } + + tags = { + Name = %[1]q + } +} +`, rName, destinationCidr) +} + func testAccAWSDefaultRouteTableImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 964fab1286e..743ecc017e6 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -55,6 +55,7 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: +* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. @@ -71,6 +72,7 @@ Note that the default route, mapping the VPC's CIDR block to "local", is created In addition to all arguments above, the following attributes are exported: * `id` - ID of the route table. +* `arn` - The ARN of the route table. * `owner_id` - ID of the AWS account that owns the route table. * `vpc_id` - ID of the VPC. From 3b6ddfed3a1dead15882b23bc98186e7d3ca219c Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 17:54:43 -0500 Subject: [PATCH 1211/1252] Revert "r/aws_default_route_table: AWS Wavelength support." This reverts commit a32cff5e705ae5c7f841c1743d8f7f84500d0294. --- aws/resource_aws_default_route_table.go | 24 +----- aws/resource_aws_default_route_table_test.go | 73 ------------------- .../docs/r/default_route_table.html.markdown | 1 - 3 files changed, 4 insertions(+), 94 deletions(-) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index e4fb553a54d..c27960876f0 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -50,9 +50,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - /// - // Destinations. - /// "cidr_block": { Type: schema.TypeString, Optional: true, @@ -71,14 +68,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { ), }, - // - // Targets. - // - "carrier_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -99,22 +88,22 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, }, - "network_interface_id": { + "transit_gateway_id": { Type: schema.TypeString, Optional: true, }, - "transit_gateway_id": { + "vpc_endpoint_id": { Type: schema.TypeString, Optional: true, }, - "vpc_endpoint_id": { + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, }, - "vpc_peering_connection_id": { + "network_interface_id": { Type: schema.TypeString, Optional: true, }, @@ -125,11 +114,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { "tags": tagsSchema(), - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "owner_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index 79c0e4db643..f26e1c1383b 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -38,7 +38,6 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { Config: testAccDefaultRouteTableConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -101,7 +100,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -121,7 +119,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // The route block from the previous step should still be @@ -137,7 +134,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // This config uses attribute syntax to set zero routes @@ -172,7 +168,6 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -404,41 +399,6 @@ func TestAccAWSDefaultRouteTable_ConditionalCidrBlock(t *testing.T) { }) } -func TestAccAWSDefaultRouteTable_IPv4_To_CarrierGateway(t *testing.T) { - var routeTable ec2.RouteTable - resourceName := "aws_default_route_table.test" - cgwResourceName := "aws_ec2_carrier_gateway.test" - rName := acctest.RandomWithPrefix("tf-acc-test") - destinationCidr := "0.0.0.0/0" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRouteTableDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr), - Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableExists(resourceName, &routeTable), - testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), - testAccCheckResourceAttrAccountID(resourceName, "owner_id"), - resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), - resource.TestCheckResourceAttr(resourceName, "route.#", "1"), - testAccCheckDefaultRouteTableRoute(resourceName, "cidr_block", destinationCidr, "carrier_gateway_id", cgwResourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckDefaultRouteTableDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -990,39 +950,6 @@ resource "aws_default_route_table" "test" { `, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) } -func testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_ec2_carrier_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_default_route_table" "test" { - default_route_table_id = aws_vpc.test.default_route_table_id - - route { - cidr_block = %[2]q - carrier_gateway_id = aws_ec2_carrier_gateway.test.id - } - - tags = { - Name = %[1]q - } -} -`, rName, destinationCidr) -} - func testAccAWSDefaultRouteTableImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 743ecc017e6..dd75125a411 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -55,7 +55,6 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: -* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. From 406cdd65123c669eecd39e164ef4b6f99f63f79f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 18:14:43 -0500 Subject: [PATCH 1212/1252] r/aws_default_route_table: Add 'arn' attribute. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSDefaultRouteTable_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSDefaultRouteTable_ -timeout 120m === RUN TestAccAWSDefaultRouteTable_basic === PAUSE TestAccAWSDefaultRouteTable_basic === RUN TestAccAWSDefaultRouteTable_disappears_Vpc === PAUSE TestAccAWSDefaultRouteTable_disappears_Vpc === RUN TestAccAWSDefaultRouteTable_Route_ConfigMode === PAUSE TestAccAWSDefaultRouteTable_Route_ConfigMode === RUN TestAccAWSDefaultRouteTable_swap === PAUSE TestAccAWSDefaultRouteTable_swap === RUN TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === RUN TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint === PAUSE TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint === RUN TestAccAWSDefaultRouteTable_VpcEndpointAssociation === PAUSE TestAccAWSDefaultRouteTable_VpcEndpointAssociation === RUN TestAccAWSDefaultRouteTable_tags === PAUSE TestAccAWSDefaultRouteTable_tags === RUN TestAccAWSDefaultRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSDefaultRouteTable_ConditionalCidrBlock === CONT TestAccAWSDefaultRouteTable_basic === CONT TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint --- PASS: TestAccAWSDefaultRouteTable_basic (29.97s) === CONT TestAccAWSDefaultRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSDefaultRouteTable_ConditionalCidrBlock (54.15s) === CONT TestAccAWSDefaultRouteTable_tags --- PASS: TestAccAWSDefaultRouteTable_tags (52.24s) === CONT TestAccAWSDefaultRouteTable_VpcEndpointAssociation --- PASS: TestAccAWSDefaultRouteTable_VpcEndpointAssociation (44.51s) === CONT TestAccAWSDefaultRouteTable_swap --- PASS: TestAccAWSDefaultRouteTable_swap (91.07s) === CONT TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === CONT TestAccAWSDefaultRouteTable_Route_ConfigMode --- PASS: TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint (323.68s) --- PASS: TestAccAWSDefaultRouteTable_Route_ConfigMode (84.01s) === CONT TestAccAWSDefaultRouteTable_disappears_Vpc --- PASS: TestAccAWSDefaultRouteTable_disappears_Vpc (14.13s) --- PASS: TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway (400.11s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 672.134s --- aws/resource_aws_default_route_table.go | 5 +++++ aws/resource_aws_default_route_table_test.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index c27960876f0..3ee9440552f 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -114,6 +114,11 @@ func resourceAwsDefaultRouteTable() *schema.Resource { "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "owner_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index f26e1c1383b..ae277c4f9e0 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -38,6 +38,7 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { Config: testAccDefaultRouteTableConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -100,6 +101,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -119,6 +121,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // The route block from the previous step should still be @@ -134,6 +137,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // This config uses attribute syntax to set zero routes @@ -168,6 +172,7 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), From 7aba268bd90c700caf087845ba503ea7cf19b96d Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 8 Jan 2021 10:52:13 -0500 Subject: [PATCH 1213/1252] r/aws_route_table: Better documentation of attribute-as-blocks mode for 'route' attribute. --- website/docs/r/route_table.html.markdown | 27 ++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index f87bf98ddf2..b30b8d87d7b 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -31,22 +31,36 @@ the separate resource. ## Example Usage -```terraform -resource "aws_route_table" "r" { - vpc_id = aws_vpc.default.id +```hcl +resource "aws_route_table" "example" { + vpc_id = aws_vpc.example.id route { cidr_block = "10.0.1.0/24" - gateway_id = aws_internet_gateway.main.id + gateway_id = aws_internet_gateway.example.id } route { ipv6_cidr_block = "::/0" - egress_only_gateway_id = aws_egress_only_internet_gateway.foo.id + egress_only_gateway_id = aws_egress_only_internet_gateway.example.id } tags = { - Name = "main" + Name = "example" + } +} +``` + +To subsequently remove all managed routes: + +```hcl +resource "aws_route_table" "example" { + vpc_id = aws_vpc.example.id + + route = [] + + tags = { + Name = "example" } } ``` @@ -57,6 +71,7 @@ The following arguments are supported: * `vpc_id` - (Required) The VPC ID. * `route` - (Optional) A list of route objects. Their keys are documented below. This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). +This means that omitting this argument is interpreted as ignoring any existing routes. To remove all managed routes an empty list should be specified. See the example above. * `tags` - (Optional) A map of tags to assign to the resource. * `propagating_vgws` - (Optional) A list of virtual gateways for propagation. From 27cc72d2e98a7ff8ff75099c047ad2ee98a6d36f Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 8 Jan 2021 10:53:16 -0500 Subject: [PATCH 1214/1252] r/aws_default_route_table: Better documentation of attribute-as-blocks mode for 'route' attribute. --- .../docs/r/default_route_table.html.markdown | 34 ++++++++++++++----- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index dd75125a411..a87fe858b1b 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -18,16 +18,36 @@ For more information, see the Amazon VPC User Guide on [Route Tables](https://do ## Example Usage -```terraform -resource "aws_default_route_table" "r" { - default_route_table_id = aws_vpc.foo.default_route_table_id +```hcl +resource "aws_default_route_table" "example" { + default_route_table_id = aws_vpc.example.default_route_table_id route { - # ... + cidr_block = "10.0.1.0/24" + gateway_id = aws_internet_gateway.example.id } + route { + ipv6_cidr_block = "::/0" + egress_only_gateway_id = aws_egress_only_internet_gateway.example.id + } + + tags = { + Name = "example" + } +} +``` + +To subsequently remove all managed routes: + +```hcl +resource "aws_default_route_table" "example" { + default_route_table_id = aws_vpc.example.default_route_table_id + + route = [] + tags = { - Name = "default table" + Name = "example" } } ``` @@ -41,13 +61,11 @@ The following arguments are required: The following arguments are optional: * `propagating_vgws` - (Optional) List of virtual gateways for propagation. -* `route` - (Optional) Configuration block of routes. Detailed below. +* `route` - (Optional) Configuration block of routes. Detailed below. This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). This means that omitting this argument is interpreted as ignoring any existing routes. To remove all managed routes an empty list should be specified. See the example above. * `tags` - (Optional) Map of tags to assign to the resource. ### route -This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). - One of the following destination arguments must be supplied: * `cidr_block` - (Required) The CIDR block of the route. From 7208fbc73c10c1ee25bfe9ad0bc54da2b17f96c8 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sun, 24 Jan 2021 17:15:02 -0500 Subject: [PATCH 1215/1252] Add CHANGELOG entry. --- .changelog/16979.txt | 11 +++++++++++ website/docs/r/default_route_table.html.markdown | 2 ++ 2 files changed, 13 insertions(+) create mode 100644 .changelog/16979.txt diff --git a/.changelog/16979.txt b/.changelog/16979.txt new file mode 100644 index 00000000000..0c1a7fc785f --- /dev/null +++ b/.changelog/16979.txt @@ -0,0 +1,11 @@ +```release-notes:enhancement +resource/aws_default_route_table: Add `arn` attribute +``` + +```release-notes:enhancement +resource/aws_route_table: Add `arn` attribute +``` + +```release-notes:enhancement +resource/aws_route_table: Add `carrier_gateway_id` attribute to `route` configuration block +``` diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index a87fe858b1b..6165a5d1c0a 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -66,6 +66,8 @@ The following arguments are optional: ### route +This argument is processed in [attribute-as-blocks mode](https://www.terraform.io/docs/configuration/attr-as-blocks.html). + One of the following destination arguments must be supplied: * `cidr_block` - (Required) The CIDR block of the route. From 3de8d25a7fc8ba0d1731927f277296f335e636f0 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 19 Feb 2021 09:19:53 -0500 Subject: [PATCH 1216/1252] Use 'ec2.ServiceName'. --- aws/resource_aws_route_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_route_table.go b/aws/resource_aws_route_table.go index 3918c8b0837..625658fc9dd 100644 --- a/aws/resource_aws_route_table.go +++ b/aws/resource_aws_route_table.go @@ -293,7 +293,7 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { ownerID := aws.StringValue(rt.OwnerId) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, - Service: "ec2", + Service: ec2.ServiceName, Region: meta.(*AWSClient).region, AccountID: ownerID, Resource: fmt.Sprintf("route-table/%s", d.Id()), From f3d5d16ee9830e8d2aa586a947bedf8992f6fac7 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 17:50:17 -0500 Subject: [PATCH 1217/1252] r/aws_default_route_table: AWS Wavelength support. --- aws/resource_aws_default_route_table.go | 19 ++++-- aws/resource_aws_default_route_table_test.go | 68 +++++++++++++++++++ .../docs/r/default_route_table.html.markdown | 1 + 3 files changed, 84 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index 3ee9440552f..e4fb553a54d 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -50,6 +50,9 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + /// + // Destinations. + /// "cidr_block": { Type: schema.TypeString, Optional: true, @@ -68,6 +71,14 @@ func resourceAwsDefaultRouteTable() *schema.Resource { ), }, + // + // Targets. + // + "carrier_gateway_id": { + Type: schema.TypeString, + Optional: true, + }, + "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -88,22 +99,22 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, }, - "transit_gateway_id": { + "network_interface_id": { Type: schema.TypeString, Optional: true, }, - "vpc_endpoint_id": { + "transit_gateway_id": { Type: schema.TypeString, Optional: true, }, - "vpc_peering_connection_id": { + "vpc_endpoint_id": { Type: schema.TypeString, Optional: true, }, - "network_interface_id": { + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, }, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index ae277c4f9e0..79c0e4db643 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -404,6 +404,41 @@ func TestAccAWSDefaultRouteTable_ConditionalCidrBlock(t *testing.T) { }) } +func TestAccAWSDefaultRouteTable_IPv4_To_CarrierGateway(t *testing.T) { + var routeTable ec2.RouteTable + resourceName := "aws_default_route_table.test" + cgwResourceName := "aws_ec2_carrier_gateway.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + destinationCidr := "0.0.0.0/0" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr), + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableExists(resourceName, &routeTable), + testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), + resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), + resource.TestCheckResourceAttr(resourceName, "route.#", "1"), + testAccCheckDefaultRouteTableRoute(resourceName, "cidr_block", destinationCidr, "carrier_gateway_id", cgwResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckDefaultRouteTableDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -955,6 +990,39 @@ resource "aws_default_route_table" "test" { `, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) } +func testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_carrier_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_default_route_table" "test" { + default_route_table_id = aws_vpc.test.default_route_table_id + + route { + cidr_block = %[2]q + carrier_gateway_id = aws_ec2_carrier_gateway.test.id + } + + tags = { + Name = %[1]q + } +} +`, rName, destinationCidr) +} + func testAccAWSDefaultRouteTableImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 6165a5d1c0a..5d97fff5230 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -75,6 +75,7 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: +* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. From b3674ec99998994ac4a2fe49ffaf53d5c83284bf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 17:54:43 -0500 Subject: [PATCH 1218/1252] Revert "r/aws_default_route_table: AWS Wavelength support." This reverts commit a32cff5e705ae5c7f841c1743d8f7f84500d0294. --- aws/resource_aws_default_route_table.go | 24 +----- aws/resource_aws_default_route_table_test.go | 73 ------------------- .../docs/r/default_route_table.html.markdown | 1 - 3 files changed, 4 insertions(+), 94 deletions(-) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index e4fb553a54d..c27960876f0 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -50,9 +50,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ - /// - // Destinations. - /// "cidr_block": { Type: schema.TypeString, Optional: true, @@ -71,14 +68,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { ), }, - // - // Targets. - // - "carrier_gateway_id": { - Type: schema.TypeString, - Optional: true, - }, - "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, @@ -99,22 +88,22 @@ func resourceAwsDefaultRouteTable() *schema.Resource { Optional: true, }, - "network_interface_id": { + "transit_gateway_id": { Type: schema.TypeString, Optional: true, }, - "transit_gateway_id": { + "vpc_endpoint_id": { Type: schema.TypeString, Optional: true, }, - "vpc_endpoint_id": { + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, }, - "vpc_peering_connection_id": { + "network_interface_id": { Type: schema.TypeString, Optional: true, }, @@ -125,11 +114,6 @@ func resourceAwsDefaultRouteTable() *schema.Resource { "tags": tagsSchema(), - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "owner_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index 79c0e4db643..f26e1c1383b 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -38,7 +38,6 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { Config: testAccDefaultRouteTableConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -101,7 +100,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -121,7 +119,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // The route block from the previous step should still be @@ -137,7 +134,6 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // This config uses attribute syntax to set zero routes @@ -172,7 +168,6 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -404,41 +399,6 @@ func TestAccAWSDefaultRouteTable_ConditionalCidrBlock(t *testing.T) { }) } -func TestAccAWSDefaultRouteTable_IPv4_To_CarrierGateway(t *testing.T) { - var routeTable ec2.RouteTable - resourceName := "aws_default_route_table.test" - cgwResourceName := "aws_ec2_carrier_gateway.test" - rName := acctest.RandomWithPrefix("tf-acc-test") - destinationCidr := "0.0.0.0/0" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckRouteTableDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr), - Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableExists(resourceName, &routeTable), - testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), - testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), - testAccCheckResourceAttrAccountID(resourceName, "owner_id"), - resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), - resource.TestCheckResourceAttr(resourceName, "route.#", "1"), - testAccCheckDefaultRouteTableRoute(resourceName, "cidr_block", destinationCidr, "carrier_gateway_id", cgwResourceName, "id"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckDefaultRouteTableDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -990,39 +950,6 @@ resource "aws_default_route_table" "test" { `, rName, destinationCidr, destinationIpv6Cidr, ipv6Route) } -func testAccDefaultRouteTableConfigIpv4CarrierGateway(rName, destinationCidr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "test" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_ec2_carrier_gateway" "test" { - vpc_id = aws_vpc.test.id - - tags = { - Name = %[1]q - } -} - -resource "aws_default_route_table" "test" { - default_route_table_id = aws_vpc.test.default_route_table_id - - route { - cidr_block = %[2]q - carrier_gateway_id = aws_ec2_carrier_gateway.test.id - } - - tags = { - Name = %[1]q - } -} -`, rName, destinationCidr) -} - func testAccAWSDefaultRouteTableImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 5d97fff5230..6165a5d1c0a 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -75,7 +75,6 @@ One of the following destination arguments must be supplied: One of the following target arguments must be supplied: -* `carrier_gateway_id` - (Optional) Identifier of a carrier gateway. This attribute can only be used when the VPC contains a subnet which is associated with a Wavelength Zone. * `egress_only_gateway_id` - (Optional) Identifier of a VPC Egress Only Internet Gateway. * `gateway_id` - (Optional) Identifier of a VPC internet gateway or a virtual private gateway. * `instance_id` - (Optional) Identifier of an EC2 instance. From 2c076394af76bb7fe0976ceea1bbdfb179c79bc1 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Wed, 6 Jan 2021 18:14:43 -0500 Subject: [PATCH 1219/1252] r/aws_default_route_table: Add 'arn' attribute. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSDefaultRouteTable_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSDefaultRouteTable_ -timeout 120m === RUN TestAccAWSDefaultRouteTable_basic === PAUSE TestAccAWSDefaultRouteTable_basic === RUN TestAccAWSDefaultRouteTable_disappears_Vpc === PAUSE TestAccAWSDefaultRouteTable_disappears_Vpc === RUN TestAccAWSDefaultRouteTable_Route_ConfigMode === PAUSE TestAccAWSDefaultRouteTable_Route_ConfigMode === RUN TestAccAWSDefaultRouteTable_swap === PAUSE TestAccAWSDefaultRouteTable_swap === RUN TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === RUN TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint === PAUSE TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint === RUN TestAccAWSDefaultRouteTable_VpcEndpointAssociation === PAUSE TestAccAWSDefaultRouteTable_VpcEndpointAssociation === RUN TestAccAWSDefaultRouteTable_tags === PAUSE TestAccAWSDefaultRouteTable_tags === RUN TestAccAWSDefaultRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSDefaultRouteTable_ConditionalCidrBlock === CONT TestAccAWSDefaultRouteTable_basic === CONT TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint --- PASS: TestAccAWSDefaultRouteTable_basic (29.97s) === CONT TestAccAWSDefaultRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSDefaultRouteTable_ConditionalCidrBlock (54.15s) === CONT TestAccAWSDefaultRouteTable_tags --- PASS: TestAccAWSDefaultRouteTable_tags (52.24s) === CONT TestAccAWSDefaultRouteTable_VpcEndpointAssociation --- PASS: TestAccAWSDefaultRouteTable_VpcEndpointAssociation (44.51s) === CONT TestAccAWSDefaultRouteTable_swap --- PASS: TestAccAWSDefaultRouteTable_swap (91.07s) === CONT TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway === CONT TestAccAWSDefaultRouteTable_Route_ConfigMode --- PASS: TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint (323.68s) --- PASS: TestAccAWSDefaultRouteTable_Route_ConfigMode (84.01s) === CONT TestAccAWSDefaultRouteTable_disappears_Vpc --- PASS: TestAccAWSDefaultRouteTable_disappears_Vpc (14.13s) --- PASS: TestAccAWSDefaultRouteTable_IPv4_To_TransitGateway (400.11s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 672.134s --- aws/resource_aws_default_route_table.go | 5 +++++ aws/resource_aws_default_route_table_test.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index c27960876f0..3ee9440552f 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -114,6 +114,11 @@ func resourceAwsDefaultRouteTable() *schema.Resource { "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "owner_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index f26e1c1383b..ae277c4f9e0 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -38,6 +38,7 @@ func TestAccAWSDefaultRouteTable_basic(t *testing.T) { Config: testAccDefaultRouteTableConfigBasic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "0"), @@ -100,6 +101,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), @@ -119,6 +121,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // The route block from the previous step should still be @@ -134,6 +137,7 @@ func TestAccAWSDefaultRouteTable_Route_ConfigMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), // This config uses attribute syntax to set zero routes @@ -168,6 +172,7 @@ func TestAccAWSDefaultRouteTable_swap(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckRouteTableExists(resourceName, &routeTable), testAccCheckAWSRouteTableNumberOfRoutes(&routeTable, 2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ec2", regexp.MustCompile(`route-table/.+$`)), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), resource.TestCheckResourceAttr(resourceName, "route.#", "1"), From 929876e638367e36ad62a0d0339ea2dea2f6c574 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 8 Jan 2021 10:53:16 -0500 Subject: [PATCH 1220/1252] r/aws_default_route_table: Better documentation of attribute-as-blocks mode for 'route' attribute. --- website/docs/r/route_table.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index b30b8d87d7b..08c8d23e27d 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -31,7 +31,7 @@ the separate resource. ## Example Usage -```hcl +```terraform resource "aws_route_table" "example" { vpc_id = aws_vpc.example.id From 577026996770a59da1f4d95950ce2adb3201941a Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Mar 2021 17:18:08 -0400 Subject: [PATCH 1221/1252] r/aws_route_table: Add 'ErrorCheck' to new acceptance tests. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteTable_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteTable_ -timeout 180m === RUN TestAccAWSRouteTable_basic === PAUSE TestAccAWSRouteTable_basic === RUN TestAccAWSRouteTable_disappears === PAUSE TestAccAWSRouteTable_disappears === RUN TestAccAWSRouteTable_disappears_SubnetAssociation === PAUSE TestAccAWSRouteTable_disappears_SubnetAssociation === RUN TestAccAWSRouteTable_IPv4_To_InternetGateway === PAUSE TestAccAWSRouteTable_IPv4_To_InternetGateway === RUN TestAccAWSRouteTable_IPv4_To_Instance === PAUSE TestAccAWSRouteTable_IPv4_To_Instance === RUN TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === PAUSE TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === RUN TestAccAWSRouteTable_tags === PAUSE TestAccAWSRouteTable_tags === RUN TestAccAWSRouteTable_RequireRouteDestination === PAUSE TestAccAWSRouteTable_RequireRouteDestination === RUN TestAccAWSRouteTable_RequireRouteTarget === PAUSE TestAccAWSRouteTable_RequireRouteTarget === RUN TestAccAWSRouteTable_Route_ConfigMode === PAUSE TestAccAWSRouteTable_Route_ConfigMode === RUN TestAccAWSRouteTable_IPv4_To_TransitGateway === PAUSE TestAccAWSRouteTable_IPv4_To_TransitGateway === RUN TestAccAWSRouteTable_IPv4_To_VpcEndpoint === PAUSE TestAccAWSRouteTable_IPv4_To_VpcEndpoint === RUN TestAccAWSRouteTable_IPv4_To_CarrierGateway === PAUSE TestAccAWSRouteTable_IPv4_To_CarrierGateway === RUN TestAccAWSRouteTable_IPv4_To_LocalGateway === PAUSE TestAccAWSRouteTable_IPv4_To_LocalGateway === RUN TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === PAUSE TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection === RUN TestAccAWSRouteTable_vgwRoutePropagation === PAUSE TestAccAWSRouteTable_vgwRoutePropagation === RUN TestAccAWSRouteTable_ConditionalCidrBlock === PAUSE TestAccAWSRouteTable_ConditionalCidrBlock === RUN TestAccAWSRouteTable_IPv4_To_NatGateway === PAUSE TestAccAWSRouteTable_IPv4_To_NatGateway === RUN TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached === PAUSE TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached === RUN TestAccAWSRouteTable_VpcMultipleCidrs === PAUSE TestAccAWSRouteTable_VpcMultipleCidrs === RUN TestAccAWSRouteTable_VpcClassicLink === PAUSE TestAccAWSRouteTable_VpcClassicLink === RUN TestAccAWSRouteTable_GatewayVpcEndpoint === PAUSE TestAccAWSRouteTable_GatewayVpcEndpoint === RUN TestAccAWSRouteTable_MultipleRoutes === PAUSE TestAccAWSRouteTable_MultipleRoutes === CONT TestAccAWSRouteTable_basic === CONT TestAccAWSRouteTable_IPv4_To_CarrierGateway --- PASS: TestAccAWSRouteTable_basic (23.03s) === CONT TestAccAWSRouteTable_MultipleRoutes --- PASS: TestAccAWSRouteTable_IPv4_To_CarrierGateway (27.07s) === CONT TestAccAWSRouteTable_GatewayVpcEndpoint --- PASS: TestAccAWSRouteTable_GatewayVpcEndpoint (38.36s) === CONT TestAccAWSRouteTable_VpcClassicLink --- PASS: TestAccAWSRouteTable_VpcClassicLink (23.18s) === CONT TestAccAWSRouteTable_VpcMultipleCidrs --- PASS: TestAccAWSRouteTable_VpcMultipleCidrs (44.45s) === CONT TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached --- PASS: TestAccAWSRouteTable_IPv6_To_NetworkInterface_Unattached (64.43s) === CONT TestAccAWSRouteTable_IPv4_To_NatGateway --- PASS: TestAccAWSRouteTable_MultipleRoutes (174.60s) === CONT TestAccAWSRouteTable_ConditionalCidrBlock --- PASS: TestAccAWSRouteTable_ConditionalCidrBlock (54.34s) === CONT TestAccAWSRouteTable_vgwRoutePropagation --- PASS: TestAccAWSRouteTable_vgwRoutePropagation (78.89s) === CONT TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection --- PASS: TestAccAWSRouteTable_IPv4_To_VpcPeeringConnection (26.74s) === CONT TestAccAWSRouteTable_IPv4_To_LocalGateway data_source_aws_outposts_outposts_test.go:67: skipping since no Outposts found === CONT TestAccAWSRouteTable_tags --- SKIP: TestAccAWSRouteTable_IPv4_To_LocalGateway (0.60s) --- PASS: TestAccAWSRouteTable_tags (68.15s) === CONT TestAccAWSRouteTable_IPv4_To_VpcEndpoint --- PASS: TestAccAWSRouteTable_IPv4_To_NatGateway (237.14s) === CONT TestAccAWSRouteTable_IPv4_To_TransitGateway --- PASS: TestAccAWSRouteTable_IPv4_To_VpcEndpoint (287.82s) === CONT TestAccAWSRouteTable_Route_ConfigMode --- PASS: TestAccAWSRouteTable_Route_ConfigMode (70.96s) === CONT TestAccAWSRouteTable_RequireRouteTarget --- PASS: TestAccAWSRouteTable_RequireRouteTarget (12.27s) === CONT TestAccAWSRouteTable_RequireRouteDestination --- PASS: TestAccAWSRouteTable_IPv4_To_TransitGateway (402.33s) === CONT TestAccAWSRouteTable_IPv4_To_InternetGateway --- PASS: TestAccAWSRouteTable_IPv4_To_InternetGateway (63.20s) === CONT TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway === CONT TestAccAWSRouteTable_IPv4_To_Instance --- PASS: TestAccAWSRouteTable_IPv6_To_EgressOnlyInternetGateway (47.99s) --- PASS: TestAccAWSRouteTable_IPv4_To_Instance (123.37s) === CONT TestAccAWSRouteTable_disappears_SubnetAssociation --- PASS: TestAccAWSRouteTable_disappears_SubnetAssociation (25.30s) === CONT TestAccAWSRouteTable_disappears --- PASS: TestAccAWSRouteTable_disappears (20.39s) --- PASS: TestAccAWSRouteTable_RequireRouteDestination (324.41s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 1121.930s --- aws/resource_aws_route_table_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/resource_aws_route_table_test.go b/aws/resource_aws_route_table_test.go index 836c78fb46c..00ea7daeaac 100644 --- a/aws/resource_aws_route_table_test.go +++ b/aws/resource_aws_route_table_test.go @@ -595,6 +595,7 @@ func TestAccAWSRouteTable_IPv4_To_CarrierGateway(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ From 0b4fba432f495c655c43449c9aea7b93fec13caf Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Thu, 25 Mar 2021 19:29:11 -0400 Subject: [PATCH 1222/1252] Nudge GitHub Actions. From bfba3e90063d659de8a09f910a0954c82158d806 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 26 Mar 2021 08:15:19 -0400 Subject: [PATCH 1223/1252] Fix tfproviderdocs errors: Error checking Terraform Provider documentation: 2 errors occurred: * website/docs/r/default_route_table.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform * website/docs/r/route_table.html.markdown: error checking file contents: example section code block language (hcl) should be: ```terraform --- website/docs/r/default_route_table.html.markdown | 4 ++-- website/docs/r/route_table.html.markdown | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/default_route_table.html.markdown b/website/docs/r/default_route_table.html.markdown index 6165a5d1c0a..1a43ee8ff6d 100644 --- a/website/docs/r/default_route_table.html.markdown +++ b/website/docs/r/default_route_table.html.markdown @@ -18,7 +18,7 @@ For more information, see the Amazon VPC User Guide on [Route Tables](https://do ## Example Usage -```hcl +```terraform resource "aws_default_route_table" "example" { default_route_table_id = aws_vpc.example.default_route_table_id @@ -40,7 +40,7 @@ resource "aws_default_route_table" "example" { To subsequently remove all managed routes: -```hcl +```terraform resource "aws_default_route_table" "example" { default_route_table_id = aws_vpc.example.default_route_table_id diff --git a/website/docs/r/route_table.html.markdown b/website/docs/r/route_table.html.markdown index 08c8d23e27d..db094952204 100644 --- a/website/docs/r/route_table.html.markdown +++ b/website/docs/r/route_table.html.markdown @@ -53,7 +53,7 @@ resource "aws_route_table" "example" { To subsequently remove all managed routes: -```hcl +```terraform resource "aws_route_table" "example" { vpc_id = aws_vpc.example.id From fc0e23e66601d453271a4b9ef3f86d733eee3e19 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 26 Mar 2021 12:30:13 -0400 Subject: [PATCH 1224/1252] tests/provider: Bootstrap d.IsNewResource() semgrep rule and fix some A resources to start (#18346) * tests/provider: Bootstrap d.IsNewResource() semgrep rule and fix some A resources to start Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16796 During resource creation, Terraform CLI expects either a properly applied state for the new resource or an error. To signal proper resource existence, the Terraform Plugin SDK uses an underlying resource identifier (set via `d.SetId(/* some value */)`). If for some reason the resource creation is returned without an error, but also without the resource identifier being set, Terraform CLI will return an error such as: ``` Error: Provider produced inconsistent result after apply When applying changes to aws_sns_topic_subscription.sqs, provider "registry.terraform.io/hashicorp/aws" produced an unexpected new value: Root resource was present, but now absent. This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` A typical pattern in resource implementations in the `Create`/`CreateContext` function is to `return` the `Read`/`ReadContext` function at the end to fill in the Terraform State for all attributes. Another typical pattern in resource implementations in the `Read`/`ReadContext` function is to remove the resource from the Terraform State if the remote system returns an error or status that indicates the remote resource no longer exists by explicitly calling `d.SetId("")` and returning no error. If the remote system is not strongly read-after-write consistent (eventually consistent), this means the resource creation can return no error and also return no resource state. To prevent this type of Terraform CLI error, the resource implementation should also check against `d.IsNewResource()` before removing from the Terraform State and returning no error. If that check is `true`, then remote operation error (or one synthesized from the non-existent status) should be returned instead. While adding this check will not fix the resource implementation to handle the eventually consistent nature of the remote system, the error being returned will be less opaque for operators and code maintainers to troubleshoot. Previously: ``` aws/resource_aws_accessanalyzer_analyzer.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 115: d.SetId("") 116: return nil aws/resource_aws_acm_certificate_validation.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 181: d.SetId("") 182: return nil aws/resource_aws_acmpca_certificate.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 175: d.SetId("") 176: return nil aws/resource_aws_acmpca_certificate_authority.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 329: d.SetId("") 330: return nil -------------------------------------------------------------------------------- 339: d.SetId("") 340: return nil -------------------------------------------------------------------------------- 371: d.SetId("") 372: return nil -------------------------------------------------------------------------------- 398: d.SetId("") 399: return nil aws/resource_aws_ami.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 344: d.SetId("") 345: return nil -------------------------------------------------------------------------------- 361: d.SetId("") 362: return nil -------------------------------------------------------------------------------- 383: d.SetId("") 384: return nil aws/resource_aws_ami_launch_permission.go severity:warning rule:helper-schema-ResourceData-SetId-empty-without-IsNewResource-check: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first 81: d.SetId("") 82: return nil ``` Output from acceptance testing: ``` --- FAIL: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcardAndRoot (4.02s) # alternate testing account issue --- FAIL: TestAccAWSAcmCertificateValidation_validationRecordFqdnsWildcard (4.11s) # alternate testing account issue --- PASS: TestAccAWSAcmCertificateValidation_basic (92.89s) --- PASS: TestAccAWSAcmCertificateValidation_timeout (25.70s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdns (101.67s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsEmail (20.07s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRoot (92.99s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsRootAndWildcard (63.68s) --- PASS: TestAccAWSAcmCertificateValidation_validationRecordFqdnsSan (88.87s) --- PASS: TestAccAwsAcmpcaCertificate_EndEntityCertificate (35.64s) --- PASS: TestAccAwsAcmpcaCertificate_RootCertificate (28.20s) --- PASS: TestAccAwsAcmpcaCertificate_SubordinateCertificate (38.12s) --- PASS: TestAccAwsAcmpcaCertificate_Validity_Absolute (34.39s) --- PASS: TestAccAwsAcmpcaCertificate_Validity_EndDate (35.95s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_basic (22.75s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_DeleteFromActiveState (24.35s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_disappears (14.37s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_Enabled (53.63s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfiguration_CustomCname (120.00s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfiguration_Enabled (95.90s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_RevocationConfiguration_CrlConfiguration_ExpirationInDays (74.81s) --- PASS: TestAccAwsAcmpcaCertificateAuthority_Tags (62.46s) --- PASS: TestAccAWSAMI_basic (63.47s) --- PASS: TestAccAWSAMI_description (76.70s) --- PASS: TestAccAWSAMI_disappears (60.26s) --- PASS: TestAccAWSAMI_EphemeralBlockDevices (63.85s) --- PASS: TestAccAWSAMI_Gp3BlockDevice (46.78s) --- PASS: TestAccAWSAMI_tags (89.70s) --- PASS: TestAccAWSAMILaunchPermission_basic (337.22s) --- PASS: TestAccAWSAMILaunchPermission_Disappears_AMI (354.06s) --- PASS: TestAccAWSAMILaunchPermission_Disappears_LaunchPermission (336.05s) --- PASS: TestAccAWSAMILaunchPermission_Disappears_LaunchPermission_Public (334.96s) ``` * tests/provider: Simplify semgrep helper-schema-ResourceData-SetId-empty-without-IsNewResource-check exclude paths --- .semgrep.yml | 38 ++++++++++++++ aws/resource_aws_accessanalyzer_analyzer.go | 3 +- ...resource_aws_acm_certificate_validation.go | 28 ++++++++--- aws/resource_aws_acmpca_certificate.go | 18 ++++--- ...source_aws_acmpca_certificate_authority.go | 50 +++++++++++-------- aws/resource_aws_ami.go | 10 +++- aws/resource_aws_ami_launch_permission.go | 4 ++ 7 files changed, 114 insertions(+), 37 deletions(-) diff --git a/.semgrep.yml b/.semgrep.yml index 0a8c8c4a7e1..1e8f05ecde4 100644 --- a/.semgrep.yml +++ b/.semgrep.yml @@ -227,6 +227,44 @@ rules: - pattern: if $VALUE, $OK := d.GetOk($KEY); $OK && len($VALUE.(string)) > 0 { $BODY } severity: WARNING + - id: helper-schema-ResourceData-SetId-empty-without-IsNewResource-check + languages: [go] + message: Calling `d.SetId("")` should ensure `!d.IsNewResource()` is checked first + paths: + exclude: + - aws/resource_aws_api_gateway_*.go + - aws/resource_aws_apigatewayv2_*.go + - aws/resource_aws_app_cookie_stickiness_policy.go + - aws/resource_aws_appautoscaling_*.go + - aws/resource_aws_appmesh_*.go + - aws/resource_aws_appsync_*.go + - aws/resource_aws_athena_*.go + - aws/resource_aws_autoscaling_*.go + - aws/resource_aws_autoscalingplans_scaling_plan.go + - aws/resource_aws_[b-g]*.go + - aws/resource_aws_i*.go + - aws/resource_aws_[k-t]*.go + - aws/resource_aws_[v-x]*.go + include: + - aws/resource*.go + patterns: + - pattern-either: + - pattern: | + d.SetId("") + ... + return nil + - pattern-not-inside: | + if ... { + if <... d.IsNewResource() ...> { ... } + ... + d.SetId("") + ... + return nil + } + - pattern-not-inside: | + if <... d.IsNewResource() ...> { ... } + severity: WARNING + - id: helper-schema-resource-Retry-without-TimeoutError-check languages: [go] message: Check resource.Retry() errors with tfresource.TimedOut() diff --git a/aws/resource_aws_accessanalyzer_analyzer.go b/aws/resource_aws_accessanalyzer_analyzer.go index c07154b97fc..52fda89c7c6 100644 --- a/aws/resource_aws_accessanalyzer_analyzer.go +++ b/aws/resource_aws_accessanalyzer_analyzer.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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" @@ -110,7 +111,7 @@ func resourceAwsAccessAnalyzerAnalyzerRead(d *schema.ResourceData, meta interfac output, err := conn.GetAnalyzer(input) - if isAWSErr(err, accessanalyzer.ErrCodeResourceNotFoundException, "") { + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, accessanalyzer.ErrCodeResourceNotFoundException) { log.Printf("[WARN] Access Analyzer Analyzer (%s) not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/aws/resource_aws_acm_certificate_validation.go b/aws/resource_aws_acm_certificate_validation.go index 89ffc3459e6..e35a802e3af 100644 --- a/aws/resource_aws_acm_certificate_validation.go +++ b/aws/resource_aws_acm_certificate_validation.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acm" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" @@ -177,19 +178,32 @@ func resourceAwsAcmCertificateValidationRead(d *schema.ResourceData, meta interf resp, err := acmconn.DescribeCertificate(params) - if err != nil && isAWSErr(err, acm.ErrCodeResourceNotFoundException, "") { + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, acm.ErrCodeResourceNotFoundException) { + log.Printf("[WARN] ACM Certificate (%s) not found, removing from state", d.Id()) d.SetId("") return nil - } else if err != nil { - return fmt.Errorf("Error describing certificate: %w", err) } - if aws.StringValue(resp.Certificate.Status) != acm.CertificateStatusIssued { - log.Printf("[INFO] Certificate status not issued, was %s, tainting validation", aws.StringValue(resp.Certificate.Status)) + if err != nil { + return fmt.Errorf("error describing ACM Certificate (%s): %w", d.Id(), err) + } + + if resp == nil || resp.Certificate == nil { + return fmt.Errorf("error describing ACM Certificate (%s): empty response", d.Id()) + } + + if status := aws.StringValue(resp.Certificate.Status); status != acm.CertificateStatusIssued { + if d.IsNewResource() { + return fmt.Errorf("ACM Certificate (%s) status not issued: %s", d.Id(), status) + } + + log.Printf("[WARN] ACM Certificate (%s) status not issued (%s), removing from state", d.Id(), status) d.SetId("") - } else { - d.SetId(aws.TimeValue(resp.Certificate.IssuedAt).String()) + return nil } + + d.SetId(aws.TimeValue(resp.Certificate.IssuedAt).String()) + return nil } diff --git a/aws/resource_aws_acmpca_certificate.go b/aws/resource_aws_acmpca_certificate.go index 5a6317d0ec4..afbcb51f8a3 100644 --- a/aws/resource_aws_acmpca_certificate.go +++ b/aws/resource_aws_acmpca_certificate.go @@ -169,13 +169,19 @@ func resourceAwsAcmpcaCertificateRead(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Reading ACM PCA Certificate: %s", getCertificateInput) certificateOutput, err := conn.GetCertificate(getCertificateInput) + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, acmpca.ErrCodeResourceNotFoundException) { + log.Printf("[WARN] ACM PCA Certificate (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { - if isAWSErr(err, acmpca.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] ACM PCA Certificate (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("error reading ACM PCA Certificate: %s", err) + return fmt.Errorf("error reading ACM PCA Certificate (%s): %w", d.Id(), err) + } + + if certificateOutput == nil { + return fmt.Errorf("error reading ACM PCA Certificate (%s): empty response", d.Id()) } d.Set("arn", d.Id()) diff --git a/aws/resource_aws_acmpca_certificate_authority.go b/aws/resource_aws_acmpca_certificate_authority.go index 2455f26e22a..a27cde4b882 100644 --- a/aws/resource_aws_acmpca_certificate_authority.go +++ b/aws/resource_aws_acmpca_certificate_authority.go @@ -324,17 +324,21 @@ func resourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta inte certificateAuthority, err := finder.CertificateAuthorityByARN(conn, d.Id()) - if isAWSErr(err, acmpca.ErrCodeResourceNotFoundException, "") { + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, acmpca.ErrCodeResourceNotFoundException) { log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) d.SetId("") return nil } if err != nil { - return fmt.Errorf("error reading ACM PCA Certificate Authority: %s", err) + return fmt.Errorf("error reading ACM PCA Certificate Authority (%s): %w", d.Id(), err) } if certificateAuthority == nil || aws.StringValue(certificateAuthority.Status) == acmpca.CertificateAuthorityStatusDeleted { + if d.IsNewResource() { + return fmt.Errorf("error reading ACM PCA Certificate Authority (%s): not found or deleted", d.Id()) + } + log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -365,17 +369,17 @@ func resourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta inte log.Printf("[DEBUG] Reading ACM PCA Certificate Authority Certificate: %s", getCertificateAuthorityCertificateInput) getCertificateAuthorityCertificateOutput, err := conn.GetCertificateAuthorityCertificate(getCertificateAuthorityCertificateInput) - if err != nil { - if isAWSErr(err, acmpca.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - // Returned when in PENDING_CERTIFICATE status - // InvalidStateException: The certificate authority XXXXX is not in the correct state to have a certificate signing request. - if !isAWSErr(err, acmpca.ErrCodeInvalidStateException, "") { - return fmt.Errorf("error reading ACM PCA Certificate Authority Certificate: %s", err) - } + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, acmpca.ErrCodeResourceNotFoundException) { + log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + // Returned when in PENDING_CERTIFICATE status + // InvalidStateException: The certificate authority XXXXX is not in the correct state to have a certificate signing request. + if err != nil && !tfawserr.ErrCodeEquals(err, acmpca.ErrCodeInvalidStateException) { + return fmt.Errorf("error reading ACM PCA Certificate Authority (%s) Certificate: %w", d.Id(), err) } d.Set("certificate", "") @@ -392,15 +396,17 @@ func resourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta inte log.Printf("[DEBUG] Reading ACM PCA Certificate Authority Certificate Signing Request: %s", getCertificateAuthorityCsrInput) getCertificateAuthorityCsrOutput, err := conn.GetCertificateAuthorityCsr(getCertificateAuthorityCsrInput) - if err != nil { - if isAWSErr(err, acmpca.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if !isAWSErr(err, acmpca.ErrCodeInvalidStateException, "") { - return fmt.Errorf("error reading ACM PCA Certificate Authority Certificate Signing Request: %s", err) - } + + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, acmpca.ErrCodeResourceNotFoundException) { + log.Printf("[WARN] ACM PCA Certificate Authority (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + // Returned when in PENDING_CERTIFICATE status + // InvalidStateException: The certificate authority XXXXX is not in the correct state to have a certificate signing request. + if err != nil && !tfawserr.ErrCodeEquals(err, acmpca.ErrCodeInvalidStateException) { + return fmt.Errorf("error reading ACM PCA Certificate Authority (%s) Certificate Signing Request: %w", d.Id(), err) } d.Set("certificate_signing_request", "") diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 574a9ad7a1f..5a11ffe13e0 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -356,7 +356,11 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Unable to find AMI after retries: %s", err) } - if len(res.Images) != 1 { + if res == nil || len(res.Images) != 1 { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 AMI (%s): empty response", d.Id()) + } + log.Printf("[WARN] AMI (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -379,6 +383,10 @@ func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { } if state == ec2.ImageStateDeregistered { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 AMI (%s): deregistered", d.Id()) + } + log.Printf("[WARN] AMI (%s) not found, removing from state", d.Id()) d.SetId("") return nil diff --git a/aws/resource_aws_ami_launch_permission.go b/aws/resource_aws_ami_launch_permission.go index 43bcd8f21f8..8d4d190d281 100644 --- a/aws/resource_aws_ami_launch_permission.go +++ b/aws/resource_aws_ami_launch_permission.go @@ -77,6 +77,10 @@ func resourceAwsAmiLaunchPermissionRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error reading AMI launch permission (%s): %w", d.Id(), err) } if !exists { + if d.IsNewResource() { + return fmt.Errorf("error reading EC2 AMI Launch Permission (%s): not found", d.Id()) + } + log.Printf("[WARN] AMI launch permission (%s) not found, removing from state", d.Id()) d.SetId("") return nil From 02a771719a11cde7a062bd1dfc3558b965781513 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 12:42:47 -0400 Subject: [PATCH 1225/1252] tests/r/default_route_table: All elasticloadbalancing ErrorCheck --- aws/resource_aws_default_route_table_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index ae277c4f9e0..054960468ab 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -261,7 +261,7 @@ func TestAccAWSDefaultRouteTable_IPv4_To_VpcEndpoint(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID, "elasticloadbalancing"), Providers: testAccProviders, CheckDestroy: testAccCheckRouteTableDestroy, Steps: []resource.TestStep{ From cfebb8d15327dd9074e38a865940e45f0074f574 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Fri, 26 Mar 2021 13:18:26 -0400 Subject: [PATCH 1226/1252] resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation (#18404) * resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation Reference: https://github.com/hashicorp/terraform-provider-aws/issues/18101 Previously: ``` === CONT TestAccAWSSyntheticsCanary_basic resource_aws_synthetics_canary_test.go:82: Step 1/3 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-s9t49btk) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 8e3169db-124d-4c5a-ac0e-d9f382cf737f; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_basic (16.37s) === CONT TestAccAWSSyntheticsCanary_runtimeVersion resource_aws_synthetics_canary_test.go:156: Step 1/3 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-nenvizbg) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ffcb7edb-c77e-43f2-8a0a-1183e92f0f8c; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_runtimeVersion (16.85s) === CONT TestAccAWSSyntheticsCanary_startCanary_codeChanges resource_aws_synthetics_canary_test.go:239: Step 1/3 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-7c9erovn) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 1c4bacd4-3134-4df3-8e82-2538e155b524; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_startCanary_codeChanges (16.92s) === CONT TestAccAWSSyntheticsCanary_startCanary resource_aws_synthetics_canary_test.go:190: Step 1/4 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-gzn0ksyz) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: afa63236-ac58-4cec-9c93-67192216f734; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_startCanary (17.91s) === CONT TestAccAWSSyntheticsCanary_s3 resource_aws_synthetics_canary_test.go:281: Step 1/2 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-rhjz4908) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: ea96e8db-b243-499e-b6e9-54e5d30c7604; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_s3 (16.68s) === CONT TestAccAWSSyntheticsCanary_runConfig resource_aws_synthetics_canary_test.go:326: Step 1/4 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-qy4r4rep) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: aee1cc0e-6f2d-4f8d-8720-91aa25333dcc; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_runConfig (15.30s) === CONT TestAccAWSSyntheticsCanary_runConfigTracing resource_aws_synthetics_canary_test.go:373: Step 1/4 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-44kmj0af) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 653d7e28-e3a6-4d5d-8da0-818cb7debb9a; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_runConfigTracing (14.80s) === CONT TestAccAWSSyntheticsCanary_vpc resource_aws_synthetics_canary_test.go:416: Step 1/4 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-278kyhh1) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 9e377590-2ea9-42db-8340-f181964fd388; Proxy: null) on terraform_plugin_test.tf line 150, in resource "aws_synthetics_canary" "test": 150: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_vpc (15.25s) === CONT TestAccAWSSyntheticsCanary_tags resource_aws_synthetics_canary_test.go:466: Step 1/4 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-8thffpcs) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 60d2ea31-fdcb-4c4e-85ec-eecda075d58c; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_tags (15.32s) === CONT TestAccAWSSyntheticsCanary_disappears resource_aws_synthetics_canary_test.go:513: Step 1/1 error: Error running apply: exit status 1 Error: error waiting for Synthetics Canary (tf-acc-test-yelzrxeu) creation: : The role defined for the function cannot be assumed by Lambda. (Service: AWSLambda; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 398f9321-06ea-4019-ba08-37594ec32f04; Proxy: null) on terraform_plugin_test.tf line 92, in resource "aws_synthetics_canary" "test": 92: resource "aws_synthetics_canary" "test" { --- FAIL: TestAccAWSSyntheticsCanary_disappears (15.34s) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSSyntheticsCanary_basic (105.78s) --- PASS: TestAccAWSSyntheticsCanary_disappears (59.55s) --- PASS: TestAccAWSSyntheticsCanary_runConfig (114.95s) --- PASS: TestAccAWSSyntheticsCanary_runConfigTracing (94.08s) --- PASS: TestAccAWSSyntheticsCanary_runtimeVersion (89.12s) --- PASS: TestAccAWSSyntheticsCanary_s3 (72.90s) --- PASS: TestAccAWSSyntheticsCanary_startCanary (124.81s) --- PASS: TestAccAWSSyntheticsCanary_startCanary_codeChanges (111.66s) --- PASS: TestAccAWSSyntheticsCanary_tags (115.10s) --- PASS: TestAccAWSSyntheticsCanary_vpc (678.91s) ``` * Update CHANGELOG for #18404 --- .changelog/18404.txt | 3 ++ aws/resource_aws_synthetics_canary.go | 61 ++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 .changelog/18404.txt diff --git a/.changelog/18404.txt b/.changelog/18404.txt new file mode 100644 index 00000000000..43e2b28b2fe --- /dev/null +++ b/.changelog/18404.txt @@ -0,0 +1,3 @@ +```release-note:bug +resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation +``` diff --git a/aws/resource_aws_synthetics_canary.go b/aws/resource_aws_synthetics_canary.go index 4da90e5ed94..eb109806e8c 100644 --- a/aws/resource_aws_synthetics_canary.go +++ b/aws/resource_aws_synthetics_canary.go @@ -10,11 +10,14 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/synthetics" + "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/synthetics/finder" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/synthetics/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) const awsMutexCanary = `aws_synthetics_canary` @@ -259,15 +262,59 @@ func resourceAwsSyntheticsCanaryCreate(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] creating Synthetics Canary: %#v", input) - resp, err := conn.CreateCanary(input) - if err != nil { - return fmt.Errorf("error creating Synthetics Canary: %w", err) - } + // Underlying IAM eventual consistency errors can occur after the creation + // operation. The goal is only retry these types of errors up to the IAM + // timeout. Since the creation process is asynchronous and can take up to + // its own timeout, we store a stop time upfront for checking. + iamwaiterStopTime := time.Now().Add(iamwaiter.PropagationTimeout) + + // Ensure to add IAM eventual consistency timeout in case of retries + err = resource.Retry(iamwaiter.PropagationTimeout+waiter.CanaryCreatedTimeout, func() *resource.RetryError { + // Only retry IAM eventual consistency errors up to that timeout + iamwaiterRetry := time.Now().Before(iamwaiterStopTime) + + resp, err := conn.CreateCanary(input) + + if err != nil { + return resource.NonRetryableError(fmt.Errorf("error creating Synthetics Canary: %w", err)) + } - d.SetId(aws.StringValue(resp.Canary.Name)) + if resp == nil || resp.Canary == nil { + return resource.NonRetryableError(fmt.Errorf("error creating Synthetics Canary: empty response")) + } + + d.SetId(aws.StringValue(resp.Canary.Name)) + + _, err = waiter.CanaryReady(conn, d.Id()) + + if err != nil { + // This error synthesized from the Status object and not an AWS SDK Go error type + if iamwaiterRetry && strings.Contains(err.Error(), "The role defined for the function cannot be assumed by Lambda") { + return resource.RetryableError(fmt.Errorf("error waiting for Synthetics Canary (%s) creation: %w", d.Id(), err)) + } - if _, err := waiter.CanaryReady(conn, d.Id()); err != nil { - return fmt.Errorf("error waiting for Synthetics Canary (%s) creation: %w", d.Id(), err) + return resource.NonRetryableError(fmt.Errorf("error waiting for Synthetics Canary (%s) creation: %w", d.Id(), err)) + } + + return nil + }) + + if tfresource.TimedOut(err) { + resp, err := conn.CreateCanary(input) + + if err != nil { + return fmt.Errorf("error creating Synthetics Canary: %w", err) + } + + if resp == nil || resp.Canary == nil { + return fmt.Errorf("error creating Synthetics Canary: empty response") + } + + d.SetId(aws.StringValue(resp.Canary.Name)) + + if _, err = waiter.CanaryReady(conn, d.Id()); err != nil { + return fmt.Errorf("error waiting for Synthetics Canary (%s) creation: %w", d.Id(), err) + } } if v := d.Get("start_canary"); v.(bool) { From 3361f550b92610ba235cb2afeadf3cf18bea6f39 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 26 Mar 2021 17:20:19 +0000 Subject: [PATCH 1227/1252] Update CHANGELOG.md for #18404 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9f2d0a549c..c5f025089e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 3.35.0 (Unreleased) +BUG FIXES: + +* resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation ([#18404](https://github.com/hashicorp/terraform-provider-aws/issues/18404)) + ## 3.34.0 (March 26, 2021) NOTES: From 3a08c224326bcdb681d5e8aa67e7431c3b657e56 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Fri, 26 Mar 2021 20:34:52 +0300 Subject: [PATCH 1228/1252] service/iam: Policy tagging support and add policy_id attribute (#18276) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSDataSourceIAMPolicy_basic (20.45s) --- PASS: TestAccAWSIAMPolicy_basic (22.11s) --- PASS: TestAccAWSIAMPolicy_description (21.92s) --- PASS: TestAccAWSIAMPolicy_disappears (18.51s) --- PASS: TestAccAWSIAMPolicy_namePrefix (22.36s) --- PASS: TestAccAWSIAMPolicy_path (22.27s) --- PASS: TestAccAWSIAMPolicy_policy (29.66s) --- PASS: TestAccAWSIAMPolicy_tags (36.52s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSDataSourceIAMPolicy_basic (25.35s) --- PASS: TestAccAWSIAMPolicy_basic (27.37s) --- PASS: TestAccAWSIAMPolicy_description (27.37s) --- PASS: TestAccAWSIAMPolicy_disappears (21.46s) --- PASS: TestAccAWSIAMPolicy_namePrefix (27.86s) --- PASS: TestAccAWSIAMPolicy_path (27.19s) --- PASS: TestAccAWSIAMPolicy_policy (41.21s) --- PASS: TestAccAWSIAMPolicy_tags (53.53s) ``` --- .changelog/18276.txt | 11 +++ aws/data_source_aws_iam_policy.go | 5 + aws/data_source_aws_iam_policy_test.go | 19 ++-- aws/internal/keyvaluetags/iam_tags.go | 35 +++++++ aws/resource_aws_iam_policy.go | 109 +++++++++++++--------- aws/resource_aws_iam_policy_test.go | 117 +++++++++++++++++++++--- website/docs/d/iam_policy.html.markdown | 2 + website/docs/r/iam_policy.html.markdown | 4 +- 8 files changed, 237 insertions(+), 65 deletions(-) create mode 100644 .changelog/18276.txt diff --git a/.changelog/18276.txt b/.changelog/18276.txt new file mode 100644 index 00000000000..b94e07e663c --- /dev/null +++ b/.changelog/18276.txt @@ -0,0 +1,11 @@ +```release-note:enhancement +resource/aws_iam_policy: Add tagging support +``` + +```release-note:enhancement +resource/aws_iam_policy: Add `policy_id` attribute +``` + +```release-note:enhancement +data-source/aws_iam_policy: Add `policy_id` and `tags` attributes +``` diff --git a/aws/data_source_aws_iam_policy.go b/aws/data_source_aws_iam_policy.go index 8e2d3fdd161..3a2233aac96 100644 --- a/aws/data_source_aws_iam_policy.go +++ b/aws/data_source_aws_iam_policy.go @@ -30,6 +30,11 @@ func dataSourceAwsIAMPolicy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "policy_id": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchemaComputed(), }, } } diff --git a/aws/data_source_aws_iam_policy_test.go b/aws/data_source_aws_iam_policy_test.go index 42bf6de1142..e3246cac11e 100644 --- a/aws/data_source_aws_iam_policy_test.go +++ b/aws/data_source_aws_iam_policy_test.go @@ -10,7 +10,8 @@ import ( ) func TestAccAWSDataSourceIAMPolicy_basic(t *testing.T) { - resourceName := "data.aws_iam_policy.test" + datasourceName := "data.aws_iam_policy.test" + resourceName := "aws_iam_policy.test" policyName := fmt.Sprintf("test-policy-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ @@ -21,11 +22,13 @@ func TestAccAWSDataSourceIAMPolicy_basic(t *testing.T) { { Config: testAccAwsDataSourceIamPolicyConfig(policyName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(resourceName, "name", policyName), - resource.TestCheckResourceAttr(resourceName, "description", "My test policy"), - resource.TestCheckResourceAttr(resourceName, "path", "/"), - resource.TestCheckResourceAttrSet(resourceName, "policy"), - resource.TestCheckResourceAttrPair(resourceName, "arn", "aws_iam_policy.test_policy", "arn"), + resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(datasourceName, "description", resourceName, "description"), + resource.TestCheckResourceAttrPair(datasourceName, "path", resourceName, "path"), + resource.TestCheckResourceAttrPair(datasourceName, "policy", resourceName, "policy"), + resource.TestCheckResourceAttrPair(datasourceName, "policy_id", resourceName, "policy_id"), + resource.TestCheckResourceAttrPair(datasourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(datasourceName, "tags", resourceName, "tags"), ), }, }, @@ -35,7 +38,7 @@ func TestAccAWSDataSourceIAMPolicy_basic(t *testing.T) { func testAccAwsDataSourceIamPolicyConfig(policyName string) string { return fmt.Sprintf(` -resource "aws_iam_policy" "test_policy" { +resource "aws_iam_policy" "test" { name = "%s" path = "/" description = "My test policy" @@ -57,7 +60,7 @@ EOF } data "aws_iam_policy" "test" { - arn = aws_iam_policy.test_policy.arn + arn = aws_iam_policy.test.arn } `, policyName) } diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go index a7af6a8c6e5..f67281a2f33 100644 --- a/aws/internal/keyvaluetags/iam_tags.go +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -151,6 +151,41 @@ func IamOpenIDConnectProviderUpdateTags(conn *iam.IAM, identifier string, oldTag return nil } +// IamPolicyUpdateTags updates IAM Policy tags. +// The identifier is the Policy ARN. +func IamPolicyUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagPolicyInput{ + PolicyArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagPolicy(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagPolicyInput{ + PolicyArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagPolicy(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + // IamSAMLProviderUpdateTags updates IAM SAML Provider tags. // The identifier is the SAML Provider ARN. func IamSAMLProviderUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { diff --git a/aws/resource_aws_iam_policy.go b/aws/resource_aws_iam_policy.go index 6feee9a8cbe..ef7c52a25ff 100644 --- a/aws/resource_aws_iam_policy.go +++ b/aws/resource_aws_iam_policy.go @@ -11,6 +11,7 @@ import ( "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" ) @@ -67,12 +68,17 @@ func resourceAwsIamPolicy() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "policy_id": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } func resourceAwsIamPolicyCreate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn var name string if v, ok := d.GetOk("name"); ok { @@ -88,11 +94,12 @@ func resourceAwsIamPolicyCreate(d *schema.ResourceData, meta interface{}) error Path: aws.String(d.Get("path").(string)), PolicyDocument: aws.String(d.Get("policy").(string)), PolicyName: aws.String(name), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().IamTags(), } - response, err := iamconn.CreatePolicy(request) + response, err := conn.CreatePolicy(request) if err != nil { - return fmt.Errorf("Error creating IAM policy %s: %s", name, err) + return fmt.Errorf("Error creating IAM policy %s: %w", name, err) } d.SetId(aws.StringValue(response.Policy.Arn)) @@ -101,7 +108,8 @@ func resourceAwsIamPolicyCreate(d *schema.ResourceData, meta interface{}) error } func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn + ignoreTagsConfig := meta.(*AWSClient).IgnoreTagsConfig getPolicyRequest := &iam.GetPolicyInput{ PolicyArn: aws.String(d.Id()), @@ -112,7 +120,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { var getPolicyResponse *iam.GetPolicyOutput err := resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error - getPolicyResponse, err = iamconn.GetPolicy(getPolicyRequest) + getPolicyResponse, err = conn.GetPolicy(getPolicyRequest) if d.IsNewResource() && isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { return resource.RetryableError(err) @@ -125,7 +133,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { return nil }) if isResourceTimeoutError(err) { - getPolicyResponse, err = iamconn.GetPolicy(getPolicyRequest) + getPolicyResponse, err = conn.GetPolicy(getPolicyRequest) } if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { log.Printf("[WARN] IAM Policy (%s) not found, removing from state", d.Id()) @@ -134,7 +142,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("Error reading IAM policy %s: %s", d.Id(), err) + return fmt.Errorf("Error reading IAM policy %s: %w", d.Id(), err) } if getPolicyResponse == nil || getPolicyResponse.Policy == nil { @@ -143,16 +151,22 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { return nil } - d.Set("arn", getPolicyResponse.Policy.Arn) - d.Set("description", getPolicyResponse.Policy.Description) - d.Set("name", getPolicyResponse.Policy.PolicyName) - d.Set("path", getPolicyResponse.Policy.Path) + policyRes := getPolicyResponse.Policy + d.Set("arn", policyRes.Arn) + d.Set("description", policyRes.Description) + d.Set("name", policyRes.PolicyName) + d.Set("path", policyRes.Path) + d.Set("policy_id", policyRes.PolicyId) + + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(policyRes.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { + return fmt.Errorf("error setting tags: %w", err) + } // Retrieve policy getPolicyVersionRequest := &iam.GetPolicyVersionInput{ PolicyArn: aws.String(d.Id()), - VersionId: getPolicyResponse.Policy.DefaultVersionId, + VersionId: policyRes.DefaultVersionId, } log.Printf("[DEBUG] Getting IAM Policy Version: %s", getPolicyVersionRequest) @@ -160,7 +174,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { var getPolicyVersionResponse *iam.GetPolicyVersionOutput err = resource.Retry(waiter.PropagationTimeout, func() *resource.RetryError { var err error - getPolicyVersionResponse, err = iamconn.GetPolicyVersion(getPolicyVersionRequest) + getPolicyVersionResponse, err = conn.GetPolicyVersion(getPolicyVersionRequest) if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { return resource.RetryableError(err) @@ -173,7 +187,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { return nil }) if isResourceTimeoutError(err) { - getPolicyVersionResponse, err = iamconn.GetPolicyVersion(getPolicyVersionRequest) + getPolicyVersionResponse, err = conn.GetPolicyVersion(getPolicyVersionRequest) } if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { log.Printf("[WARN] IAM Policy (%s) not found, removing from state", d.Id()) @@ -182,7 +196,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { } if err != nil { - return fmt.Errorf("Error reading IAM policy version %s: %s", d.Id(), err) + return fmt.Errorf("Error reading IAM policy version %s: %w", d.Id(), err) } policy := "" @@ -190,7 +204,7 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { var err error policy, err = url.QueryUnescape(aws.StringValue(getPolicyVersionResponse.PolicyVersion.Document)) if err != nil { - return fmt.Errorf("error parsing policy: %s", err) + return fmt.Errorf("error parsing policy: %w", err) } } @@ -200,29 +214,40 @@ func resourceAwsIamPolicyRead(d *schema.ResourceData, meta interface{}) error { } func resourceAwsIamPolicyUpdate(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn - if err := iamPolicyPruneVersions(d.Id(), iamconn); err != nil { - return err - } + if d.HasChangeExcept("tags") { - request := &iam.CreatePolicyVersionInput{ - PolicyArn: aws.String(d.Id()), - PolicyDocument: aws.String(d.Get("policy").(string)), - SetAsDefault: aws.Bool(true), + if err := iamPolicyPruneVersions(d.Id(), conn); err != nil { + return err + } + + request := &iam.CreatePolicyVersionInput{ + PolicyArn: aws.String(d.Id()), + PolicyDocument: aws.String(d.Get("policy").(string)), + SetAsDefault: aws.Bool(true), + } + + if _, err := conn.CreatePolicyVersion(request); err != nil { + return fmt.Errorf("Error updating IAM policy %s: %w", d.Id(), err) + } } - if _, err := iamconn.CreatePolicyVersion(request); err != nil { - return fmt.Errorf("Error updating IAM policy %s: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.IamPolicyUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags for IAM Policy (%s): %w", d.Id(), err) + } } return resourceAwsIamPolicyRead(d, meta) } func resourceAwsIamPolicyDelete(d *schema.ResourceData, meta interface{}) error { - iamconn := meta.(*AWSClient).iamconn + conn := meta.(*AWSClient).iamconn - if err := iamPolicyDeleteNondefaultVersions(d.Id(), iamconn); err != nil { + if err := iamPolicyDeleteNondefaultVersions(d.Id(), conn); err != nil { return err } @@ -230,11 +255,11 @@ func resourceAwsIamPolicyDelete(d *schema.ResourceData, meta interface{}) error PolicyArn: aws.String(d.Id()), } - if _, err := iamconn.DeletePolicy(request); err != nil { + if _, err := conn.DeletePolicy(request); err != nil { if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { return nil } - return fmt.Errorf("Error deleting IAM policy %s: %s", d.Id(), err) + return fmt.Errorf("Error deleting IAM policy %s: %w", d.Id(), err) } return nil @@ -247,8 +272,8 @@ func resourceAwsIamPolicyDelete(d *schema.ResourceData, meta interface{}) error // // The default version is never deleted. -func iamPolicyPruneVersions(arn string, iamconn *iam.IAM) error { - versions, err := iamPolicyListVersions(arn, iamconn) +func iamPolicyPruneVersions(arn string, conn *iam.IAM) error { + versions, err := iamPolicyListVersions(arn, conn) if err != nil { return err } @@ -268,12 +293,12 @@ func iamPolicyPruneVersions(arn string, iamconn *iam.IAM) error { } } - err1 := iamPolicyDeleteVersion(arn, *oldestVersion.VersionId, iamconn) + err1 := iamPolicyDeleteVersion(arn, aws.StringValue(oldestVersion.VersionId), conn) return err1 } -func iamPolicyDeleteNondefaultVersions(arn string, iamconn *iam.IAM) error { - versions, err := iamPolicyListVersions(arn, iamconn) +func iamPolicyDeleteNondefaultVersions(arn string, conn *iam.IAM) error { + versions, err := iamPolicyListVersions(arn, conn) if err != nil { return err } @@ -282,7 +307,7 @@ func iamPolicyDeleteNondefaultVersions(arn string, iamconn *iam.IAM) error { if *version.IsDefaultVersion { continue } - if err := iamPolicyDeleteVersion(arn, *version.VersionId, iamconn); err != nil { + if err := iamPolicyDeleteVersion(arn, aws.StringValue(version.VersionId), conn); err != nil { return err } } @@ -290,27 +315,27 @@ func iamPolicyDeleteNondefaultVersions(arn string, iamconn *iam.IAM) error { return nil } -func iamPolicyDeleteVersion(arn, versionID string, iamconn *iam.IAM) error { +func iamPolicyDeleteVersion(arn, versionID string, conn *iam.IAM) error { request := &iam.DeletePolicyVersionInput{ PolicyArn: aws.String(arn), VersionId: aws.String(versionID), } - _, err := iamconn.DeletePolicyVersion(request) + _, err := conn.DeletePolicyVersion(request) if err != nil { - return fmt.Errorf("Error deleting version %s from IAM policy %s: %s", versionID, arn, err) + return fmt.Errorf("Error deleting version %s from IAM policy %s: %w", versionID, arn, err) } return nil } -func iamPolicyListVersions(arn string, iamconn *iam.IAM) ([]*iam.PolicyVersion, error) { +func iamPolicyListVersions(arn string, conn *iam.IAM) ([]*iam.PolicyVersion, error) { request := &iam.ListPolicyVersionsInput{ PolicyArn: aws.String(arn), } - response, err := iamconn.ListPolicyVersions(request) + response, err := conn.ListPolicyVersions(request) if err != nil { - return nil, fmt.Errorf("Error listing versions for IAM policy %s: %s", arn, err) + return nil, fmt.Errorf("Error listing versions for IAM policy %s: %w", arn, err) } return response.Versions, nil } diff --git a/aws/resource_aws_iam_policy_test.go b/aws/resource_aws_iam_policy_test.go index 8335b961744..584c617ee84 100644 --- a/aws/resource_aws_iam_policy_test.go +++ b/aws/resource_aws_iam_policy_test.go @@ -126,6 +126,8 @@ func TestAccAWSIAMPolicy_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "path", "/"), resource.TestCheckResourceAttr(resourceName, "policy", expectedPolicyText), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttrSet(resourceName, "policy_id"), ), }, { @@ -164,6 +166,51 @@ func TestAccAWSIAMPolicy_description(t *testing.T) { }) } +func TestAccAWSIAMPolicy_tags(t *testing.T) { + var out iam.GetPolicyOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_iam_policy.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ErrorCheck: testAccErrorCheck(t, iam.EndpointsID), + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSIAMPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSIAMPolicyConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIAMPolicyExists(resourceName, &out), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSIAMPolicyConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIAMPolicyExists(resourceName, &out), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSIAMPolicyConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSIAMPolicyExists(resourceName, &out), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSIAMPolicy_disappears(t *testing.T) { var out iam.GetPolicyOutput rName := acctest.RandomWithPrefix("tf-acc-test") @@ -179,7 +226,7 @@ func TestAccAWSIAMPolicy_disappears(t *testing.T) { Config: testAccAWSIAMPolicyConfigName(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSIAMPolicyExists(resourceName, &out), - testAccCheckAWSIAMPolicyDisappears(&out), + testAccCheckResourceDisappears(testAccProvider, resourceAwsIamPolicy(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -334,19 +381,6 @@ func testAccCheckAWSIAMPolicyDestroy(s *terraform.State) error { return nil } -func testAccCheckAWSIAMPolicyDisappears(out *iam.GetPolicyOutput) resource.TestCheckFunc { - return func(s *terraform.State) error { - iamconn := testAccProvider.Meta().(*AWSClient).iamconn - - params := &iam.DeletePolicyInput{ - PolicyArn: out.Policy.Arn, - } - - _, err := iamconn.DeletePolicy(params) - return err - } -} - func testAccAWSIAMPolicyConfigDescription(rName, description string) string { return fmt.Sprintf(` resource "aws_iam_policy" "test" { @@ -449,3 +483,58 @@ resource "aws_iam_policy" "test" { } `, rName, policy) } + +func testAccAWSIAMPolicyConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_policy" "test" { + name = %q + + policy = < Date: Fri, 26 Mar 2021 20:47:18 +0300 Subject: [PATCH 1229/1252] resource/aws_ssm_parameter: Tag on create + validations (#17830) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSSSMParameter_disappears (35.77s) --- PASS: TestAccAWSSSMParameter_fullPath (51.23s) --- PASS: TestAccAWSSSMParameter_basic (51.86s) --- PASS: TestAccAWSSSMParameter_secure (52.09s) --- PASS: TestAccAWSSSMParameter_DataType_AwsEc2Image (58.46s) --- PASS: TestAccAWSSSMParameter_secure_with_key (60.49s) --- PASS: TestAccAWSSSMParameter_overwrite (77.69s) --- PASS: TestAccAWSSSMParameter_changeNameForcesNew (82.64s) --- PASS: TestAccAWSSSMParameter_updateDescription (82.84s) --- PASS: TestAccAWSSSMParameter_updateType (83.08s) --- PASS: TestAccAWSSSMParameter_secure_keyUpdate (85.13s) --- PASS: TestAccAWSSSMParameter_Tier_IntelligentTieringToStandard (93.66s) --- PASS: TestAccAWSSSMParameter_tags (94.47s) --- PASS: TestAccAWSSSMParameter_Tier (96.68s) --- PASS: TestAccAWSSSMParameter_Tier_IntelligentTieringToAdvanced (98.75s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSSSMParameter_disappears (40.39s) --- PASS: TestAccAWSSSMParameter_fullPath (59.78s) --- PASS: TestAccAWSSSMParameter_secure (59.78s) --- PASS: TestAccAWSSSMParameter_DataType_AwsEc2Image (59.81s) --- PASS: TestAccAWSSSMParameter_secure_with_key (59.87s) --- PASS: TestAccAWSSSMParameter_basic (59.88s) --- PASS: TestAccAWSSSMParameter_changeNameForcesNew (77.00s) --- PASS: TestAccAWSSSMParameter_updateDescription (83.65s) --- PASS: TestAccAWSSSMParameter_overwrite (84.29s) --- PASS: TestAccAWSSSMParameter_updateType (84.34s) --- PASS: TestAccAWSSSMParameter_secure_keyUpdate (85.81s) --- PASS: TestAccAWSSSMParameter_Tier_IntelligentTieringToStandard (97.59s) --- PASS: TestAccAWSSSMParameter_tags (100.37s) --- PASS: TestAccAWSSSMParameter_Tier (100.40s) --- PASS: TestAccAWSSSMParameter_Tier_IntelligentTieringToAdvanced (103.42s) ``` --- .changelog/17830.txt | 7 ++++++ aws/resource_aws_ssm_parameter.go | 41 ++++++++++++++++++------------- 2 files changed, 31 insertions(+), 17 deletions(-) create mode 100644 .changelog/17830.txt diff --git a/.changelog/17830.txt b/.changelog/17830.txt new file mode 100644 index 00000000000..ca76c19e6fc --- /dev/null +++ b/.changelog/17830.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_ssm_parameter: Add plan time validation to `name`, `description` and `allowed_pattern` +``` + +```release-note:enhancement +resource/aws_ssm_parameter: Tag on create +``` diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index 901fd3d81be..b9d6ad46a9f 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -32,13 +32,15 @@ func resourceAwsSsmParameter() *schema.Resource { Schema: map[string]*schema.Schema{ "name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringLenBetween(1, 2048), }, "description": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "tier": { Type: schema.TypeString, @@ -83,8 +85,9 @@ func resourceAwsSsmParameter() *schema.Resource { Optional: true, }, "allowed_pattern": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "version": { Type: schema.TypeInt, @@ -164,7 +167,7 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error } describeResp, err := ssmconn.DescribeParameters(describeParamsInput) if err != nil { - return fmt.Errorf("error describing SSM parameter: %s", err) + return fmt.Errorf("error describing SSM parameter: %w", err) } if describeResp == nil || len(describeResp.Parameters) == 0 || describeResp.Parameters[0] == nil { @@ -186,11 +189,11 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error tags, err := keyvaluetags.SsmListTags(ssmconn, name, ssm.ResourceTypeForTaggingParameter) if err != nil { - return fmt.Errorf("error listing tags for SSM Parameter (%s): %s", name, err) + return fmt.Errorf("error listing tags for SSM Parameter (%s): %w", name, err) } if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) } d.Set("arn", param.ARN) @@ -216,10 +219,11 @@ func resourceAwsSsmParameterDelete(d *schema.ResourceData, meta interface{}) err func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error { ssmconn := meta.(*AWSClient).ssmconn - log.Printf("[INFO] Creating SSM Parameter: %s", d.Get("name").(string)) + name := d.Get("name").(string) + log.Printf("[INFO] Creating SSM Parameter: %s", name) paramInput := &ssm.PutParameterInput{ - Name: aws.String(d.Get("name").(string)), + Name: aws.String(name), Type: aws.String(d.Get("type").(string)), Tier: aws.String(d.Get("tier").(string)), Value: aws.String(d.Get("value").(string)), @@ -240,6 +244,10 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error paramInput.SetKeyId(keyID.(string)) } + if v, ok := d.GetOk("tags"); ok && d.IsNewResource() { + paramInput.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SsmTags() + } + log.Printf("[DEBUG] Waiting for SSM Parameter %v to be updated", d.Get("name")) _, err := ssmconn.PutParameter(paramInput) @@ -249,19 +257,18 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error } if err != nil { - return fmt.Errorf("error creating SSM parameter: %s", err) + return fmt.Errorf("error creating SSM parameter: %w", err) } - name := d.Get("name").(string) - if d.HasChange("tags") { + if !d.IsNewResource() && d.HasChange("tags") { o, n := d.GetChange("tags") if err := keyvaluetags.SsmUpdateTags(ssmconn, name, ssm.ResourceTypeForTaggingParameter, o, n); err != nil { - return fmt.Errorf("error updating SSM Parameter (%s) tags: %s", name, err) + return fmt.Errorf("error updating SSM Parameter (%s) tags: %w", name, err) } } - d.SetId(d.Get("name").(string)) + d.SetId(name) return resourceAwsSsmParameterRead(d, meta) } From cf2b1967eb5b2e6f51ab87f6f0d059b3308e3666 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Mar 2021 13:49:38 -0400 Subject: [PATCH 1230/1252] build(deps): Bump github.com/aws/aws-sdk-go from 1.38.0 to 1.38.6 (#18424) Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.38.0 to 1.38.6. - [Release notes](https://github.com/aws/aws-sdk-go/releases) - [Changelog](https://github.com/aws/aws-sdk-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-go/compare/v1.38.0...v1.38.6) 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 f3fff429233..f871edf996c 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws go 1.16 require ( - github.com/aws/aws-sdk-go v1.38.0 + github.com/aws/aws-sdk-go v1.38.6 github.com/beevik/etree v1.1.0 github.com/fatih/color v1.9.0 // indirect github.com/hashicorp/aws-sdk-go-base v0.7.0 diff --git a/go.sum b/go.sum index ca88e1982cc..b6655438a2e 100644 --- a/go.sum +++ b/go.sum @@ -55,8 +55,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.31.9/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0= -github.com/aws/aws-sdk-go v1.38.0 h1:mqnmtdW8rGIQmp2d0WRFLua0zW0Pel0P6/vd3gJuViY= -github.com/aws/aws-sdk-go v1.38.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.38.6 h1:h0AKIaz/A1kEJ50HxCv7tL1GW+KbxYbp75+lZ/nvFOI= +github.com/aws/aws-sdk-go v1.38.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs= github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= From e74a20106459aadf28f99c35e4aee4d6a69a2a47 Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 26 Mar 2021 17:51:16 +0000 Subject: [PATCH 1231/1252] Update CHANGELOG.md for #18424 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5f025089e5..66aa3d3d814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## 3.35.0 (Unreleased) +ENHANCEMENTS: + +* data-source/aws_iam_policy: Add `policy_id` and `tags` attributes ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) +* resource/aws_iam_policy: Add `policy_id` attribute ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) +* resource/aws_iam_policy: Add tagging support ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) +* resource/aws_ssm_parameter: Add plan time validation to `name`, `description` and `allowed_pattern` ([#17830](https://github.com/hashicorp/terraform-provider-aws/issues/17830)) +* resource/aws_ssm_parameter: Tag on create ([#17830](https://github.com/hashicorp/terraform-provider-aws/issues/17830)) + BUG FIXES: * resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation ([#18404](https://github.com/hashicorp/terraform-provider-aws/issues/18404)) From b5fb25d5c918d2463dc8a39970c31e9d3c30a854 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Mar 2021 17:58:42 +0000 Subject: [PATCH 1232/1252] build(deps): Bump github.com/aws/aws-sdk-go in /awsproviderlint (#18422) --- awsproviderlint/go.mod | 2 +- awsproviderlint/go.sum | 4 +- .../aws/aws-sdk-go/aws/endpoints/defaults.go | 12 - .../github.com/aws/aws-sdk-go/aws/version.go | 2 +- .../aws/aws-sdk-go/service/s3/api.go | 233 ++++++++++-------- awsproviderlint/vendor/modules.txt | 2 +- 6 files changed, 142 insertions(+), 113 deletions(-) diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index d42c5b438c8..369eeda6f03 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -3,7 +3,7 @@ module github.com/terraform-providers/terraform-provider-aws/awsproviderlint go 1.16 require ( - github.com/aws/aws-sdk-go v1.38.0 + github.com/aws/aws-sdk-go v1.38.6 github.com/bflad/tfproviderlint v0.24.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index 2fad834c143..d03f71c440f 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -58,8 +58,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.38.0 h1:mqnmtdW8rGIQmp2d0WRFLua0zW0Pel0P6/vd3gJuViY= -github.com/aws/aws-sdk-go v1.38.0/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= +github.com/aws/aws-sdk-go v1.38.6 h1:h0AKIaz/A1kEJ50HxCv7tL1GW+KbxYbp75+lZ/nvFOI= +github.com/aws/aws-sdk-go v1.38.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= 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.24.0 h1:q7nuajx5fjlaH4L4DUDoNlME+MkaHUHDv5d20qmXJ6Y= diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go index 05cbff6294e..ee958ece47c 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/endpoints/defaults.go @@ -8270,18 +8270,6 @@ var awsusgovPartition = partition{ "batch": service{ Endpoints: endpoints{ - "fips-us-gov-east-1": endpoint{ - Hostname: "batch.us-gov-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-east-1", - }, - }, - "fips-us-gov-west-1": endpoint{ - Hostname: "batch.us-gov-west-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-gov-west-1", - }, - }, "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go index 937f765df1b..7092e4a5192 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.38.0" +const SDKVersion = "1.38.6" diff --git a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go index 6cc91dd2c56..6d15bad28f7 100644 --- a/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ b/awsproviderlint/vendor/github.com/aws/aws-sdk-go/service/s3/api.go @@ -2096,7 +2096,8 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // // Removes the null version (if there is one) of an object and inserts a delete // marker, which becomes the latest version of the object. If there isn't a -// null version, Amazon S3 does not remove any objects. +// null version, Amazon S3 does not remove any objects but will still respond +// that the command was successful. // // To remove a specific version, you must be the bucket owner and you must use // the version Id subresource. Using this subresource permanently deletes the @@ -6188,6 +6189,9 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req // use request parameters as selection criteria to return metadata about a subset // of all the object versions. // +// To use this operation, you must have permissions to perform the s3:ListBucketVersions +// action. Be aware of the name difference. +// // A 200 OK response can contain valid or invalid XML. Make sure to design your // application to parse the contents of the response and handle it appropriately. // @@ -9194,7 +9198,7 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // The Content-MD5 header is required for any request to upload an object with // a retention period configured using Amazon S3 Object Lock. For more information // about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. // // Server-side Encryption // @@ -9490,14 +9494,11 @@ func (c *S3) PutObjectLegalHoldRequest(input *PutObjectLegalHoldInput) (req *req // PutObjectLegalHold API operation for Amazon Simple Storage Service. // -// Applies a Legal Hold configuration to the specified object. +// Applies a Legal Hold configuration to the specified object. For more information, +// see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). // // This action is not supported by Amazon S3 on Outposts. // -// Related Resources -// -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -9576,14 +9577,16 @@ func (c *S3) PutObjectLockConfigurationRequest(input *PutObjectLockConfiguration // // Places an Object Lock configuration on the specified bucket. The rule specified // in the Object Lock configuration will be applied by default to every new -// object placed in the specified bucket. +// object placed in the specified bucket. For more information, see Locking +// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). // -// DefaultRetention requires either Days or Years. You can't specify both at -// the same time. +// * The DefaultRetention settings require both a mode and a period. // -// Related Resources +// * The DefaultRetention period can be either Days or Years but you must +// select one. You cannot specify Days and Years at the same time. // -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) +// * You can only enable Object Lock for new buckets. If you want to turn +// on Object Lock for an existing bucket, contact AWS Support. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9661,14 +9664,11 @@ func (c *S3) PutObjectRetentionRequest(input *PutObjectRetentionInput) (req *req // PutObjectRetention API operation for Amazon Simple Storage Service. // -// Places an Object Retention configuration on an object. +// Places an Object Retention configuration on an object. For more information, +// see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). // // This action is not supported by Amazon S3 on Outposts. // -// Related Resources -// -// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html) -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -10905,6 +10905,32 @@ func (c *S3) WriteGetObjectResponseRequest(input *WriteGetObjectResponseInput) ( // a customer-owned Lambda function, the metadata returned to the end user GetObject // call might differ from what Amazon S3 would normally return. // +// AWS provides some prebuilt Lambda functions that you can use with S3 Object +// Lambda to detect and redact personally identifiable information (PII) and +// decompress S3 objects. These Lambda functions are available in the AWS Serverless +// Application Repository, and can be selected through the AWS Management Console +// when you create your Object Lambda Access Point. +// +// Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, +// a natural language processing (NLP) service using machine learning to find +// insights and relationships in text. It automatically detects personally identifiable +// information (PII) such as names, addresses, dates, credit card numbers, and +// social security numbers from documents in your Amazon S3 bucket. +// +// Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a +// natural language processing (NLP) service using machine learning to find +// insights and relationships in text. It automatically redacts personally identifiable +// information (PII) such as names, addresses, dates, credit card numbers, and +// social security numbers from documents in your Amazon S3 bucket. +// +// Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, +// is equipped to decompress objects stored in S3 in one of six compressed file +// formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. +// +// For information on how to view and use these functions, see Using AWS built +// Lambda functions (https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html) +// in the Amazon S3 User Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -10937,7 +10963,7 @@ func (c *S3) WriteGetObjectResponseWithContext(ctx aws.Context, input *WriteGetO // that Amazon S3 will wait before permanently removing all parts of the upload. // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type AbortIncompleteMultipartUpload struct { _ struct{} `type:"structure"` @@ -10972,7 +10998,7 @@ type AbortMultipartUploadInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -10980,7 +11006,7 @@ type AbortMultipartUploadInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -11133,7 +11159,7 @@ func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipart // Configures the transfer acceleration state for an Amazon S3 bucket. For more // information, see Amazon S3 Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type AccelerateConfiguration struct { _ struct{} `type:"structure"` @@ -11611,7 +11637,7 @@ func (s *Bucket) SetName(v string) *Bucket { // Specifies the lifecycle configuration for objects in an Amazon S3 bucket. // For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type BucketLifecycleConfiguration struct { _ struct{} `type:"structure"` @@ -11705,7 +11731,7 @@ func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggin // Describes the cross-origin access configuration for objects in an Amazon // S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon -// Simple Storage Service Developer Guide. +// S3 User Guide. type CORSConfiguration struct { _ struct{} `type:"structure"` @@ -12266,7 +12292,7 @@ type CompleteMultipartUploadOutput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -12274,7 +12300,7 @@ type CompleteMultipartUploadOutput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Bucket *string `type:"string"` // Indicates whether the multipart upload uses an S3 Bucket Key for server-side @@ -12552,7 +12578,7 @@ type CopyObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -12560,7 +12586,7 @@ type CopyObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13469,7 +13495,7 @@ type CreateMultipartUploadInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -13477,7 +13503,7 @@ type CreateMultipartUploadInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13883,7 +13909,7 @@ type CreateMultipartUploadOutput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -13891,7 +13917,7 @@ type CreateMultipartUploadOutput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Bucket *string `locationName:"Bucket" type:"string"` // Indicates whether the multipart upload uses an S3 Bucket Key for server-side @@ -14024,17 +14050,24 @@ func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUplo // The container element for specifying the default Object Lock retention settings // for new objects placed in the specified bucket. +// +// * The DefaultRetention settings require both a mode and a period. +// +// * The DefaultRetention period can be either Days or Years but you must +// select one. You cannot specify Days and Years at the same time. type DefaultRetention struct { _ struct{} `type:"structure"` // The number of days that you want to specify for the default retention period. + // Must be used with Mode. Days *int64 `type:"integer"` // The default Object Lock retention mode you want to apply to new objects placed - // in the specified bucket. + // in the specified bucket. Must be used with either Days or Years. Mode *string `type:"string" enum:"ObjectLockRetentionMode"` // The number of years that you want to specify for the default retention period. + // Must be used with Mode. Years *int64 `type:"integer"` } @@ -15581,7 +15614,7 @@ type DeleteObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -15589,7 +15622,7 @@ type DeleteObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -15787,7 +15820,7 @@ type DeleteObjectTaggingInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -15795,7 +15828,7 @@ type DeleteObjectTaggingInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -15938,7 +15971,7 @@ type DeleteObjectsInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -15946,7 +15979,7 @@ type DeleteObjectsInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -17048,7 +17081,7 @@ type FilterRule struct { // the filtering rule applies. The maximum length is 1,024 characters. Overlapping // prefixes and suffixes are not supported. For more information, see Configuring // Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Name *string `type:"string" enum:"FilterRuleName"` // The value that the filter searches for in object key names. @@ -19458,7 +19491,7 @@ type GetObjectAclInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19632,7 +19665,7 @@ type GetObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -19640,7 +19673,7 @@ type GetObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19932,7 +19965,7 @@ type GetObjectLegalHoldInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -20087,7 +20120,7 @@ type GetObjectLockConfigurationInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -20535,7 +20568,7 @@ type GetObjectRetentionInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -20690,7 +20723,7 @@ type GetObjectTaggingInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -20698,7 +20731,7 @@ type GetObjectTaggingInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -21310,7 +21343,7 @@ type HeadBucketInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -21318,7 +21351,7 @@ type HeadBucketInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -21425,7 +21458,7 @@ type HeadObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -21433,7 +21466,7 @@ type HeadObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -21792,7 +21825,7 @@ type HeadObjectOutput struct { // If an archive copy is already restored, the header value indicates when Amazon // S3 is scheduled to delete the object copy. For example: // - // x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 + // x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 // GMT" // // If the object restoration is in progress, the header returns the value ongoing-request="true". @@ -22869,14 +22902,14 @@ type LambdaFunctionConfiguration struct { // The Amazon S3 bucket event for which to invoke the AWS Lambda function. For // more information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` // Specifies object key name filtering rules. For information about key name // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Filter *NotificationConfigurationFilter `type:"structure"` // An optional unique identifier for configurations in a notification configuration. @@ -23044,7 +23077,7 @@ type LifecycleRule struct { // that Amazon S3 will wait before permanently removing all parts of the upload. // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` // Specifies the expiration for the lifecycle of the object in the form of date, @@ -23052,7 +23085,8 @@ type LifecycleRule struct { Expiration *LifecycleExpiration `type:"structure"` // The Filter is used to identify objects that a Lifecycle Rule applies to. - // A Filter must have exactly one of Prefix, Tag, or And specified. + // A Filter must have exactly one of Prefix, Tag, or And specified. Filter is + // required if the LifecycleRule does not containt a Prefix element. Filter *LifecycleRuleFilter `type:"structure"` // Unique identifier for the rule. The value cannot be longer than 255 characters. @@ -23073,7 +23107,7 @@ type LifecycleRule struct { NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` // Prefix identifying one or more objects to which the rule applies. This is - // No longer used; use Filter instead. + // no longer used; use Filter instead. // // Replacement must be made for object keys containing special characters (such // as carriage returns) when using XML requests. For more information, see XML @@ -23954,7 +23988,7 @@ type ListMultipartUploadsInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -23962,7 +23996,7 @@ type ListMultipartUploadsInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -24594,7 +24628,7 @@ type ListObjectsInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -24602,7 +24636,7 @@ type ListObjectsInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -24888,7 +24922,7 @@ type ListObjectsV2Input struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -24896,7 +24930,7 @@ type ListObjectsV2Input struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -25124,7 +25158,7 @@ type ListObjectsV2Output struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -25132,7 +25166,7 @@ type ListObjectsV2Output struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Name *string `type:"string"` // NextContinuationToken is sent when isTruncated is true, which means there @@ -25240,7 +25274,7 @@ type ListPartsInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -25248,7 +25282,7 @@ type ListPartsInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -26155,7 +26189,7 @@ type NoncurrentVersionTransition struct { // perform the associated action. For information about the noncurrent days // calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent // (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. NoncurrentDays *int64 `type:"integer"` // The class of storage used to store the object. @@ -26317,7 +26351,7 @@ func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConf // Specifies object key name filtering rules. For information about key name // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// in the Amazon Simple Storage Service Developer Guide. +// in the Amazon S3 User Guide. type NotificationConfigurationFilter struct { _ struct{} `type:"structure"` @@ -26485,10 +26519,14 @@ func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { type ObjectLockConfiguration struct { _ struct{} `type:"structure"` - // Indicates whether this bucket has an Object Lock configuration enabled. + // Indicates whether this bucket has an Object Lock configuration enabled. Enable + // ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. ObjectLockEnabled *string `type:"string" enum:"ObjectLockEnabled"` - // The Object Lock rule in place for the specified object. + // Specifies the Object Lock rule for the specified object. Enable the this + // rule when you apply ObjectLockConfiguration to a bucket. Bucket settings + // require both a mode and a period. The period can be either Days or Years + // but you must select one. You cannot specify Days and Years at the same time. Rule *ObjectLockRule `type:"structure"` } @@ -26575,8 +26613,10 @@ func (s *ObjectLockRetention) SetRetainUntilDate(v time.Time) *ObjectLockRetenti type ObjectLockRule struct { _ struct{} `type:"structure"` - // The default retention period that you want to apply to new objects placed - // in the specified bucket. + // The default Object Lock retention mode and period that you want to apply + // to new objects placed in the specified bucket. Bucket settings require both + // a mode and a period. The period can be either Days or Years but you must + // select one. You cannot specify Days and Years at the same time. DefaultRetention *DefaultRetention `type:"structure"` } @@ -27698,7 +27738,7 @@ type PutBucketEncryptionInput struct { // Amazon S3-managed keys (SSE-S3) or customer master keys stored in AWS KMS // (SSE-KMS). For information about the Amazon S3 default encryption feature, // see Amazon S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -29654,7 +29694,7 @@ type PutObjectAclInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -29695,7 +29735,7 @@ type PutObjectAclInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -29703,7 +29743,7 @@ type PutObjectAclInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -29905,7 +29945,7 @@ type PutObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -29913,7 +29953,7 @@ type PutObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -30362,7 +30402,7 @@ type PutObjectLegalHoldInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -30792,7 +30832,7 @@ type PutObjectRetentionInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -30968,7 +31008,7 @@ type PutObjectTaggingInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -30976,7 +31016,7 @@ type PutObjectTaggingInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -31158,7 +31198,7 @@ type PutPublicAccessBlockInput struct { // S3 bucket. You can enable the configuration options in any combination. For // more information about when Amazon S3 considers a bucket or object public, // see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // PublicAccessBlockConfiguration is a required field PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `locationName:"PublicAccessBlockConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -31271,7 +31311,7 @@ type QueueConfiguration struct { // Specifies object key name filtering rules. For information about key name // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Filter *NotificationConfigurationFilter `type:"structure"` // An optional unique identifier for configurations in a notification configuration. @@ -31625,7 +31665,7 @@ type ReplicationConfiguration struct { // The Amazon Resource Name (ARN) of the AWS Identity and Access Management // (IAM) role that Amazon S3 assumes when replicating objects. For more information, // see How to Set Up Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Role is a required field Role *string `type:"string" required:"true"` @@ -31740,7 +31780,7 @@ type ReplicationRule struct { // with the highest priority. The higher the number, the higher the priority. // // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Priority *int64 `type:"integer"` // A container that describes additional filters for identifying the source @@ -32156,7 +32196,7 @@ type RestoreObjectInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -32164,7 +32204,7 @@ type RestoreObjectInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -32509,7 +32549,7 @@ type Rule struct { // that Amazon S3 will wait before permanently removing all parts of the upload. // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` // Specifies the expiration for the lifecycle of the object. @@ -33951,7 +33991,7 @@ type TopicConfiguration struct { // Specifies object key name filtering rules. For information about key name // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. Filter *NotificationConfigurationFilter `type:"structure"` // An optional unique identifier for configurations in a notification configuration. @@ -34131,7 +34171,7 @@ type UploadPartCopyInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -34139,7 +34179,7 @@ type UploadPartCopyInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -34573,7 +34613,7 @@ type UploadPartInput struct { // When using this action with an access point through the AWS SDKs, you provide // the access point ARN in place of the bucket name. For more information about // access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // When using this action with Amazon S3 on Outposts, you must direct requests // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form @@ -34581,7 +34621,7 @@ type UploadPartInput struct { // using this action using S3 on Outposts through the AWS SDKs, you provide // the Outposts bucket ARN in place of the bucket name. For more information // about S3 on Outposts ARNs, see Using S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon Simple Storage Service Developer Guide. + // in the Amazon S3 User Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -35054,7 +35094,8 @@ type WriteGetObjectResponseInput struct { // A string that uniquely identifies an error condition. Returned in the // tag of the error XML response for a corresponding GetObject call. Cannot // be used with a successful StatusCode header or when the transformed object - // is provided in the body. + // is provided in the body. All error codes from S3 are sentence-cased. Regex + // value is "^[A-Z][a-zA-Z]+$". ErrorCode *string `location:"header" locationName:"x-amz-fwd-error-code" type:"string"` // Contains a generic description of the error condition. Returned in the diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index 048a9a27bae..498d214814e 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -12,7 +12,7 @@ cloud.google.com/go/storage github.com/agext/levenshtein # github.com/apparentlymart/go-textseg/v12 v12.0.0 github.com/apparentlymart/go-textseg/v12/textseg -# github.com/aws/aws-sdk-go v1.38.0 +# github.com/aws/aws-sdk-go v1.38.6 ## explicit github.com/aws/aws-sdk-go/aws github.com/aws/aws-sdk-go/aws/arn From dc9dae26e1263148402a4f95a1598acb6693eb1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Mar 2021 18:10:42 +0000 Subject: [PATCH 1233/1252] build(deps): Bump github.com/bflad/tfproviderlint in /awsproviderlint (#18434) --- awsproviderlint/go.mod | 2 +- awsproviderlint/go.sum | 9 ++- .../helper/analysisutils/analyzers.go | 21 ++++++ .../helper/analysisutils/runners.go | 68 +++++++++++++++++++ .../helper/analysisutils/stdlib_analyzers.go | 13 ++++ .../helper/analysisutils/stdlib_runners.go | 23 +++++++ .../helper/schema/type_resource.go | 40 ++++++----- .../osexeccommandcallexpr.go | 11 +++ .../osexeccommandcontextcallexpr.go | 11 +++ .../osexeccommandcontextselectorexpr.go | 11 +++ .../osexeccommandselectorexpr.go | 11 +++ .../tfproviderlint/xpasses/XR006/XR006.go | 8 +-- .../tfproviderlint/xpasses/XR007/README.md | 28 ++++++++ .../tfproviderlint/xpasses/XR007/XR007.go | 15 ++++ .../tfproviderlint/xpasses/XR008/README.md | 28 ++++++++ .../tfproviderlint/xpasses/XR008/XR008.go | 15 ++++ .../bflad/tfproviderlint/xpasses/checks.go | 4 ++ awsproviderlint/vendor/modules.txt | 8 ++- 18 files changed, 297 insertions(+), 29 deletions(-) create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr/osexeccommandcallexpr.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr/osexeccommandcontextcallexpr.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr/osexeccommandcontextselectorexpr.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr/osexeccommandselectorexpr.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/XR007.go create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/README.md create mode 100644 awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/XR008.go diff --git a/awsproviderlint/go.mod b/awsproviderlint/go.mod index 369eeda6f03..d726f48f4b5 100644 --- a/awsproviderlint/go.mod +++ b/awsproviderlint/go.mod @@ -4,7 +4,7 @@ go 1.16 require ( github.com/aws/aws-sdk-go v1.38.6 - github.com/bflad/tfproviderlint v0.24.0 + github.com/bflad/tfproviderlint v0.26.0 github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 golang.org/x/tools v0.0.0-20201028111035-eafbe7b904eb ) diff --git a/awsproviderlint/go.sum b/awsproviderlint/go.sum index d03f71c440f..ab6f15db173 100644 --- a/awsproviderlint/go.sum +++ b/awsproviderlint/go.sum @@ -62,8 +62,8 @@ github.com/aws/aws-sdk-go v1.38.6 h1:h0AKIaz/A1kEJ50HxCv7tL1GW+KbxYbp75+lZ/nvFOI github.com/aws/aws-sdk-go v1.38.6/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= 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.24.0 h1:q7nuajx5fjlaH4L4DUDoNlME+MkaHUHDv5d20qmXJ6Y= -github.com/bflad/tfproviderlint v0.24.0/go.mod h1:hvNY+Nthz7T/LHmycyyBfgfHvtmkHVgZTwfVD89er3U= +github.com/bflad/tfproviderlint v0.26.0 h1:Xd+hbVlSQhKlXifpqmHPvlcnOK1lRS4IZf+cXBAUpCs= +github.com/bflad/tfproviderlint v0.26.0/go.mod h1:7Z9Pyl1Z1UWJcPBuyjN89D2NaJGpjReQb5NoaaQCthQ= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= @@ -206,9 +206,8 @@ github.com/hashicorp/terraform-json v0.8.0 h1:XObQ3PgqU52YLQKEaJ08QtUshAfN3yu4u8 github.com/hashicorp/terraform-json v0.8.0/go.mod h1:3defM4kkMfttwiE7VakJDwCd4R+umhSQnvJwORXbprE= github.com/hashicorp/terraform-plugin-go v0.2.1 h1:EW/R8bB2Zbkjmugzsy1d27yS8/0454b3MtYHkzOknqA= github.com/hashicorp/terraform-plugin-go v0.2.1/go.mod h1:10V6F3taeDWVAoLlkmArKttR3IULlRWFAGtQIQTIDr4= -github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5 h1:ECRaTJhZpRUs7SHB7qHIT4+elRSEWSOYvSx7T4Y0cVo= -github.com/hashicorp/terraform-plugin-sdk v1.16.1-0.20210222152151-32f0219df5b5/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= -github.com/hashicorp/terraform-plugin-sdk/v2 v2.4.4/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= +github.com/hashicorp/terraform-plugin-sdk v1.16.1 h1:G2iK7MBT4LuNcVASPXWS1ciBUuIm8oIY0zRfCmi3xy4= +github.com/hashicorp/terraform-plugin-sdk v1.16.1/go.mod h1:KSsGcuZ1JRqnmYzz+sWIiUwNvJkzXbGRIdefwFfOdyY= github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0 h1:4EHNOAjwiYCeBxY16rt2KwyRNNVsCaVO3kWBbiXfYM0= github.com/hashicorp/terraform-plugin-sdk/v2 v2.5.0/go.mod h1:z+cMZ0iswzZOahBJ3XmNWgWkVnAd2bl8g+FhyyuPDH4= github.com/hashicorp/terraform-plugin-test/v2 v2.1.3/go.mod h1:pmaUHiUtDL/8Mz3FuyZ/vRDb0LpaOWQjVRW9ORF7FHs= diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go index b5fcb049387..9fc2a16b874 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go @@ -11,6 +11,27 @@ import ( "golang.org/x/tools/go/analysis/passes/inspect" ) +// AvoidSelectorExprAnalyzer returns an Analyzer for *ast.SelectorExpr to avoid +func AvoidSelectorExprAnalyzer(analyzerName string, callExprAnalyzer, selectorExprAnalyzer *analysis.Analyzer, packagePath, typeName string) *analysis.Analyzer { + doc := fmt.Sprintf(`check for %[2]s.%[3]s usage to avoid + +The %[1]s analyzer reports usage: + +%[2]s.%[3]s +`, analyzerName, packagePath, typeName) + + return &analysis.Analyzer{ + Name: analyzerName, + Doc: doc, + Requires: []*analysis.Analyzer{ + callExprAnalyzer, + commentignore.Analyzer, + selectorExprAnalyzer, + }, + Run: AvoidSelectorExprRunner(analyzerName, callExprAnalyzer, selectorExprAnalyzer, packagePath, typeName), + } +} + // DeprecatedReceiverMethodSelectorExprAnalyzer returns an Analyzer for deprecated *ast.SelectorExpr func DeprecatedReceiverMethodSelectorExprAnalyzer(analyzerName string, callExprAnalyzer, selectorExprAnalyzer *analysis.Analyzer, packagePath, typeName, methodName string) *analysis.Analyzer { doc := fmt.Sprintf(`check for deprecated %[2]s.%[3]s usage diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go index 50b44083efe..2c7cc9ccfca 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go @@ -15,6 +15,74 @@ import ( "golang.org/x/tools/go/ast/inspector" ) +// AvoidSelectorExprRunner returns an Analyzer runner for *ast.SelectorExpr to avoid +func AvoidSelectorExprRunner(analyzerName string, callExprAnalyzer, selectorExprAnalyzer *analysis.Analyzer, packagePath, typeName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + callExprs := pass.ResultOf[callExprAnalyzer].([]*ast.CallExpr) + selectorExprs := pass.ResultOf[selectorExprAnalyzer].([]*ast.SelectorExpr) + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + + // CallExpr and SelectorExpr will overlap, so only perform one report/fix + reported := make(map[token.Pos]struct{}) + + for _, callExpr := range callExprs { + if ignorer.ShouldIgnore(analyzerName, callExpr) { + continue + } + + pass.Report(analysis.Diagnostic{ + Pos: callExpr.Pos(), + End: callExpr.End(), + Message: fmt.Sprintf("%s: avoid %s.%s", analyzerName, packagePath, typeName), + SuggestedFixes: []analysis.SuggestedFix{ + { + Message: "Remove", + TextEdits: []analysis.TextEdit{ + { + Pos: callExpr.Pos(), + End: callExpr.End(), + NewText: []byte{}, + }, + }, + }, + }, + }) + + reported[callExpr.Pos()] = struct{}{} + } + + for _, selectorExpr := range selectorExprs { + if ignorer.ShouldIgnore(analyzerName, selectorExpr) { + continue + } + + if _, ok := reported[selectorExpr.Pos()]; ok { + continue + } + + pass.Report(analysis.Diagnostic{ + Pos: selectorExpr.Pos(), + End: selectorExpr.End(), + Message: fmt.Sprintf("%s: avoid %s.%s", analyzerName, packagePath, typeName), + SuggestedFixes: []analysis.SuggestedFix{ + { + Message: "Remove", + TextEdits: []analysis.TextEdit{ + { + Pos: selectorExpr.Pos(), + End: selectorExpr.End(), + NewText: []byte{}, + }, + }, + }, + }, + }) + } + + return nil, nil + } +} + // DeprecatedReceiverMethodSelectorExprRunner returns an Analyzer runner for deprecated *ast.SelectorExpr func DeprecatedReceiverMethodSelectorExprRunner(analyzerName string, callExprAnalyzer, selectorExprAnalyzer *analysis.Analyzer, packagePath, typeName, methodName string) func(*analysis.Pass) (interface{}, error) { return func(pass *analysis.Pass) (interface{}, error) { diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_analyzers.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_analyzers.go index df0a1dbd238..e21f27ae6fe 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_analyzers.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_analyzers.go @@ -21,3 +21,16 @@ func StdlibFunctionCallExprAnalyzer(analyzerName string, packagePath string, fun ResultType: reflect.TypeOf([]*ast.CallExpr{}), } } + +// StdlibFunctionSelectorExprAnalyzer returns an Analyzer for standard library function *ast.SelectorExpr +func StdlibFunctionSelectorExprAnalyzer(analyzerName string, packagePath string, functionName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find %s.%s() selectors for later passes", packagePath, functionName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: StdlibFunctionSelectorExprRunner(packagePath, functionName), + ResultType: reflect.TypeOf([]*ast.SelectorExpr{}), + } +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_runners.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_runners.go index 36ad4bf8687..a5dee95c21c 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_runners.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/stdlib_runners.go @@ -31,3 +31,26 @@ func StdlibFunctionCallExprRunner(packagePath string, functionName string) func( return result, nil } } + +// StdlibFunctionSelectorExprRunner returns an Analyzer runner for function *ast.SelectorExpr +func StdlibFunctionSelectorExprRunner(packagePath string, functionName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.SelectorExpr)(nil), + } + var result []*ast.SelectorExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + selectorExpr := n.(*ast.SelectorExpr) + + if !astutils.IsStdlibPackageFunc(selectorExpr, pass.TypesInfo, packagePath, functionName) { + return + } + + result = append(result, selectorExpr) + }) + + return result, nil + } +} diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go index 2bac427df55..1d8f75b22ca 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go @@ -9,24 +9,28 @@ import ( ) const ( - ResourceFieldCreate = `Create` - ResourceFieldCreateContext = `CreateContext` - ResourceFieldCustomizeDiff = `CustomizeDiff` - ResourceFieldDelete = `Delete` - ResourceFieldDeleteContext = `DeleteContext` - ResourceFieldDeprecationMessage = `DeprecationMessage` - ResourceFieldDescription = `Description` - ResourceFieldExists = `Exists` - ResourceFieldImporter = `Importer` - ResourceFieldMigrateState = `MigrateState` - ResourceFieldRead = `Read` - ResourceFieldReadContext = `ReadContext` - ResourceFieldSchema = `Schema` - ResourceFieldSchemaVersion = `SchemaVersion` - ResourceFieldStateUpgraders = `StateUpgraders` - ResourceFieldTimeouts = `Timeouts` - ResourceFieldUpdate = `Update` - ResourceFieldUpdateContext = `UpdateContext` + ResourceFieldCreate = `Create` + ResourceFieldCreateContext = `CreateContext` + ResourceFieldCreateWithoutTimeout = `CreateWithoutTimeout` + ResourceFieldCustomizeDiff = `CustomizeDiff` + ResourceFieldDelete = `Delete` + ResourceFieldDeleteContext = `DeleteContext` + ResourceFieldDeleteWithoutTimeout = `DeleteWithoutTimeout` + ResourceFieldDeprecationMessage = `DeprecationMessage` + ResourceFieldDescription = `Description` + ResourceFieldExists = `Exists` + ResourceFieldImporter = `Importer` + ResourceFieldMigrateState = `MigrateState` + ResourceFieldRead = `Read` + ResourceFieldReadContext = `ReadContext` + ResourceFieldReadWithoutTimeout = `ReadWithoutTimeout` + ResourceFieldSchema = `Schema` + ResourceFieldSchemaVersion = `SchemaVersion` + ResourceFieldStateUpgraders = `StateUpgraders` + ResourceFieldTimeouts = `Timeouts` + ResourceFieldUpdate = `Update` + ResourceFieldUpdateContext = `UpdateContext` + ResourceFieldUpdateWithoutTimeout = `UpdateWithoutTimeout` TypeNameResource = `Resource` ) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr/osexeccommandcallexpr.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr/osexeccommandcallexpr.go new file mode 100644 index 00000000000..c39ce0e3f18 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr/osexeccommandcallexpr.go @@ -0,0 +1,11 @@ +package osexeccommandcallexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" +) + +var Analyzer = analysisutils.StdlibFunctionCallExprAnalyzer( + "osexeccommandcallexpr", + "os/exec", + "Command", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr/osexeccommandcontextcallexpr.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr/osexeccommandcontextcallexpr.go new file mode 100644 index 00000000000..50a38373591 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr/osexeccommandcontextcallexpr.go @@ -0,0 +1,11 @@ +package osexeccommandcontextcallexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" +) + +var Analyzer = analysisutils.StdlibFunctionCallExprAnalyzer( + "osexeccommandcontextcallexpr", + "os/exec", + "CommandContext", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr/osexeccommandcontextselectorexpr.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr/osexeccommandcontextselectorexpr.go new file mode 100644 index 00000000000..18b7e3706c2 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr/osexeccommandcontextselectorexpr.go @@ -0,0 +1,11 @@ +package osexeccommandcontextselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" +) + +var Analyzer = analysisutils.StdlibFunctionSelectorExprAnalyzer( + "osexeccommandselectorexpr", + "os/exec", + "CommandContext", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr/osexeccommandselectorexpr.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr/osexeccommandselectorexpr.go new file mode 100644 index 00000000000..a90a13d720c --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr/osexeccommandselectorexpr.go @@ -0,0 +1,11 @@ +package osexeccommandselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" +) + +var Analyzer = analysisutils.StdlibFunctionSelectorExprAnalyzer( + "osexeccommandselectorexpr", + "os/exec", + "Command", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR006/XR006.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR006/XR006.go index d9c8d405fce..6d89ae4b74f 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR006/XR006.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR006/XR006.go @@ -32,19 +32,19 @@ func run(pass *analysis.Pass) (interface{}, error) { continue } - if !resource.DeclaresField(schema.ResourceFieldCreate) && !resource.DeclaresField(schema.ResourceFieldCreateContext) && resource.Resource.Timeouts.Create != nil { + if !resource.DeclaresField(schema.ResourceFieldCreate) && !resource.DeclaresField(schema.ResourceFieldCreateContext) && !resource.DeclaresField(schema.ResourceFieldCreateWithoutTimeout) && resource.Resource.Timeouts.Create != nil { pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should not configure Timeouts.Create without Create implementation", analyzerName) } - if !resource.DeclaresField(schema.ResourceFieldDelete) && !resource.DeclaresField(schema.ResourceFieldDeleteContext) && resource.Resource.Timeouts.Delete != nil { + if !resource.DeclaresField(schema.ResourceFieldDelete) && !resource.DeclaresField(schema.ResourceFieldDeleteContext) && !resource.DeclaresField(schema.ResourceFieldDeleteWithoutTimeout) && resource.Resource.Timeouts.Delete != nil { pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should not configure Timeouts.Delete without Delete implementation", analyzerName) } - if !resource.DeclaresField(schema.ResourceFieldRead) && !resource.DeclaresField(schema.ResourceFieldReadContext) && resource.Resource.Timeouts.Read != nil { + if !resource.DeclaresField(schema.ResourceFieldRead) && !resource.DeclaresField(schema.ResourceFieldReadContext) && !resource.DeclaresField(schema.ResourceFieldReadWithoutTimeout) && resource.Resource.Timeouts.Read != nil { pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should not configure Timeouts.Read without Read implementation", analyzerName) } - if !resource.DeclaresField(schema.ResourceFieldUpdate) && !resource.DeclaresField(schema.ResourceFieldUpdateContext) && resource.Resource.Timeouts.Update != nil { + if !resource.DeclaresField(schema.ResourceFieldUpdate) && !resource.DeclaresField(schema.ResourceFieldUpdateContext) && !resource.DeclaresField(schema.ResourceFieldUpdateWithoutTimeout) && resource.Resource.Timeouts.Update != nil { pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should not configure Timeouts.Update without Update implementation", analyzerName) } } diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/README.md new file mode 100644 index 00000000000..bd827290864 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/README.md @@ -0,0 +1,28 @@ +# XR007 + +The XR007 analyzer reports usage of the [`os/exec.Command()`](https://pkg.go.dev/os/exec#Command) function. Providers that are using Go language based SDKs likely want to prevent any execution of other binaries for various reasons such as security and unexpected requirements (e.g. tool installation outside Terraform). + +## Flagged Code + +```go +var sneaky = exec.Command + +sneaky("evilprogram") + +exec.Command("evilprogram") +``` + +## Passing Code + +```go +// Not present :) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR007` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR007 +exec.Command("evilprogram") +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/XR007.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/XR007.go new file mode 100644 index 00000000000..5db4c3ab93d --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR007/XR007.go @@ -0,0 +1,15 @@ +package XR007 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr" + "github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr" +) + +var Analyzer = analysisutils.AvoidSelectorExprAnalyzer( + "XR007", + osexeccommandcallexpr.Analyzer, + osexeccommandselectorexpr.Analyzer, + "os/exec", + "Command", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/README.md b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/README.md new file mode 100644 index 00000000000..69edac4a6ee --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/README.md @@ -0,0 +1,28 @@ +# XR008 + +The XR008 analyzer reports usage of the [`os/exec.CommandContext()`](https://pkg.go.dev/os/exec#CommandContext) function. Providers that are using Go language based SDKs likely want to prevent any execution of other binaries for various reasons such as security and unexpected requirements (e.g. tool installation outside Terraform). + +## Flagged Code + +```go +var sneaky = exec.CommandContext + +sneaky("evilprogram") + +exec.CommandContext("evilprogram") +``` + +## Passing Code + +```go +// Not present :) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR008` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR008 +exec.CommandContext("evilprogram") +``` diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/XR008.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/XR008.go new file mode 100644 index 00000000000..8e970478f47 --- /dev/null +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/XR008/XR008.go @@ -0,0 +1,15 @@ +package XR008 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr" + "github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr" +) + +var Analyzer = analysisutils.AvoidSelectorExprAnalyzer( + "XR008", + osexeccommandcontextcallexpr.Analyzer, + osexeccommandcontextselectorexpr.Analyzer, + "os/exec", + "CommandContext", +) diff --git a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go index bbd0f03f57e..289fa1cbfa2 100644 --- a/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go +++ b/awsproviderlint/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go @@ -8,6 +8,8 @@ import ( "github.com/bflad/tfproviderlint/xpasses/XR004" "github.com/bflad/tfproviderlint/xpasses/XR005" "github.com/bflad/tfproviderlint/xpasses/XR006" + "github.com/bflad/tfproviderlint/xpasses/XR007" + "github.com/bflad/tfproviderlint/xpasses/XR008" "github.com/bflad/tfproviderlint/xpasses/XS001" "github.com/bflad/tfproviderlint/xpasses/XS002" "golang.org/x/tools/go/analysis" @@ -24,6 +26,8 @@ var AllChecks = []*analysis.Analyzer{ XR004.Analyzer, XR005.Analyzer, XR006.Analyzer, + XR007.Analyzer, + XR008.Analyzer, XS001.Analyzer, XS002.Analyzer, } diff --git a/awsproviderlint/vendor/modules.txt b/awsproviderlint/vendor/modules.txt index 498d214814e..45dbbb83936 100644 --- a/awsproviderlint/vendor/modules.txt +++ b/awsproviderlint/vendor/modules.txt @@ -68,7 +68,7 @@ github.com/bflad/gopaniccheck/passes/logpaniccallexpr github.com/bflad/gopaniccheck/passes/logpanicfcallexpr github.com/bflad/gopaniccheck/passes/logpaniclncallexpr github.com/bflad/gopaniccheck/passes/paniccallexpr -# github.com/bflad/tfproviderlint v0.24.0 +# github.com/bflad/tfproviderlint v0.26.0 ## explicit github.com/bflad/tfproviderlint/helper/analysisutils github.com/bflad/tfproviderlint/helper/astutils @@ -198,6 +198,10 @@ github.com/bflad/tfproviderlint/passes/helper/validation/validatelistuniquestrin github.com/bflad/tfproviderlint/passes/helper/validation/validateregexpselectorexpr github.com/bflad/tfproviderlint/passes/helper/validation/validaterfc3339timestringselectorexpr github.com/bflad/tfproviderlint/passes/stdlib/fmtsprintfcallexpr +github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcallexpr +github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextcallexpr +github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandcontextselectorexpr +github.com/bflad/tfproviderlint/passes/stdlib/osexeccommandselectorexpr github.com/bflad/tfproviderlint/passes/stdlib/timesleepcallexpr github.com/bflad/tfproviderlint/passes/testaccfuncdecl github.com/bflad/tfproviderlint/passes/testfuncdecl @@ -209,6 +213,8 @@ github.com/bflad/tfproviderlint/xpasses/XR003 github.com/bflad/tfproviderlint/xpasses/XR004 github.com/bflad/tfproviderlint/xpasses/XR005 github.com/bflad/tfproviderlint/xpasses/XR006 +github.com/bflad/tfproviderlint/xpasses/XR007 +github.com/bflad/tfproviderlint/xpasses/XR008 github.com/bflad/tfproviderlint/xpasses/XS001 github.com/bflad/tfproviderlint/xpasses/XS002 # github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d From 344e9bc3dccbd9b8961f95868bce43f2a93b75bf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Mar 2021 14:29:27 -0400 Subject: [PATCH 1234/1252] build(deps): bump github/issue-labeler from v2.2 to v2.3 (#18322) Bumps [github/issue-labeler](https://github.com/github/issue-labeler) from v2.2 to v2.3. - [Release notes](https://github.com/github/issue-labeler/releases) - [Commits](https://github.com/github/issue-labeler/compare/v2.2...a326d12b9b64d4395a18e50f648214c609501643) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/issues.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 5189985a451..b37a71dd387 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -9,13 +9,13 @@ jobs: - uses: actions/checkout@v2 - name: Apply Issue needs-triage Label if: github.event.action == 'opened' && !contains(fromJSON('["anGie44", "bflad", "bill-rich", "breathingdust", "DrFaust92", "ewbankkit", "gdavison", "maryelizbeth", "YakDriver"]'), github.actor) - uses: github/issue-labeler@v2.2 + uses: github/issue-labeler@v2.3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-needs-triage.yml enable-versioned-regex: 0 - name: Apply Issue Triage Labels - uses: github/issue-labeler@v2.2 + uses: github/issue-labeler@v2.3 with: repo-token: "${{ secrets.GITHUB_TOKEN }}" configuration-path: .github/labeler-issue-triage.yml From 79998b175bf3a6208a406c4c3499e1ae3fc56494 Mon Sep 17 00:00:00 2001 From: Ilia Lazebnik Date: Fri, 26 Mar 2021 21:43:06 +0300 Subject: [PATCH 1235/1252] resource/aws_efs_file_system: Add attributes and refactor to use waiter package (#17969) Output from acceptance testing in AWS Commercial: ``` --- PASS: TestAccAWSEFSFileSystem_kmsConfigurationWithoutEncryption (15.26s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy (29.48s) --- PASS: TestAccAWSEFSFileSystem_disappears (37.95s) --- PASS: TestAccAWSEFSFileSystem_kmsKey (54.93s) --- PASS: TestAccAWSEFSFileSystem_ThroughputMode (65.88s) --- PASS: TestAccAWSEFSFileSystem_basic (83.23s) --- PASS: TestAccAWSEFSFileSystem_pagedTags (85.76s) --- PASS: TestAccAWSEFSFileSystem_ProvisionedThroughputInMibps (94.41s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_removal (96.71s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_update (107.04s) --- PASS: TestAccAWSEFSFileSystem_tags (142.76s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSEFSFileSystem_kmsConfigurationWithoutEncryption (19.51s) --- PASS: TestAccAWSEFSFileSystem_pagedTags (58.12s) --- PASS: TestAccAWSEFSFileSystem_kmsKey (64.15s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy (67.15s) --- PASS: TestAccAWSEFSFileSystem_disappears (85.41s) --- PASS: TestAccAWSEFSFileSystem_basic (95.51s) --- PASS: TestAccAWSEFSFileSystem_ThroughputMode (101.41s) --- PASS: TestAccAWSEFSFileSystem_ProvisionedThroughputInMibps (103.19s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_update (105.87s) --- PASS: TestAccAWSEFSFileSystem_tags (149.67s) --- PASS: TestAccAWSEFSFileSystem_lifecyclePolicy_removal (151.51s) ``` --- .changelog/17969.txt | 3 + aws/internal/service/efs/waiter/status.go | 23 ++ aws/internal/service/efs/waiter/waiter.go | 50 ++++- aws/resource_aws_efs_file_system.go | 212 ++++++++----------- aws/resource_aws_efs_file_system_test.go | 48 ++--- website/docs/r/efs_file_system.html.markdown | 9 + 6 files changed, 189 insertions(+), 156 deletions(-) create mode 100644 .changelog/17969.txt diff --git a/.changelog/17969.txt b/.changelog/17969.txt new file mode 100644 index 00000000000..40a3386fda3 --- /dev/null +++ b/.changelog/17969.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_efs_file_system: Add `number_of_mount_targets`, `size_in_bytes` and `owner_id` attributes +``` \ No newline at end of file diff --git a/aws/internal/service/efs/waiter/status.go b/aws/internal/service/efs/waiter/status.go index d48fb58c92b..97d4f7d1612 100644 --- a/aws/internal/service/efs/waiter/status.go +++ b/aws/internal/service/efs/waiter/status.go @@ -28,3 +28,26 @@ func AccessPointLifeCycleState(conn *efs.EFS, accessPointId string) resource.Sta return mt, aws.StringValue(mt.LifeCycleState), nil } } + +// FileSystemLifeCycleState fetches the Access Point and its LifecycleState +func FileSystemLifeCycleState(conn *efs.EFS, fileSystemID string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &efs.DescribeFileSystemsInput{ + FileSystemId: aws.String(fileSystemID), + } + + output, err := conn.DescribeFileSystems(input) + + if err != nil { + return nil, "", err + } + + if output == nil || len(output.FileSystems) == 0 || output.FileSystems[0] == nil { + return nil, "", nil + } + + mt := output.FileSystems[0] + + return mt, aws.StringValue(mt.LifeCycleState), nil + } +} diff --git a/aws/internal/service/efs/waiter/waiter.go b/aws/internal/service/efs/waiter/waiter.go index 71db067975a..fd065e5c89d 100644 --- a/aws/internal/service/efs/waiter/waiter.go +++ b/aws/internal/service/efs/waiter/waiter.go @@ -9,8 +9,14 @@ import ( const ( // Maximum amount of time to wait for an Operation to return Success - AccessPointCreatedTimeout = 10 * time.Minute - AccessPointDeletedTimeout = 10 * time.Minute + AccessPointCreatedTimeout = 10 * time.Minute + AccessPointDeletedTimeout = 10 * time.Minute + FileSystemAvailableTimeout = 10 * time.Minute + FileSystemAvailableDelayTimeout = 2 * time.Second + FileSystemAvailableMinTimeout = 3 * time.Second + FileSystemDeletedTimeout = 10 * time.Minute + FileSystemDeletedDelayTimeout = 2 * time.Second + FileSystemDeletedMinTimeout = 3 * time.Second ) // AccessPointCreated waits for an Operation to return Success @@ -48,3 +54,43 @@ func AccessPointDeleted(conn *efs.EFS, accessPointId string) (*efs.AccessPointDe return nil, err } + +// FileSystemAvailable waits for an Operation to return Available +func FileSystemAvailable(conn *efs.EFS, fileSystemID string) (*efs.FileSystemDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{efs.LifeCycleStateCreating, efs.LifeCycleStateUpdating}, + Target: []string{efs.LifeCycleStateAvailable}, + Refresh: FileSystemLifeCycleState(conn, fileSystemID), + Timeout: FileSystemAvailableTimeout, + Delay: FileSystemAvailableDelayTimeout, + MinTimeout: FileSystemAvailableMinTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if output, ok := outputRaw.(*efs.FileSystemDescription); ok { + return output, err + } + + return nil, err +} + +// FileSystemDeleted waits for an Operation to return Deleted +func FileSystemDeleted(conn *efs.EFS, fileSystemID string) (*efs.FileSystemDescription, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{efs.LifeCycleStateAvailable, efs.LifeCycleStateDeleting}, + Target: []string{}, + Refresh: FileSystemLifeCycleState(conn, fileSystemID), + Timeout: FileSystemDeletedTimeout, + Delay: FileSystemDeletedDelayTimeout, + MinTimeout: FileSystemDeletedMinTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if output, ok := outputRaw.(*efs.FileSystemDescription); ok { + return output, err + } + + return nil, err +} diff --git a/aws/resource_aws_efs_file_system.go b/aws/resource_aws_efs_file_system.go index 3ee30becd2b..7a90f70fe39 100644 --- a/aws/resource_aws_efs_file_system.go +++ b/aws/resource_aws_efs_file_system.go @@ -4,15 +4,14 @@ import ( "errors" "fmt" "log" - "time" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/efs/waiter" ) func resourceAwsEfsFileSystem() *schema.Resource { @@ -41,14 +40,11 @@ func resourceAwsEfsFileSystem() *schema.Resource { }, "performance_mode": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{ - efs.PerformanceModeGeneralPurpose, - efs.PerformanceModeMaxIo, - }, false), + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice(efs.PerformanceMode_Values(), false), }, "encrypted": { @@ -75,17 +71,21 @@ func resourceAwsEfsFileSystem() *schema.Resource { Type: schema.TypeFloat, Optional: true, }, - + "number_of_mount_targets": { + Type: schema.TypeInt, + Computed: true, + }, + "owner_id": { + Type: schema.TypeString, + Computed: true, + }, "tags": tagsSchema(), "throughput_mode": { - Type: schema.TypeString, - Optional: true, - Default: efs.ThroughputModeBursting, - ValidateFunc: validation.StringInSlice([]string{ - efs.ThroughputModeBursting, - efs.ThroughputModeProvisioned, - }, false), + Type: schema.TypeString, + Optional: true, + Default: efs.ThroughputModeBursting, + ValidateFunc: validation.StringInSlice(efs.ThroughputMode_Values(), false), }, "lifecycle_policy": { @@ -95,15 +95,29 @@ func resourceAwsEfsFileSystem() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "transition_to_ia": { - Type: schema.TypeString, - Required: true, - ValidateFunc: validation.StringInSlice([]string{ - efs.TransitionToIARulesAfter7Days, - efs.TransitionToIARulesAfter14Days, - efs.TransitionToIARulesAfter30Days, - efs.TransitionToIARulesAfter60Days, - efs.TransitionToIARulesAfter90Days, - }, false), + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice(efs.TransitionToIARules_Values(), false), + }, + }, + }, + }, + "size_in_bytes": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "value": { + Type: schema.TypeInt, + Computed: true, + }, + "value_in_ia": { + Type: schema.TypeInt, + Computed: true, + }, + "value_in_standard": { + Type: schema.TypeInt, + Computed: true, }, }, }, @@ -155,25 +169,16 @@ func resourceAwsEfsFileSystemCreate(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] EFS file system create options: %#v", *createOpts) fs, err := conn.CreateFileSystem(createOpts) if err != nil { - return fmt.Errorf("Error creating EFS file system: %s", err) + return fmt.Errorf("Error creating EFS file system: %w", err) } d.SetId(aws.StringValue(fs.FileSystemId)) log.Printf("[INFO] EFS file system ID: %s", d.Id()) - stateConf := &resource.StateChangeConf{ - Pending: []string{efs.LifeCycleStateCreating}, - Target: []string{efs.LifeCycleStateAvailable}, - Refresh: resourceEfsFileSystemCreateUpdateRefreshFunc(d.Id(), conn), - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, + if _, err := waiter.FileSystemAvailable(conn, d.Id()); err != nil { + return fmt.Errorf("error waiting for EFS file system (%s) to be available: %w", d.Id(), err) } - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("Error waiting for EFS file system (%q) to create: %s", d.Id(), err) - } log.Printf("[DEBUG] EFS file system %q created.", d.Id()) _, hasLifecyclePolicy := d.GetOk("lifecycle_policy") @@ -208,21 +213,11 @@ func resourceAwsEfsFileSystemUpdate(d *schema.ResourceData, meta interface{}) er _, err := conn.UpdateFileSystem(input) if err != nil { - return fmt.Errorf("error updating EFS File System %q: %s", d.Id(), err) + return fmt.Errorf("error updating EFS file system (%s): %w", d.Id(), err) } - stateConf := &resource.StateChangeConf{ - Pending: []string{efs.LifeCycleStateUpdating}, - Target: []string{efs.LifeCycleStateAvailable}, - Refresh: resourceEfsFileSystemCreateUpdateRefreshFunc(d.Id(), conn), - Timeout: 10 * time.Minute, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - - _, err = stateConf.WaitForState() - if err != nil { - return fmt.Errorf("error waiting for EFS file system (%q) to update: %s", d.Id(), err) + if _, err := waiter.FileSystemAvailable(conn, d.Id()); err != nil { + return fmt.Errorf("error waiting for EFS file system (%s) to be available: %w", d.Id(), err) } } @@ -250,7 +245,7 @@ func resourceAwsEfsFileSystemUpdate(d *schema.ResourceData, meta interface{}) er o, n := d.GetChange("tags") if err := keyvaluetags.EfsUpdateTags(conn, d.Id(), o, n); err != nil { - return fmt.Errorf("error updating EFS file system (%s) tags: %s", d.Id(), err) + return fmt.Errorf("error updating EFS file system (%s) tags: %w", d.Id(), err) } } @@ -285,43 +280,40 @@ func resourceAwsEfsFileSystemRead(d *schema.ResourceData, meta interface{}) erro } } if fs == nil { - log.Printf("[WARN] EFS (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] EFS File System (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - fsARN := arn.ARN{ - AccountID: meta.(*AWSClient).accountid, - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Resource: fmt.Sprintf("file-system/%s", aws.StringValue(fs.FileSystemId)), - Service: "elasticfilesystem", - }.String() - - d.Set("arn", fsARN) + d.Set("arn", fs.FileSystemArn) d.Set("creation_token", fs.CreationToken) d.Set("encrypted", fs.Encrypted) d.Set("kms_key_id", fs.KmsKeyId) d.Set("performance_mode", fs.PerformanceMode) d.Set("provisioned_throughput_in_mibps", fs.ProvisionedThroughputInMibps) d.Set("throughput_mode", fs.ThroughputMode) + d.Set("owner_id", fs.OwnerId) + d.Set("number_of_mount_targets", fs.NumberOfMountTargets) if err := d.Set("tags", keyvaluetags.EfsKeyValueTags(fs.Tags).IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil { - return fmt.Errorf("error setting tags: %s", err) + return fmt.Errorf("error setting tags: %w", err) + } + + if err := d.Set("size_in_bytes", flattenEfsFileSystemSizeInBytes(fs.SizeInBytes)); err != nil { + return fmt.Errorf("error setting size_in_bytes: %w", err) } d.Set("dns_name", meta.(*AWSClient).RegionalHostname(fmt.Sprintf("%s.efs", aws.StringValue(fs.FileSystemId)))) res, err := conn.DescribeLifecycleConfiguration(&efs.DescribeLifecycleConfigurationInput{ - FileSystemId: fs.FileSystemId, + FileSystemId: aws.String(d.Id()), }) if err != nil { - return fmt.Errorf("Error describing lifecycle configuration for EFS file system (%s): %s", - aws.StringValue(fs.FileSystemId), err) + return fmt.Errorf("Error describing lifecycle configuration for EFS file system (%s): %w", d.Id(), err) } if err := d.Set("lifecycle_policy", flattenEfsFileSystemLifecyclePolicies(res.LifecyclePolicies)); err != nil { - return fmt.Errorf("error setting lifecycle_policy: %s", err) + return fmt.Errorf("error setting lifecycle_policy: %w", err) } return nil @@ -335,50 +327,22 @@ func resourceAwsEfsFileSystemDelete(d *schema.ResourceData, meta interface{}) er FileSystemId: aws.String(d.Id()), }) if err != nil { + if isAWSErr(err, efs.ErrCodeFileSystemNotFound, "") { + return nil + } return fmt.Errorf("Error delete file system: %s with err %s", d.Id(), err.Error()) } - err = waitForDeleteEfsFileSystem(conn, d.Id(), 10*time.Minute) - if err != nil { - return fmt.Errorf("Error waiting for EFS file system (%q) to delete: %w", d.Id(), err) + if _, err := waiter.FileSystemDeleted(conn, d.Id()); err != nil { + if isAWSErr(err, efs.ErrCodeFileSystemNotFound, "") { + return nil + } + return fmt.Errorf("error waiting for EFS file system (%s) deletion: %w", d.Id(), err) } - log.Printf("[DEBUG] EFS file system %q deleted.", d.Id()) - return nil } -func waitForDeleteEfsFileSystem(conn *efs.EFS, id string, timeout time.Duration) error { - stateConf := &resource.StateChangeConf{ - Pending: []string{"available", "deleting"}, - Target: []string{}, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeFileSystems(&efs.DescribeFileSystemsInput{ - FileSystemId: aws.String(id), - }) - if err != nil { - if isAWSErr(err, efs.ErrCodeFileSystemNotFound, "") { - return nil, "", nil - } - return nil, "error", err - } - - if hasEmptyFileSystems(resp) { - return nil, "", nil - } - - fs := resp.FileSystems[0] - log.Printf("[DEBUG] current status of %q: %q", *fs.FileSystemId, *fs.LifeCycleState) - return fs, *fs.LifeCycleState, nil - }, - Timeout: timeout, - Delay: 2 * time.Second, - MinTimeout: 3 * time.Second, - } - _, err := stateConf.WaitForState() - return err -} - func hasEmptyFileSystems(fs *efs.DescribeFileSystemsOutput) bool { if fs != nil && len(fs.FileSystems) > 0 { return false @@ -386,26 +350,6 @@ func hasEmptyFileSystems(fs *efs.DescribeFileSystemsOutput) bool { return true } -func resourceEfsFileSystemCreateUpdateRefreshFunc(id string, conn *efs.EFS) resource.StateRefreshFunc { - return func() (interface{}, string, error) { - resp, err := conn.DescribeFileSystems(&efs.DescribeFileSystemsInput{ - FileSystemId: aws.String(id), - }) - if err != nil { - return nil, "error", err - } - - if hasEmptyFileSystems(resp) { - return nil, "not-found", fmt.Errorf("EFS file system %q could not be found.", id) - } - - fs := resp.FileSystems[0] - state := aws.StringValue(fs.LifeCycleState) - log.Printf("[DEBUG] current status of %q: %q", id, state) - return fs, state, nil - } -} - func flattenEfsFileSystemLifecyclePolicies(apiObjects []*efs.LifecyclePolicy) []interface{} { var tfList []interface{} @@ -447,3 +391,23 @@ func expandEfsFileSystemLifecyclePolicies(tfList []interface{}) []*efs.Lifecycle return apiObjects } + +func flattenEfsFileSystemSizeInBytes(sizeInBytes *efs.FileSystemSize) []interface{} { + if sizeInBytes == nil { + return []interface{}{} + } + + m := map[string]interface{}{ + "value": aws.Int64Value(sizeInBytes.Value), + } + + if sizeInBytes.ValueInIA != nil { + m["value_in_ia"] = aws.Int64Value(sizeInBytes.ValueInIA) + } + + if sizeInBytes.ValueInStandard != nil { + m["value_in_standard"] = aws.Int64Value(sizeInBytes.ValueInStandard) + } + + return []interface{}{m} +} diff --git a/aws/resource_aws_efs_file_system_test.go b/aws/resource_aws_efs_file_system_test.go index 282287d6414..d91465bd989 100644 --- a/aws/resource_aws_efs_file_system_test.go +++ b/aws/resource_aws_efs_file_system_test.go @@ -5,11 +5,10 @@ import ( "log" "regexp" "testing" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/efs" - multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" @@ -32,8 +31,8 @@ func testSweepEfsFileSystems(region string) error { return fmt.Errorf("error getting client: %s", err) } conn := client.(*AWSClient).efsconn + var sweeperErrs *multierror.Error - var errors error input := &efs.DescribeFileSystemsInput{} err = conn.DescribeFileSystemsPages(input, func(page *efs.DescribeFileSystemsOutput, lastPage bool) bool { for _, filesystem := range page.FileSystems { @@ -41,27 +40,24 @@ func testSweepEfsFileSystems(region string) error { log.Printf("[INFO] Deleting EFS File System: %s", id) - _, err := conn.DeleteFileSystem(&efs.DeleteFileSystemInput{ - FileSystemId: filesystem.FileSystemId, - }) - if err != nil { - errors = multierror.Append(errors, fmt.Errorf("error deleting EFS File System %q: %w", id, err)) - continue - } + r := resourceAwsEfsFileSystem() + d := r.Data(nil) + d.SetId(id) + err := r.Delete(d, client) - err = waitForDeleteEfsFileSystem(conn, id, 10*time.Minute) if err != nil { - errors = multierror.Append(fmt.Errorf("error waiting for EFS File System %q to delete: %w", id, err)) + log.Printf("[ERROR] %s", err) + sweeperErrs = multierror.Append(sweeperErrs, err) continue } } return true }) if err != nil { - errors = multierror.Append(errors, fmt.Errorf("error retrieving EFS File Systems: %w", err)) + sweeperErrs = multierror.Append(sweeperErrs, fmt.Errorf("error retrieving EFS File Systems: %w", err)) } - return errors + return sweeperErrs.ErrorOrNil() } func TestResourceAWSEFSFileSystem_hasEmptyFileSystems(t *testing.T) { @@ -104,6 +100,12 @@ func TestAccAWSEFSFileSystem_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "throughput_mode", efs.ThroughputModeBursting), testAccCheckEfsFileSystem(resourceName, &desc), testAccCheckEfsFileSystemPerformanceMode(resourceName, "generalPurpose"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "size_in_bytes.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "size_in_bytes.0.value"), + resource.TestCheckResourceAttrSet(resourceName, "size_in_bytes.0.value_in_ia"), + resource.TestCheckResourceAttrSet(resourceName, "size_in_bytes.0.value_in_standard"), + testAccMatchResourceAttrAccountID(resourceName, "owner_id"), ), }, { @@ -444,7 +446,7 @@ func TestAccAWSEFSFileSystem_lifecyclePolicy_removal(t *testing.T) { func TestAccAWSEFSFileSystem_disappears(t *testing.T) { var desc efs.FileSystemDescription resourceName := "aws_efs_file_system.test" - rName := acctest.RandomWithPrefix("tf-acc-disappears") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -456,7 +458,7 @@ func TestAccAWSEFSFileSystem_disappears(t *testing.T) { Config: testAccAWSEFSFileSystemConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckEfsFileSystem(resourceName, &desc), - testAccCheckEfsFileSystemDisappears(&desc), + testAccCheckResourceDisappears(testAccProvider, resourceAwsEfsFileSystem(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -519,20 +521,6 @@ func testAccCheckEfsFileSystem(resourceID string, fDesc *efs.FileSystemDescripti } } -func testAccCheckEfsFileSystemDisappears(fDesc *efs.FileSystemDescription) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).efsconn - - input := &efs.DeleteFileSystemInput{ - FileSystemId: fDesc.FileSystemId, - } - - _, err := conn.DeleteFileSystem(input) - - return err - } -} - func testAccCheckEfsCreationToken(resourceID string, expectedToken string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceID] diff --git a/website/docs/r/efs_file_system.html.markdown b/website/docs/r/efs_file_system.html.markdown index bdda69f1c48..eff84716096 100644 --- a/website/docs/r/efs_file_system.html.markdown +++ b/website/docs/r/efs_file_system.html.markdown @@ -64,6 +64,15 @@ In addition to all arguments above, the following attributes are exported: * `arn` - Amazon Resource Name of the file system. * `id` - The ID that identifies the file system (e.g. fs-ccfc0d65). * `dns_name` - The DNS name for the filesystem per [documented convention](http://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html). +* `owner_id` - The AWS account that created the file system. If the file system was createdby an IAM user, the parent account to which the user belongs is the owner. +* `number_of_mount_targets` - The current number of mount targets that the file system has. +* `size_in_bytes` - The latest known metered size (in bytes) of data stored in the file system, the value is not the exact size that the file system was at any point in time. See [Size In Bytes](#size-in-bytes). + +### Size In Bytes + +* `value` - The latest known metered size (in bytes) of data stored in the file system. +* `value_in_ia` - The latest known metered size (in bytes) of data stored in the Infrequent Access storage class. +* `value_in_standard` - The latest known metered size (in bytes) of data stored in the Standard storage class. ## Import From 18cac7d2ca2d8f04dda02e9d8465ccac5f021e5d Mon Sep 17 00:00:00 2001 From: changelogbot Date: Fri, 26 Mar 2021 18:59:57 +0000 Subject: [PATCH 1236/1252] Update CHANGELOG.md for #18341 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66aa3d3d814..63e682b5949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ENHANCEMENTS: * data-source/aws_iam_policy: Add `policy_id` and `tags` attributes ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) +* resource/aws_efs_file_system: Add `number_of_mount_targets`, `size_in_bytes` and `owner_id` attributes ([#17969](https://github.com/hashicorp/terraform-provider-aws/issues/17969)) * resource/aws_iam_policy: Add `policy_id` attribute ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) * resource/aws_iam_policy: Add tagging support ([#18276](https://github.com/hashicorp/terraform-provider-aws/issues/18276)) * resource/aws_ssm_parameter: Add plan time validation to `name`, `description` and `allowed_pattern` ([#17830](https://github.com/hashicorp/terraform-provider-aws/issues/17830)) @@ -10,6 +11,7 @@ ENHANCEMENTS: BUG FIXES: +* resource/aws_securityhub_organization_admin_account: Retry on `ResourceConflictException` error during creation ([#18341](https://github.com/hashicorp/terraform-provider-aws/issues/18341)) * resource/aws_synthetics_canary: Handle asynchronous IAM eventual consistency error on creation ([#18404](https://github.com/hashicorp/terraform-provider-aws/issues/18404)) ## 3.34.0 (March 26, 2021) From bcad46fe362d84297ded1f612fbcc59db9bb8c53 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 17:20:14 -0400 Subject: [PATCH 1237/1252] r/ecs_service: Rework status, waiter --- aws/internal/service/ecs/waiter/status.go | 37 ++++++++++++ aws/internal/service/ecs/waiter/waiter.go | 70 ++++++++++++++++++++++- 2 files changed, 106 insertions(+), 1 deletion(-) diff --git a/aws/internal/service/ecs/waiter/status.go b/aws/internal/service/ecs/waiter/status.go index 9b1ba797bb2..3e69362b027 100644 --- a/aws/internal/service/ecs/waiter/status.go +++ b/aws/internal/service/ecs/waiter/status.go @@ -1,8 +1,11 @@ package waiter import ( + "log" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -12,6 +15,14 @@ const ( // EventSubscription Unknown CapacityProviderStatusUnknown = "Unknown" + + // AWS will likely add consts for these at some point + ServiceStatusInactive = "INACTIVE" + ServiceStatusActive = "ACTIVE" + ServiceStatusDraining = "DRAINING" + + ServiceStatusError = "ERROR" + ServiceStatusNone = "NONE" ) // CapacityProviderStatus fetches the Capacity Provider and its Status @@ -34,3 +45,29 @@ func CapacityProviderStatus(conn *ecs.ECS, capacityProvider string) resource.Sta return output.CapacityProviders[0], aws.StringValue(output.CapacityProviders[0].Status), nil } } + +func ServiceStatus(conn *ecs.ECS, id, cluster string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &ecs.DescribeServicesInput{ + Services: aws.StringSlice([]string{id}), + Cluster: aws.String(cluster), + } + + output, err := conn.DescribeServices(input) + + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeServiceNotFoundException) { + return nil, ServiceStatusNone, nil + } + + if err != nil { + return nil, ServiceStatusError, err + } + + if len(output.Services) == 0 { + return nil, ServiceStatusNone, nil + } + + log.Printf("[DEBUG] ECS service (%s) is currently %q", id, *output.Services[0].Status) + return output, aws.StringValue(output.Services[0].Status), err + } +} diff --git a/aws/internal/service/ecs/waiter/waiter.go b/aws/internal/service/ecs/waiter/waiter.go index 265d0ed28ba..3f12cef4d75 100644 --- a/aws/internal/service/ecs/waiter/waiter.go +++ b/aws/internal/service/ecs/waiter/waiter.go @@ -3,6 +3,7 @@ package waiter import ( "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecs" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" ) @@ -10,7 +11,12 @@ import ( const ( // Maximum amount of time to wait for a Capacity Provider to return INACTIVE CapacityProviderInactiveTimeout = 20 * time.Minute - ServiceCreateTimeout = 2 * time.Minute + + ServiceCreateTimeout = 2 * time.Minute + ServiceInactiveTimeout = 10 * time.Minute + ServiceInactiveTimeoutMin = 1 * time.Second + ServiceDescribeTimeout = 2 * time.Minute + ServiceUpdateTimeout = 2 * time.Minute ) // CapacityProviderInactive waits for a Capacity Provider to return INACTIVE @@ -30,3 +36,65 @@ func CapacityProviderInactive(conn *ecs.ECS, capacityProvider string) (*ecs.Capa return nil, err } + +func ServiceStable(conn *ecs.ECS, id, cluster string) error { + input := &ecs.DescribeServicesInput{ + Services: aws.StringSlice([]string{id}), + } + + if cluster != "" { + input.Cluster = aws.String(cluster) + } + + if err := conn.WaitUntilServicesStable(input); err != nil { + return err + } + return nil +} + +func ServiceInactive(conn *ecs.ECS, id, cluster string) error { + input := &ecs.DescribeServicesInput{ + Services: aws.StringSlice([]string{id}), + } + + if cluster != "" { + input.Cluster = aws.String(cluster) + } + + if err := conn.WaitUntilServicesInactive(input); err != nil { + return err + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{ServiceStatusActive, ServiceStatusDraining}, + Target: []string{ServiceStatusInactive, ServiceStatusNone}, + Refresh: ServiceStatus(conn, id, cluster), + Timeout: ServiceInactiveTimeout, + MinTimeout: ServiceInactiveTimeoutMin, + } + + _, err := stateConf.WaitForState() + + if err != nil { + return err + } + + return nil +} + +func ServiceDescribeReady(conn *ecs.ECS, id, cluster string) (*ecs.DescribeServicesOutput, error) { + stateConf := &resource.StateChangeConf{ + Pending: []string{ServiceStatusInactive, ServiceStatusDraining, ServiceStatusNone}, + Target: []string{ServiceStatusActive}, + Refresh: ServiceStatus(conn, id, cluster), + Timeout: ServiceDescribeTimeout, + } + + outputRaw, err := stateConf.WaitForState() + + if v, ok := outputRaw.(*ecs.DescribeServicesOutput); ok { + return v, err + } + + return nil, err +} From 3956780c0434492966cf786d2d7c75cadc82534d Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 17:20:36 -0400 Subject: [PATCH 1238/1252] r/ecs_service: Rework retries, waiters --- aws/resource_aws_ecs_service.go | 198 ++++++++++++++++---------------- 1 file changed, 97 insertions(+), 101 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index d0389a0e370..9b78351a65b 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -11,12 +11,15 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ecs" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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/terraform-providers/terraform-provider-aws/aws/internal/hashcode" "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ecs/waiter" + iamwaiter "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/iam/waiter" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/tfresource" ) func resourceAwsEcsService() *schema.Resource { @@ -522,45 +525,62 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Creating ECS service: %s", input) // Retry due to AWS IAM & ECS eventual consistency - var out *ecs.CreateServiceOutput - var err error - err = resource.Retry(waiter.ServiceCreateTimeout, func() *resource.RetryError { - out, err = conn.CreateService(&input) + err := resource.Retry(iamwaiter.PropagationTimeout+waiter.ServiceCreateTimeout, func() *resource.RetryError { + output, err := conn.CreateService(&input) if err != nil { - if isAWSErr(err, ecs.ErrCodeClusterNotFoundException, "") { + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException) { return resource.RetryableError(err) } - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "Please verify that the ECS service role being passed has the proper permissions.") { + + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "verify that the ECS service role being passed has the proper permissions") { return resource.RetryableError(err) } - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "does not have an associated load balancer") { + + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "does not have an associated load balancer") { return resource.RetryableError(err) } - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "Unable to assume the service linked role."+ - " Please verify that the ECS service linked role exists") { + + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "Unable to assume the service linked role") { return resource.RetryableError(err) } - return resource.NonRetryableError(err) + + return resource.NonRetryableError(fmt.Errorf("error waiting for ECS service (%s) creation: %w", d.Get("name").(string), err)) } + log.Printf("[DEBUG] ECS service created: %s", aws.StringValue(output.Service.ServiceArn)) + d.SetId(aws.StringValue(output.Service.ServiceArn)) + return nil }) - if isResourceTimeoutError(err) { - out, err = conn.CreateService(&input) + + if tfresource.TimedOut(err) { + output, err := conn.CreateService(&input) + + if err != nil { + return fmt.Errorf("error creating ECS service: %w", err) + } + + if output == nil || output.Service == nil { + return fmt.Errorf("error creating ECS service: empty response") + } + + log.Printf("[DEBUG] ECS service created: %s", aws.StringValue(output.Service.ServiceArn)) + d.SetId(aws.StringValue(output.Service.ServiceArn)) } + if err != nil { return fmt.Errorf("error creating %s service: %w", d.Get("name").(string), err) } - service := *out.Service - - log.Printf("[DEBUG] ECS service created: %s", aws.StringValue(service.ServiceArn)) - d.SetId(aws.StringValue(service.ServiceArn)) - if d.Get("wait_for_steady_state").(bool) { - if err := waitForSteadyState(conn, d); err != nil { - return err + cluster := "" + if v, ok := d.GetOk("cluster"); ok { + cluster = v.(string) + } + + if err := waiter.ServiceStable(conn, d.Id(), cluster); err != nil { + return fmt.Errorf("error waiting for ECS service (%s) to become ready: %w", d.Id(), err) } } @@ -574,42 +594,23 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Reading ECS service %s", d.Id()) input := ecs.DescribeServicesInput{ Cluster: aws.String(d.Get("cluster").(string)), - Include: []*string{aws.String(ecs.ServiceFieldTags)}, - Services: []*string{aws.String(d.Id())}, + Include: aws.StringSlice([]string{ecs.ServiceFieldTags}), + Services: aws.StringSlice([]string{d.Id()}), } - var out *ecs.DescribeServicesOutput - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - var err error - out, err = conn.DescribeServices(&input) - if err != nil { - if d.IsNewResource() && isAWSErr(err, ecs.ErrCodeServiceNotFoundException, "") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - - if len(out.Services) < 1 { - if d.IsNewResource() { - return resource.RetryableError(fmt.Errorf("ECS service not created yet: %q", d.Id())) - } - log.Printf("[WARN] ECS Service %s not found, removing from state.", d.Id()) - d.SetId("") - return nil - } - - service := out.Services[0] - if d.IsNewResource() && *service.Status == "INACTIVE" { - return resource.RetryableError(fmt.Errorf("ECS service currently INACTIVE: %q", d.Id())) - } + output, err := conn.DescribeServices(&input) + if !d.IsNewResource() && tfawserr.ErrCodeEquals(err, ecs.ErrCodeServiceNotFoundException) { + log.Printf("[WARN] ECS service (%s) not found, removing from state", d.Id()) + d.SetId("") return nil - }) - if isResourceTimeoutError(err) { - out, err = conn.DescribeServices(&input) } - if isAWSErr(err, ecs.ErrCodeClusterNotFoundException, "") { + if err != nil { + output, err = waiter.ServiceDescribeReady(conn, d.Id(), d.Get("cluster").(string)) + } + + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeClusterNotFoundException) { log.Printf("[WARN] ECS Service %s parent cluster %s not found, removing from state.", d.Id(), d.Get("cluster").(string)) d.SetId("") return nil @@ -619,7 +620,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error reading ECS service: %w", err) } - if len(out.Services) < 1 { + if len(output.Services) < 1 { if d.IsNewResource() { return fmt.Errorf("ECS service not created: %q", d.Id()) } @@ -628,11 +629,11 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { return nil } - service := out.Services[0] + service := output.Services[0] // Status==INACTIVE means deleted service - if *service.Status == "INACTIVE" { - log.Printf("[WARN] Removing ECS service %q because it's INACTIVE", *service.ServiceArn) + if aws.StringValue(service.Status) == "INACTIVE" { + log.Printf("[WARN] Removing ECS service %q because it's INACTIVE", aws.StringValue(service.ServiceArn)) d.SetId("") return nil } @@ -650,7 +651,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { if strings.HasPrefix(d.Get("task_definition").(string), "arn:"+meta.(*AWSClient).partition+":ecs:") { d.Set("task_definition", service.TaskDefinition) } else { - taskDefinition := buildFamilyAndRevisionFromARN(*service.TaskDefinition) + taskDefinition := buildFamilyAndRevisionFromARN(aws.StringValue(service.TaskDefinition)) d.Set("task_definition", taskDefinition) } } @@ -668,7 +669,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { if strings.HasPrefix(d.Get("cluster").(string), "arn:"+meta.(*AWSClient).partition+":ecs:") { d.Set("cluster", service.ClusterArn) } else { - clusterARN := getNameFromARN(*service.ClusterArn) + clusterARN := getNameFromARN(aws.StringValue(service.ClusterArn)) d.Set("cluster", clusterARN) } @@ -677,7 +678,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { if strings.HasPrefix(d.Get("iam_role").(string), "arn:"+meta.(*AWSClient).partition+":iam:") { d.Set("iam_role", service.RoleArn) } else { - roleARN := getNameFromARN(*service.RoleArn) + roleARN := getNameFromARN(aws.StringValue(service.RoleArn)) d.Set("iam_role", roleARN) } } @@ -794,7 +795,7 @@ func flattenEcsNetworkConfiguration(nc *ecs.NetworkConfiguration) []interface{} result["subnets"] = flattenStringSet(nc.AwsvpcConfiguration.Subnets) if nc.AwsvpcConfiguration.AssignPublicIp != nil { - result["assign_public_ip"] = *nc.AwsvpcConfiguration.AssignPublicIp == ecs.AssignPublicIpEnabled + result["assign_public_ip"] = aws.StringValue(nc.AwsvpcConfiguration.AssignPublicIp) == ecs.AssignPublicIpEnabled } return []interface{}{result} @@ -901,9 +902,9 @@ func flattenServicePlacementConstraints(pcs []*ecs.PlacementConstraint) []map[st results := make([]map[string]interface{}, 0) for _, pc := range pcs { c := make(map[string]interface{}) - c["type"] = *pc.Type + c["type"] = aws.StringValue(pc.Type) if pc.Expression != nil { - c["expression"] = *pc.Expression + c["expression"] = aws.StringValue(pc.Expression) } results = append(results, c) @@ -957,14 +958,14 @@ func flattenPlacementStrategy(pss []*ecs.PlacementStrategy) []interface{} { results := make([]interface{}, 0, len(pss)) for _, ps := range pss { c := make(map[string]interface{}) - c["type"] = *ps.Type + c["type"] = aws.StringValue(ps.Type) if ps.Field != nil { - c["field"] = *ps.Field + c["field"] = aws.StringValue(ps.Field) // for some fields the API requires lowercase for creation but will return uppercase on query - if *ps.Field == "MEMORY" || *ps.Field == "CPU" { - c["field"] = strings.ToLower(*ps.Field) + if aws.StringValue(ps.Field) == "MEMORY" || aws.StringValue(ps.Field) == "CPU" { + c["field"] = strings.ToLower(aws.StringValue(ps.Field)) } } @@ -1112,30 +1113,40 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error if updateService { log.Printf("[DEBUG] Updating ECS Service (%s): %s", d.Id(), input) // Retry due to IAM eventual consistency - err := resource.Retry(2*time.Minute, func() *resource.RetryError { + err := resource.Retry(iamwaiter.PropagationTimeout+waiter.ServiceUpdateTimeout, func() *resource.RetryError { _, err := conn.UpdateService(&input) + if err != nil { - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "Please verify that the ECS service role being passed has the proper permissions.") { + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "verify that the ECS service role being passed has the proper permissions") { return resource.RetryableError(err) } - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "does not have an associated load balancer") { + + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "does not have an associated load balancer") { return resource.RetryableError(err) } + return resource.NonRetryableError(err) } return nil }) - if isResourceTimeoutError(err) { + + if tfresource.TimedOut(err) { _, err = conn.UpdateService(&input) } + if err != nil { return fmt.Errorf("error updating ECS Service (%s): %w", d.Id(), err) } } if d.Get("wait_for_steady_state").(bool) { - if err := waitForSteadyState(conn, d); err != nil { - return err + cluster := "" + if v, ok := d.GetOk("cluster"); ok { + cluster = v.(string) + } + + if err := waiter.ServiceStable(conn, d.Id(), cluster); err != nil { + return fmt.Errorf("error waiting for ECS service (%s) to become ready: %w", d.Id(), err) } } @@ -1154,31 +1165,32 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error conn := meta.(*AWSClient).ecsconn // Check if it's not already gone - resp, err := conn.DescribeServices(&ecs.DescribeServicesInput{ - Services: []*string{aws.String(d.Id())}, + output, err := conn.DescribeServices(&ecs.DescribeServicesInput{ + Services: aws.StringSlice([]string{d.Id()}), Cluster: aws.String(d.Get("cluster").(string)), }) + if err != nil { - if isAWSErr(err, ecs.ErrCodeServiceNotFoundException, "") { + if tfawserr.ErrCodeEquals(err, ecs.ErrCodeServiceNotFoundException) { log.Printf("[DEBUG] Removing ECS Service from state, %q is already gone", d.Id()) return nil } return err } - if len(resp.Services) == 0 { + if len(output.Services) == 0 { log.Printf("[DEBUG] Removing ECS Service from state, %q is already gone", d.Id()) return nil } - log.Printf("[DEBUG] ECS service %s is currently %s", d.Id(), *resp.Services[0].Status) + log.Printf("[DEBUG] ECS service %s is currently %s", d.Id(), aws.StringValue(output.Services[0].Status)) - if *resp.Services[0].Status == "INACTIVE" { + if aws.StringValue(output.Services[0].Status) == "INACTIVE" { return nil } // Drain the ECS service - if *resp.Services[0].Status != "DRAINING" && aws.StringValue(resp.Services[0].SchedulingStrategy) != ecs.SchedulingStrategyDaemon { + if aws.StringValue(output.Services[0].Status) != "DRAINING" && aws.StringValue(output.Services[0].SchedulingStrategy) != ecs.SchedulingStrategyDaemon { log.Printf("[DEBUG] Draining ECS service %s", d.Id()) _, err = conn.UpdateService(&ecs.UpdateServiceInput{ Service: aws.String(d.Id()), @@ -1197,46 +1209,30 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error // Wait until the ECS service is drained err = resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { log.Printf("[DEBUG] Trying to delete ECS service %s", input) + _, err := conn.DeleteService(&input) + if err != nil { - if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "The service cannot be stopped while deployments are active.") { + if tfawserr.ErrMessageContains(err, ecs.ErrCodeInvalidParameterException, "The service cannot be stopped while deployments are active.") { return resource.RetryableError(err) } + return resource.NonRetryableError(err) } + return nil }) + if isResourceTimeoutError(err) { _, err = conn.DeleteService(&input) } + if err != nil { return fmt.Errorf("error deleting ECS service (%s): %w", d.Id(), err) } - // Wait until it's deleted - wait := resource.StateChangeConf{ - Pending: []string{"ACTIVE", "DRAINING"}, - Target: []string{"INACTIVE"}, - Timeout: 10 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - log.Printf("[DEBUG] Checking if ECS service %s is INACTIVE", d.Id()) - resp, err := conn.DescribeServices(&ecs.DescribeServicesInput{ - Services: []*string{aws.String(d.Id())}, - Cluster: aws.String(d.Get("cluster").(string)), - }) - if err != nil { - return resp, "FAILED", err - } - - log.Printf("[DEBUG] ECS service (%s) is currently %q", d.Id(), *resp.Services[0].Status) - return resp, *resp.Services[0].Status, nil - }, - } - - _, err = wait.WaitForState() - if err != nil { - return err + if err := waiter.ServiceInactive(conn, d.Id(), d.Get("cluster").(string)); err != nil { + return fmt.Errorf("error deleting ECS service (%s): %w", d.Id(), err) } log.Printf("[DEBUG] ECS service %s deleted.", d.Id()) From a3d243832632b39b5d3c0f2789bbe0eeacdcf404 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 17:36:35 -0400 Subject: [PATCH 1239/1252] tests/r/ecs_service: Use proper disappears test --- aws/resource_aws_ecs_service_test.go | 46 ++-------------------------- 1 file changed, 3 insertions(+), 43 deletions(-) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 0febeea555c..24ea29c25fc 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -191,6 +191,7 @@ func TestAccAWSEcsService_disappears(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-arn-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-arn-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-arn-%s", rString) + resourceName := "aws_ecs_service.mongo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -201,8 +202,8 @@ func TestAccAWSEcsService_disappears(t *testing.T) { { Config: testAccAWSEcsService(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - testAccCheckAWSEcsServiceDisappears(&service), + testAccCheckAWSEcsServiceExists(resourceName, &service), + testAccCheckResourceDisappears(testAccProvider, resourceAwsEcsService(), resourceName), ), ExpectNonEmptyPlan: true, }, @@ -1442,47 +1443,6 @@ func testAccCheckAWSEcsServiceExists(name string, service *ecs.Service) resource } } -func testAccCheckAWSEcsServiceDisappears(service *ecs.Service) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).ecsconn - - input := &ecs.DeleteServiceInput{ - Cluster: service.ClusterArn, - Service: service.ServiceName, - Force: aws.Bool(true), - } - - _, err := conn.DeleteService(input) - - if err != nil { - return err - } - - // Wait until it's deleted - wait := resource.StateChangeConf{ - Pending: []string{"ACTIVE", "DRAINING"}, - Target: []string{"INACTIVE"}, - Timeout: 10 * time.Minute, - MinTimeout: 1 * time.Second, - Refresh: func() (interface{}, string, error) { - resp, err := conn.DescribeServices(&ecs.DescribeServicesInput{ - Cluster: service.ClusterArn, - Services: []*string{service.ServiceName}, - }) - if err != nil { - return resp, "FAILED", err - } - - return resp, aws.StringValue(resp.Services[0].Status), nil - }, - } - - _, err = wait.WaitForState() - - return err - } -} - func testAccCheckAWSEcsServiceNotRecreated(i, j *ecs.Service) resource.TestCheckFunc { return func(s *terraform.State) error { if !aws.TimeValue(i.CreatedAt).Equal(aws.TimeValue(j.CreatedAt)) { From b443562d179da1dfc1e9315895a8f310e8176d99 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 18:16:51 -0400 Subject: [PATCH 1240/1252] tests/r/ecs_service: Use standard resource naming --- aws/resource_aws_ecs_service_test.go | 550 ++++++++++++++------------- 1 file changed, 286 insertions(+), 264 deletions(-) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 24ea29c25fc..7494c15659d 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -112,6 +112,7 @@ func TestAccAWSEcsService_withARN(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-arn-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-arn-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-arn-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -122,18 +123,18 @@ func TestAccAWSEcsService_withARN(t *testing.T) { { Config: testAccAWSEcsService(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "service_registries.#", "0"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "scheduling_strategy", "REPLICA"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "0"), + resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "REPLICA"), ), }, { Config: testAccAWSEcsServiceModified(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "service_registries.#", "0"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "scheduling_strategy", "REPLICA"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "0"), + resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "REPLICA"), ), }, }, @@ -148,7 +149,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { tdName := fmt.Sprintf("tf-acc-td-svc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-%s", rString) - resourceName := "aws_ecs_service.jenkins" + resourceName := "aws_ecs_service.test" importInput := fmt.Sprintf("%s/%s", clusterName, svcName) resource.ParallelTest(t, resource.TestCase{ @@ -160,7 +161,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { { Config: testAccAWSEcsServiceWithFamilyAndRevision(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.jenkins", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, // Test existent resource import @@ -191,7 +192,7 @@ func TestAccAWSEcsService_disappears(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-arn-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-arn-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-arn-%s", rString) - resourceName := "aws_ecs_service.mongo" + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -218,6 +219,7 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -228,7 +230,7 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { { Config: testAccAWSEcsServiceWithInterchangeablePlacementStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, }, @@ -243,6 +245,7 @@ func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) providerName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -253,13 +256,13 @@ func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { { Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 1, 0), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 10, 1), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, }, @@ -274,6 +277,7 @@ func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { tdName := fmt.Sprintf("tf-acc-td-svc-w-mcps-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-mcps-%s", rString) sgName := fmt.Sprintf("tf-acc-sg-svc-w-mcps-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -284,8 +288,8 @@ func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { { Config: testAccAWSEcsServiceWithMultipleCapacityProviderStrategies(clusterName, tdName, svcName, sgName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "capacity_provider_strategy.#", "2"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "capacity_provider_strategy.#", "2"), ), }, }, @@ -299,6 +303,7 @@ func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-far-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-far-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-far-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -309,14 +314,14 @@ func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { { Config: testAccAWSEcsServiceWithFamilyAndRevision(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.jenkins", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { Config: testAccAWSEcsServiceWithFamilyAndRevisionModified(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.jenkins", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, }, @@ -332,6 +337,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { uClusterName := fmt.Sprintf("tf-acc-cluster-svc-w-rc-updated-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-rc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-rc-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -342,16 +348,16 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { { Config: testAccAWSEcsServiceWithRenamedCluster(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestCheckResourceAttrPair("aws_ecs_service.ghost", "cluster", "aws_ecs_cluster.default", "arn"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), ), }, { Config: testAccAWSEcsServiceWithRenamedCluster(uClusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestCheckResourceAttrPair("aws_ecs_service.ghost", "cluster", "aws_ecs_cluster.default", "arn"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), ), }, }, @@ -370,7 +376,7 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) { lbName := fmt.Sprintf("tf-acc-lb-svc-w-hcgps-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-hcgps-%s", rString) - resourceName := "aws_ecs_service.with_alb" + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -425,6 +431,7 @@ func TestAccAWSEcsService_withIamRole(t *testing.T) { roleName := fmt.Sprintf("tf-acc-role-svc-w-iam-role-%s", rString) policyName := fmt.Sprintf("tf-acc-policy-svc-w-iam-role-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-iam-role-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -435,7 +442,7 @@ func TestAccAWSEcsService_withIamRole(t *testing.T) { { Config: testAccAWSEcsService_withIamRole(clusterName, tdName, roleName, policyName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, }, @@ -512,6 +519,7 @@ func TestAccAWSEcsService_withDeploymentValues(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-dv-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-dv-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-dv-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -522,11 +530,9 @@ func TestAccAWSEcsService_withDeploymentValues(t *testing.T) { { Config: testAccAWSEcsServiceWithDeploymentValues(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - resource.TestCheckResourceAttr( - "aws_ecs_service.mongo", "deployment_maximum_percent", "200"), - resource.TestCheckResourceAttr( - "aws_ecs_service.mongo", "deployment_minimum_healthy_percent", "100"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "deployment_maximum_percent", "200"), + resource.TestCheckResourceAttr(resourceName, "deployment_minimum_healthy_percent", "100"), ), }, }, @@ -591,6 +597,7 @@ func TestAccAWSEcsService_withLbChanges(t *testing.T) { roleName := fmt.Sprintf("tf-acc-role-svc-w-lbc-%s", rString) policyName := fmt.Sprintf("tf-acc-policy-svc-w-lbc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-lbc-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -601,13 +608,13 @@ func TestAccAWSEcsService_withLbChanges(t *testing.T) { { Config: testAccAWSEcsService_withLbChanges(clusterName, tdName, roleName, policyName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.with_lb_changes", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { Config: testAccAWSEcsService_withLbChanges_modified(clusterName, tdName, roleName, policyName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.with_lb_changes", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, }, @@ -622,6 +629,7 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-cluster-name-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-cluster-name-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-cluster-name-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -632,9 +640,9 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { { Config: testAccAWSEcsServiceWithEcsClusterName(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.jenkins", &service), + testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr( - "aws_ecs_service.jenkins", "cluster", clusterName), + resourceName, "cluster", clusterName), ), }, }, @@ -651,6 +659,7 @@ func TestAccAWSEcsService_withAlb(t *testing.T) { policyName := fmt.Sprintf("tf-acc-policy-svc-w-alb-%s", rString) lbName := fmt.Sprintf("tf-acc-lb-svc-w-alb-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-alb-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -661,8 +670,8 @@ func TestAccAWSEcsService_withAlb(t *testing.T) { { Config: testAccAWSEcsServiceWithAlb(clusterName, tdName, roleName, policyName, lbName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.with_alb", &service), - resource.TestCheckResourceAttr("aws_ecs_service.with_alb", "load_balancer.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "load_balancer.#", "1"), ), }, }, @@ -677,6 +686,7 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { tdName := fmt.Sprintf("tf-acc-td-svc-w-alb-%s", rString) lbName := fmt.Sprintf("tf-acc-lb-svc-w-alb-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-alb-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -687,8 +697,8 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { { Config: testAccAWSEcsServiceWithMultipleTargetGroups(clusterName, tdName, lbName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.with_alb", &service), - resource.TestCheckResourceAttr("aws_ecs_service.with_alb", "load_balancer.#", "2"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "load_balancer.#", "2"), ), }, }, @@ -697,7 +707,7 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { func TestAccAWSEcsService_withForceNewDeployment(t *testing.T) { var service1, service2 ecs.Service - resourceName := "aws_ecs_service.mongo" + resourceName := "aws_ecs_service.test" rString := acctest.RandString(8) clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ps-%s", rString) @@ -738,6 +748,7 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ps-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ps-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ps-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -748,40 +759,40 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { { Config: testAccAWSEcsService(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service1), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.#", "0"), + testAccCheckAWSEcsServiceExists(resourceName, &service1), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "0"), ), }, { Config: testAccAWSEcsServiceWithPlacementStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service2), + testAccCheckAWSEcsServiceExists(resourceName, &service2), testAccCheckAWSEcsServiceNotRecreated(&service1, &service2), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.#", "1"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.type", "binpack"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.field", "memory"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.type", "binpack"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.field", "memory"), ), }, { Config: testAccAWSEcsServiceWithRandomPlacementStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service3), + testAccCheckAWSEcsServiceExists(resourceName, &service3), testAccCheckAWSEcsServiceNotRecreated(&service2, &service3), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.#", "1"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.type", "random"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.field", ""), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.type", "random"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.field", ""), ), }, { Config: testAccAWSEcsServiceWithMultiPlacementStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service4), + testAccCheckAWSEcsServiceExists(resourceName, &service4), testAccCheckAWSEcsServiceNotRecreated(&service3, &service4), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.#", "2"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.type", "binpack"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.0.field", "memory"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.1.type", "spread"), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "ordered_placement_strategy.1.field", "instanceId"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.type", "binpack"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.0.field", "memory"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.1.type", "spread"), + resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.1.field", "instanceId"), ), }, }, @@ -813,6 +824,7 @@ func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-pc-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-pc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-pc-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -823,16 +835,16 @@ func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { { Config: testAccAWSEcsServiceWithPlacementConstraint(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service1), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "placement_constraints.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service1), + resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), ), }, { Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service2), + testAccCheckAWSEcsServiceExists(resourceName, &service2), testAccCheckAWSEcsServiceNotRecreated(&service1, &service2), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "placement_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), ), }, }, @@ -846,6 +858,7 @@ func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-pc-ee-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-pc-ee-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-pc-ee-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -856,8 +869,8 @@ func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) { Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), - resource.TestCheckResourceAttr("aws_ecs_service.mongo", "placement_constraints.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), ), }, }, @@ -873,6 +886,7 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ltf-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ltf-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ltf-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -883,26 +897,26 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { { Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "false"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "launch_type", "FARGATE"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.assign_public_ip", "false"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.security_groups.#", "2"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.subnets.#", "2"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "platform_version", "LATEST"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "launch_type", "FARGATE"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.security_groups.#", "2"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.subnets.#", "2"), + resource.TestCheckResourceAttr(resourceName, "platform_version", "LATEST"), ), }, { Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "true"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.assign_public_ip", "true"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "true"), ), }, { Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "false"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.assign_public_ip", "false"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), ), }, }, @@ -918,6 +932,7 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) clusterName := fmt.Sprintf("tf-acc-cluster-svc-ltf-w-pv-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-ltf-w-pv-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-ltf-w-pv-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -928,22 +943,22 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) { Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "1.3.0"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "platform_version", "1.3.0"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "platform_version", "1.3.0"), ), }, { Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "LATEST"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "platform_version", "LATEST"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "platform_version", "LATEST"), ), }, { Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "1.4.0"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "platform_version", "1.4.0"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "platform_version", "1.4.0"), ), }, }, @@ -1036,6 +1051,7 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-nc-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-nc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-nc-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1046,19 +1062,19 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) { Config: testAccAWSEcsServiceWithNetworkConfiguration(sg1Name, sg2Name, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.assign_public_ip", "false"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.security_groups.#", "2"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.subnets.#", "2"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.security_groups.#", "2"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.subnets.#", "2"), ), }, { Config: testAccAWSEcsServiceWithNetworkConfiguration_modified(sg1Name, sg2Name, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.main", &service), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.assign_public_ip", "false"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.security_groups.#", "1"), - resource.TestCheckResourceAttr("aws_ecs_service.main", "network_configuration.0.subnets.#", "2"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.security_groups.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_configuration.0.subnets.#", "2"), ), }, }, @@ -1072,6 +1088,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-daemon-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-daemon-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ss-daemon-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1082,8 +1099,8 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { { Config: testAccAWSEcsServiceWithDaemonSchedulingStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestCheckResourceAttr("aws_ecs_service.ghost", "scheduling_strategy", "DAEMON"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "DAEMON"), ), }, }, @@ -1097,6 +1114,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *te clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-daemon-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-daemon-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ss-daemon-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1107,8 +1125,8 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *te { Config: testAccAWSEcsServiceWithDaemonSchedulingStrategySetDeploymentMinimum(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestCheckResourceAttr("aws_ecs_service.ghost", "scheduling_strategy", "DAEMON"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "DAEMON"), ), }, }, @@ -1122,6 +1140,7 @@ func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-replica-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-replica-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ss-replica-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1132,8 +1151,8 @@ func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { { Config: testAccAWSEcsServiceWithReplicaSchedulingStrategy(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestCheckResourceAttr("aws_ecs_service.ghost", "scheduling_strategy", "REPLICA"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "REPLICA"), ), }, }, @@ -1147,6 +1166,7 @@ func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, @@ -1157,8 +1177,8 @@ func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { { Config: testAccAWSEcsService_withServiceRegistries(rString, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), - resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), ), }, }, @@ -1172,6 +1192,7 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, @@ -1182,8 +1203,8 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { { Config: testAccAWSEcsService_withServiceRegistries_container(rString, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), - resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), ), }, }, @@ -1199,6 +1220,7 @@ func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck(servicediscovery.EndpointsID, t) }, @@ -1209,15 +1231,15 @@ func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { { Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, serviceDiscoveryName, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), - resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), ), }, { Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, updatedServiceDiscoveryName, clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), - resource.TestCheckResourceAttr("aws_ecs_service.test", "service_registries.#", "1"), + testAccCheckAWSEcsServiceExists(resourceName, &service), + resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), ), }, }, @@ -1459,7 +1481,7 @@ resource "aws_ecs_cluster" "default" { name = "%s" } -resource "aws_ecs_task_definition" "mongo" { +resource "aws_ecs_task_definition" "test" { family = "%s" container_definitions = < Date: Mon, 4 Jan 2021 17:19:40 -0500 Subject: [PATCH 1241/1252] d/aws_route: AWS Wavelength support. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteDataSource_' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteDataSource_ -timeout 120m === RUN TestAccAWSRouteDataSource_basic === PAUSE TestAccAWSRouteDataSource_basic === RUN TestAccAWSRouteDataSource_TransitGatewayID === PAUSE TestAccAWSRouteDataSource_TransitGatewayID === RUN TestAccAWSRouteDataSource_IPv6DestinationCidr === PAUSE TestAccAWSRouteDataSource_IPv6DestinationCidr === RUN TestAccAWSRouteDataSource_LocalGatewayID === PAUSE TestAccAWSRouteDataSource_LocalGatewayID === CONT TestAccAWSRouteDataSource_basic === CONT TestAccAWSRouteDataSource_LocalGatewayID data_source_aws_outposts_outposts_test.go:66: skipping since no Outposts found --- SKIP: TestAccAWSRouteDataSource_LocalGatewayID (2.00s) === CONT TestAccAWSRouteDataSource_IPv6DestinationCidr --- PASS: TestAccAWSRouteDataSource_IPv6DestinationCidr (24.28s) === CONT TestAccAWSRouteDataSource_TransitGatewayID --- PASS: TestAccAWSRouteDataSource_basic (328.90s) --- PASS: TestAccAWSRouteDataSource_TransitGatewayID (305.22s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 331.596s --- aws/data_source_aws_route.go | 192 +++++++++++++---------------- website/docs/d/route.html.markdown | 2 + 2 files changed, 87 insertions(+), 107 deletions(-) diff --git a/aws/data_source_aws_route.go b/aws/data_source_aws_route.go index 56bd92e2c56..ac5630cda84 100644 --- a/aws/data_source_aws_route.go +++ b/aws/data_source_aws_route.go @@ -2,12 +2,12 @@ package aws import ( "fmt" - "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" tfec2 "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/finder" ) func dataSourceAwsRoute() *schema.Resource { @@ -19,52 +19,74 @@ func dataSourceAwsRoute() *schema.Resource { Type: schema.TypeString, Required: true, }, + + /// + // Destinations. + /// "destination_cidr_block": { Type: schema.TypeString, Optional: true, Computed: true, }, + "destination_ipv6_cidr_block": { Type: schema.TypeString, Optional: true, Computed: true, }, + + // + // Targets. + // + "carrier_gateway_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, + "gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, + "instance_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "nat_gateway_id": { + + "local_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "local_gateway_id": { + + "nat_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "transit_gateway_id": { + + "network_interface_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "vpc_peering_connection_id": { + + "transit_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "network_interface_id": { + + "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, Computed: true, @@ -75,63 +97,19 @@ func dataSourceAwsRoute() *schema.Resource { func dataSourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - req := &ec2.DescribeRouteTablesInput{} - rtbId := d.Get("route_table_id") - cidr := d.Get("destination_cidr_block") - ipv6Cidr := d.Get("destination_ipv6_cidr_block") - - req.Filters = buildEC2AttributeFilterList( - map[string]string{ - "route-table-id": rtbId.(string), - "route.destination-cidr-block": cidr.(string), - "route.destination-ipv6-cidr-block": ipv6Cidr.(string), - }, - ) - log.Printf("[DEBUG] Reading Route Table: %s", req) - resp, err := conn.DescribeRouteTables(req) - if err != nil { - return err - } - if resp == nil || len(resp.RouteTables) == 0 { - return fmt.Errorf("Your query returned no results. Please change your search criteria and try again.") - } - if len(resp.RouteTables) > 1 { - return fmt.Errorf("Your query returned more than one route table. Please change your search criteria and try again.") - } + routeTableID := d.Get("route_table_id").(string) - results := getRoutes(resp.RouteTables[0], d) + routeTable, err := finder.RouteTableByID(conn, routeTableID) - if len(results) == 0 { - return fmt.Errorf("No routes matching supplied arguments found in table(s)") - } - if len(results) > 1 { - return fmt.Errorf("Multiple routes matched; use additional constraints to reduce matches to a single route") + if err != nil { + return fmt.Errorf("error reading Route Table (%s): %w", routeTableID, err) } - route := results[0] - - d.SetId(resourceAwsRouteID(d, route)) // using function from "resource_aws_route.go" - d.Set("destination_cidr_block", route.DestinationCidrBlock) - d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) - d.Set("egress_only_gateway_id", route.EgressOnlyInternetGatewayId) - d.Set("gateway_id", route.GatewayId) - d.Set("instance_id", route.InstanceId) - d.Set("nat_gateway_id", route.NatGatewayId) - d.Set("local_gateway_id", route.LocalGatewayId) - d.Set("transit_gateway_id", route.TransitGatewayId) - d.Set("vpc_peering_connection_id", route.VpcPeeringConnectionId) - d.Set("network_interface_id", route.NetworkInterfaceId) - return nil -} - -func getRoutes(table *ec2.RouteTable, d *schema.ResourceData) []*ec2.Route { - ec2Routes := table.Routes - routes := make([]*ec2.Route, 0, len(ec2Routes)) - // Loop through the routes and add them to the set - for _, r := range ec2Routes { + routes := []*ec2.Route{} - if r.Origin != nil && *r.Origin == "EnableVgwRoutePropagation" { + for _, r := range routeTable.Routes { + if aws.StringValue(r.Origin) == ec2.RouteOriginEnableVgwRoutePropagation { continue } @@ -141,79 +119,79 @@ func getRoutes(table *ec2.RouteTable, d *schema.ResourceData) []*ec2.Route { continue } - if v, ok := d.GetOk("destination_cidr_block"); ok { - if r.DestinationCidrBlock == nil || *r.DestinationCidrBlock != v.(string) { - continue - } + if v, ok := d.GetOk("destination_cidr_block"); ok && aws.StringValue(r.DestinationCidrBlock) != v.(string) { + continue } - if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok { - if r.DestinationIpv6CidrBlock == nil || *r.DestinationIpv6CidrBlock != v.(string) { - continue - } + if v, ok := d.GetOk("destination_ipv6_cidr_block"); ok && aws.StringValue(r.DestinationIpv6CidrBlock) != v.(string) { + continue } - if v, ok := d.GetOk("egress_only_gateway_id"); ok { - if r.EgressOnlyInternetGatewayId == nil || *r.EgressOnlyInternetGatewayId != v.(string) { - continue - } + if v, ok := d.GetOk("carrier_gateway_id"); ok && aws.StringValue(r.CarrierGatewayId) != v.(string) { + continue } - if v, ok := d.GetOk("gateway_id"); ok { - if r.GatewayId == nil || *r.GatewayId != v.(string) { - continue - } + if v, ok := d.GetOk("egress_only_gateway_id"); ok && aws.StringValue(r.EgressOnlyInternetGatewayId) != v.(string) { + continue } - if v, ok := d.GetOk("instance_id"); ok { - if r.InstanceId == nil || *r.InstanceId != v.(string) { - continue - } + if v, ok := d.GetOk("gateway_id"); ok && aws.StringValue(r.GatewayId) != v.(string) { + continue } - if v, ok := d.GetOk("nat_gateway_id"); ok { - if r.NatGatewayId == nil || *r.NatGatewayId != v.(string) { - continue - } + if v, ok := d.GetOk("instance_id"); ok && aws.StringValue(r.InstanceId) != v.(string) { + continue } - if v, ok := d.GetOk("local_gateway_id"); ok { - if r.LocalGatewayId == nil || *r.LocalGatewayId != v.(string) { - continue - } + if v, ok := d.GetOk("local_gateway_id"); ok && aws.StringValue(r.LocalGatewayId) != v.(string) { + continue } - if v, ok := d.GetOk("transit_gateway_id"); ok { - if r.TransitGatewayId == nil || *r.TransitGatewayId != v.(string) { - continue - } + if v, ok := d.GetOk("nat_gateway_id"); ok && aws.StringValue(r.NatGatewayId) != v.(string) { + continue } - if v, ok := d.GetOk("vpc_peering_connection_id"); ok { - if r.VpcPeeringConnectionId == nil || *r.VpcPeeringConnectionId != v.(string) { - continue - } + if v, ok := d.GetOk("network_interface_id"); ok && aws.StringValue(r.NetworkInterfaceId) != v.(string) { + continue } - if v, ok := d.GetOk("network_interface_id"); ok { - if r.NetworkInterfaceId == nil || *r.NetworkInterfaceId != v.(string) { - continue - } + if v, ok := d.GetOk("transit_gateway_id"); ok && aws.StringValue(r.TransitGatewayId) != v.(string) { + continue } + + if v, ok := d.GetOk("vpc_peering_connection_id"); ok && aws.StringValue(r.VpcPeeringConnectionId) != v.(string) { + continue + } + routes = append(routes, r) } - return routes -} -// Helper: Create an ID for a route -func resourceAwsRouteID(d *schema.ResourceData, r *ec2.Route) string { - routeTableID := d.Get("route_table_id").(string) + if len(routes) == 0 { + return fmt.Errorf("No routes matching supplied arguments found in Route Table (%s)", routeTableID) + } - if destination := aws.StringValue(r.DestinationCidrBlock); destination != "" { - return tfec2.RouteCreateID(routeTableID, destination) - } else if destination := aws.StringValue(r.DestinationIpv6CidrBlock); destination != "" { - return tfec2.RouteCreateID(routeTableID, destination) + if len(routes) > 1 { + return fmt.Errorf("%d routes matched in Route Table (%s); use additional constraints to reduce matches to a single route", len(routes), routeTableID) } - return "" + route := routes[0] + + if destination := aws.StringValue(route.DestinationCidrBlock); destination != "" { + d.SetId(tfec2.RouteCreateID(routeTableID, destination)) + } else if destination := aws.StringValue(route.DestinationIpv6CidrBlock); destination != "" { + d.SetId(tfec2.RouteCreateID(routeTableID, destination)) + } + d.Set("carrier_gateway_id", route.CarrierGatewayId) + d.Set("destination_cidr_block", route.DestinationCidrBlock) + d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) + d.Set("egress_only_gateway_id", route.EgressOnlyInternetGatewayId) + d.Set("gateway_id", route.GatewayId) + d.Set("instance_id", route.InstanceId) + d.Set("local_gateway_id", route.LocalGatewayId) + d.Set("nat_gateway_id", route.NatGatewayId) + d.Set("network_interface_id", route.NetworkInterfaceId) + d.Set("transit_gateway_id", route.TransitGatewayId) + d.Set("vpc_peering_connection_id", route.VpcPeeringConnectionId) + + return nil } diff --git a/website/docs/d/route.html.markdown b/website/docs/d/route.html.markdown index af334618969..1a7c9d9179b 100644 --- a/website/docs/d/route.html.markdown +++ b/website/docs/d/route.html.markdown @@ -64,6 +64,8 @@ Route whose data will be exported as attributes. * `network_interface_id` - (Optional) The Network Interface ID of the Route belonging to the Route Table. +* `carrier_gateway_id` - (Optional) The EC2 Carrier Gateway ID of the Route belonging to the Route Table. + ## Attributes Reference All of the argument attributes are also exported as From cf55b56df86bf53dd043a19a2a74e9a81879c7a6 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Tue, 5 Jan 2021 09:30:23 -0500 Subject: [PATCH 1242/1252] d/aws_route: Add 'TestAccAWSRouteDataSource_CarrierGatewayID'. Acceptance test output: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSRouteDataSource_CarrierGatewayID' ACCTEST_PARALLELISM=2 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 2 -run=TestAccAWSRouteDataSource_CarrierGatewayID -timeout 120m === RUN TestAccAWSRouteDataSource_CarrierGatewayID === PAUSE TestAccAWSRouteDataSource_CarrierGatewayID === CONT TestAccAWSRouteDataSource_CarrierGatewayID --- PASS: TestAccAWSRouteDataSource_CarrierGatewayID (25.26s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 25.394s --- aws/data_source_aws_route_test.go | 61 +++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/aws/data_source_aws_route_test.go b/aws/data_source_aws_route_test.go index 9bcba44af9f..fc1d423f89b 100644 --- a/aws/data_source_aws_route_test.go +++ b/aws/data_source_aws_route_test.go @@ -115,6 +115,28 @@ func TestAccAWSRouteDataSource_LocalGatewayID(t *testing.T) { }) } +func TestAccAWSRouteDataSource_CarrierGatewayID(t *testing.T) { + dataSourceName := "data.aws_route.test" + resourceName := "aws_route.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRouteDataSourceConfigIpv4CarrierGateway(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "destination_cidr_block", dataSourceName, "destination_cidr_block"), + resource.TestCheckResourceAttrPair(resourceName, "route_table_id", dataSourceName, "route_table_id"), + resource.TestCheckResourceAttrPair(resourceName, "carrier_gateway_id", dataSourceName, "carrier_gateway_id"), + ), + }, + }, + }) +} + func testAccDataSourceAwsRouteConfigBasic(rName string) string { return composeConfig( testAccLatestAmazonLinuxHvmEbsAmiConfig(), @@ -352,3 +374,42 @@ data "aws_route" "by_local_gateway_id" { } `, rName) } + +func testAccAWSRouteDataSourceConfigIpv4CarrierGateway(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_ec2_carrier_gateway" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_route" "test" { + destination_cidr_block = "0.0.0.0/0" + route_table_id = aws_route_table.test.id + carrier_gateway_id = aws_ec2_carrier_gateway.test.id +} + +data "aws_route" "test" { + route_table_id = aws_route.test.route_table_id + carrier_gateway_id = aws_route.test.carrier_gateway_id +} +`, rName) +} From 8b7a44617048783abd52db305ecf152212c43c69 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Sat, 23 Jan 2021 18:19:46 -0500 Subject: [PATCH 1243/1252] Add CHANGELOG entry. --- .changelog/16963.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/16963.txt diff --git a/.changelog/16963.txt b/.changelog/16963.txt new file mode 100644 index 00000000000..fe1bfd80372 --- /dev/null +++ b/.changelog/16963.txt @@ -0,0 +1,3 @@ +```release-notes:enhancement +data-source/aws_route: Add `carrier_gateway_id` attribute +``` From 790d40161260e193dd024fb330a6c92974899360 Mon Sep 17 00:00:00 2001 From: Kit Ewbank Date: Fri, 26 Mar 2021 13:54:31 -0400 Subject: [PATCH 1244/1252] Add 'ErrorCheck' for new acceptance tests. --- aws/data_source_aws_route_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/aws/data_source_aws_route_test.go b/aws/data_source_aws_route_test.go index fc1d423f89b..6a6228378db 100644 --- a/aws/data_source_aws_route_test.go +++ b/aws/data_source_aws_route_test.go @@ -122,6 +122,7 @@ func TestAccAWSRouteDataSource_CarrierGatewayID(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWavelengthZoneAvailable(t) }, + ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID), Providers: testAccProviders, CheckDestroy: testAccCheckAWSRouteDestroy, Steps: []resource.TestStep{ From c679cffea774c1a01cd4ba1025bba49c51c39a53 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 18:38:06 -0400 Subject: [PATCH 1245/1252] ds/route: Minor cleanup --- aws/data_source_aws_route.go | 10 +------ website/docs/d/route.html.markdown | 48 +++++++++++------------------- 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/aws/data_source_aws_route.go b/aws/data_source_aws_route.go index ac5630cda84..0a3afb6225c 100644 --- a/aws/data_source_aws_route.go +++ b/aws/data_source_aws_route.go @@ -28,7 +28,6 @@ func dataSourceAwsRoute() *schema.Resource { Optional: true, Computed: true, }, - "destination_ipv6_cidr_block": { Type: schema.TypeString, Optional: true, @@ -43,49 +42,41 @@ func dataSourceAwsRoute() *schema.Resource { Optional: true, Computed: true, }, - "egress_only_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "instance_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "local_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "nat_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "network_interface_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "transit_gateway_id": { Type: schema.TypeString, Optional: true, Computed: true, }, - "vpc_peering_connection_id": { Type: schema.TypeString, Optional: true, @@ -181,6 +172,7 @@ func dataSourceAwsRouteRead(d *schema.ResourceData, meta interface{}) error { } else if destination := aws.StringValue(route.DestinationIpv6CidrBlock); destination != "" { d.SetId(tfec2.RouteCreateID(routeTableID, destination)) } + d.Set("carrier_gateway_id", route.CarrierGatewayId) d.Set("destination_cidr_block", route.DestinationCidrBlock) d.Set("destination_ipv6_cidr_block", route.DestinationIpv6CidrBlock) diff --git a/website/docs/d/route.html.markdown b/website/docs/d/route.html.markdown index 1a7c9d9179b..bb2293c2c3a 100644 --- a/website/docs/d/route.html.markdown +++ b/website/docs/d/route.html.markdown @@ -10,14 +10,11 @@ description: |- `aws_route` provides details about a specific Route. -This resource can prove useful when finding the resource -associated with a CIDR. For example, finding the peering -connection associated with a CIDR value. +This resource can prove useful when finding the resource associated with a CIDR. For example, finding the peering connection associated with a CIDR value. ## Example Usage -The following example shows how one might use a CIDR value to find a network interface id -and use this to create a data source of that network interface. +The following example shows how one might use a CIDR value to find a network interface id and use this to create a data source of that network interface. ```terraform variable "subnet_id" {} @@ -38,35 +35,26 @@ data "aws_network_interface" "interface" { ## Argument Reference -The arguments of this data source act as filters for querying the available -Route in the current region. The given filters must match exactly one -Route whose data will be exported as attributes. +The arguments of this data source act as filters for querying the available Route in the current region. The given filters must match exactly oneRoute whose data will be exported as attributes. -* `route_table_id` - (Required) The id of the specific Route Table containing the Route entry. +The following arguments are required: -* `destination_cidr_block` - (Optional) The CIDR block of the Route belonging to the Route Table. +* `route_table_id` - (Required) The ID of the specific Route Table containing the Route entry. -* `destination_ipv6_cidr_block` - (Optional) The IPv6 CIDR block of the Route belonging to the Route Table. +The following arguments are optional: -* `egress_only_gateway_id` - (Optional) The Egress Only Gateway ID of the Route belonging to the Route Table. - -* `gateway_id` - (Optional) The Gateway ID of the Route belonging to the Route Table. - -* `instance_id` - (Optional) The Instance ID of the Route belonging to the Route Table. - -* `nat_gateway_id` - (Optional) The NAT Gateway ID of the Route belonging to the Route Table. - -* `local_gateway_id` - (Optional) The Local Gateway ID of the Route belonging to the Route Table. - -* `transit_gateway_id` - (Optional) The EC2 Transit Gateway ID of the Route belonging to the Route Table. - -* `vpc_peering_connection_id` - (Optional) The VPC Peering Connection ID of the Route belonging to the Route Table. - -* `network_interface_id` - (Optional) The Network Interface ID of the Route belonging to the Route Table. - -* `carrier_gateway_id` - (Optional) The EC2 Carrier Gateway ID of the Route belonging to the Route Table. +* `carrier_gateway_id` - (Optional) EC2 Carrier Gateway ID of the Route belonging to the Route Table. +* `destination_cidr_block` - (Optional) CIDR block of the Route belonging to the Route Table. +* `destination_ipv6_cidr_block` - (Optional) IPv6 CIDR block of the Route belonging to the Route Table. +* `egress_only_gateway_id` - (Optional) Egress Only Gateway ID of the Route belonging to the Route Table. +* `gateway_id` - (Optional) Gateway ID of the Route belonging to the Route Table. +* `instance_id` - (Optional) Instance ID of the Route belonging to the Route Table. +* `local_gateway_id` - (Optional) Local Gateway ID of the Route belonging to the Route Table. +* `nat_gateway_id` - (Optional) NAT Gateway ID of the Route belonging to the Route Table. +* `network_interface_id` - (Optional) Network Interface ID of the Route belonging to the Route Table. +* `transit_gateway_id` - (Optional) EC2 Transit Gateway ID of the Route belonging to the Route Table. +* `vpc_peering_connection_id` - (Optional) VPC Peering Connection ID of the Route belonging to the Route Table. ## Attributes Reference -All of the argument attributes are also exported as -result attributes when there is data available. For example, the `vpc_peering_connection_id` field will be empty when the route is attached to a Network Interface. +All of the argument attributes are also exported as result attributes when there is data available. For example, the `vpc_peering_connection_id` field will be empty when the route is attached to a Network Interface. From f5ec59fec631b563bde027acb94b3835691b78f1 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 18:51:06 -0400 Subject: [PATCH 1246/1252] r/ecs_service: Remove unused wait func --- aws/resource_aws_ecs_service.go | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 9b78351a65b..a2a7d246c67 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -1264,17 +1264,3 @@ func buildFamilyAndRevisionFromARN(arn string) string { func getNameFromARN(arn string) string { return strings.Split(arn, "/")[1] } - -func waitForSteadyState(conn *ecs.ECS, d *schema.ResourceData) error { - input := &ecs.DescribeServicesInput{ - Services: aws.StringSlice([]string{d.Id()}), - } - if v, ok := d.GetOk("cluster"); ok { - input.Cluster = aws.String(v.(string)) - } - - if err := conn.WaitUntilServicesStable(input); err != nil { - return fmt.Errorf("error waiting for service (%s) to reach a steady state: %w", d.Id(), err) - } - return nil -} From db5984df9da09e601ab40d4412b4cc385bbdd500 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 21:29:44 -0400 Subject: [PATCH 1247/1252] tests/r/ecs_service: Adjust for standard variables, names --- aws/resource_aws_ecs_service_test.go | 863 +++++++++++---------------- 1 file changed, 354 insertions(+), 509 deletions(-) diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index 7494c15659d..f89caae5fc2 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -107,11 +107,7 @@ func testSweepEcsServices(region string) error { func TestAccAWSEcsService_withARN(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-arn-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-arn-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-arn-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -121,7 +117,7 @@ func TestAccAWSEcsService_withARN(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService(clusterName, tdName, svcName), + Config: testAccAWSEcsService(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "0"), @@ -130,7 +126,7 @@ func TestAccAWSEcsService_withARN(t *testing.T) { }, { - Config: testAccAWSEcsServiceModified(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceModified(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "0"), @@ -143,14 +139,9 @@ func TestAccAWSEcsService_withARN(t *testing.T) { func TestAccAWSEcsService_basicImport(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-%s", rString) - + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" - importInput := fmt.Sprintf("%s/%s", clusterName, svcName) + importInput := fmt.Sprintf("%s/%s", rName, rName) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -159,7 +150,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithFamilyAndRevision(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithFamilyAndRevision(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -176,7 +167,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { // Test non-existent resource import { ResourceName: resourceName, - ImportStateId: fmt.Sprintf("%s/nonexistent", clusterName), + ImportStateId: fmt.Sprintf("%s/nonexistent", rName), ImportState: true, ImportStateVerify: false, ExpectError: regexp.MustCompile(`(Please verify the ID is correct|Cannot import non-existent remote object)`), @@ -187,11 +178,7 @@ func TestAccAWSEcsService_basicImport(t *testing.T) { func TestAccAWSEcsService_disappears(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-arn-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-arn-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-arn-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -201,7 +188,7 @@ func TestAccAWSEcsService_disappears(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService(clusterName, tdName, svcName), + Config: testAccAWSEcsService(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), testAccCheckResourceDisappears(testAccProvider, resourceAwsEcsService(), resourceName), @@ -214,11 +201,7 @@ func TestAccAWSEcsService_disappears(t *testing.T) { func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -228,7 +211,7 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithInterchangeablePlacementStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithInterchangeablePlacementStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -239,12 +222,7 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) - providerName := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -254,13 +232,13 @@ func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 1, 0), + Config: testAccAWSEcsServiceWithCapacityProviderStrategy(rName, 1, 0), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { - Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 10, 1), + Config: testAccAWSEcsServiceWithCapacityProviderStrategy(rName, 10, 1), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -271,12 +249,7 @@ func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-mcps-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-mcps-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-mcps-%s", rString) - sgName := fmt.Sprintf("tf-acc-sg-svc-w-mcps-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -286,7 +259,7 @@ func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithMultipleCapacityProviderStrategies(clusterName, tdName, svcName, sgName), + Config: testAccAWSEcsServiceWithMultipleCapacityProviderStrategies(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "capacity_provider_strategy.#", "2"), @@ -298,11 +271,7 @@ func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-far-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-far-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-far-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -312,14 +281,14 @@ func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithFamilyAndRevision(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithFamilyAndRevision(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { - Config: testAccAWSEcsServiceWithFamilyAndRevisionModified(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithFamilyAndRevisionModified(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -331,12 +300,7 @@ func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { // Regression for https://github.com/hashicorp/terraform/issues/2427 func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-rc-%s", rString) - uClusterName := fmt.Sprintf("tf-acc-cluster-svc-w-rc-updated-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-rc-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-rc-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -346,7 +310,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithRenamedCluster(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithRenamedCluster(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), @@ -354,7 +318,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { }, { - Config: testAccAWSEcsServiceWithRenamedCluster(uClusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithRenamedCluster(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttrPair(resourceName, "cluster", "aws_ecs_cluster.default", "arn"), @@ -366,16 +330,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - vpcNameTag := "terraform-testacc-ecs-service-health-check-grace-period" - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-hcgps-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-hcgps-%s", rString) - roleName := fmt.Sprintf("tf-acc-role-svc-w-hcgps-%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-svc-w-hcgps-%s", rString) - lbName := fmt.Sprintf("tf-acc-lb-svc-w-hcgps-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-hcgps-%s", rString) - + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -385,34 +340,29 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName, - roleName, policyName, lbName, svcName, -1), + Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(rName, -1), ExpectError: regexp.MustCompile(`expected health_check_grace_period_seconds to be in the range`), }, { - Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName, - roleName, policyName, lbName, svcName, math.MaxInt32+1), + Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(rName, math.MaxInt32+1), ExpectError: regexp.MustCompile(`expected health_check_grace_period_seconds to be in the range`), }, { - Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName, - roleName, policyName, lbName, svcName, 300), + Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(rName, 300), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "health_check_grace_period_seconds", "300"), ), }, { - Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName, - roleName, policyName, lbName, svcName, 600), + Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(rName, 600), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "health_check_grace_period_seconds", "600"), ), }, { - Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(vpcNameTag, clusterName, tdName, - roleName, policyName, lbName, svcName, math.MaxInt32), + Config: testAccAWSEcsService_healthCheckGracePeriodSeconds(rName, math.MaxInt32), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "health_check_grace_period_seconds", "2147483647"), @@ -424,13 +374,7 @@ func TestAccAWSEcsService_healthCheckGracePeriodSeconds(t *testing.T) { func TestAccAWSEcsService_withIamRole(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-iam-role-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-iam-role-%s", rString) - roleName := fmt.Sprintf("tf-acc-role-svc-w-iam-role-%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-svc-w-iam-role-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-iam-role-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -440,7 +384,7 @@ func TestAccAWSEcsService_withIamRole(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_withIamRole(clusterName, tdName, roleName, policyName, svcName), + Config: testAccAWSEcsService_withIamRole(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -514,11 +458,7 @@ func TestAccAWSEcsService_withDeploymentController_Type_External(t *testing.T) { func TestAccAWSEcsService_withDeploymentValues(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-dv-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-dv-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-dv-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -528,7 +468,7 @@ func TestAccAWSEcsService_withDeploymentValues(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithDeploymentValues(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithDeploymentValues(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "deployment_maximum_percent", "200"), @@ -590,13 +530,7 @@ func TestAccAWSEcsService_withDeploymentCircuitBreaker(t *testing.T) { // Regression for https://github.com/hashicorp/terraform/issues/3444 func TestAccAWSEcsService_withLbChanges(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-lbc-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-lbc-%s", rString) - roleName := fmt.Sprintf("tf-acc-role-svc-w-lbc-%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-svc-w-lbc-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-lbc-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -606,13 +540,13 @@ func TestAccAWSEcsService_withLbChanges(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_withLbChanges(clusterName, tdName, roleName, policyName, svcName), + Config: testAccAWSEcsService_withLbChanges(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), }, { - Config: testAccAWSEcsService_withLbChanges_modified(clusterName, tdName, roleName, policyName, svcName), + Config: testAccAWSEcsService_withLbChanges_modified(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), ), @@ -624,11 +558,7 @@ func TestAccAWSEcsService_withLbChanges(t *testing.T) { // Regression for https://github.com/hashicorp/terraform/issues/3361 func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-cluster-name-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-cluster-name-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-cluster-name-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -638,11 +568,10 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithEcsClusterName(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithEcsClusterName(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), - resource.TestCheckResourceAttr( - resourceName, "cluster", clusterName), + resource.TestCheckResourceAttr(resourceName, "cluster", rName), ), }, }, @@ -651,14 +580,7 @@ func TestAccAWSEcsService_withEcsClusterName(t *testing.T) { func TestAccAWSEcsService_withAlb(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-alb-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-alb-%s", rString) - roleName := fmt.Sprintf("tf-acc-role-svc-w-alb-%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-svc-w-alb-%s", rString) - lbName := fmt.Sprintf("tf-acc-lb-svc-w-alb-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-alb-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -668,7 +590,7 @@ func TestAccAWSEcsService_withAlb(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithAlb(clusterName, tdName, roleName, policyName, lbName, svcName), + Config: testAccAWSEcsServiceWithAlb(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "load_balancer.#", "1"), @@ -680,12 +602,7 @@ func TestAccAWSEcsService_withAlb(t *testing.T) { func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-alb-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-alb-%s", rString) - lbName := fmt.Sprintf("tf-acc-lb-svc-w-alb-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-alb-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -695,7 +612,7 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithMultipleTargetGroups(clusterName, tdName, lbName, svcName), + Config: testAccAWSEcsServiceWithMultipleTargetGroups(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "load_balancer.#", "2"), @@ -707,12 +624,8 @@ func TestAccAWSEcsService_withMultipleTargetGroups(t *testing.T) { func TestAccAWSEcsService_withForceNewDeployment(t *testing.T) { var service1, service2 ecs.Service + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ps-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ps-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ps-%s", rString) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -721,14 +634,14 @@ func TestAccAWSEcsService_withForceNewDeployment(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService(clusterName, tdName, svcName), + Config: testAccAWSEcsService(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service1), resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "0"), ), }, { - Config: testAccAWSEcsServiceWithForceNewDeployment(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithForceNewDeployment(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service2), testAccCheckAWSEcsServiceNotRecreated(&service1, &service2), @@ -743,11 +656,7 @@ func TestAccAWSEcsService_withForceNewDeployment(t *testing.T) { func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { var service1, service2, service3, service4 ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ps-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ps-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ps-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -757,14 +666,14 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService(clusterName, tdName, svcName), + Config: testAccAWSEcsService(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service1), resource.TestCheckResourceAttr(resourceName, "ordered_placement_strategy.#", "0"), ), }, { - Config: testAccAWSEcsServiceWithPlacementStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithPlacementStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service2), testAccCheckAWSEcsServiceNotRecreated(&service1, &service2), @@ -774,7 +683,7 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { ), }, { - Config: testAccAWSEcsServiceWithRandomPlacementStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithRandomPlacementStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service3), testAccCheckAWSEcsServiceNotRecreated(&service2, &service3), @@ -784,7 +693,7 @@ func TestAccAWSEcsService_withPlacementStrategy(t *testing.T) { ), }, { - Config: testAccAWSEcsServiceWithMultiPlacementStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithMultiPlacementStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service4), testAccCheckAWSEcsServiceNotRecreated(&service3, &service4), @@ -819,11 +728,7 @@ func TestAccAWSEcsService_withPlacementStrategy_Type_Missing(t *testing.T) { func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { var service1, service2 ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-pc-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-pc-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-pc-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -833,14 +738,14 @@ func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithPlacementConstraint(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithPlacementConstraint(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service1), resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), ), }, { - Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service2), testAccCheckAWSEcsServiceNotRecreated(&service1, &service2), @@ -853,11 +758,7 @@ func TestAccAWSEcsService_withPlacementConstraints(t *testing.T) { func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-pc-ee-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-pc-ee-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-pc-ee-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -867,7 +768,7 @@ func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithPlacementConstraintEmptyExpression(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), @@ -879,13 +780,7 @@ func TestAccAWSEcsService_withPlacementConstraints_emptyExpression(t *testing.T) func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - sg1Name := fmt.Sprintf("tf-acc-sg-1-svc-w-ltf-%s", rString) - sg2Name := fmt.Sprintf("tf-acc-sg-2-svc-w-ltf-%s", rString) - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ltf-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ltf-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ltf-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -895,7 +790,7 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "false"), + Config: testAccAWSEcsServiceWithLaunchTypeFargate(rName, false), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "launch_type", "FARGATE"), @@ -906,14 +801,14 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { ), }, { - Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "true"), + Config: testAccAWSEcsServiceWithLaunchTypeFargate(rName, true), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "true"), ), }, { - Config: testAccAWSEcsServiceWithLaunchTypeFargate(sg1Name, sg2Name, clusterName, tdName, svcName, "false"), + Config: testAccAWSEcsServiceWithLaunchTypeFargate(rName, false), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), @@ -925,13 +820,7 @@ func TestAccAWSEcsService_withLaunchTypeFargate(t *testing.T) { func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - sg1Name := fmt.Sprintf("tf-acc-sg-1-svc-ltf-w-pv-%s", rString) - sg2Name := fmt.Sprintf("tf-acc-sg-2-svc-ltf-w-pv-%s", rString) - clusterName := fmt.Sprintf("tf-acc-cluster-svc-ltf-w-pv-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-ltf-w-pv-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-ltf-w-pv-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -941,21 +830,21 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "1.3.0"), + Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(rName, "1.3.0"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "platform_version", "1.3.0"), ), }, { - Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "LATEST"), + Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(rName, "LATEST"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "platform_version", "LATEST"), ), }, { - Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(sg1Name, sg2Name, clusterName, tdName, svcName, "1.4.0"), + Config: testAccAWSEcsServiceWithLaunchTypeFargateAndPlatformVersion(rName, "1.4.0"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "platform_version", "1.4.0"), @@ -967,9 +856,8 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndPlatformVersion(t *testing.T) func TestAccAWSEcsService_withLaunchTypeFargateAndWaitForSteadyState(t *testing.T) { var service ecs.Service + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" - rString := acctest.RandString(8) - rName := fmt.Sprintf("tf-acc-svc-w-ltf-ss-%s", rString) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1001,10 +889,8 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndWaitForSteadyState(t *testing. func TestAccAWSEcsService_withLaunchTypeFargateAndUpdateWaitForSteadyState(t *testing.T) { var service ecs.Service + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" - rString := acctest.RandString(8) - - rName := fmt.Sprintf("tf-acc-svc-w-ltf-ss-%s", rString) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1044,13 +930,7 @@ func TestAccAWSEcsService_withLaunchTypeFargateAndUpdateWaitForSteadyState(t *te func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - sg1Name := fmt.Sprintf("tf-acc-sg-1-svc-w-nc-%s", rString) - sg2Name := fmt.Sprintf("tf-acc-sg-2-svc-w-nc-%s", rString) - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-nc-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-nc-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-nc-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1060,7 +940,7 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithNetworkConfiguration(sg1Name, sg2Name, clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithNetworkConfiguration(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), @@ -1069,7 +949,7 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) ), }, { - Config: testAccAWSEcsServiceWithNetworkConfiguration_modified(sg1Name, sg2Name, clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithNetworkConfiguration_modified(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "network_configuration.0.assign_public_ip", "false"), @@ -1083,11 +963,7 @@ func TestAccAWSEcsService_withLaunchTypeEC2AndNetworkConfiguration(t *testing.T) func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-daemon-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-daemon-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ss-daemon-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1097,7 +973,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithDaemonSchedulingStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithDaemonSchedulingStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "DAEMON"), @@ -1109,11 +985,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategy(t *testing.T) { func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-daemon-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-daemon-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ss-daemon-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1123,7 +995,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *te CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithDaemonSchedulingStrategySetDeploymentMinimum(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithDaemonSchedulingStrategySetDeploymentMinimum(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "DAEMON"), @@ -1135,11 +1007,7 @@ func TestAccAWSEcsService_withDaemonSchedulingStrategySetDeploymentMinimum(t *te func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ss-replica-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ss-replica-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ss-replica-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1149,7 +1017,7 @@ func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsServiceWithReplicaSchedulingStrategy(clusterName, tdName, svcName), + Config: testAccAWSEcsServiceWithReplicaSchedulingStrategy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "scheduling_strategy", "REPLICA"), @@ -1161,11 +1029,7 @@ func TestAccAWSEcsService_withReplicaSchedulingStrategy(t *testing.T) { func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1175,7 +1039,7 @@ func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_withServiceRegistries(rString, clusterName, tdName, svcName), + Config: testAccAWSEcsService_withServiceRegistries(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), @@ -1187,11 +1051,7 @@ func TestAccAWSEcsService_withServiceRegistries(t *testing.T) { func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1201,7 +1061,7 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_withServiceRegistries_container(rString, clusterName, tdName, svcName), + Config: testAccAWSEcsService_withServiceRegistries_container(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), @@ -1213,13 +1073,9 @@ func TestAccAWSEcsService_withServiceRegistries_container(t *testing.T) { func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { var service ecs.Service - rString := acctest.RandString(8) - - serviceDiscoveryName := fmt.Sprintf("tf-acc-sd-%s", rString) - updatedServiceDiscoveryName := fmt.Sprintf("tf-acc-sd-%s-updated", rString) - clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) - tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) - svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + rName := acctest.RandomWithPrefix("tf-acc-test") + serviceDiscoveryName := acctest.RandomWithPrefix("tf-acc-test") + updatedServiceDiscoveryName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_ecs_service.test" resource.ParallelTest(t, resource.TestCase{ @@ -1229,14 +1085,14 @@ func TestAccAWSEcsService_withServiceRegistriesChanges(t *testing.T) { CheckDestroy: testAccCheckAWSEcsServiceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, serviceDiscoveryName, clusterName, tdName, svcName), + Config: testAccAWSEcsService_withServiceRegistriesChanges(rName, serviceDiscoveryName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), ), }, { - Config: testAccAWSEcsService_withServiceRegistriesChanges(rString, updatedServiceDiscoveryName, clusterName, tdName, svcName), + Config: testAccAWSEcsService_withServiceRegistriesChanges(rName, updatedServiceDiscoveryName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists(resourceName, &service), resource.TestCheckResourceAttr(resourceName, "service_registries.#", "1"), @@ -1475,14 +1331,14 @@ func testAccCheckAWSEcsServiceNotRecreated(i, j *ecs.Service) resource.TestCheck } } -func testAccAWSEcsService(clusterName, tdName, svcName string) string { +func testAccAWSEcsService(rName string) string { return fmt.Sprintf(` resource "aws_ecs_cluster" "default" { - name = "%s" + name = %[1]q } resource "aws_ecs_task_definition" "test" { - family = "%s" + family = %[1]q container_definitions = < Date: Fri, 26 Mar 2021 21:56:10 -0400 Subject: [PATCH 1248/1252] r/ecs_service: Add retry for dependencyviolation --- aws/resource_aws_ecs_service.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index a2a7d246c67..de9a76a9dec 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -1217,6 +1217,10 @@ func resourceAwsEcsServiceDelete(d *schema.ResourceData, meta interface{}) error return resource.RetryableError(err) } + if tfawserr.ErrMessageContains(err, "DependencyViolation", "has a dependent object") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) } From 628497f45b24aad7efda2313b03adb61329c99f3 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 21:57:10 -0400 Subject: [PATCH 1249/1252] r/security_group: Increase delete timeout and ensure dependencyviolation caught --- aws/resource_aws_security_group.go | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/aws/resource_aws_security_group.go b/aws/resource_aws_security_group.go index eafb6c3d7ca..9acb2a03475 100644 --- a/aws/resource_aws_security_group.go +++ b/aws/resource_aws_security_group.go @@ -13,6 +13,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/aws-sdk-go-base/tfawserr" "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" @@ -34,7 +35,7 @@ func resourceAwsSecurityGroup() *schema.Resource { Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(10 * time.Minute), - Delete: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(15 * time.Minute), }, SchemaVersion: 1, @@ -467,13 +468,23 @@ func resourceAwsSecurityGroupDelete(d *schema.ResourceData, meta interface{}) er err := resource.Retry(d.Timeout(schema.TimeoutDelete), func() *resource.RetryError { _, err := conn.DeleteSecurityGroup(input) if err != nil { - if isAWSErr(err, "InvalidGroup.NotFound", "") { + if tfawserr.ErrCodeEquals(err, "InvalidGroup.NotFound") { return nil } - if isAWSErr(err, "DependencyViolation", "") { - // If it is a dependency violation, we want to retry + + // If it is a dependency violation, we want to retry + if tfawserr.ErrMessageContains(err, "DependencyViolation", "has a dependent object") { + return resource.RetryableError(err) + } + + if tfawserr.ErrCodeEquals(err, "DependencyViolation") { return resource.RetryableError(err) } + + if tfawserr.ErrCodeEquals(err, "InvalidGroup.InUse") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) } return nil From 5c39042177b26f3876a8179778f9fe040636b0a9 Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 21:57:56 -0400 Subject: [PATCH 1250/1252] docs/r/security_group: Increase delete timeout --- website/docs/r/security_group.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/security_group.html.markdown b/website/docs/r/security_group.html.markdown index 77982527349..725cd604264 100644 --- a/website/docs/r/security_group.html.markdown +++ b/website/docs/r/security_group.html.markdown @@ -174,7 +174,7 @@ In addition to all arguments above, the following attributes are exported: configuration options: - `create` - (Default `10m`) How long to wait for a security group to be created. -- `delete` - (Default `10m`) How long to retry on `DependencyViolation` errors during security group deletion from lingering ENIs left by certain AWS services such as Elastic Load Balancing. NOTE: Lambda ENIs can take up to 45 minutes to delete, which is not affected by changing this customizable timeout (in version 2.31.0 and later of the Terraform AWS Provider) unless it is increased above 45 minutes. +- `delete` - (Default `15m`) How long to retry on `DependencyViolation` errors during security group deletion from lingering ENIs left by certain AWS services such as Elastic Load Balancing. NOTE: Lambda ENIs can take up to 45 minutes to delete, which is not affected by changing this customizable timeout (in version 2.31.0 and later of the Terraform AWS Provider) unless it is increased above 45 minutes. ## Import From d941b5878682788402de4db47dd72d60bd40ae6f Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 22:01:16 -0400 Subject: [PATCH 1251/1252] docs/r/ecs_service: Minor doc cleanup --- website/docs/r/ecs_service.html.markdown | 116 +++++++++++------------ 1 file changed, 57 insertions(+), 59 deletions(-) diff --git a/website/docs/r/ecs_service.html.markdown b/website/docs/r/ecs_service.html.markdown index 2d1cf47afac..9aee88093a0 100644 --- a/website/docs/r/ecs_service.html.markdown +++ b/website/docs/r/ecs_service.html.markdown @@ -87,71 +87,84 @@ resource "aws_ecs_service" "example" { ## Argument Reference -The following arguments are supported: +The following arguments are required: -* `name` - (Required) The name of the service (up to 255 letters, numbers, hyphens, and underscores) -* `capacity_provider_strategy` - (Optional) The capacity provider strategy to use for the service. Can be one or more. Defined below. +* `name` - (Required) Name of the service (up to 255 letters, numbers, hyphens, and underscores) + +The following arguments are optional: + +* `capacity_provider_strategy` - (Optional) Capacity provider strategy to use for the service. Can be one or more. Detailed below. * `cluster` - (Optional) ARN of an ECS cluster -* `deployment_circuit_breaker` - (Optional) Configuration block containing deployment circuit breaker. Defined below. -* `deployment_controller` - (Optional) Configuration block containing deployment controller configuration. Defined below. -* `deployment_maximum_percent` - (Optional) The upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy. -* `deployment_minimum_healthy_percent` - (Optional) The lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. -* `desired_count` - (Optional) The number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy. +* `deployment_circuit_breaker` - (Optional) Configuration block for deployment circuit breaker. Detailed below. +* `deployment_controller` - (Optional) Configuration block for deployment controller configuration. Detailed below. +* `deployment_maximum_percent` - (Optional) Upper limit (as a percentage of the service's desiredCount) of the number of running tasks that can be running in a service during a deployment. Not valid when using the `DAEMON` scheduling strategy. +* `deployment_minimum_healthy_percent` - (Optional) Lower limit (as a percentage of the service's desiredCount) of the number of running tasks that must remain running and healthy in a service during a deployment. +* `desired_count` - (Optional) Number of instances of the task definition to place and keep running. Defaults to 0. Do not specify if using the `DAEMON` scheduling strategy. * `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. * `force_new_deployment` - (Optional) Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates. * `health_check_grace_period_seconds` - (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers. * `iam_role` - (Optional) ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here. -* `launch_type` - (Optional) The launch type on which to run your service. The valid values are `EC2` and `FARGATE`. Defaults to `EC2`. -* `load_balancer` - (Optional) A load balancer block. Load balancers documented below. -* `network_configuration` - (Optional) The 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. -* `ordered_placement_strategy` - (Optional) Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. Defined below. -* `placement_constraints` - (Optional) rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. Defined below. -* `platform_version` - (Optional) The platform version on which to run your service. Only applicable for `launch_type` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). +* `launch_type` - (Optional) Launch type on which to run your service. The valid values are `EC2` and `FARGATE`. Defaults to `EC2`. +* `load_balancer` - (Optional) Configuration block for load balancers. Detailed below. +* `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. Detailed below. +* `ordered_placement_strategy` - (Optional) Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. Detailed below. +* `placement_constraints` - (Optional) Rules that are taken into consideration during task placement. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. Maximum number of `placement_constraints` is `10`. Detailed below. +* `platform_version` - (Optional) Platform version on which to run your service. Only applicable for `launch_type` set to `FARGATE`. Defaults to `LATEST`. More information about Fargate platform versions can be found in the [AWS ECS User Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html). * `propagate_tags` - (Optional) Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are `SERVICE` and `TASK_DEFINITION`. -* `scheduling_strategy` - (Optional) The scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html). -* `service_registries` - (Optional) The service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. +* `scheduling_strategy` - (Optional) Scheduling strategy to use for the service. The valid values are `REPLICA` and `DAEMON`. Defaults to `REPLICA`. Note that [*Tasks using the Fargate launch type or the `CODE_DEPLOY` or `EXTERNAL` deployment controller types don't support the `DAEMON` scheduling strategy*](https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_CreateService.html). +* `service_registries` - (Optional) Service discovery registries for the service. The maximum number of `service_registries` blocks is `1`. Detailed below. * `tags` - (Optional) Key-value map of resource tags -* `task_definition` - (Optional) The family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used. +* `task_definition` - (Optional) Family and revision (`family:revision`) or full ARN of the task definition that you want to run in your service. Required unless using the `EXTERNAL` deployment controller. If a revision is not specified, the latest `ACTIVE` revision is used. * `wait_for_steady_state` - (Optional) If `true`, Terraform will wait for the service to reach a steady state (like [`aws ecs wait services-stable`](https://docs.aws.amazon.com/cli/latest/reference/ecs/wait/services-stable.html)) before continuing. Default `false`. -## capacity_provider_strategy +### capacity_provider_strategy The `capacity_provider_strategy` configuration block supports the following: -* `capacity_provider` - (Required) The short name of the capacity provider. -* `weight` - (Required) The relative percentage of the total number of launched tasks that should use the specified capacity provider. -* `base` - (Optional) The number of tasks, at a minimum, to run on the specified capacity provider. Only one capacity provider in a capacity provider strategy can have a base defined. +* `base` - (Optional) 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. +* `capacity_provider` - (Required) Short name of the capacity provider. +* `weight` - (Required) Relative percentage of the total number of launched tasks that should use the specified capacity provider. -## deployment_circuit_breaker +### deployment_circuit_breaker The `deployment_circuit_breaker` configuration block supports the following: * `enable` - (Required) Whether to enable the deployment circuit breaker logic for the service. * `rollback` - (Required) Whether to enable Amazon ECS to roll back the service if a service deployment fails. If rollback is enabled, when a service deployment fails, the service is rolled back to the last deployment that completed successfully. -## deployment_controller +### deployment_controller The `deployment_controller` configuration block supports the following: * `type` - (Optional) Type of deployment controller. Valid values: `CODE_DEPLOY`, `ECS`, `EXTERNAL`. Default: `ECS`. -## load_balancer +### load_balancer `load_balancer` supports the following: -* `elb_name` - (Required for ELB Classic) The name of the ELB (Classic) to associate with the service. -* `target_group_arn` - (Required for ALB/NLB) The ARN of the Load Balancer target group to associate with the service. -* `container_name` - (Required) The name of the container to associate with the load balancer (as it appears in a container definition). -* `container_port` - (Required) The port on the container to associate with the load balancer. +* `elb_name` - (Required for ELB Classic) Name of the ELB (Classic) to associate with the service. +* `target_group_arn` - (Required for ALB/NLB) ARN of the Load Balancer target group to associate with the service. +* `container_name` - (Required) Name of the container to associate with the load balancer (as it appears in a container definition). +* `container_port` - (Required) Port on the container to associate with the load balancer. -> **Version note:** Multiple `load_balancer` configuration block support was added in Terraform AWS Provider version 2.22.0. This allows configuration of [ECS service support for multiple target groups](https://aws.amazon.com/about-aws/whats-new/2019/07/amazon-ecs-services-now-support-multiple-load-balancer-target-groups/). -## ordered_placement_strategy +### network_configuration + +`network_configuration` support the following: + +* `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 [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) + +### ordered_placement_strategy `ordered_placement_strategy` supports the following: -* `type` - (Required) The type of placement strategy. Must be one of: `binpack`, `random`, or `spread` +* `type` - (Required) Type of placement strategy. Must be one of: `binpack`, `random`, or `spread` * `field` - (Optional) For the `spread` placement strategy, valid values are `instanceId` (or `host`, which has the same effect), or any platform or custom attribute that is applied to a container instance. For the `binpack` type, valid values are `memory` and `cpu`. For the `random` type, this attribute is not @@ -159,50 +172,35 @@ The `deployment_controller` configuration block supports the following: -> **Note:** for `spread`, `host` and `instanceId` will be normalized, by AWS, to be `instanceId`. This means the statefile will show `instanceId` but your config will differ if you use `host`. -## placement_constraints +### placement_constraints `placement_constraints` support the following: -* `type` - (Required) The type of constraint. The only valid values at this time are `memberOf` and `distinctInstance`. -* `expression` - (Optional) Cluster Query Language expression to apply to the constraint. Does not need to be specified -for the `distinctInstance` type. -For more information, see [Cluster Query Language in the Amazon EC2 Container -Service Developer -Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html). - -## network_configuration - -`network_configuration` support the following: - -* `subnets` - (Required) The subnets associated with the task or service. -* `security_groups` - (Optional) The 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 [Task Networking](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) +* `type` - (Required) Type of constraint. The only valid values at this time are `memberOf` and `distinctInstance`. +* `expression` - (Optional) Cluster Query Language expression to apply to the constraint. Does not need to be specified for the `distinctInstance` type. For more information, see [Cluster Query Language in the Amazon EC2 Container Service Developer Guide](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-query-language.html). -## service_registries +### service_registries `service_registries` support the following: -* `registry_arn` - (Required) The ARN of the Service Registry. The currently supported service registry is Amazon Route 53 Auto Naming Service(`aws_service_discovery_service`). For more information, see [Service](https://docs.aws.amazon.com/Route53/latest/APIReference/API_autonaming_Service.html) -* `port` - (Optional) The port value used if your Service Discovery service specified an SRV record. -* `container_port` - (Optional) The port value, already specified in the task definition, to be used for your service discovery service. -* `container_name` - (Optional) The container name value, already specified in the task definition, to be used for your service discovery service. +* `registry_arn` - (Required) ARN of the Service Registry. The currently supported service registry is Amazon Route 53 Auto Naming Service(`aws_service_discovery_service`). For more information, see [Service](https://docs.aws.amazon.com/Route53/latest/APIReference/API_autonaming_Service.html) +* `port` - (Optional) Port value used if your Service Discovery service specified an SRV record. +* `container_port` - (Optional) Port value, already specified in the task definition, to be used for your service discovery service. +* `container_name` - (Optional) Container name value, already specified in the task definition, to be used for your service discovery service. ## Attributes Reference In addition to all arguments above, the following attributes are exported: -* `id` - The Amazon Resource Name (ARN) that identifies the service -* `name` - The name of the service -* `cluster` - The Amazon Resource Name (ARN) of cluster which the service runs on -* `iam_role` - The ARN of IAM role used for ELB -* `desired_count` - The number of instances of the task definition +* `cluster` - Amazon Resource Name (ARN) of cluster which the service runs on. +* `desired_count` - Number of instances of the task definition. +* `iam_role` - ARN of IAM role used for ELB. +* `id` - ARN that identifies the service. +* `name` - Name of the service. ## Timeouts -`aws_ecs_service` provides the following -[Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: +`aws_ecs_service` provides the following [Timeouts](https://www.terraform.io/docs/configuration/blocks/resources/syntax.html#operation-timeouts) configuration options: - `delete` - (Default `20 minutes`) From 4246861f75c4594777c84195dda0b9c6c3acd8dc Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Fri, 26 Mar 2021 22:15:40 -0400 Subject: [PATCH 1252/1252] r/ecs_service: Add changelog --- .changelog/16936.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .changelog/16936.txt diff --git a/.changelog/16936.txt b/.changelog/16936.txt new file mode 100644 index 00000000000..c3d439350fa --- /dev/null +++ b/.changelog/16936.txt @@ -0,0 +1,7 @@ +```release-note:enhancement +resource/aws_ecs_service: Add `deployment_circuit_breaker` +``` + +```release-note:bug +resource/aws_ecs_service: Improve handling of eventual consistency including security group dependency violations on deletion +``` \ No newline at end of file