Create an aws cdk script to create an sqs queue and a lambda associated to it
- User
Create an aws cdk script to create an sqs queue and a lambda associated to it
Assistant
This is a Node.js script that uses the aws-cdk module. It defines an SQS queue and a Lambda function, and it sets up a trigger so that the Lambda function is executed whenever a new message is added to the queue.
- User
Can you write it in Python please?
Assistant
Yes, here it is in Python. It uses the aws-cdk module for Python, and it defines an SQS queue and a Lambda function, and it sets up a trigger so that the Lambda function is executed whenever a new message is added to the queue.
- User
Can you add a deadletter to the queue please?
Assistant
Sure, here’s the updated code. It adds a deadletter queue for the SQS queue, and it sets up a deadletter trigger so that the Lambda function is executed whenever a message is moved to the deadletter queue.
- User
the lambda cannot be found
Assistant
Here is the updated code with the deadletter queue and trigger added. The Lambda function is now defined as a separate construct and is referenced in the deadletter trigger.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.