This message was deleted.
s
This message was deleted.
g
Defining callbacks like this
Copy code
export async function myLambda(
    event: awsx.apigateway.Request): Promise<awsx.apigateway.Response> {
Copy code
new aws.lambda.CallbackFunction(name,
        {
            policies: [aws.iam.ManagedPolicy.AWSLambdaBasicExecutionRole, aws.iam.ManagedPolicy.AWSLambdaDynamoDBExecutionRole],
            callback: f
        },)
my gateway
Copy code
aws.apigateway.RestApi
Then i go on to define a custome resource which inside does a
Copy code
resource

method(dependsOn:[lambda, resource])

integration(dependsOn:[lambda,resource,method]
and finally a deployment depending on my custom resource for the route.
Found it needed to define an
aws.lambda.Permission
for the api to invoke the lambda.
almost no tutorials on using lambda.callback included this