-
Notifications
You must be signed in to change notification settings - Fork 1
Add upsert lambda #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add upsert lambda #280
Conversation
8c4f7c3 to
8a74c03
Compare
infrastructure/terraform/components/api/module_lambda_upsert_letter.tf
Outdated
Show resolved
Hide resolved
| }; | ||
|
|
||
| function createDocumentClient(): DynamoDBDocumentClient { | ||
| const ddbClient = new DynamoDBClient({}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should the region be passed in during creation?
Which region is used by default if you omit it?
547f6b1
* swap partition and sort for letters * store changes and source, subject, billingref * unsafe marker * rename correctly
| test("processes all v1 records successfully and returns no batch failures", async () => { | ||
| const evt: SQSEvent = { | ||
| Records: [ | ||
| createSqsRecord( | ||
| "msg1", | ||
| JSON.stringify(createNotification(createPreparedV1Event())), | ||
| ), | ||
| createSqsRecord( | ||
| "msg2", | ||
| JSON.stringify( | ||
| createNotification( | ||
| createPreparedV1Event({ | ||
| id: "7b9a03ca-342a-4150-b56b-989109c45614", | ||
| domainId: "letter2", | ||
| url: "s3://letterDataBucket/letter2.pdf", | ||
| }), | ||
| ), | ||
| ), | ||
| ), | ||
| ], | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A parameterised test structure might be worth considering - maybe as a tech debt - as for each path (insert or upsert) I expect regardless of the supported event input we would want the same outputs.
Although it would still require extra tests for mixed events etc, I wonder if it might be easier to maintain/reduce the boilerplate?
|
|
||
| await Promise.all(tasks); | ||
|
|
||
| return { batchItemFailures }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does batch failure support not require a terraform configuration to be set on the queue?
Description
Context
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.