Working with DynamoDB
In this section, we will update the existing functions to read and write from/to the DynamoDB table. The following diagram describes the target architecture:

API Gateway
will forward incoming requests to the target Lambda function, which will call the corresponding DynamoDB operation on the movies
table.
Scan request
To get started, we need to implement the function responsible for returning a list of movies; the following steps describe how to achieve that:
- Update the
findAll
handler endpoint to use theScan
method to fetch all items from the table:
func findAll() (events.APIGatewayProxyResponse, error) { cfg, err := external.LoadDefaultAWSConfig() if err != nil { return events.APIGatewayProxyResponse{ StatusCode: http.StatusInternalServerError, Body: "Error while retrieving AWS credentials", }, nil } svc := dynamodb.New(cfg) req := svc.ScanRequest(&dynamodb.ScanInput{ TableName: aws.String(os.Getenv("TABLE_NAME")), }) res...