-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapigw.json
36 lines (36 loc) · 907 Bytes
/
apigw.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
"$schema": "../cdk.schema.json",
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "A template creates a lambda function with an api gateway",
"Resources": {
"HelloLambda": {
"Type": "aws-cdk-lib.aws_lambda.Function",
"Properties": {
"code": {
"aws-cdk-lib.aws_lambda.Code.fromAsset": "examples/lambda-handler"
},
"runtime": "PYTHON_3_6",
"handler": "index.handler"
},
"Tags": [
{
"Key": "category",
"Value": "ecommerce"
}
]
},
"MyApi": {
"Type": "aws-cdk-lib.aws_apigateway.LambdaRestApi",
"Properties": {
"handler": { "Ref": "HelloLambda" }
}
},
"GetRoot": {
"Type": "aws-cdk-lib.aws_apigateway.Method",
"Properties": {
"resource": { "CDK::GetProp": "MyApi.root" },
"httpMethod": "GET"
}
}
}
}