Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions delphi/create_dynamodb_tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,19 @@ def create_evoc_tables(dynamodb, delete_existing=False):
],
'Projection': {'ProjectionType': 'ALL'},
'ProvisionedThroughput': {'ReadCapacityUnits': 5, 'WriteCapacityUnits': 5}
},
{
'IndexName': 'zid-index',
'KeySchema': [
{'AttributeName': 'conversation_id', 'KeyType': 'HASH'}
],
'Projection': {
'ProjectionType': 'ALL'
},
'ProvisionedThroughput': {
'ReadCapacityUnits': 5,
'WriteCapacityUnits': 5
}
}
],
'ProvisionedThroughput': {
Expand Down
13 changes: 7 additions & 6 deletions delphi/create_topic_agenda_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
python create_topic_agenda_table.py [options]

Options:
--endpoint-url ENDPOINT_URL DynamoDB endpoint URL (default: http://localhost:8000)
--endpoint-url ENDPOINT_URL DynamoDB endpoint URL
--region REGION AWS region (default: us-east-1)
--force Force recreate table if it exists
"""
Expand Down Expand Up @@ -75,18 +75,19 @@ def create_topic_agenda_table(dynamodb, force_recreate=False):
def main():
# Parse arguments
parser = argparse.ArgumentParser(description='Create Topic Agenda DynamoDB table')
parser.add_argument('--endpoint-url', type=str, default='http://localhost:8000',
help='DynamoDB endpoint URL (default: http://localhost:8000)')
parser.add_argument('--endpoint-url', type=str, default=None,
help='DynamoDB endpoint URL')
parser.add_argument('--region', type=str, default='us-east-1',
help='AWS region (default: us-east-1)')
parser.add_argument('--force', action='store_true',
help='Force recreate table if it exists')
args = parser.parse_args()

# Set up environment variables for local DynamoDB
if 'localhost' in args.endpoint_url or '127.0.0.1' in args.endpoint_url:
os.environ['AWS_ACCESS_KEY_ID'] = 'dummy'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'dummy'
if args.endpoint_url:
if 'localhost' in args.endpoint_url or '127.0.0.1' in args.endpoint_url:
os.environ['AWS_ACCESS_KEY_ID'] = 'dummy'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'dummy'

# Create DynamoDB resource
dynamodb = boto3.resource(
Expand Down
Loading
Loading