@@ -31,16 +31,16 @@ This example follows a use case of a database that stores unit inspection inform
3131
3232Running this example requires access to a DDB table with the
3333following key configuration:
34- - Partition key is named partitionKeyName with type (S)
35- - Sort key is named sortKey with type (S)
34+ - Partition key is named "work_id" with type (S)
35+ - Sort key is named "inspection_date" with type (S)
3636
3737This table must have a Global Secondary Index (GSI) configured named "last4-unit-index":
3838 - Partition key is named "aws_dbe_b_inspector_id_last4" with type (S)
3939 - Sort key is named "aws_dbe_b_unit" with type (S)
4040
4141In this example for storing unit inspection information, this schema is utilized for the data:
42- - partitionKeyName stores a unique identifier for a unit inspection work order (v4 UUID)
43- - sortKey stores an ISO 8601 date for the inspection (YYYY-MM-DD)
42+ - "work_id" stores a unique identifier for a unit inspection work order (v4 UUID)
43+ - "inspection_date" stores an ISO 8601 date for the inspection (YYYY-MM-DD)
4444 - "inspector_id_last4" stores the last 4 digits of the ID of the inspector performing the work
4545 - "unit" stores a 12-digit serial number for the unit being inspected
4646
@@ -59,7 +59,7 @@ func BasicSearchableEncryptionExample(
5959 branchKeyDdbTableName string ) {
6060 const gsiName = "last4-unit-index"
6161 partitionKeyName := "work_id"
62- sortKey := "inspection_date"
62+ sortKeyName := "inspection_date"
6363 // 1. Configure Beacons.
6464 // The beacon name must be the name of a table attribute that will be encrypted.
6565 // The `length` parameter dictates how many bits are in the beacon attribute value.
@@ -238,7 +238,7 @@ func BasicSearchableEncryptionExample(
238238 // Any attributes that will be used in beacons must be configured as ENCRYPT_AND_SIGN.
239239 attributeActionsOnEncrypt := map [string ]dbesdkstructuredencryptiontypes.CryptoAction {
240240 partitionKeyName : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our partition attribute must be SIGN_ONLY
241- sortKey : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our sort attribute must be SIGN_ONLY
241+ sortKeyName : dbesdkstructuredencryptiontypes .CryptoActionSignOnly , // Our sort attribute must be SIGN_ONLY
242242 "inspector_id_last4" : dbesdkstructuredencryptiontypes .CryptoActionEncryptAndSign , // Beaconized attributes must be encrypted
243243 "unit" : dbesdkstructuredencryptiontypes .CryptoActionEncryptAndSign , // Beaconized attributes must be encrypted
244244 }
@@ -254,7 +254,7 @@ func BasicSearchableEncryptionExample(
254254 tableConfig := dbesdkdynamodbencryptiontypes.DynamoDbTableEncryptionConfig {
255255 LogicalTableName : ddbTableName ,
256256 PartitionKeyName : partitionKeyName ,
257- SortKeyName : & sortKey ,
257+ SortKeyName : & sortKeyName ,
258258 AttributeActionsOnEncrypt : attributeActionsOnEncrypt ,
259259 Keyring : kmsKeyring ,
260260 Search : & searchConfig ,
@@ -285,7 +285,7 @@ func BasicSearchableEncryptionExample(
285285 // aws_dbe_b_unit = truncate(HMAC("123456789012"), 30)
286286 item := map [string ]types.AttributeValue {
287287 partitionKeyName : & types.AttributeValueMemberS {Value : "1313ba89-5661-41eb-ba6c-cb1b4cb67b2d" },
288- sortKey : & types.AttributeValueMemberS {Value : "2023-06-13" },
288+ sortKeyName : & types.AttributeValueMemberS {Value : "2023-06-13" },
289289 "inspector_id_last4" : & types.AttributeValueMemberS {Value : "4321" },
290290 "unit" : & types.AttributeValueMemberS {Value : "123456789012" },
291291 }
0 commit comments