MCPcopy Create free account
hub / github.com/dwyl/aws-lambda-test-utils / createS3Event

Function createS3Event

mockEvent.js:129–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

127}
128
129function createS3Event() {
130 return {
131 "Records": [
132 {
133 "eventVersion": "2.0",
134 "eventTime": "1970-01-01T00:00:00.000Z",
135 "requestParameters": {
136 "sourceIPAddress": "127.0.0.1"
137 },
138 "s3": {
139 "configurationId": "testConfigRule",
140 "object": {
141 "eTag": "0123456789abcdef0123456789abcdef",
142 "sequencer": "0A1B2C3D4E5F678901",
143 "key": "HappyFace.jpg",
144 "size": 1024
145 },
146 "bucket": {
147 "arn": "arn:aws:s3:::mybucket",
148 "name": "sourcebucket",
149 "ownerIdentity": {
150 "principalId": "EXAMPLE"
151 }
152 },
153 "s3SchemaVersion": "1.0"
154 },
155 "responseElements": {
156 "x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH",
157 "x-amz-request-id": "EXAMPLE123456789"
158 },
159 "awsRegion": "eu-west-1",
160 "eventName": "ObjectCreated:Put",
161 "userIdentity": {
162 "principalId": "EXAMPLE"
163 },
164 "eventSource": "aws:s3"
165 }
166 ]
167 }
168}
169
170function createAPIGatewayEvent(options) {
171 var options = setDefaults(options, "api-gateway");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected