AWS Lambda Function In-console Tests

JS
S
JSON

Example of a payload request JSON object to test a lambda function with output to APIGateway

1{
2  "body": {"experimentId":"5c406781d1d4f5000fca6deb","loadConfigs":[{"variant":"5c406782d1d4f5000fca6e23","split":"0.5"},{"variant":"5c409f0cd3be72000fa07679","split":"0.5"}]},
3  "resource": "/{proxy+}",
4  "path": "/path/to/resource",
5  "httpMethod": "POST",
6  "isBase64Encoded": true,
7  "queryStringParameters": {
8    "foo": "bar"
9  },
10  "pathParameters": {
11    "proxy": "/path/to/resource"
12  },
13  "stageVariables": {
14    "baz": "qux"
15  },
16  "headers": {
17    "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
18    "Accept-Encoding": "gzip, deflate, sdch",
19    "Accept-Language": "en-US,en;q=0.8",
20    "Cache-Control": "max-age=0",
21    "CloudFront-Forwarded-Proto": "https",
22    "CloudFront-Is-Desktop-Viewer": "true",
23    "CloudFront-Is-Mobile-Viewer": "false",
24    "CloudFront-Is-SmartTV-Viewer": "false",
25    "CloudFront-Is-Tablet-Viewer": "false",
26    "CloudFront-Viewer-Country": "US",
27    "Host": "1234567890.execute-api.us-east-1.amazonaws.com",
28    "Upgrade-Insecure-Requests": "1",
29    "User-Agent": "Custom User Agent String",
30    "Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)",
31    "X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==",
32    "X-Forwarded-For": "127.0.0.1, 127.0.0.2",
33    "X-Forwarded-Port": "443",
34    "X-Forwarded-Proto": "https"
35  },
36  "requestContext": {
37    "accountId": "123456789012",
38    "resourceId": "123456",
39    "stage": "prod",
40    "requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
41    "requestTime": "09/Apr/2015:12:34:56 +0000",
42    "requestTimeEpoch": 1428582896000,
43    "identity": {
44      "cognitoIdentityPoolId": null,
45      "accountId": null,
46      "cognitoIdentityId": null,
47      "caller": null,
48      "accessKey": null,
49      "sourceIp": "127.0.0.1",
50      "cognitoAuthenticationType": null,
51      "cognitoAuthenticationProvider": null,
52      "userArn": null,
53      "userAgent": "Custom User Agent String",
54      "user": null
55    },
56    "path": "/prod/path/to/resource",
57    "resourcePath": "/{proxy+}",
58    "httpMethod": "POST",
59    "apiId": "1234567890",
60    "protocol": "HTTP/1.1"
61  }
62}

Created on 2/7/2019