Skip to content

Commit

Permalink
Workaround for issue hashicorp#10114
Browse files Browse the repository at this point in the history
  • Loading branch information
obourdon committed Sep 17, 2019
1 parent 27a69c2 commit 05a910c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion aws/resource_aws_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -1439,12 +1439,16 @@ func deleteLingeringLambdaENIs(conn *ec2.EC2, d *schema.ResourceData, filterName
return nil
}
if isAWSErr(detachNetworkInterfaceErr, "OperationNotPermitted", "You are not allowed to manage 'ela-attach' attachments") {
locTimeout := d.Timeout(schema.TimeoutDelete)
if int64(locTimeout) <= int64(20*time.Minute) {
locTimeout = *schema.DefaultTimeout(25 * time.Minute)
}
log.Printf("[DEBUG] Waiting for ENI (%s) to become available", *eni.NetworkInterfaceId)
stateConf := &resource.StateChangeConf{
Pending: []string{"false"},
Target: []string{"true"},
Refresh: networkInterfaceAvailableRefreshFunc(conn, *eni.NetworkInterfaceId),
Timeout: d.Timeout(schema.TimeoutDelete),
Timeout: locTimeout,
}
if _, err := stateConf.WaitForState(); err != nil {
if err.Error() == "Improper number of interfaces returned: 0" {
Expand Down

0 comments on commit 05a910c

Please sign in to comment.