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_vpc_route_read_error #32196

Merged
merged 6 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 3 additions & 0 deletions .changelog/32196.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
resource/aws_route: Fix `reading Route in Route Table (rtb-1234abcd) with destination (1.2.3.4/5): couldn't find resource` errors when reading new resource
```
2 changes: 1 addition & 1 deletion internal/service/ec2/ebs_snapshot_import.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func resourceEBSSnapshotImportCreate(ctx context.Context, d *schema.ResourceData
input.RoleName = aws.String(v.(string))
}

outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout,
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout,
func() (interface{}, error) {
return conn.ImportSnapshotWithContext(ctx, input)
},
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/ec2_ami.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ func resourceAMIRead(ctx context.Context, d *schema.ResourceData, meta interface
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindImageByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
4 changes: 2 additions & 2 deletions internal/service/ec2/ec2_eip.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func resourceEIPRead(ctx context.Context, d *schema.ResourceData, meta interface
return sdkdiag.AppendErrorf(diags, `with the retirement of EC2-Classic %s domain EC2 EIPs are no longer supported`, ec2.DomainTypeStandard)
}

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindEIPByAllocationID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down Expand Up @@ -339,7 +339,7 @@ func associateEIP(ctx context.Context, conn *ec2.EC2, allocationID, instanceID,
return fmt.Errorf("associating EC2 EIP (%s): %w", allocationID, err)
}

_, err = tfresource.RetryWhen(ctx, propagationTimeout,
_, err = tfresource.RetryWhen(ctx, ec2PropagationTimeout,
func() (interface{}, error) {
return FindEIPByAssociationID(ctx, conn, aws.StringValue(output.AssociationId))
},
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/ec2_eip_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func resourceEIPAssociationCreate(ctx context.Context, d *schema.ResourceData, m

d.SetId(aws.StringValue(output.AssociationId))

_, err = tfresource.RetryWhen(ctx, propagationTimeout,
_, err = tfresource.RetryWhen(ctx, ec2PropagationTimeout,
func() (interface{}, error) {
return FindEIPByAssociationID(ctx, conn, d.Id())
},
Expand Down
8 changes: 4 additions & 4 deletions internal/service/ec2/ec2_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ func resourceInstanceCreate(ctx context.Context, d *schema.ResourceData, meta in
}

log.Printf("[DEBUG] Creating EC2 Instance: %s", input)
outputRaw, err := tfresource.RetryWhen(ctx, propagationTimeout,
outputRaw, err := tfresource.RetryWhen(ctx, iamPropagationTimeout,
func() (interface{}, error) {
return conn.RunInstancesWithContext(ctx, input)
},
Expand Down Expand Up @@ -1504,7 +1504,7 @@ func resourceInstanceUpdate(ctx context.Context, d *schema.ResourceData, meta in
return sdkdiag.AppendErrorf(diags, "updating EC2 Instance (%s): %s", d.Id(), err)
}
} else {
err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError {
err := retry.RetryContext(ctx, iamPropagationTimeout, func() *retry.RetryError {
_, err := conn.ReplaceIamInstanceProfileAssociationWithContext(ctx, input)
if err != nil {
if tfawserr.ErrMessageContains(err, "InvalidParameterValue", "Invalid IAM Instance Profile") {
Expand Down Expand Up @@ -2074,7 +2074,7 @@ func modifyInstanceAttributeWithStopStart(ctx context.Context, conn *ec2.EC2, in
}

// Reference: https://github.com/hashicorp/terraform-provider-aws/issues/16433.
_, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout,
_, err := tfresource.RetryWhenAWSErrMessageContains(ctx, ec2PropagationTimeout,
func() (interface{}, error) {
return conn.StartInstancesWithContext(ctx, &ec2.StartInstancesInput{
InstanceIds: aws.StringSlice([]string{id}),
Expand Down Expand Up @@ -2153,7 +2153,7 @@ func associateInstanceProfile(ctx context.Context, d *schema.ResourceData, conn
Name: aws.String(d.Get("iam_instance_profile").(string)),
},
}
err := retry.RetryContext(ctx, propagationTimeout, func() *retry.RetryError {
err := retry.RetryContext(ctx, iamPropagationTimeout, func() *retry.RetryError {
_, err := conn.AssociateIamInstanceProfileWithContext(ctx, input)
if err != nil {
if tfawserr.ErrMessageContains(err, "InvalidParameterValue", "Invalid IAM Instance Profile") {
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/ec2_spot_fleet_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ func resourceSpotFleetRequestCreate(ctx context.Context, d *schema.ResourceData,
}

log.Printf("[DEBUG] Creating EC2 Spot Fleet Request: %s", input)
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout,
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout,
func() (interface{}, error) {
return conn.RequestSpotFleetWithContext(ctx, input)
},
Expand Down
4 changes: 2 additions & 2 deletions internal/service/ec2/ec2_spot_instance_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func resourceSpotInstanceRequestCreate(ctx context.Context, d *schema.ResourceDa
input.LaunchSpecification.Placement = instanceOpts.SpotPlacement
}

outputRaw, err := tfresource.RetryWhen(ctx, propagationTimeout,
outputRaw, err := tfresource.RetryWhen(ctx, iamPropagationTimeout,
func() (interface{}, error) {
return conn.RequestSpotInstancesWithContext(ctx, input)
},
Expand Down Expand Up @@ -239,7 +239,7 @@ func resourceSpotInstanceRequestRead(ctx context.Context, d *schema.ResourceData
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindSpotInstanceRequestByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func resourceTransitGatewayMulticastGroupMemberRead(ctx context.Context, d *sche
return diag.FromErr(err)
}

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindTransitGatewayMulticastGroupMemberByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID)
}, d.IsNewResource())

Expand Down Expand Up @@ -137,7 +137,7 @@ func deregisterTransitGatewayMulticastGroupMember(ctx context.Context, conn *ec2
return fmt.Errorf("deleting EC2 Transit Gateway Multicast Group Member (%s): %w", id, err)
}

_, err = tfresource.RetryUntilNotFound(ctx, propagationTimeout, func() (interface{}, error) {
_, err = tfresource.RetryUntilNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindTransitGatewayMulticastGroupMemberByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func resourceTransitGatewayMulticastGroupSourceRead(ctx context.Context, d *sche
return diag.FromErr(err)
}

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindTransitGatewayMulticastGroupSourceByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID)
}, d.IsNewResource())

Expand Down Expand Up @@ -137,7 +137,7 @@ func deregisterTransitGatewayMulticastGroupSource(ctx context.Context, conn *ec2
return fmt.Errorf("deleting EC2 Transit Gateway Multicast Group Source (%s): %w", id, err)
}

_, err = tfresource.RetryUntilNotFound(ctx, propagationTimeout, func() (interface{}, error) {
_, err = tfresource.RetryUntilNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindTransitGatewayMulticastGroupSourceByThreePartKey(ctx, conn, multicastDomainID, groupIPAddress, eniID)
})

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/transitgateway_route.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func resourceTransitGatewayRouteRead(ctx context.Context, d *schema.ResourceData
return sdkdiag.AppendErrorf(diags, "reading EC2 Transit Gateway Route (%s): %s", d.Id(), err)
}

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindTransitGatewayRoute(ctx, conn, transitGatewayRouteTableID, destination)
}, d.IsNewResource())

Expand Down
10 changes: 5 additions & 5 deletions internal/service/ec2/vpc_.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func resourceVPCCreate(ctx context.Context, d *schema.ResourceData, meta interfa
input.Ipv6NetmaskLength = aws.Int64(int64(v.(int)))
}

outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return conn.CreateVpcWithContext(ctx, input)
// "UnsupportedOperation: The operation AllocateIpamPoolCidr is not supported. Account 123456789012 is not monitored by IPAM ipam-07b079e3392782a55."
}, errCodeUnsupportedOperation, "is not monitored by IPAM")
Expand Down Expand Up @@ -255,7 +255,7 @@ func resourceVPCRead(ctx context.Context, d *schema.ResourceData, meta interface
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindVPCByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down Expand Up @@ -285,23 +285,23 @@ func resourceVPCRead(ctx context.Context, d *schema.ResourceData, meta interface
d.Set("instance_tenancy", vpc.InstanceTenancy)
d.Set("owner_id", ownerID)

if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindVPCAttribute(ctx, conn, d.Id(), ec2.VpcAttributeNameEnableDnsHostnames)
}, d.IsNewResource()); err != nil {
return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) Attribute (%s): %s", d.Id(), ec2.VpcAttributeNameEnableDnsHostnames, err)
} else {
d.Set("enable_dns_hostnames", v)
}

if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindVPCAttribute(ctx, conn, d.Id(), ec2.VpcAttributeNameEnableDnsSupport)
}, d.IsNewResource()); err != nil {
return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) Attribute (%s): %s", d.Id(), ec2.VpcAttributeNameEnableDnsSupport, err)
} else {
d.Set("enable_dns_support", v)
}

if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
if v, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindVPCAttribute(ctx, conn, d.Id(), ec2.VpcAttributeNameEnableNetworkAddressUsageMetrics)
}, d.IsNewResource()); err != nil {
return sdkdiag.AppendErrorf(diags, "reading EC2 VPC (%s) Attribute (%s): %s", d.Id(), ec2.VpcAttributeNameEnableNetworkAddressUsageMetrics, err)
Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_dhcp_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func resourceVPCDHCPOptionsRead(ctx context.Context, d *schema.ResourceData, met
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindDHCPOptionsByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_dhcp_options_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func resourceVPCDHCPOptionsAssociationRead(ctx context.Context, d *schema.Resour
return sdkdiag.AppendErrorf(diags, "reading EC2 VPC DHCP Options Set Association (%s): %s", d.Id(), err)
}

_, err = tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
_, err = tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return nil, FindVPCDHCPOptionsAssociation(ctx, conn, vpcID, dhcpOptionsID)
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_egress_only_internet_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func resourceEgressOnlyInternetGatewayRead(ctx context.Context, d *schema.Resour
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindEgressOnlyInternetGatewayByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ 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 := tfresource.RetryWhenNewResourceNotFound(ctx, RouteTableAssociationPropagationTimeout, func() (interface{}, error) {
_, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return nil, FindVPCEndpointRouteTableAssociationExists(ctx, conn, endpointID, routeTableID)
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_flow_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func resourceLogFlowCreate(ctx context.Context, d *schema.ResourceData, meta int
input.MaxAggregationInterval = aws.Int64(int64(v.(int)))
}

outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenAWSErrMessageContains(ctx, iamPropagationTimeout, func() (interface{}, error) {
return conn.CreateFlowLogsWithContext(ctx, input)
}, errCodeInvalidParameter, "Unable to assume given IAM role")

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_internet_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func resourceInternetGatewayRead(ctx context.Context, d *schema.ResourceData, me
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindInternetGatewayByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_internet_gateway_attachment.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func resourceInternetGatewayAttachmentRead(ctx context.Context, d *schema.Resour
return sdkdiag.AppendErrorf(diags, "reading EC2 Internet Gateway Attachment (%s): %s", d.Id(), err)
}

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindInternetGatewayAttachment(ctx, conn, igwID, vpcID)
}, d.IsNewResource())

Expand Down
4 changes: 2 additions & 2 deletions internal/service/ec2/vpc_network_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ func resourceNetworkACLRead(ctx context.Context, d *schema.ResourceData, meta in
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindNetworkACLByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down Expand Up @@ -281,7 +281,7 @@ func resourceNetworkACLDelete(ctx context.Context, d *schema.ResourceData, meta
}

log.Printf("[INFO] Deleting EC2 Network ACL: %s", d.Id())
_, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (interface{}, error) {
_, err = tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return conn.DeleteNetworkAclWithContext(ctx, input)
}, errCodeDependencyViolation)

Expand Down
4 changes: 2 additions & 2 deletions internal/service/ec2/vpc_network_acl_association.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func resourceNetworkACLAssociationRead(ctx context.Context, d *schema.ResourceDa
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindNetworkACLAssociationByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down Expand Up @@ -126,7 +126,7 @@ func networkACLAssociationCreate(ctx context.Context, conn *ec2.EC2, naclID, sub
}

log.Printf("[DEBUG] Creating EC2 Network ACL Association: %s", input)
outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenAWSErrCodeEquals(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return conn.ReplaceNetworkAclAssociationWithContext(ctx, input)
}, errCodeInvalidAssociationIDNotFound)

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_network_acl_rule.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ func resourceNetworkACLRuleRead(ctx context.Context, d *schema.ResourceData, met
naclID := d.Get("network_acl_id").(string)
ruleNumber := d.Get("rule_number").(int)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindNetworkACLEntryByThreePartKey(ctx, conn, naclID, egress, ruleNumber)
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_network_interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func resourceNetworkInterfaceRead(ctx context.Context, d *schema.ResourceData, m
var diags diag.Diagnostics
conn := meta.(*conns.AWSClient).EC2Conn(ctx)

outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindNetworkInterfaceByID(ctx, conn, d.Id())
}, d.IsNewResource())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func resourceNetworkInterfaceSGAttachmentRead(ctx context.Context, d *schema.Res

networkInterfaceID := d.Get("network_interface_id").(string)
sgID := d.Get("security_group_id").(string)
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, propagationTimeout, func() (interface{}, error) {
outputRaw, err := tfresource.RetryWhenNewResourceNotFound(ctx, ec2PropagationTimeout, func() (interface{}, error) {
return FindNetworkInterfaceSecurityGroup(ctx, conn, networkInterfaceID, sgID)
}, d.IsNewResource())

Expand Down
2 changes: 1 addition & 1 deletion internal/service/ec2/vpc_peering_connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ func modifyVPCPeeringConnectionOptions(ctx context.Context, conn *ec2.EC2, d *sc

// Retry reading back the modified options to deal with eventual consistency.
// Often this is to do with a delay transitioning from pending-acceptance to active.
err := retry.RetryContext(ctx, VPCPeeringConnectionOptionsPropagationTimeout, func() *retry.RetryError { // nosemgrep:ci.helper-schema-retry-RetryContext-without-TimeoutError-check
err := retry.RetryContext(ctx, ec2PropagationTimeout, func() *retry.RetryError { // nosemgrep:ci.helper-schema-retry-RetryContext-without-TimeoutError-check
vpcPeeringConnection, err := FindVPCPeeringConnectionByID(ctx, conn, d.Id())

if err != nil {
Expand Down
Loading