1 | import { Handler } from "../handler";
|
2 | import { EventBridgeEvent } from "./eventbridge";
|
3 |
|
4 | export interface S3ObjectAccessTierChangedNotificationEventDetail {
|
5 | version: "0";
|
6 | bucket: {
|
7 | name: string;
|
8 | };
|
9 | object: {
|
10 | key: string;
|
11 | size: number;
|
12 | etag: string;
|
13 | "version-id": string;
|
14 | };
|
15 | "request-id": string;
|
16 | requester: string;
|
17 | "destination-access-tier": "ARCHIVE_ACCESS" | "DEEP_ARCHIVE_ACCESS";
|
18 | }
|
19 |
|
20 | export interface S3ObjectACLUpdatedNotificationEventDetail {
|
21 | version: "0";
|
22 | bucket: {
|
23 | name: string;
|
24 | };
|
25 | object: {
|
26 | key: string;
|
27 | etag: string;
|
28 | "version-id": string;
|
29 | };
|
30 | "request-id": string;
|
31 | requester: string;
|
32 | "source-ip-address": string;
|
33 | }
|
34 |
|
35 | export interface S3ObjectCreatedNotificationEventDetail {
|
36 | version: "0";
|
37 | bucket: {
|
38 | name: string;
|
39 | };
|
40 | object: {
|
41 | key: string;
|
42 | size: number;
|
43 | etag: string;
|
44 | "version-id": string;
|
45 | sequencer: string;
|
46 | };
|
47 | "request-id": string;
|
48 | requester: string;
|
49 | "source-ip-address": string;
|
50 | reason: "PutObject" | "POST Object" | "CopyObject" | "CompleteMultipartUpload";
|
51 | }
|
52 |
|
53 | export interface S3ObjectDeletedNotificationEventLifecycleExpirationDetail {
|
54 | version: "0";
|
55 | bucket: {
|
56 | name: string;
|
57 | };
|
58 | object: {
|
59 | key: string;
|
60 | etag: string;
|
61 | "version-id": string;
|
62 | sequencer: string;
|
63 | };
|
64 | "request-id": string;
|
65 | requester: string;
|
66 | reason: "Lifecycle Expiration";
|
67 | "deletion-type": "Permanently Deleted" | "Delete Marker Created";
|
68 | }
|
69 |
|
70 | export interface S3ObjectDeletedNotificationEventDeleteObjectDetail {
|
71 | version: "0";
|
72 | bucket: {
|
73 | name: string;
|
74 | };
|
75 | object: {
|
76 | key: string;
|
77 | etag: string;
|
78 | "version-id": string;
|
79 | sequencer: string;
|
80 | };
|
81 | "request-id": string;
|
82 | requester: string;
|
83 | "source-ip-address": string;
|
84 | reason: "DeleteObject";
|
85 | "deletion-type": "Permanently Deleted" | "Delete Marker Created";
|
86 | }
|
87 |
|
88 | export type S3ObjectDeletedNotificationEventDetail =
|
89 | | S3ObjectDeletedNotificationEventLifecycleExpirationDetail
|
90 | | S3ObjectDeletedNotificationEventDeleteObjectDetail;
|
91 |
|
92 | export interface S3ObjectRestoreCompletedNotificationEventDetail {
|
93 | version: "0";
|
94 | bucket: {
|
95 | name: string;
|
96 | };
|
97 | object: {
|
98 | key: string;
|
99 | size: number;
|
100 | "version-id": string;
|
101 | etag: string;
|
102 | };
|
103 | "request-id": string;
|
104 | requester: "s3.amazonaws.com";
|
105 | "restore-expiry-time": string;
|
106 | "source-storage-class":
|
107 | | "STANDARD"
|
108 | | "REDUCED_REDUNDANCY"
|
109 | | "STANDARD_IA"
|
110 | | "ONEZONE_IA"
|
111 | | "INTELLIGENT_TIERING"
|
112 | | "GLACIER"
|
113 | | "DEEP_ARCHIVE"
|
114 | | "OUTPOSTS"
|
115 | | "GLACIER_IR";
|
116 | }
|
117 |
|
118 | export interface S3ObjectRestoreExpiredNotificationEventDetail {
|
119 | version: "0";
|
120 | bucket: {
|
121 | name: string;
|
122 | };
|
123 | object: {
|
124 | key: string;
|
125 | "version-id": string;
|
126 | etag: string;
|
127 | };
|
128 | "request-id": string;
|
129 | requester: "s3.amazonaws.com";
|
130 | }
|
131 |
|
132 | export interface S3ObjectRestoreInitiatedNotificationEventDetail {
|
133 | version: "0";
|
134 | bucket: {
|
135 | name: string;
|
136 | };
|
137 | object: {
|
138 | key: string;
|
139 | size: number;
|
140 | "version-id": string;
|
141 | etag: string;
|
142 | };
|
143 | "request-id": string;
|
144 | requester: string;
|
145 | "source-ip-address": string;
|
146 | "source-storage-class":
|
147 | | "STANDARD"
|
148 | | "REDUCED_REDUNDANCY"
|
149 | | "STANDARD_IA"
|
150 | | "ONEZONE_IA"
|
151 | | "INTELLIGENT_TIERING"
|
152 | | "GLACIER"
|
153 | | "DEEP_ARCHIVE"
|
154 | | "OUTPOSTS"
|
155 | | "GLACIER_IR";
|
156 | }
|
157 |
|
158 | export interface S3ObjectStorageClassChangedNotificationEventDetail {
|
159 | version: "0";
|
160 | bucket: {
|
161 | name: string;
|
162 | };
|
163 | object: {
|
164 | key: string;
|
165 | size: number;
|
166 | "version-id": string;
|
167 | etag: string;
|
168 | };
|
169 | "request-id": string;
|
170 | requester: string;
|
171 | "destination-storage-class":
|
172 | | "STANDARD"
|
173 | | "REDUCED_REDUNDANCY"
|
174 | | "STANDARD_IA"
|
175 | | "ONEZONE_IA"
|
176 | | "INTELLIGENT_TIERING"
|
177 | | "GLACIER"
|
178 | | "DEEP_ARCHIVE"
|
179 | | "OUTPOSTS"
|
180 | | "GLACIER_IR";
|
181 | }
|
182 |
|
183 | export interface S3ObjectTagsAddedNotificationEventDetail {
|
184 | version: "0";
|
185 | bucket: {
|
186 | name: string;
|
187 | };
|
188 | object: {
|
189 | key: string;
|
190 | "version-id": string;
|
191 | etag: string;
|
192 | };
|
193 | "request-id": string;
|
194 | requester: string;
|
195 | "source-ip-address": string;
|
196 | }
|
197 |
|
198 | export interface S3ObjectTagsDeletedNotificationEventDetail {
|
199 | version: "0";
|
200 | bucket: {
|
201 | name: string;
|
202 | };
|
203 | object: {
|
204 | key: string;
|
205 | "version-id": string;
|
206 | etag: string;
|
207 | };
|
208 | "request-id": string;
|
209 | requester: string;
|
210 | "source-ip-address": string;
|
211 | }
|
212 |
|
213 | export interface S3ObjectAccessTierChangedNotificationEvent
|
214 | extends EventBridgeEvent<"Object Access Tier Changed", S3ObjectAccessTierChangedNotificationEventDetail>
|
215 | {
|
216 | source: "aws.s3";
|
217 | }
|
218 |
|
219 | export interface S3ObjectACLUpdatedNotificationEvent
|
220 | extends EventBridgeEvent<"Object ACL Updated", S3ObjectACLUpdatedNotificationEventDetail>
|
221 | {
|
222 | source: "aws.s3";
|
223 | }
|
224 |
|
225 | export interface S3ObjectCreatedNotificationEvent
|
226 | extends EventBridgeEvent<"Object Created", S3ObjectCreatedNotificationEventDetail>
|
227 | {
|
228 | source: "aws.s3";
|
229 | }
|
230 |
|
231 | export interface S3ObjectDeletedNotificationEvent
|
232 | extends EventBridgeEvent<"Object Deleted", S3ObjectDeletedNotificationEventDetail>
|
233 | {
|
234 | source: "aws.s3";
|
235 | }
|
236 |
|
237 | export interface S3ObjectRestoreCompletedNotificationEvent
|
238 | extends EventBridgeEvent<"Object Restore Completed", S3ObjectRestoreCompletedNotificationEventDetail>
|
239 | {
|
240 | source: "aws.s3";
|
241 | }
|
242 |
|
243 | export interface S3ObjectRestoreExpiredNotificationEvent
|
244 | extends EventBridgeEvent<"Object Restore Expired", S3ObjectRestoreExpiredNotificationEventDetail>
|
245 | {
|
246 | source: "aws.s3";
|
247 | }
|
248 |
|
249 | export interface S3ObjectRestoreInitiatedNotificationEvent
|
250 | extends EventBridgeEvent<"Object Restore Initiated", S3ObjectRestoreInitiatedNotificationEventDetail>
|
251 | {
|
252 | source: "aws.s3";
|
253 | }
|
254 |
|
255 | export interface S3ObjectStorageClassChangedNotificationEvent
|
256 | extends EventBridgeEvent<"Object Storage Class Changed", S3ObjectStorageClassChangedNotificationEventDetail>
|
257 | {
|
258 | source: "aws.s3";
|
259 | }
|
260 |
|
261 | export interface S3ObjectTagsAddedNotificationEvent
|
262 | extends EventBridgeEvent<"Object Tags Added", S3ObjectTagsAddedNotificationEventDetail>
|
263 | {
|
264 | source: "aws.s3";
|
265 | }
|
266 |
|
267 | export interface S3ObjectTagsDeletedNotificationEvent
|
268 | extends EventBridgeEvent<"Object Tags Deleted", S3ObjectTagsDeletedNotificationEventDetail>
|
269 | {
|
270 | source: "aws.s3";
|
271 | }
|
272 |
|
273 | export type S3NotificationEvent =
|
274 | | S3ObjectAccessTierChangedNotificationEvent
|
275 | | S3ObjectACLUpdatedNotificationEvent
|
276 | | S3ObjectCreatedNotificationEvent
|
277 | | S3ObjectDeletedNotificationEvent
|
278 | | S3ObjectRestoreCompletedNotificationEvent
|
279 | | S3ObjectRestoreExpiredNotificationEvent
|
280 | | S3ObjectRestoreInitiatedNotificationEvent
|
281 | | S3ObjectStorageClassChangedNotificationEvent
|
282 | | S3ObjectTagsAddedNotificationEvent
|
283 | | S3ObjectTagsDeletedNotificationEvent;
|
284 |
|
285 | export type S3NotificationEventBridgeHandler<EventType extends S3NotificationEvent = S3NotificationEvent> = Handler<
|
286 | EventBridgeEvent<EventType["detail-type"], EventType["detail"]> & {
|
287 | source: "aws.s3";
|
288 | },
|
289 | void
|
290 | >;
|