Repository: awslabs/llrt
File: example/infrastructure/src/index.ts (TypeScript)

Code before:
    runtime: aws_lambda.Runtime.PROVIDED_AL2023,
    layers: [llrtLayer],
  });

  // LLRT aws-sdk-v3, DynamoDBClient & S3 API
  const llrtS3Function = new aws_lambda.Function(stack, "LlrtS3Function", {
    functionName: "example-llrt-s3",
    code: aws_lambda.Code.fromAsset(sourceDirs["v3-s3.mjs"]),
    handler: "index.handler",
    ...props,
    runtime: aws_lambda.Runtime.PROVIDED_AL2023,
    environment: {
      ...props.environment,
    },
    layers: [llrtLayer],
  });

  // aws-sdk-v3, DynamoDBClient & S3 API
  const s3Function = new aws_lambda.Function(stack, "S3Function", {
    functionName: "example-s3",
    code: aws_lambda.Code.fromAsset(sourceDirs["v3-s3.mjs"]),
    handler: "index.handler",
    ...props,
    environment: {
      ...props.environment,
    },
  });

  // ssr react, node.js
  const reactFunction = new aws_lambda.Function(stack, "ReactFunction", {
    functionName: "example-react",
    code: aws_lambda.Code.fromAsset("../functions/build"),
    handler: "index.handler",
    ...props,
    environment: {
      ...props.environment,
      TABLE_NAME: todoTable.tableName,
    },
  });

  // ssr react,llrt
  const llrtReactFunction = new aws_lambda.Function(
    stack,
    "LlrtReactFunction",
    {
      functionName: "example-llrt-react",
      code: aws_lambda.Code.fromAsset("../functions/build"),
      handler: "index.handler",
      ...props,
      runtime: aws_lambda.Runtime.PROVIDED_AL2023,
      environment: {

Review comment (bug):
`/llrt-react` is also broken on `main`, I assume it's an LLRT compatibility error this time:
```
Error resolving module '/var/task/process' from 'stream'    at <anonymous> (stream:2:18087)
    at <anonymous> (stream:1:506)
    at <anonymous> (stream:2:75522)
    at <anonymous> (stream:1:506)
    at <anonymous> (stream:2:81273)
    at <anonymous> (stream:1:506)
    at <anonymous> (stream:2:82932)
    at <anonymous> (stream:1:506)
    at <anonymous> (stream:2:83196)
    at ../../node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js (/var/task/index.mjs:395:14)
    at __require2 (/var/task/index.mjs:18:17)
    at ../../node_modules/react-dom/server.node.js (/var/task/index.mjs:3849:11)
    at __require2 (/var/task/index.mjs:18:17)
    at <anonymous> (/var/task/index.mjs:4024:29)
```

 I can open another issue if you'd like

Code after:
      ...props.environment,
    },
  });

  // ssr react, node.js
  const reactFunction = new aws_lambda.Function(stack, "ReactFunction", {
    functionName: "example-react",
    code: aws_lambda.Code.fromAsset("../functions/build"),
    handler: "index.handler",
    ...props,
    environment: {
      ...props.environment,
      TABLE_NAME: todoTable.tableName,
    },
  });

  // ssr react,llrt
  const llrtReactFunction = new aws_lambda.Function(
    stack,
    "LlrtReactFunction",
    {
      functionName: "example-llrt-react",
      code: aws_lambda.Code.fromAsset("../functions/build"),
      handler: "index.handler",
      ...props,
      runtime: aws_lambda.Runtime.PROVIDED_AL2023,
      environment: {
        ...props.environment,
        TABLE_NAME: todoTable.tableName,
      },
      layers: [llrtLayer],
    }
  );

  todoTable.grantReadWriteData(reactFunction);
  todoTable.grantReadWriteData(llrtReactFunction);
  table.grantReadWriteData(v2Function);
  table.grantReadWriteData(v3BundledFunction);
  table.grantReadWriteData(v3providedFunction);
  table.grantReadWriteData(v3providedMonoFunction);
  table.grantReadWriteData(v3BundledMonoFunction);
  table.grantReadWriteData(llrtFunction);
  table.grantReadWriteData(llrtS3Function);
  table.grantReadWriteData(s3Function);

  bucket.grantReadWrite(llrtS3Function);
  bucket.grantReadWrite(s3Function);

  addRoute(helloNode20Function, "/hello-20");
  addRoute(helloNode18Function, "/hello-18");
  addRoute(helloNode16Function, "/hello-16");