-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
DynamoDB Global table V2 - Creation fails with multiple replicas #13132
Comments
I wonder if this worked in the original implementation but broke in 715b453#diff-c8928c2dd5459e42d28428384a191ba8L633 @cmonty / @bflad There aren't currently any tests to cover multiple replicas. |
We did test creating replicas with the original implementation and that worked. I don't see any specific documentation from AWS on this topic. |
I'm facing the same issue with Terraform and Dynamo Global Tables. |
@jsalcedo1987 the workaround is adding the replicas one by one. Add, plan, apply for every single replica. |
@cmonty the documentation is not clear at all but if you look at the tutorial they tell you to run a command for every replica you want to create. |
…etions Reference: #13132 Also includes slight changes to the acceptance testing recommendations for cross-region testing since we now are introducing the framework to test a third region. If approved, will followup this change with refactoring of the existing testing to use the newer functions. Previously: ``` --- FAIL: TestAccAWSDynamoDbTable_Replica_Multiple (41.02s) TestAccAWSDynamoDbTable_Replica_Multiple: testing.go:684: Step 0 error: errors during apply: Error: error creating DynamoDB Table (TerraformTestTable--8440396559818741779) replicas: error creating DynamoDB Table (TerraformTestTable--8440396559818741779) replicas: ValidationException: Update table operation with more than one create or delete replica actions not allowed status code: 400, request id: 5MA0CQ5LJAVOKM671RT7QTKRTJVV4KQNSO5AEMVJF66Q9ASUAAJG on /var/folders/w8/05f3x02n27x72g0mc2jy6_180000gp/T/tf-test945359260/main.tf line 20: (source code not available) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSDynamoDbTable_attributeUpdate (756.09s) --- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (17.31s) --- PASS: TestAccAWSDynamoDbTable_basic (82.00s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (135.99s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest (1296.50s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned (134.93s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest (934.09s) --- PASS: TestAccAWSDynamoDbTable_disappears (59.40s) --- PASS: TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI (140.30s) --- PASS: TestAccAWSDynamoDbTable_enablePitr (152.34s) --- PASS: TestAccAWSDynamoDbTable_encryption (249.98s) --- PASS: TestAccAWSDynamoDbTable_extended (443.38s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (144.47s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (443.69s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (757.61s) --- PASS: TestAccAWSDynamoDbTable_Replica_Multiple (1193.16s) --- PASS: TestAccAWSDynamoDbTable_Replica_Single (1077.60s) --- PASS: TestAccAWSDynamoDbTable_streamSpecification (148.25s) --- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (12.21s) --- PASS: TestAccAWSDynamoDbTable_tags (88.24s) --- PASS: TestAccAWSDynamoDbTable_Ttl_Disabled (116.66s) --- PASS: TestAccAWSDynamoDbTable_Ttl_Enabled (81.82s) ```
Sorry for the hassle here folks 😓 that followup optimization attempt should have been proven via additional acceptance testing. To that end, have submitted the following to add the testing and fix this issue: #13523 |
…etions (#13523) * resource/aws_dynamodb_table: Perform individual replica creations/deletions Reference: #13132 Also includes slight changes to the acceptance testing recommendations for cross-region testing since we now are introducing the framework to test a third region. If approved, will followup this change with refactoring of the existing testing to use the newer functions. Previously: ``` --- FAIL: TestAccAWSDynamoDbTable_Replica_Multiple (41.02s) TestAccAWSDynamoDbTable_Replica_Multiple: testing.go:684: Step 0 error: errors during apply: Error: error creating DynamoDB Table (TerraformTestTable--8440396559818741779) replicas: error creating DynamoDB Table (TerraformTestTable--8440396559818741779) replicas: ValidationException: Update table operation with more than one create or delete replica actions not allowed status code: 400, request id: 5MA0CQ5LJAVOKM671RT7QTKRTJVV4KQNSO5AEMVJF66Q9ASUAAJG on /var/folders/w8/05f3x02n27x72g0mc2jy6_180000gp/T/tf-test945359260/main.tf line 20: (source code not available) ``` Output from acceptance testing: ``` --- PASS: TestAccAWSDynamoDbTable_attributeUpdate (756.09s) --- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (17.31s) --- PASS: TestAccAWSDynamoDbTable_basic (82.00s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (135.99s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest (1296.50s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned (134.93s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest (934.09s) --- PASS: TestAccAWSDynamoDbTable_disappears (59.40s) --- PASS: TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI (140.30s) --- PASS: TestAccAWSDynamoDbTable_enablePitr (152.34s) --- PASS: TestAccAWSDynamoDbTable_encryption (249.98s) --- PASS: TestAccAWSDynamoDbTable_extended (443.38s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (144.47s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (443.69s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (757.61s) --- PASS: TestAccAWSDynamoDbTable_Replica_Multiple (1193.16s) --- PASS: TestAccAWSDynamoDbTable_Replica_Single (1077.60s) --- PASS: TestAccAWSDynamoDbTable_streamSpecification (148.25s) --- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (12.21s) --- PASS: TestAccAWSDynamoDbTable_tags (88.24s) --- PASS: TestAccAWSDynamoDbTable_Ttl_Disabled (116.66s) --- PASS: TestAccAWSDynamoDbTable_Ttl_Enabled (81.82s) ``` * tests/provider: Consolidate logic into testAccMultipleRegionPreCheck
The fix for this has been merged, verified, and will release with version 2.65.0 of the Terraform AWS Provider, likely tomorrow. |
This has been released in version 2.65.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 for triage. Thanks! |
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. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Terraform Version
0.12.24
Affected Resource(s)
Terraform Configuration Files
Debug Output
https://gist.github.com/giacomomagini/4e308947a2ad7c857ecb2edc3961dbaa
Panic Output
Expected Behavior
Create a global table with the two replicas
us-east-1
andus-east-2
.Actual Behavior
Error: error creating DynamoDB Table (test-table) replicas: error creating DynamoDB Table (test-table) replicas: ValidationException: Update table operation with more than one create or delete replica actions not allowed
Steps to Reproduce
terraform init
terraform plan -out=plan.out <module_path>
terraform apply plan.out
Important Factoids
None.
References
The first implementation of the code is in this PR (#12342) but a refactor has been done afterwards in this commit (715b453)
The issue is that tf sends a single update with all the
replica
create commands while it should send these every create command in a different call.The text was updated successfully, but these errors were encountered: