@@ -44,17 +44,21 @@ func GetEncryptedDataKeyDescriptionExample(kmsKeyID, ddbTableName string) {
44
44
}
45
45
returnedItem , err := ddb .GetItem (context .TODO (), getInput )
46
46
utils .HandleError (err )
47
- // inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberitem{
48
- // Value: returnedItem.Item,
49
- // }
50
- headerAttribute := "aws_dbe_head"
51
- headerBytes , ok := returnedItem .Item [headerAttribute ].(* types.AttributeValueMemberB )
52
- if ! ok {
53
- panic ("attribute1 is not binary. It might not be encrypted." )
54
- }
55
- inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberheader {
56
- Value : headerBytes .Value ,
47
+ inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberitem {
48
+ Value : returnedItem .Item ,
57
49
}
50
+
51
+ // The code below shows how we can send header as the input to the DynamoDB. This code is written to demo the
52
+ // alternative approach. So, it is commented.
53
+ // headerAttribute := "aws_dbe_head"
54
+ // headerBytes, ok := returnedItem.Item[headerAttribute].(*types.AttributeValueMemberB)
55
+ // if !ok {
56
+ // panic("attribute1 is not binary. It might not be encrypted.")
57
+ // }
58
+ // inputUnion := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionUnionMemberheader{
59
+ // Value: headerBytes.Value,
60
+ // }
61
+
58
62
encryptedDataKeyDescriptionInput := dbesdkdynamodbencryptiontypes.GetEncryptedDataKeyDescriptionInput {
59
63
Input : & inputUnion ,
60
64
}
0 commit comments