Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inconsistent read after create for vpc_endpoint_route_table_association #30994

Merged
merged 2 commits into from
Apr 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func resourceVPCEndpointRouteTableAssociationCreate(ctx context.Context, d *sche

log.Printf("[DEBUG] Creating VPC Endpoint Route Table Association: %s", input)
_, err := conn.ModifyVpcEndpointWithContext(ctx, input)

if err != nil {
return sdkdiag.AppendErrorf(diags, "creating VPC Endpoint Route Table Association (%s): %s", id, err)
}
Expand All @@ -82,7 +81,9 @@ func resourceVPCEndpointRouteTableAssociationRead(ctx context.Context, d *schema
// Human friendly ID for error messages since d.Id() is non-descriptive
id := fmt.Sprintf("%s/%s", endpointID, routeTableID)

err := FindVPCEndpointRouteTableAssociationExists(ctx, conn, endpointID, routeTableID)
_, err := tfresource.RetryWhenNewResourceNotFound(ctx, RouteTableAssociationPropagationTimeout, func() (interface{}, error) {
return nil, FindVPCEndpointRouteTableAssociationExists(ctx, conn, endpointID, routeTableID)
}, d.IsNewResource())

if !d.IsNewResource() && tfresource.NotFound(err) {
log.Printf("[WARN] VPC Endpoint Route Table Association (%s) not found, removing from state", id)
Expand Down