terraform-provider-awscc
terraform-provider-awscc copied to clipboard
awscc_dynamodb_table: key_schema and attribute_definitions expected to match in number of attributes
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
- The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.
Terraform CLI and Terraform AWS Cloud Control Provider Version
- Terraform cli version : 1.7.4
- AWSCC provider : v0.76.0
Affected Resource(s)
- awscc_dynamodb_table
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
resource "awscc_dynamodb_table" "main" {
table_name = "dynamodb_table_name"
key_schema = jsonencode([{
AttributeName = "UserId"
KeyType = "HASH"
}])
attribute_definitions = [{
attribute_name = "UserId"
attribute_type = "S"
},
{
attribute_name = "Test"
attribute_type = "S"
},
]
billing_mode = "PROVISIONED"
provisioned_throughput = {
read_capacity_units = 20
write_capacity_units = 20
}
deletion_protection_enabled = true
table_class = "STANDARD"
}
Debug Output
Panic Output
Expected Behavior
The table should be provisioned.
Actual Behavior
The apply step fails with the schema validation error below.
│ Waiting for Cloud Control API service CreateResource operation completion returned: waiter state transitioned to FAILED. StatusMessage: Number of attributes in KeySchema does not exactly
│ match number of attributes defined in AttributeDefinitions. ErrorCode: InvalidRequest
Steps to Reproduce
-
terraform apply
Important Factoids
Opening this for visibility based on https://github.com/hashicorp/terraform-provider-awscc/issues/951#issuecomment-2093507074
References
Not unexpectedly, this issue is also present on the awscc_dynamodb_global_table
resource