-
Notifications
You must be signed in to change notification settings - Fork 10.1k
[Bug]: aws_s3_directory_bucket — Missing Resource Identity After Read #47755
Copy link
Copy link
Open
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.Part of the maintainer teams immediate focus. To be addressed within the current quarter.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.resource-identityPertains to resource identity.Pertains to resource identity.service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.
Metadata
Metadata
Assignees
Labels
bugAddresses a defect in current functionality.Addresses a defect in current functionality.prioritizedPart of the maintainer teams immediate focus. To be addressed within the current quarter.Part of the maintainer teams immediate focus. To be addressed within the current quarter.regressionPertains to a degraded workflow resulting from an upstream patch or internal enhancement.Pertains to a degraded workflow resulting from an upstream patch or internal enhancement.resource-identityPertains to resource identity.Pertains to resource identity.service/s3Issues and PRs that pertain to the s3 service.Issues and PRs that pertain to the s3 service.
Terraform and AWS Provider Version
hashicorp/aws v6.34.0Affected Resource(s) or Data Source(s)
aws_s3_directory_bucketExpected Behavior
terraform applyof a freshaws_s3_directory_bucketresource should create the bucket and complete without error. Refresh of an existing one should populate state and identity cleanly.Actual Behavior
Both Create-then-Read and refresh against an existing directory bucket fail with:
The Read function returns no error and no identity, tripping the framework's identity assertion. This blocks all reconciliation — the resource never proceeds to Create or to a clean refresh.
Steps to Reproduce
Apply a minimal config:
Run
terraform apply(greenfield) — error fires before Create.Or, pre-create the bucket out of band with
aws s3api create-bucket --bucket example-bucket--use1-az4--x-s3 --create-bucket-configuration '{"Location":{"Type":"AvailabilityZone","Name":"use1-az4"},"Bucket":{"Type":"Directory","DataRedundancy":"SingleAvailabilityZone"}}'and thenterraform import aws_s3_directory_bucket.example example-bucket--use1-az4--x-s3→ next refresh hits the same error.The bucket itself can be created and managed normally via the AWS CLI / SDK; the failure is purely the TF resource's identity contract.
Relevant Error/Panic Output
Notes
internal/service/s3/directory_bucket.godeclaresframework.WithImportByIdentityand is annotated@Testing(preIdentityVersion=\"v6.31.0\"), but theReadfunction does not appear to populate identity on the response, which appears to be the proximate cause. Comparable issues for sibling resources have been resolved by explicitly setting identity in Read — e.g. #46674 (aws_s3_bucket_lifecycle_configuration) and #46116 (security group). #45303 tracks the same class of bug for VPC SG rules and is still open.