Skip to content

Commit

Permalink
NOBUG: Skip indexing user information into opensearch.
Browse files Browse the repository at this point in the history
  • Loading branch information
marklise committed Oct 10, 2024
1 parent bf37098 commit d4da343
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion handlers/dynamoStream/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { logger } = require('/opt/base');
const { batchWriteData, AUDIT_TABLE_NAME, marshall, unmarshall } = require('/opt/dynamodb');
const { batchWriteData, AUDIT_TABLE_NAME, marshall, unmarshall, USER_ID_PARTITION } = require('/opt/dynamodb');
const { OPENSEARCH_MAIN_INDEX, bulkWriteDocuments } = require('/opt/opensearch');


Expand All @@ -20,6 +20,12 @@ exports.handler = async function (event, context) {
const creationTime = createDate.toISOString();

const gsipk = record.dynamodb.Keys.pk;

// If pk === 'userid' then skip
if (gsipk.S === USER_ID_PARTITION) {
continue;
}

const gsisk = record.dynamodb.Keys.sk;
const user = newImage?.lastModifiedBy?.S || "system";

Expand Down

0 comments on commit d4da343

Please sign in to comment.