Skip to content

Conversation

acwwat
Copy link
Contributor

@acwwat acwwat commented Aug 17, 2025

Rollback Plan

If a change needs to be reverted, we will publish an updated version of the library.

Changes to Security Controls

Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.

Description

This PR is to add support for the sort and z-order compaction strategy to the aws_s3tables_table resource.

Note: This feature cannot be completed because the two new strategies require sort order to be specified in the table metadata, yet there is no way to set this in the aws_s3tables_table resource. I am creating this PR just to keep track of the code changes - I will keep it in DRAFT until a resolution for the sort order is available...

Relations

Relates #43167

References

Referred to the AWS SDK for Go v2 for specs. The API reference isn't even updated to reflect the strategy attribute. I will open an AWS Support Case to get this addressed.

Output from Acceptance Testing

$ make testacc TESTS=TestAccS3TablesTable_ PKG=s3tables
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/s3tables/... -v -count 1 -parallel 20 -run='TestAccS3TablesTable_'  -timeout 360m -vet=off    
2025/08/16 22:24:22 Creating Terraform AWS Provider (SDKv2-style)...
2025/08/16 22:24:22 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccS3TablesTable_basic
=== PAUSE TestAccS3TablesTable_basic
=== RUN   TestAccS3TablesTable_disappears
=== PAUSE TestAccS3TablesTable_disappears
=== RUN   TestAccS3TablesTable_rename
=== PAUSE TestAccS3TablesTable_rename
=== RUN   TestAccS3TablesTable_updateNamespace
=== PAUSE TestAccS3TablesTable_updateNamespace
=== RUN   TestAccS3TablesTable_updateNameAndNamespace
=== PAUSE TestAccS3TablesTable_updateNameAndNamespace
=== RUN   TestAccS3TablesTable_maintenanceConfiguration
=== PAUSE TestAccS3TablesTable_maintenanceConfiguration
=== RUN   TestAccS3TablesTable_compactionStrategy
=== PAUSE TestAccS3TablesTable_compactionStrategy
=== RUN   TestAccS3TablesTable_encryptionConfiguration
=== PAUSE TestAccS3TablesTable_encryptionConfiguration
=== RUN   TestAccS3TablesTable_metadata
=== PAUSE TestAccS3TablesTable_metadata
=== CONT  TestAccS3TablesTable_basic
=== CONT  TestAccS3TablesTable_maintenanceConfiguration
=== CONT  TestAccS3TablesTable_updateNamespace
=== CONT  TestAccS3TablesTable_updateNameAndNamespace
=== CONT  TestAccS3TablesTable_encryptionConfiguration
=== CONT  TestAccS3TablesTable_metadata
=== CONT  TestAccS3TablesTable_compactionStrategy
=== CONT  TestAccS3TablesTable_disappears
=== CONT  TestAccS3TablesTable_rename
=== NAME  TestAccS3TablesTable_compactionStrategy
    table_test.go:481: Step 1/4 error: Error running apply: exit status 1

        Error: putting S3 Tables Table (tf_acc_test_9174382277842168773) maintenance configuration (icebergCompaction)

          with aws_s3tables_table.test,
          on terraform_plugin_test.tf line 12, in resource "aws_s3tables_table" "test":
          12: resource "aws_s3tables_table" "test" {

        operation error S3Tables: PutTableMaintenanceConfiguration, https response
        error StatusCode: 400, RequestID: 10424394-f516-4495-95b8-1ee9f4ac08af,
        BadRequestException: The specified compaction strategy requires sort order in
        the table metadata.
    panic.go:636: Error running post-test destroy, there may be dangling resources: exit status 1

        Error: deleting Amazon S3 Tables Namespace ("tf_acc_test_7948767596760045402"): operation error S3Tables: DeleteNamespace, https response error StatusCode: 400, RequestID: 86f3d0ba-b72e-4661-a186-a879310803b8, BadRequestException: The namespace that you tried to delete is not empty.

        operation error S3Tables: DeleteNamespace, https response error StatusCode:
        400, RequestID: 86f3d0ba-b72e-4661-a186-a879310803b8, BadRequestException:
        The namespace that you tried to delete is not empty.        
--- FAIL: TestAccS3TablesTable_compactionStrategy (16.51s)
--- PASS: TestAccS3TablesTable_disappears (27.67s)
--- PASS: TestAccS3TablesTable_metadata (31.40s)
--- PASS: TestAccS3TablesTable_basic (32.62s)
--- PASS: TestAccS3TablesTable_encryptionConfiguration (37.93s)
--- PASS: TestAccS3TablesTable_updateNamespace (47.85s)
--- PASS: TestAccS3TablesTable_rename (48.23s)
--- PASS: TestAccS3TablesTable_updateNameAndNamespace (48.24s)
--- PASS: TestAccS3TablesTable_maintenanceConfiguration (50.70s)
FAIL
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/s3tables       51.016s
FAIL
make: *** [GNUmakefile:645: testacc] Error 1

@acwwat acwwat requested a review from a team as a code owner August 17, 2025 02:33
@acwwat acwwat marked this pull request as draft August 17, 2025 02:33
Copy link
Contributor

Community Guidelines

This comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Pull Request by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Pull Request and do not help prioritize the request.

Pull Request Authors

  • Review the contribution guide relating to the type of change you are making to ensure all of the necessary steps have been taken.
  • Whether or not the branch has been rebased will not impact prioritization, but doing so is always a welcome surprise.

Copy link
Contributor

github-actions bot commented Aug 17, 2025

✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. documentation Introduces or discusses updates to documentation. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. service/s3tables Issues and PRs that pertain to the s3tables service. size/L Managed by automation to categorize the size of a PR. external-maintainer Contribution from a trusted external contributor. labels Aug 17, 2025
@acwwat acwwat force-pushed the f-aws_s3tables_table-add_sort_zorder_compaction branch from d03a3b1 to a07ff72 Compare August 17, 2025 02:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Introduces or discusses updates to documentation. external-maintainer Contribution from a trusted external contributor. needs-triage Waiting for first response or review from a maintainer. service/s3tables Issues and PRs that pertain to the s3tables service. size/L Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant