Hi everyone! I have been using the NextJsSite cons...
# help
c
Hi everyone! I have been using the NextJsSite construct for a few weeks and have two questions: 1. When instancing a new NextJsSite construct, how can I access the created resources (they are private fields currently)? For example, I want to add a dead-letter-queue to the queue generated by NextJsSite, but how can I do that without access to the created resources? 2. Is it intentional that the regeneration Lambda has only 128MB memory? Currently I have an issue where the regeneration Lambda always times out. To fix this, I wanted to increase its memory, but it is not customizable as far as I can tell. Wanted to ask here before creating issues on GitHub. And thank you for such an amazing project!
b
Yeah we need option to customize its resources
c
Yes I think so too, otherwise you loose quite a lot of what the CDK offers. @Frank is this something that is intentional, or would you welcome contributions adding more customizability?
f
@Christian Kaindl sorry for the late followup guys. For now if we exposed the queue and allowed you to customize the Lambda function like this:
Copy code
const site = new NextjsSite(this, "NextSite", {
  path: "path/to/site",
  defaultFunctionProps: {
    memorySize: 512,  // customize functions
  },
});

site.regenerationQueue; // access the queue
Would it work?
b
Yes it would work @Frank Actually I have PR for customizing regenerator function: https://github.com/serverless-stack/serverless-stack/pull/1250
c
For the function props: yes, as per @Bshr Ramadan's PR. That would work! Regarding the regeneration SQS queue: I initially thought so, but now that I looked at the CDK Queue construct, it doesn't seem like there is a way to attach a dead letter queue after initial creation, or am I missing something? If that is indeed the case the Queue props would need to be exposed in the constructor (like
defaultFunctionProps
is).