## 前提
- [[AWS SDK for Go V2でDynamoDBのクライアント作成]]ができている
## コード
```go
_, err = client.CreateTable(context.TODO(), &dynamodb.CreateTableInput{
TableName: aws.String("hogehoge"),
KeySchema: []types.KeySchemaElement{
{
AttributeName: aws.String("id"),
KeyType: types.KeyTypeHash,
},
},
AttributeDefinitions: []types.AttributeDefinition{
{
AttributeName: aws.String("id"),
AttributeType: types.ScalarAttributeTypeN,
},
},
BillingMode: types.BillingModePayPerRequest,
})
if err != nil {
log.Fatalf("failed to create table, %v", err)
}
```
---
**💽Change log**
- #2021/10/29 作成