-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Wait for import to complete during dynamodb table creation #34848
Wait for import to complete during dynamodb table creation #34848
Conversation
if import fails i.e if import doesn't lead to completed status with timeout period or fails due to some error before that, we will throw an exception.
Community NoteVoting for Prioritization
For Submitters
|
Otherwise the table would get created but state won't manage it which would then require manual intervention to fix.
7969d38
to
41d4297
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
% make testacc TESTARGS="-run=estAccDynamoDBTable_importTable\|estAccDynamoDBTable_basic\|estAccDynamoDBTable_disappears" PKG=dynamodb
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/dynamodb/... -v -count 1 -parallel 20 -run=estAccDynamoDBTable_importTable\|estAccDynamoDBTable_basic\|estAccDynamoDBTable_disappears -timeout 360m
=== RUN TestAccDynamoDBTable_basic
=== PAUSE TestAccDynamoDBTable_basic
=== RUN TestAccDynamoDBTable_disappears
=== PAUSE TestAccDynamoDBTable_disappears
=== RUN TestAccDynamoDBTable_importTable
=== PAUSE TestAccDynamoDBTable_importTable
=== CONT TestAccDynamoDBTable_basic
=== CONT TestAccDynamoDBTable_importTable
=== CONT TestAccDynamoDBTable_disappears
--- PASS: TestAccDynamoDBTable_disappears (35.23s)
--- PASS: TestAccDynamoDBTable_basic (38.93s)
--- PASS: TestAccDynamoDBTable_importTable (165.57s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/dynamodb 169.036s
This functionality has been released in v5.32.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 pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Description
Terraform offers a way to create a dynamodb and initialize it with data from an s3 prefix.
This is done using the
import_table
option. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_table#import_tableHowever, the provider doesn't validate if the import actually succeeded.
Even when the import fails, the table creation shows to be successful.
This PR resolves the issue by waiting for dynamodb import to become
COMPLETE
before moving on and if it fails, will throw an exception.Relations
Closes #34847
References
Output from Acceptance Testing
Tried running
make testacc TESTS=dynamo
It ran for a while with no bugs, and then wsl crashed :(
Other Tests
Applied the plan from the config mentioned in #34847 and it failed with an error (expected behavior)
Config File:
Console Log