https://pulumi.com logo
#aws
Title
# aws
a

astonishing-gpu-12842

03/26/2020, 9:46 PM
Any suggestion on how I can specify node runtime when declaring an endpoint? Here is the sample code I have to work with. Whenever pulumi creates the resource it appears to be using Node 8 and I need to specify Node 10.
Copy code
const endpoint = new awsx.apigateway.API("mapboxQuery", {
  routes: [
    {
      path: "/",
      method: "GET",
      eventHandler: (request, ctx, cb) => {
        const AWS = require("aws-sdk");
        const ddb = new AWS.DynamoDB.DocumentClient({
          apiVersion: "2012-10-08"
        });
        const tableName = assetTable.name.value;
        const params = {
          TableName: tableName
        };
        <!-- code -->
      }
    }
  ],
  stageName: "dev"
});
I just get this in the output:
Copy code
handler                     : "__index.handler"
            memorySize                  : 128
            name                        : "mapboxQuery4c238266-c28e6f7"
            publish                     : false
            reservedConcurrentExecutions: -1
            role                        : output<string>
            runtime                     : "nodejs8.10"
            timeout                     : 180
g

gentle-diamond-70147

03/26/2020, 10:20 PM
I believe you can pass a full
Function
object to
eventHandler
there that lets you specify more of the arguments such as
runtime
. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/lambda/#Function