-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Open
Labels
service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.technical-debtAddresses areas of the codebase that need refactoring or redesign.Addresses areas of the codebase that need refactoring or redesign.testsPRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Description
Description
#42801 added a generated functional option for all AWS service clients to handle VCR-specific error codes. However, if a service client has "extra options" implemented which also overrides the default Retryer
, the generated option may be overwritten during client initialization. One known example is the S3 client:
terraform-provider-aws/internal/service/s3/service_package.go
Lines 40 to 47 in b3cd3cc
func(o *s3.Options) { | |
o.Retryer = conns.AddIsErrorRetryables(cfg.Retryer().(aws.RetryerV2), retry.IsErrorRetryableFunc(func(err error) aws.Ternary { | |
if tfawserr.ErrMessageContains(err, errCodeOperationAborted, "A conflicting conditional operation is currently in progress against this resource. Please try again.") { | |
return aws.TrueTernary | |
} | |
return aws.UnknownTernary // Delegate to configured Retryer. | |
})) | |
}, |
When the Retryer
is overridden in this way, VCR-specific errors can once again cause replayed acceptance tests to hang while retrying interaction not found
errors.
=== NAME TestAccElastiCacheCluster_Engine_Redis_LogDeliveryConfigurations
cluster_test.go:1053: Step 1/9 error: Error running apply: exit status 1
Error: creating S3 Bucket (terraform-20250610133851487100000001): operation error S3: CreateBucket, exceeded maximum number of attempts, 25, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Put "https://terraform-20250610133851487100000001.s3.us-west-2.amazonaws.com/": requested interaction not found
with aws_s3_bucket.b,
on terraform_plugin_test.tf line 39, in resource "aws_s3_bucket" "b":
39: resource "aws_s3_bucket" "b" {
--- FAIL: TestAccElastiCacheCluster_Engine_Redis_LogDeliveryConfigurations (4211.93s)
We should either:
- Append to the existing set of retryable functions in the "extra options" (research needed to determine feasability).
- Manually include the VCR-specific logic in the "extra options" definition for impacted clients. If this is only a handful of services this may be the pragmatic, if not most elegant, option.
Important Facts and References
Would you like to implement a relevant change?
No
Metadata
Metadata
Assignees
Labels
service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.technical-debtAddresses areas of the codebase that need refactoring or redesign.Addresses areas of the codebase that need refactoring or redesign.testsPRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.