I'm experiencing a timeout in index creation using the following configuration on Terraform v0.13.6 and using AWS provider version 3.42.0:
resource "aws_dynamodb_table" "TestDB" {
name = "TestDB"
billing_mode = "PAY_PER_REQUEST"
hash_key = "..."
range_key = "..."
attributes {...}
global_secondary_index {...}
timeouts {
create = "2h"
delete = "2h"
update = "2h"
}
I get the following error when working with a large amount of items in the table:
Error: error waiting for DynamoDB Table (TestDB) Global Secondary Index (TestIndex) creation: timeout while waiting for state to become 'ACTIVE' (last state: 'CREATING', timeout: 20m0s)
The most relevant issue I could find was: https://github.com/hashicorp/terraform-provider-aws/issues/5471, which seems to resolve timeout issues when indices need to be updated by using the timeout specified in the aws_dynamodb_table.timeouts
block . This is described in the documentation.
In my case, I believe I need the timeout for creating an index needs to be longer. And for reference, terraform is being run on CircleCI. I believe the 20 min timeout comes from terraform defaults: https://www.terraform.io/plugin/sdkv2/resources/retries-and-customizable-timeouts.
Is there a way to extend the timeout on GSI creation using terraform?