Closed
Description
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
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.19
- provider.aws v3.6.0
Affected Resource(s)
- aws_dynamodb_table
Terraform Configuration Files
resource "aws_dynamodb_table" "agent_jobs" {
name = "data-agents2"
hash_key = "agentId"
range_key = "jobId"
attribute {
name = "jobId" // job id
type = "S"
}
attribute {
name = "agentId"
type = "S"
}
attribute {
name = "jobStatusDate"
type = "S"
}
local_secondary_index {
name = "idx-agentId-jobStatusDate"
projection_type = "INCLUDE"
range_key = "jobStatusDate"
non_key_attributes = ["revision"]
}
billing_mode = "PAY_PER_REQUEST"
stream_enabled = true
stream_view_type = "NEW_AND_OLD_IMAGES"
}
Debug Output
Request sent to aws:
{
"AttributeDefinitions": [
{
"AttributeName": "jobStatusDate",
"AttributeType": "S"
},
{
"AttributeName": "agentId",
"AttributeType": "S"
},
{
"AttributeName": "jobId",
"AttributeType": "S"
}
],
"BillingMode": "PAY_PER_REQUEST",
"KeySchema": [
{
"AttributeName": "agentId",
"KeyType": "HASH"
},
{
"AttributeName": "jobId",
"KeyType": "RANGE"
}
],
"LocalSecondaryIndexes": [
{
"IndexName": "idx-agentId-jobStatusDate",
"KeySchema": [
{
"AttributeName": "agentId",
"KeyType": "HASH"
},
{
"AttributeName": "jobStatusDate",
"KeyType": "RANGE"
}
],
"Projection": {
"ProjectionType": "INCLUDE"
}
}
],
"StreamSpecification": {
"StreamEnabled": true,
"StreamViewType": "NEW_AND_OLD_IMAGES"
},
"TableName": "data-agents2",
"Tags": []
}
Panic Output
Expected Behavior
Should have created the dynamodb table
Actual Behavior
Did not create the table. Error: ProjectionType is INCLUDE, but NonKeyAttributes is not specified. Non-key attributes were specified in HCL
Steps to Reproduce
terraform apply
Important Factoids
References
- #0000