-
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
Unable to change DynamoDB billing_mode from PAY_PER_REQUEST to PROVISIONED when using GSIs #7447
Comments
I am double checking this against the currently unreleased fix we merged yesterday (#7363) via additional acceptance testing and will report back shortly. |
It looks like GSIs still have a similar issue when going
I will submit a fix later today. |
References: * #7447 * #5471 Changes: * tests/resource/aws_dynamodb_table: Ensure acceptance testing covers all scenarios involving billing_mode updates with and without global secondary indexes * tests/resource/aws_dynamodb_table: Update testAccCheckDynamoDbTableHasBilling_Provisioned to handle missing BillingModeSummary * resource/aws_dynamodb_table: Consolidate UpdateTable calls to prevent error when switching billing_mode from PAY_PER_REQUEST to PROVISIONED when global secondary indexes are present and reduce API traffic * resource/aws_dynamodb_table: Utilize customizable update timeout in global secondary index update operations * resource/aws_dynamodb_table: Increase default update timeout from 10 minutes to 60 minutes since even 30 minutes can trigger timeouts with no table data Previous output from acceptance testing: ``` --- FAIL: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (142.20s) testing.go:538: Step 1 error: Error applying: 1 error occurred: * aws_dynamodb_table.basic-dynamodb-table: 1 error occurred: * aws_dynamodb_table.basic-dynamodb-table: Error updating DynamoDB Table (TerraformTestTable--132444596974972667) billing mode: ValidationException: One or more parameter values were invalid: ProvisionedThroughput must be specified for index: TestTableGSI ``` Output from acceptance testing: ``` --- PASS: TestAccAWSDynamoDbTable_attributeUpdate (441.98s) --- PASS: TestAccAWSDynamoDbTable_attributeUpdateValidation (3.00s) --- PASS: TestAccAWSDynamoDbTable_basic (108.09s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned (158.73s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest (1027.81s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned (127.56s) --- PASS: TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest (917.15s) --- PASS: TestAccAWSDynamoDbTable_disappears (17.37s) --- PASS: TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI (181.60s) --- PASS: TestAccAWSDynamoDbTable_enablePitr (286.99s) --- PASS: TestAccAWSDynamoDbTable_encryption (222.91s) --- PASS: TestAccAWSDynamoDbTable_extended (286.03s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateCapacity (178.27s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes (416.57s) --- PASS: TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes (661.25s) --- PASS: TestAccAWSDynamoDbTable_importBasic (137.95s) --- PASS: TestAccAWSDynamoDbTable_importTags (170.40s) --- PASS: TestAccAWSDynamoDbTable_importTimeToLive (138.59s) --- PASS: TestAccAWSDynamoDbTable_streamSpecification (127.55s) --- PASS: TestAccAWSDynamoDbTable_streamSpecificationValidation (1.05s) --- PASS: TestAccAWSDynamoDbTable_tags (144.68s) --- PASS: TestAccAWSDynamoDbTable_ttl (139.86s) ```
Fix submitted: #7453 |
The fix for this has been merged and will release with version 1.59.0 of the Terraform AWS Provider, likely middle of this week. 👍 |
This has been released in version 1.59.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
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! |
When updating a DynamoDB table with one or more global secondary indexes, changing billing_mode from PAY_PER_REQUEST to PROVISIONED, the update fails to apply. Terraform tries to create a new GSI with given read & write capacity, while the existing GSI is left with "0" capacity which makes it fail due to invalid parameter (ProvisionedThroughput must be specified when BillingMode is PROVISIONED).
Community Note
Terraform Version
Terraform v0.11.10
provider.aws v1.57.0
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
Billing mode should have changed along with read & write capacities for the table and global secondary index(es).
Actual Behavior
terraform apply
exits with an error.Output:
Steps to Reproduce
PAY_PER_REQUEST
as billing_modeaws_dynamodb_table
configuration from PAY_PER_REQUEST to PROVISIONEDterraform apply
The text was updated successfully, but these errors were encountered: