This will allow the Turbot home view to scan the hunt_id_index to find
all existing hunts, (without having to scan non-hunt items from the
database).
{'AttributeName': 'PK', 'AttributeType': 'S'},
{'AttributeName': 'SK', 'AttributeType': 'S'},
{'AttributeName': 'channel_id', 'AttributeType': 'S'},
{'AttributeName': 'PK', 'AttributeType': 'S'},
{'AttributeName': 'SK', 'AttributeType': 'S'},
{'AttributeName': 'channel_id', 'AttributeType': 'S'},
+ {'AttributeName': 'hunt_id', 'AttributeType': 'S'},
],
ProvisionedThroughput={
'ReadCapacityUnits': 5,
],
ProvisionedThroughput={
'ReadCapacityUnits': 5,
'ReadCapacityUnits': 5,
'WriteCapacityUnits': 5
}
'ReadCapacityUnits': 5,
'WriteCapacityUnits': 5
}
+ },
+ {
+ 'IndexName': 'hunt_id_index',
+ 'KeySchema': [
+ {'AttributeName': 'hunt_id', 'KeyType': 'HASH'}
+ ],
+ 'Projection': {
+ 'ProjectionType': 'ALL'
+ },
+ 'ProvisionedThroughput': {
+ 'ReadCapacityUnits': 5,
+ 'WriteCapacityUnits': 5
+ }
Item={
"PK": "hunt-{}".format(hunt_id),
"SK": "hunt-{}".format(hunt_id),
Item={
"PK": "hunt-{}".format(hunt_id),
"SK": "hunt-{}".format(hunt_id),
"channel_id": channel_id,
"active": False,
"name": name,
"channel_id": channel_id,
"active": False,
"name": name,