-
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 with Global table v2019.11.21 and PROVISIONED and autscaling generates Table Capacity and/or GSI capacityValidationException #13097
Comments
We've encountered this issue as well, using pretty much the same TF configuration as outlined in the report above. I've worked around it by initially setting up the DynamoDB resource with
The Note that the DynamoDB resource would also need to have a It isn't pretty, but allows us to continue with the desired state. Hopefully this will help someone until it is fixed. |
I'm encountering the same issue as well, Replica block isn't working as expected at the time of table creation. Error: error creating DynamoDB Table (example_test) replicas: error creating DynamoDB Table (example_test) replica (us-west-2): ValidationException: Table write capacity should either be Pay-Per-Request or AutoScaled. on modules/aws-dynamodb/module.tf line 11, in resource "aws_dynamodb_table" "dynamodb_table_master": If I add replica block after the table creation in resource |
I have this error when I try to make a global table (the new v2 2019.11.21) type per: https://www.terraform.io/docs/providers/aws/r/dynamodb_table.html
The error is: |
Is the any progress there? I have the same issue and looks like I'm not alone
error creating DynamoDB Table (my_table_name) replica (eu-west-1): ValidationException: Table write capacity should either be Pay-Per-Request or AutoScaled. |
this does not work on very firs creation and when I create a table without replicas blocks, add them afterwards and apply one mode time. In both cases it failed with the same error. |
resolved it with now creating/updating/destroying works perfect
|
Same issue, any updates? My workaround was using the 2017 "layered" tables approach. https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/dynamodb_global_table |
Seeing same issue. |
This can be solved by initially having the replication turned off, and applying everything. In case of GSI's you need to create additional scaling targets and policies for each index, which is also described for CLI here: difference compared to the normal target and policy the
after that is applied, enable the region and have terraform update in place. |
@quinyx-tjeerd, this is really not a solution but rather a valid workaround around for this problem. The idea of this ticket is for Terraform to take care of such details or at least warn or error in the planning face and not as it is creating resources. |
Currently experiencing this issue. Does the merged PR above solve it? Also, I agree with @onema. Terraform should be able to handle creating the DDB replicas, or at a minimum return an error during the call to |
I too am struggling with this at the moment. Our use-case was that we had a provisioned-throughput table with autoscaling read and write credits already created and I attempted to add a replica. Using PAY_PER_REQUEST isn't a valid solution for us because then the autoscaling targets complain. |
Hey all, after some investigation, I've found that this is a limitation of the DynamoDB API and managing a table+replica of this kind in terraform is troublesome to do in a single The AWS console, for example does allow one to configure autoscaling at With that said, I do not foresee a plausible code change to solve this issue, but rather want to reiterate the workaround by @quinyx-tjeerd as a viable interim solution to the upstream service's limitation; first apply the dynamodb table (and related resources like appautoscaling) without the Reference: * Best Practices and Requirements for Managing Global Tables
|
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. |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
gist
Panic Output
NA
Expected Behavior
Replica for Gobal tables
v2019.11.21
should play nicely with autoscaling:Actual Behavior
Errors out with a message:
Steps to Reproduce
terraform apply
Important Factoids
NA
References
The text was updated successfully, but these errors were encountered: