Open Drodevbar opened 1 year ago
⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 5 GPT-4 tickets left. For more GPT-4 tickets, visit our payment portal.
I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.
From looking through the relevant snippets, I decided to make the following modifications:
File Path | Proposed Changes |
---|---|
functions/update-dynamodb/handler.ts |
Create a new file handler.ts in the functions/update-dynamodb/ directory. This file will contain the new lambda function. The function should be similar to the one in functions/cron-update-dynamodb/handler.ts , but it should use environmental variables to get the values for pk and sk . |
functions/update-dynamodb/function.yml |
Create a new file function.yml in the functions/update-dynamodb/ directory. This file will contain the configuration for the new lambda function, including the handler and environmental variables. |
serverless.yml |
Add the new lambda function to the functions section of the serverless.yml file. Also, define the environmental variables for pk and sk in the environment section of the new lambda function. |
I have created a plan for writing the pull request. I am now working my plan and coding the required changes to address this issue. Here is the planned pull request:
Create lambda function to update DDB item with pk=1 and sk=2
sweep/feature/update-dynamodb-function
Description
This PR adds a new lambda function to update a DynamoDB item with
pk=1
andsk=2
. The function is similar to the existingcron-update-dynamodb
function, but it uses environmental variables to get the values forpk
andsk
.Changes Made
- Created a new lambda function
update-dynamodb
in thefunctions
directory.- Added a new file
handler.ts
in thefunctions/update-dynamodb/
directory, which contains the implementation of the lambda function.- Added a new file
function.yml
in thefunctions/update-dynamodb/
directory, which contains the configuration for the lambda function, including the handler and environmental variables.- Modified the
serverless.yml
file to include the new lambda function in thefunctions
section and define the environmental variables forpk
andsk
in theenvironment
section of the new lambda function.Testing Instructions
- Deploy the updated serverless stack.
- Trigger the
update-dynamodb
lambda function manually or through a scheduled event.- Verify that the DynamoDB item with
pk=1
andsk=2
has been updated with the current timestamp.Related Issues
Resolves #13
I have finished coding the issue. I am now reviewing it for completeness.
Success! 🚀
I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind! Join Our Discord
Take a look at the implementation of functions/cron-update-dynamodb/handler.ts. The function that you create should be similar to this one. Input for which DDB item to update should be passed from environmental variables from lambda function level