3 Respostas
- Mais recentes
- Mais votos
- Mais comentários
0
It looks like you have switched the arguments for tableName and newUser. You passed the newUser argument first, it is being interpreted as the tableName, but since it's an Object not a string it doesn't match the regular expression for table names.
respondido há 5 anos
0
Hi, you are trying to create a table named 'Users' and you are getting an error, correct?
The 'Users' is a valid table name, I was just able to create a new table with that name. I am not as familiar with the GraphQL syntax, so I tried this using Python (below), and it worked as expected. Can you describe what specifically you are trying to do, and I can help out. Thank you.
dynamodb = boto3.resource('dynamodb', region_name='us-east-1')
table = dynamodb.create_table(
TableName='Users',
KeySchema=[
{
'AttributeName': 'pk',
'KeyType': 'HASH' #Partition key
},
{
'AttributeName': 'sk',
'KeyType': 'RANGE' #Sort key
}
],
AttributeDefinitions=[
{
'AttributeName': 'pk',
'AttributeType': 'N'
},
{
'AttributeName': 'sk',
'AttributeType': 'S'
},
],
ProvisionedThroughput={
'ReadCapacityUnits': 10,
'WriteCapacityUnits': 10
}
)
respondido há 5 anos
Conteúdo relevante
- AWS OFICIALAtualizada há 2 anos