Skip to content

Commit

Permalink
Merge pull request #21062 from ryancragun/ryancragun/rtb_association_…
Browse files Browse the repository at this point in the history
…max_not_found

r/aws_route_table_association: Wait for 40 NotFoundChecks
  • Loading branch information
ewbankkit authored Sep 28, 2021
2 parents 18a8835 + ea669b3 commit 4086370
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .changelog/21062.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_route_table_association: Wait for up to 40 not found checks when creating a new route table association
```
12 changes: 7 additions & 5 deletions aws/internal/service/ec2/waiter/waiter.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ const (
RouteTableDeletedTimeout = 5 * time.Minute
RouteTableUpdatedTimeout = 5 * time.Minute

RouteTableNotFoundChecks = 40
RouteTableNotFoundChecks = 40
RouteTableAssociationCreatedNotFoundChecks = 40
)

func RouteTableReady(conn *ec2.EC2, id string) (*ec2.RouteTable, error) {
Expand Down Expand Up @@ -351,10 +352,11 @@ func RouteTableDeleted(conn *ec2.EC2, id string) (*ec2.RouteTable, error) {

func RouteTableAssociationCreated(conn *ec2.EC2, id string) (*ec2.RouteTableAssociationState, error) {
stateConf := &resource.StateChangeConf{
Pending: []string{ec2.RouteTableAssociationStateCodeAssociating},
Target: []string{ec2.RouteTableAssociationStateCodeAssociated},
Refresh: RouteTableAssociationState(conn, id),
Timeout: RouteTableAssociationCreatedTimeout,
Pending: []string{ec2.RouteTableAssociationStateCodeAssociating},
Target: []string{ec2.RouteTableAssociationStateCodeAssociated},
Refresh: RouteTableAssociationState(conn, id),
Timeout: RouteTableAssociationCreatedTimeout,
NotFoundChecks: RouteTableAssociationCreatedNotFoundChecks,
}

outputRaw, err := stateConf.WaitForState()
Expand Down

0 comments on commit 4086370

Please sign in to comment.