I have a few general questions about AWS using Lam...
# aws
e
I have a few general questions about AWS using Lambda and SQS: 1. If I have an SQS queue with hundreds of thousands of messages in it with a lambda listening to the queue, how many instances of the same Lambda will AWS spawn? Is there a way I can limit it? 2. If I have a FIFO SQS queue with multiple groups, will each group be processed by a different lambda instance? For example, I have
groupA
and
groupB
, will AWS automatically spawn multiple lambda instances and process
groupA
messages in parallel to
groupB
? 3. For how long will an SQS message processing will be attempted before it gets discarded (or sent to a DLQ) when it fails? 4. Is there a way to send a message that failed to process back to the queue with a delay of few seconds/minutes before it’s being retried? Also, is it possible to get the retry number in the lambda itself? Thanks in advance!
d
re: concurrency https://docs.aws.amazon.com/lambda/latest/dg/configuration-concurrency.html I haven't use it in pulumi yet but I assume there's a property to set those limits
e
Thank you very much! I’ll start reading this right away!
By the way, is there any good practice for folder structuring? Where would you define each piece of infra and domain logic
d
There's a few old chats on the subject, the key points where everyone seem to agree are: • keep things that change at the same rate together • better to have multiple stacks/projects than a monolithic one
I have : • functions with app code and infra folder, that's one pulumi project • frontend - with its own infra (S3+cloudfront+route 53) • infrastructure with everything else (VPC, cognito, sqs, codebuild/pipeline)
Arguably I can split further, especially the codepipeline seems a bit out of place.
e
So you split your folder per “features” and inside each feature you have the infra and the app code?
For example:
Copy code
root/
├─ frontend/
│  ├─ infra/
│  │  ├─ index.ts
│  ├─ src/
├─ backend/
│  ├─ infra/
│  │  ├─ index.ts
│  ├─ src/
├─ shared-infra/
│  ├─ index.ts
d
yes like that 👍
then inside share infra I have /route53 /sqs /dyanamo /etc
e
@damp-school-17708 I see. How does Pulumi know to look for the
index.ts
inside infra?
d
There's a 'main' property in the Pulumi.yaml, set it to the folder name
e
@damp-school-17708 oh I see. Thanks!