From bac66a9cf59c81517d5df7fba5fafd80aa8eb48e Mon Sep 17 00:00:00 2001 From: Dirk Avery Date: Mon, 4 Oct 2021 17:18:04 -0400 Subject: [PATCH] volume_attachment: Use const in waiter --- aws/internal/service/ec2/waiter/waiter.go | 2 ++ aws/resource_aws_volume_attachment.go | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aws/internal/service/ec2/waiter/waiter.go b/aws/internal/service/ec2/waiter/waiter.go index 826a9aa3d8e..e0ca5fa7f35 100644 --- a/aws/internal/service/ec2/waiter/waiter.go +++ b/aws/internal/service/ec2/waiter/waiter.go @@ -19,6 +19,8 @@ const ( // Maximum amount of time to wait for EC2 Instance attribute modifications to propagate InstanceAttributePropagationTimeout = 2 * time.Minute + InstanceStopTimeout = 10 * time.Minute + // General timeout for EC2 resource creations to propagate PropagationTimeout = 2 * time.Minute ) diff --git a/aws/resource_aws_volume_attachment.go b/aws/resource_aws_volume_attachment.go index 818cde5be21..6589fd9162c 100644 --- a/aws/resource_aws_volume_attachment.go +++ b/aws/resource_aws_volume_attachment.go @@ -13,6 +13,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/hashcode" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/ec2/waiter" ) func resourceAwsVolumeAttachment() *schema.Resource { @@ -211,7 +212,7 @@ func resourceAwsVolumeAttachmentDelete(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error stopping instance (%s): %s", iID, err) } - if err := waitForInstanceStopping(conn, iID, 10*time.Minute); err != nil { + if err := waitForInstanceStopping(conn, iID, waiter.InstanceStopTimeout); err != nil { return err } }