Created
August 22, 2019 15:05
-
-
Save wreulicke/7d994f15e58f7828d004fa9e6f66455e to your computer and use it in GitHub Desktop.
CDKでAPI Gateway経由でlambdaを叩けるようにするやつ
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
#!/usr/bin/env node | |
import 'source-map-support/register'; | |
import {App, Stack} from '@aws-cdk/core'; | |
import {Runtime, Code, Function} from "@aws-cdk/aws-lambda" | |
import {ApiEventSource} from "@aws-cdk/aws-lambda-event-sources" | |
const app = new App(); | |
const stack = new Stack(app, "example-stack") | |
const f = new Function(stack, "example-lambda", { | |
handler: "main", | |
code: Code.fromAsset("dist/"), | |
runtime: Runtime.GO_1_X, | |
role: role, | |
}) | |
f.addEventSource(new ApiEventSource("POST", "/")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment