Skip to content

Commit

Permalink
volume_attachment: Use const in waiter
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed Oct 4, 2021
1 parent b09f380 commit bac66a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions aws/internal/service/ec2/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
3 changes: 2 additions & 1 deletion aws/resource_aws_volume_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
}
Expand Down

0 comments on commit bac66a9

Please sign in to comment.