I’ve been trying to write a Golang function to put a new item into DynamoDB.
There isn’t much information on using Golang, DynamoDB, and Serverless, but I managed to put something together.
My problem is I get this error when I try to start the DynamoDB service: ResourceNotFoundException: Requested resource not found
My code is very basic:
sess := session.Must(session.NewSession(&aws.Config{
Region: aws.String("us-east-1")},
))
// Create DynamoDB client
svc := dynamodb.New(sess)
body.SlackWebHook = ""
body.ID = u2
av, err := dynamodbattribute.MarshalMap(body)
if err != nil {
return err
}
input := &dynamodb.PutItemInput{
Item: av,
TableName: aws.String("Leads"),
}
_, err = svc.PutItem(input)
if err != nil {
return err
}
return nil
Thanks for any help!