Created
April 3, 2022 00:50
-
-
Save louislatreille/946bd904ebf492f46e87787f213c0ecd to your computer and use it in GitHub Desktop.
pulumiServerlessJourney - index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as apigateway from "@pulumi/aws-apigateway"; | |
import * as aws from "@pulumi/aws"; | |
export const api = new apigateway.RestAPI("pulumi-serverless-journey", { | |
stageName: "dev", | |
routes: [ | |
{ | |
path: "/function1", | |
method: "POST", | |
eventHandler: new aws.lambda.CallbackFunction("function1", { | |
callback: async () => { | |
console.log("Hello from function 1!"); | |
return { | |
statusCode: 200, | |
}; | |
}, | |
}), | |
}, | |
{ | |
path: "/function2", | |
method: "POST", | |
eventHandler: new aws.lambda.CallbackFunction("function2", { | |
callback: async () => { | |
console.log("Hello from function 2!"); | |
return { | |
statusCode: 200, | |
}; | |
}, | |
}), | |
}, | |
{ | |
path: "/function3", | |
method: "POST", | |
eventHandler: new aws.lambda.CallbackFunction("function3", { | |
callback: async () => { | |
console.log("Hello from function 3!"); | |
return { | |
statusCode: 200, | |
}; | |
}, | |
}), | |
}, | |
], | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment