Project example of how to implement AWS DynamoDb in Spring Boot
- Java 11
- Spring Boot
- DynamoDb
You must set your credentials from AWS in the DynamoDbConfiguration file
private AmazonDynamoDB buildAmazonDynamoDb() {
return AmazonDynamoDBClientBuilder
.standard()
.withEndpointConfiguration(
new AwsClientBuilder.EndpointConfiguration(
"dynamodb.{{YOUR-REGION}}.amazonaws.com",
"{{YOUR-REGION}}"
)
).withCredentials(
new AWSStaticCredentialsProvider(
new BasicAWSCredentials(
"{{YOUR-ACCESS-KEY}}",
"{{YOUR-SECRET-KEY}}"
)
)
).build();
}
You can access the postman collection here
- GET - /employee/{id}
Get dynamoDb filtering employee by Id
- POST - /employee
Create employee in dynamoDb
{
"firstName": "Jean",
"lastName": "Barros",
"email": "[email protected]",
"department": {
"departmentName": "IT",
"departmentCode": "IT--006"
}
}
- PUT - /employee/{id}
Update employee in dynamoDb
{
"firstName": "Jean",
"lastName": "Jacques",
"email": "[email protected]",
"department": {
"departmentName": "IT",
"departmentCode": "IT--010"
}
}
- DELETE - /employee/{id}
Delete employee in dynamoDb
Developed by Jean Jacques