Skip to content

Commit bb2635e

Browse files
committed
test(all): add mock events payload of most known Lambda event sources generated by AWS services (#10)
1 parent 791a24b commit bb2635e

File tree

48 files changed

+1440
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1440
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "TOKEN",
3+
"authorizationToken": "incoming-client-token",
4+
"methodArn": "arn:aws:execute-api:eu-central-1:123456789012:example/prod/POST/{proxy+}"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"body": "eyJ0ZXN0IjoiYm9keSJ9",
3+
"resource": "/{proxy+}",
4+
"path": "/path/to/resource",
5+
"httpMethod": "POST",
6+
"isBase64Encoded": true,
7+
"queryStringParameters": {
8+
"foo": "bar"
9+
},
10+
"multiValueQueryStringParameters": {
11+
"foo": [
12+
"bar"
13+
]
14+
},
15+
"pathParameters": {
16+
"proxy": "/path/to/resource"
17+
},
18+
"stageVariables": {
19+
"baz": "qux"
20+
},
21+
"headers": {
22+
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
23+
"Accept-Encoding": "gzip, deflate, sdch",
24+
"Accept-Language": "en-US,en;q=0.8",
25+
"Cache-Control": "max-age=0",
26+
"CloudFront-Forwarded-Proto": "https",
27+
"CloudFront-Is-Desktop-Viewer": "true",
28+
"CloudFront-Is-Mobile-Viewer": "false",
29+
"CloudFront-Is-SmartTV-Viewer": "false",
30+
"CloudFront-Is-Tablet-Viewer": "false",
31+
"CloudFront-Viewer-Country": "US",
32+
"Host": "1234567890.execute-api.eu-central-1.amazonaws.com",
33+
"Upgrade-Insecure-Requests": "1",
34+
"User-Agent": "Custom User Agent String",
35+
"Via": "1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)",
36+
"X-Amz-Cf-Id": "cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA==",
37+
"X-Forwarded-For": "127.0.0.1, 127.0.0.2",
38+
"X-Forwarded-Port": "443",
39+
"X-Forwarded-Proto": "https"
40+
},
41+
"multiValueHeaders": {
42+
"Accept": [
43+
"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
44+
],
45+
"Accept-Encoding": [
46+
"gzip, deflate, sdch"
47+
],
48+
"Accept-Language": [
49+
"en-US,en;q=0.8"
50+
],
51+
"Cache-Control": [
52+
"max-age=0"
53+
],
54+
"CloudFront-Forwarded-Proto": [
55+
"https"
56+
],
57+
"CloudFront-Is-Desktop-Viewer": [
58+
"true"
59+
],
60+
"CloudFront-Is-Mobile-Viewer": [
61+
"false"
62+
],
63+
"CloudFront-Is-SmartTV-Viewer": [
64+
"false"
65+
],
66+
"CloudFront-Is-Tablet-Viewer": [
67+
"false"
68+
],
69+
"CloudFront-Viewer-Country": [
70+
"US"
71+
],
72+
"Host": [
73+
"0123456789.execute-api.eu-central-1.amazonaws.com"
74+
],
75+
"Upgrade-Insecure-Requests": [
76+
"1"
77+
],
78+
"User-Agent": [
79+
"Custom User Agent String"
80+
],
81+
"Via": [
82+
"1.1 08f323deadbeefa7af34d5feb414ce27.cloudfront.net (CloudFront)"
83+
],
84+
"X-Amz-Cf-Id": [
85+
"cDehVQoZnx43VYQb9j2-nvCh-9z396Uhbp027Y2JvkCPNLmGJHqlaA=="
86+
],
87+
"X-Forwarded-For": [
88+
"127.0.0.1, 127.0.0.2"
89+
],
90+
"X-Forwarded-Port": [
91+
"443"
92+
],
93+
"X-Forwarded-Proto": [
94+
"https"
95+
]
96+
},
97+
"requestContext": {
98+
"accountId": "123456789012",
99+
"resourceId": "123456",
100+
"stage": "prod",
101+
"requestId": "c6af9ac6-7b61-11e6-9a41-93e8deadbeef",
102+
"requestTime": "09/Apr/2015:12:34:56 +0000",
103+
"requestTimeEpoch": 1428582896000,
104+
"identity": {
105+
"cognitoIdentityPoolId": null,
106+
"accountId": null,
107+
"cognitoIdentityId": null,
108+
"caller": null,
109+
"accessKey": null,
110+
"sourceIp": "127.0.0.1",
111+
"cognitoAuthenticationType": null,
112+
"cognitoAuthenticationProvider": null,
113+
"userArn": null,
114+
"userAgent": "Custom User Agent String",
115+
"user": null
116+
},
117+
"path": "/prod/path/to/resource",
118+
"resourcePath": "/{proxy+}",
119+
"httpMethod": "POST",
120+
"apiId": "1234567890",
121+
"protocol": "HTTP/1.1"
122+
}
123+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"arguments": {
3+
"id": "my identifier"
4+
},
5+
"identity": {
6+
"claims": {
7+
"sub": "192879fc-a240-4bf1-ab5a-d6a00f3063f9",
8+
"email_verified": true,
9+
"iss": "https://cognito-idp.us-west-2.amazonaws.com/us-west-xxxxxxxxxxx",
10+
"phone_number_verified": false,
11+
"cognito:username": "jdoe",
12+
"aud": "7471s60os7h0uu77i1tk27sp9n",
13+
"event_id": "bc334ed8-a938-4474-b644-9547e304e606",
14+
"token_use": "id",
15+
"auth_time": 1599154213,
16+
"phone_number": "+19999999999",
17+
"exp": 1599157813,
18+
"iat": 1599154213,
19+
"email": "[email protected]"
20+
},
21+
"defaultAuthStrategy": "ALLOW",
22+
"groups": null,
23+
"issuer": "https://cognito-idp.us-west-2.amazonaws.com/us-west-xxxxxxxxxxx",
24+
"sourceIp": [
25+
"1.1.1.1"
26+
],
27+
"sub": "192879fc-a240-4bf1-ab5a-d6a00f3063f9",
28+
"username": "jdoe"
29+
},
30+
"source": null,
31+
"request": {
32+
"headers": {
33+
"x-forwarded-for": "1.1.1.1, 2.2.2.2",
34+
"cloudfront-viewer-country": "US",
35+
"cloudfront-is-tablet-viewer": "false",
36+
"via": "2.0 xxxxxxxxxxxxxxxx.cloudfront.net (CloudFront)",
37+
"cloudfront-forwarded-proto": "https",
38+
"origin": "https://us-west-1.console.aws.amazon.com",
39+
"content-length": "217",
40+
"accept-language": "en-US,en;q=0.9",
41+
"host": "xxxxxxxxxxxxxxxx.appsync-api.us-west-1.amazonaws.com",
42+
"x-forwarded-proto": "https",
43+
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36",
44+
"accept": "*/*",
45+
"cloudfront-is-mobile-viewer": "false",
46+
"cloudfront-is-smarttv-viewer": "false",
47+
"accept-encoding": "gzip, deflate, br",
48+
"referer": "https://us-west-1.console.aws.amazon.com/appsync/home?region=us-west-1",
49+
"content-type": "application/json",
50+
"sec-fetch-mode": "cors",
51+
"x-amz-cf-id": "3aykhqlUwQeANU-HGY7E_guV5EkNeMMtwyOgiA==",
52+
"x-amzn-trace-id": "Root=1-5f512f51-fac632066c5e848ae714",
53+
"authorization": "eyJraWQiOiJScWFCSlJqYVJlM0hrSnBTUFpIcVRXazNOW...",
54+
"sec-fetch-dest": "empty",
55+
"x-amz-user-agent": "AWS-Console-AppSync/",
56+
"cloudfront-is-desktop-viewer": "true",
57+
"sec-fetch-site": "cross-site",
58+
"x-forwarded-port": "443"
59+
}
60+
},
61+
"prev": null,
62+
"info": {
63+
"selectionSetList": [
64+
"id",
65+
"field1",
66+
"field2"
67+
],
68+
"selectionSetGraphQL": "{\n id\n field1\n field2\n}",
69+
"parentTypeName": "Mutation",
70+
"fieldName": "createSomething",
71+
"variables": {}
72+
},
73+
"stash": {}
74+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"jobName": "hello_world",
3+
"jobQueue": "default",
4+
"jobDefinition": "hello_world"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"jobName": "hello_world",
3+
"jobQueue": "default",
4+
"jobDefinition": "hello_world"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"RequestType": "Create",
3+
"ResponseURL": "http://pre-signed-S3-url-for-response",
4+
"StackId": "arn:aws:cloudformation:eu-central-1:123456789012:stack/MyStack/guid",
5+
"RequestId": "unique id for this create request",
6+
"ResourceType": "Custom::TestResource",
7+
"LogicalResourceId": "MyTestResource",
8+
"ResourceProperties": {
9+
"StackName": "MyStack",
10+
"List": [
11+
"1",
12+
"2",
13+
"3"
14+
]
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"uri": "/test",
10+
"method": "GET",
11+
"clientIp": "2001:cdba::3257:9652",
12+
"headers": {
13+
"user-agent": [
14+
{
15+
"key": "User-Agent",
16+
"value": "Test Agent"
17+
}
18+
],
19+
"host": [
20+
{
21+
"key": "Host",
22+
"value": "d123.cf.net"
23+
}
24+
],
25+
"cookie": [
26+
{
27+
"key": "Cookie",
28+
"value": "SomeCookie=1; AnotherOne=A; X-Experiment-Name=B"
29+
}
30+
]
31+
}
32+
}
33+
}
34+
}
35+
]
36+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"headers": {
10+
"host": [
11+
{
12+
"key": "Host",
13+
"value": "d123.cf.net"
14+
}
15+
],
16+
"user-name": [
17+
{
18+
"key": "User-Name",
19+
"value": "CloudFront"
20+
}
21+
]
22+
},
23+
"clientIp": "2001:cdba::3257:9652",
24+
"uri": "/test",
25+
"method": "GET"
26+
},
27+
"response": {
28+
"status": "200",
29+
"statusDescription": "OK",
30+
"headers": {
31+
"x-cache": [
32+
{
33+
"key": "X-Cache",
34+
"value": "Hello from Cloudfront"
35+
}
36+
]
37+
}
38+
}
39+
}
40+
}
41+
]
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"uri": "/test",
10+
"method": "GET",
11+
"clientIp": "2001:cdba::3257:9652",
12+
"headers": {
13+
"user-agent": [
14+
{
15+
"key": "User-Agent",
16+
"value": "test-agent"
17+
}
18+
],
19+
"host": [
20+
{
21+
"key": "Host",
22+
"value": "d123.cf.net"
23+
}
24+
]
25+
}
26+
}
27+
}
28+
}
29+
]
30+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"Records": [
3+
{
4+
"cf": {
5+
"config": {
6+
"distributionId": "EXAMPLE"
7+
},
8+
"request": {
9+
"uri": "/test",
10+
"querystring": "auth=test&foo=bar",
11+
"method": "GET",
12+
"clientIp": "2001:cdba::3257:9652",
13+
"headers": {
14+
"host": [
15+
{
16+
"key": "Host",
17+
"value": "d123.cf.net"
18+
}
19+
],
20+
"user-agent": [
21+
{
22+
"key": "User-Agent",
23+
"value": "Test Agent"
24+
}
25+
],
26+
"user-name": [
27+
{
28+
"key": "User-Name",
29+
"value": "aws-cloudfront"
30+
}
31+
]
32+
}
33+
}
34+
}
35+
}
36+
]
37+
}

0 commit comments

Comments
 (0)