-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
[Bug]: aws_s3_directory_bucket uses incorrect URL for bucket lookup during terraform plan #34869
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
I'm now wedged on this issue because I cannot plan or apply due to this problem, nor can I remove the bucket. |
@balkat Thanks for raising this issue 👏. Immediately, you can work around this by either adding provider "aws" {
...
s3_us_east_1_regional_endpoint = "regional"
} or specifying |
Relates #34606. % AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccS3DirectoryBucket_basic' PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run=TestAccS3DirectoryBucket_basic -timeout 360m
=== RUN TestAccS3DirectoryBucket_basic
=== PAUSE TestAccS3DirectoryBucket_basic
=== CONT TestAccS3DirectoryBucket_basic
directory_bucket_test.go:27: Step 1/2 error: Check failed: Check 1/7 error: operation error S3: HeadBucket, get identity: get credentials: operation error S3: CreateSession, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Get "https://tf-acc-test-7493582040251937474--use1-az6--x-s3.s3express-use1-az6.aws-global.amazonaws.com/?session=": dial tcp: lookup tf-acc-test-7493582040251937474--use1-az6--x-s3.s3express-use1-az6.aws-global.amazonaws.com: no such host
testing_new.go:91: Error running post-test destroy, there may be dangling resources: operation error S3: HeadBucket, get identity: get credentials: operation error S3: CreateSession, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Get "https://tf-acc-test-7493582040251937474--use1-az6--x-s3.s3express-use1-az6.aws-global.amazonaws.com/?session=": dial tcp: lookup tf-acc-test-7493582040251937474--use1-az6--x-s3.s3express-use1-az6.aws-global.amazonaws.com: no such host
--- FAIL: TestAccS3DirectoryBucket_basic (9.71s)
FAIL
FAIL github.com/hashicorp/terraform-provider-aws/internal/service/s3 14.819s
FAIL
make: *** [testacc] Error 1 % AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional AWS_DEFAULT_REGION=us-east-1 make testacc TESTARGS='-run=TestAccS3DirectoryBucket_basic' PKG=s3
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/s3/... -v -count 1 -parallel 20 -run=TestAccS3DirectoryBucket_basic -timeout 360m
=== RUN TestAccS3DirectoryBucket_basic
=== PAUSE TestAccS3DirectoryBucket_basic
=== CONT TestAccS3DirectoryBucket_basic
--- PASS: TestAccS3DirectoryBucket_basic (17.67s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/s3 23.102s |
Actually, using the regional endpoint for |
Thanks for jumping on this so quickly @ewbankkit Kind regards
|
This functionality has been released in v5.31.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Terraform Core Version
1.6.5
AWS Provider Version
5.30.0
Affected Resource(s)
aws_s3_directory_bucket
Expected Behavior
terraform plan
should have succeededActual Behavior
terraform plan
fails on trying to look up the directory bucket resource because it uses an incorrect URL when trying to access the bucketRelevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
The new configuration for an
aws_s3_directory_bucket
shown above was added to an existing (working) config file.terraform apply
ran as expected and created the new directory bucket. So far, so good.A subsequent
terraform plan
tried to look up the bucket resource for the first time and failed because it used an unsupported DNS pathname in the bucket URL.According to https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-networking.html
a specific zonal endpoint must be used for operations on the bucket, e.g.
s3express-use1-az6.us-east-1.amazonaws.com
for the bucket in question.You can see in the Relevant Error snippet above that when the zonal endpoint is used the bucket URL resolves correctly.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-networking.html
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: