This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws dynamodb update-item --endpoint-url http://localhost:8042 --table-name demo-customer-info \ | |
| --key '{"customerId": {"S": "1111"}}' \ | |
| --update-expression 'SET #lastName = :lastName, #dateOfBirth = :dateOfBirth' \ | |
| --expression-attribute-names '{"#lastName": "lastName", "#dateOfBirth": "dateOfBirth"}' \ | |
| --expression-attribute-values '{":lastName": {"S": "Jones"}, ":dateOfBirth": {"S": "1985-03-01"}}' \ | |
| --return-values ALL_NEW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws dynamodb delete-item --endpoint-url http://localhost:8042 --table-name demo-customer-info \ | |
| --key '{"customerId": {"S": "1111"}}' \ | |
| --return-values ALL_OLD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| docker-compose -f docker-compose-dynamodb.yaml down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws dynamodb put-item --endpoint-url http://localhost:8042 --table-name demo-customer-info \ | |
| --item '{"customerId": {"S": "1111"}, "email": {"S": "[email protected]"}}' \ | |
| --condition-expression "attribute_not_exists(customerId)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| aws dynamodb update-item --endpoint-url http://localhost:8042 --table-name demo-customer-info \ | |
| --key '{"customerId": {"S": "1111"}}' \ | |
| --update-expression 'SET #isEligibleForPromotion = :eligibility' \ | |
| --expression-attribute-names '{"#isEligibleForPromotion": "isEligibleForPromotion", "#dateOfBirth": "dateOfBirth"}' \ | |
| --expression-attribute-values '{":eligibility": {"BOOL": true}, ":dateFrom": {"S": "1980-01-01"}}' \ | |
| --condition-expression "#dateOfBirth > :dateFrom" \ | |
| --return-values ALL_NEW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.codebrews.dynamodemo | |
| import org.springframework.boot.context.properties.ConfigurationProperties | |
| import org.springframework.stereotype.Component | |
| @Component | |
| @ConfigurationProperties(prefix = "application.dynamo") | |
| data class DynamoConfigProperties( | |
| var customerTableName: String = "", | |
| var region: String = "", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.codebrews.dynamodemo | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider | |
| import software.amazon.awssdk.regions.Region | |
| import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient | |
| import java.net.URI | |
| @Configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.codebrews.dynamodemo | |
| import org.springframework.boot.context.properties.ConfigurationProperties | |
| import org.springframework.boot.context.properties.ConstructorBinding | |
| @ConstructorBinding | |
| @ConfigurationProperties(prefix = "application.dynamo") | |
| data class DynamoConfigProperties( | |
| val customerTableName: String, | |
| val region: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.codebrews.dynamodemo | |
| import org.springframework.boot.autoconfigure.SpringBootApplication | |
| import org.springframework.boot.context.properties.ConfigurationPropertiesScan | |
| import org.springframework.boot.runApplication | |
| @SpringBootApplication | |
| @ConfigurationPropertiesScan | |
| class DynamodemoApplication |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package io.codebrews.dynamodemo | |
| import org.springframework.boot.autoconfigure.SpringBootApplication | |
| import org.springframework.boot.context.properties.EnableConfigurationProperties | |
| import org.springframework.boot.runApplication | |
| @SpringBootApplication | |
| @EnableConfigurationProperties(DynamoConfigProperties::class) | |
| class DynamodemoApplication |