Skip to content

Conversation

icholy
Copy link

@icholy icholy commented Aug 29, 2025

Description

Add support for importing aws_dynamodb_table_item. The import id format is the same as the resource id: tableName|hashKeyName|hashKeyValue[|rangeKeyValue]. This has the unfortunate limitation of not allowing | to be used in the key value.

Output from Acceptance Testing

% AWS_PROFILE=default make testacc TESTS=TestAccDynamoDBTableItem PKG=dynamodb
make: Verifying source code with gofmt...
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go1.24.6 test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run='TestAccDynamoDBTableItem'  -timeout 360m -vet=off
2025/09/02 13:17:12 Creating Terraform AWS Provider (SDKv2-style)...
2025/09/02 13:17:12 Initializing Terraform AWS Provider (SDKv2-style)...
=== RUN   TestAccDynamoDBTableItemDataSource_basic
=== PAUSE TestAccDynamoDBTableItemDataSource_basic
=== RUN   TestAccDynamoDBTableItemDataSource_projectionExpression
=== PAUSE TestAccDynamoDBTableItemDataSource_projectionExpression
=== RUN   TestAccDynamoDBTableItemDataSource_expressionAttributeNames
=== PAUSE TestAccDynamoDBTableItemDataSource_expressionAttributeNames
=== RUN   TestAccDynamoDBTableItem_basic
=== PAUSE TestAccDynamoDBTableItem_basic
=== RUN   TestAccDynamoDBTableItem_rangeKey
=== PAUSE TestAccDynamoDBTableItem_rangeKey
=== RUN   TestAccDynamoDBTableItem_withMultipleItems
=== PAUSE TestAccDynamoDBTableItem_withMultipleItems
=== RUN   TestAccDynamoDBTableItem_withDuplicateItemsSameRangeKey
=== PAUSE TestAccDynamoDBTableItem_withDuplicateItemsSameRangeKey
=== RUN   TestAccDynamoDBTableItem_withDuplicateItemsDifferentRangeKey
=== PAUSE TestAccDynamoDBTableItem_withDuplicateItemsDifferentRangeKey
=== RUN   TestAccDynamoDBTableItem_wonkyItems
=== PAUSE TestAccDynamoDBTableItem_wonkyItems
=== RUN   TestAccDynamoDBTableItem_update
=== PAUSE TestAccDynamoDBTableItem_update
=== RUN   TestAccDynamoDBTableItem_updateWithRangeKey
=== PAUSE TestAccDynamoDBTableItem_updateWithRangeKey
=== RUN   TestAccDynamoDBTableItem_disappears
=== PAUSE TestAccDynamoDBTableItem_disappears
=== RUN   TestAccDynamoDBTableItem_mapOutOfBandUpdate
=== PAUSE TestAccDynamoDBTableItem_mapOutOfBandUpdate
=== CONT  TestAccDynamoDBTableItemDataSource_basic
=== CONT  TestAccDynamoDBTableItem_withDuplicateItemsDifferentRangeKey
=== CONT  TestAccDynamoDBTableItem_rangeKey
=== CONT  TestAccDynamoDBTableItem_withDuplicateItemsSameRangeKey
=== CONT  TestAccDynamoDBTableItem_withMultipleItems
=== CONT  TestAccDynamoDBTableItemDataSource_projectionExpression
=== CONT  TestAccDynamoDBTableItem_updateWithRangeKey
=== CONT  TestAccDynamoDBTableItem_disappears
=== CONT  TestAccDynamoDBTableItem_mapOutOfBandUpdate
=== CONT  TestAccDynamoDBTableItem_update
=== CONT  TestAccDynamoDBTableItem_wonkyItems
=== CONT  TestAccDynamoDBTableItemDataSource_expressionAttributeNames
=== CONT  TestAccDynamoDBTableItem_basic
--- PASS: TestAccDynamoDBTableItem_withDuplicateItemsSameRangeKey (20.34s)
--- PASS: TestAccDynamoDBTableItemDataSource_expressionAttributeNames (29.96s)
--- PASS: TestAccDynamoDBTableItemDataSource_basic (30.01s)
--- PASS: TestAccDynamoDBTableItem_withDuplicateItemsDifferentRangeKey (30.26s)
--- PASS: TestAccDynamoDBTableItem_withMultipleItems (31.89s)
--- PASS: TestAccDynamoDBTableItem_disappears (32.07s)
--- PASS: TestAccDynamoDBTableItem_basic (33.70s)
--- PASS: TestAccDynamoDBTableItem_rangeKey (33.74s)
--- PASS: TestAccDynamoDBTableItem_wonkyItems (37.17s)
--- PASS: TestAccDynamoDBTableItemDataSource_projectionExpression (37.25s)
--- PASS: TestAccDynamoDBTableItem_mapOutOfBandUpdate (40.82s)
--- PASS: TestAccDynamoDBTableItem_update (43.35s)
--- PASS: TestAccDynamoDBTableItem_updateWithRangeKey (49.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb	49.778s

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.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/M Managed by automation to categorize the size of a PR. labels Aug 29, 2025
@icholy icholy force-pushed the f-aws_dynamodb_table_item-import branch 3 times, most recently from 0905eb9 to 234f250 Compare September 2, 2025 16:34
@github-actions github-actions bot added the tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. label Sep 2, 2025
@icholy icholy force-pushed the f-aws_dynamodb_table_item-import branch from 234f250 to 5c82faf Compare September 2, 2025 16:42
@github-actions github-actions bot added the documentation Introduces or discusses updates to documentation. label Sep 2, 2025
@icholy icholy force-pushed the f-aws_dynamodb_table_item-import branch from 5c82faf to 1a96562 Compare September 2, 2025 16:45
Copy link
Contributor

github-actions bot commented Sep 2, 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 the provider Pertains to the provider itself, rather than any interaction with AWS. label Sep 2, 2025
@icholy icholy force-pushed the f-aws_dynamodb_table_item-import branch from 1a96562 to 2aab910 Compare September 2, 2025 17:18
@github-actions github-actions bot added the size/L Managed by automation to categorize the size of a PR. label Sep 2, 2025
@icholy icholy force-pushed the f-aws_dynamodb_table_item-import branch from 2aab910 to 7ef1151 Compare September 2, 2025 17:20
@icholy icholy marked this pull request as ready for review September 2, 2025 17:21
@icholy icholy requested a review from a team as a code owner September 2, 2025 17:21
@justinretzolk justinretzolk added enhancement Requests to existing resources that expand the functionality or scope. resource-import Pertains to issues importing resources. and removed needs-triage Waiting for first response or review from a maintainer. labels Sep 2, 2025
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. enhancement Requests to existing resources that expand the functionality or scope. provider Pertains to the provider itself, rather than any interaction with AWS. resource-import Pertains to issues importing resources. service/dynamodb Issues and PRs that pertain to the dynamodb service. size/L Managed by automation to categorize the size of a PR. size/M 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.

2 participants