@gammarers/aws-secure-bucket 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/API.md ADDED
@@ -0,0 +1,1274 @@
1
+ # API Reference <a name="API Reference" id="api-reference"></a>
2
+
3
+ ## Constructs <a name="Constructs" id="Constructs"></a>
4
+
5
+ ### SecureBucket <a name="SecureBucket" id="@gammarers/aws-secure-bucket.SecureBucket"></a>
6
+
7
+ #### Initializers <a name="Initializers" id="@gammarers/aws-secure-bucket.SecureBucket.Initializer"></a>
8
+
9
+ ```typescript
10
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
11
+
12
+ new SecureBucket(scope: Construct, id: string, props?: SecureBucketProps)
13
+ ```
14
+
15
+ | **Name** | **Type** | **Description** |
16
+ | --- | --- | --- |
17
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.scope">scope</a></code> | <code>constructs.Construct</code> | *No description.* |
18
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.id">id</a></code> | <code>string</code> | *No description.* |
19
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.props">props</a></code> | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps">SecureBucketProps</a></code> | *No description.* |
20
+
21
+ ---
22
+
23
+ ##### `scope`<sup>Required</sup> <a name="scope" id="@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.scope"></a>
24
+
25
+ - *Type:* constructs.Construct
26
+
27
+ ---
28
+
29
+ ##### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.id"></a>
30
+
31
+ - *Type:* string
32
+
33
+ ---
34
+
35
+ ##### `props`<sup>Optional</sup> <a name="props" id="@gammarers/aws-secure-bucket.SecureBucket.Initializer.parameter.props"></a>
36
+
37
+ - *Type:* <a href="#@gammarers/aws-secure-bucket.SecureBucketProps">SecureBucketProps</a>
38
+
39
+ ---
40
+
41
+ #### Methods <a name="Methods" id="Methods"></a>
42
+
43
+ | **Name** | **Description** |
44
+ | --- | --- |
45
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.toString">toString</a></code> | Returns a string representation of this construct. |
46
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.applyRemovalPolicy">applyRemovalPolicy</a></code> | Apply the given removal policy to this resource. |
47
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addEventNotification">addEventNotification</a></code> | Adds a bucket notification event destination. |
48
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addObjectCreatedNotification">addObjectCreatedNotification</a></code> | Subscribes a destination to receive notifications when an object is created in the bucket. |
49
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addObjectRemovedNotification">addObjectRemovedNotification</a></code> | Subscribes a destination to receive notifications when an object is removed from the bucket. |
50
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addToResourcePolicy">addToResourcePolicy</a></code> | Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this bucket and/or its contents. Use `bucketArn` and `arnForObjects(keys)` to obtain ARNs for this bucket or objects. |
51
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.arnForObjects">arnForObjects</a></code> | Returns an ARN that represents all objects within the bucket that match the key pattern specified. |
52
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.enableEventBridgeNotification">enableEventBridgeNotification</a></code> | Enables event bridge notification, causing all events below to be sent to EventBridge:. |
53
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantDelete">grantDelete</a></code> | Grants s3:DeleteObject* permission to an IAM principal for objects in this bucket. |
54
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantPublicAccess">grantPublicAccess</a></code> | Allows unrestricted access to objects from this bucket. |
55
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantPut">grantPut</a></code> | Grants s3:PutObject* and s3:Abort* permissions for this bucket to an IAM principal. |
56
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantPutAcl">grantPutAcl</a></code> | Grant the given IAM identity permissions to modify the ACLs of objects in the given Bucket. |
57
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantRead">grantRead</a></code> | Grant read permissions for this bucket and it's contents to an IAM principal (Role/Group/User). |
58
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantReadWrite">grantReadWrite</a></code> | Grants read/write permissions for this bucket and it's contents to an IAM principal (Role/Group/User). |
59
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.grantWrite">grantWrite</a></code> | Grant write permissions to this bucket to an IAM principal. |
60
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailEvent">onCloudTrailEvent</a></code> | Define a CloudWatch event that triggers when something happens to this repository. |
61
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailPutObject">onCloudTrailPutObject</a></code> | Defines an AWS CloudWatch event that triggers when an object is uploaded to the specified paths (keys) in this bucket using the PutObject API call. |
62
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailWriteObject">onCloudTrailWriteObject</a></code> | Defines an AWS CloudWatch event that triggers when an object at the specified paths (keys) in this bucket are written to. |
63
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.s3UrlForObject">s3UrlForObject</a></code> | The S3 URL of an S3 object. For example:. |
64
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.transferAccelerationUrlForObject">transferAccelerationUrlForObject</a></code> | The https Transfer Acceleration URL of an S3 object. |
65
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.urlForObject">urlForObject</a></code> | The https URL of an S3 object. Specify `regional: false` at the options for non-regional URLs. For example:. |
66
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.virtualHostedUrlForObject">virtualHostedUrlForObject</a></code> | The virtual hosted-style URL of an S3 object. Specify `regional: false` at the options for non-regional URL. For example:. |
67
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addCorsRule">addCorsRule</a></code> | Adds a cross-origin access configuration for objects in an Amazon S3 bucket. |
68
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addInventory">addInventory</a></code> | Add an inventory configuration. |
69
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addLifecycleRule">addLifecycleRule</a></code> | Add a lifecycle rule to the bucket. |
70
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.addMetric">addMetric</a></code> | Adds a metrics configuration for the CloudWatch request metrics from the bucket. |
71
+
72
+ ---
73
+
74
+ ##### `toString` <a name="toString" id="@gammarers/aws-secure-bucket.SecureBucket.toString"></a>
75
+
76
+ ```typescript
77
+ public toString(): string
78
+ ```
79
+
80
+ Returns a string representation of this construct.
81
+
82
+ ##### `applyRemovalPolicy` <a name="applyRemovalPolicy" id="@gammarers/aws-secure-bucket.SecureBucket.applyRemovalPolicy"></a>
83
+
84
+ ```typescript
85
+ public applyRemovalPolicy(policy: RemovalPolicy): void
86
+ ```
87
+
88
+ Apply the given removal policy to this resource.
89
+
90
+ The Removal Policy controls what happens to this resource when it stops
91
+ being managed by CloudFormation, either because you've removed it from the
92
+ CDK application or because you've made a change that requires the resource
93
+ to be replaced.
94
+
95
+ The resource can be deleted (`RemovalPolicy.DESTROY`), or left in your AWS
96
+ account for data recovery and cleanup later (`RemovalPolicy.RETAIN`).
97
+
98
+ ###### `policy`<sup>Required</sup> <a name="policy" id="@gammarers/aws-secure-bucket.SecureBucket.applyRemovalPolicy.parameter.policy"></a>
99
+
100
+ - *Type:* aws-cdk-lib.RemovalPolicy
101
+
102
+ ---
103
+
104
+ ##### `addEventNotification` <a name="addEventNotification" id="@gammarers/aws-secure-bucket.SecureBucket.addEventNotification"></a>
105
+
106
+ ```typescript
107
+ public addEventNotification(event: EventType, dest: IBucketNotificationDestination, filters: NotificationKeyFilter): void
108
+ ```
109
+
110
+ Adds a bucket notification event destination.
111
+
112
+ > [https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html)
113
+
114
+ *Example*
115
+
116
+ ```typescript
117
+ declare const myLambda: lambda.Function;
118
+ const bucket = new s3.Bucket(this, 'MyBucket');
119
+ bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.LambdaDestination(myLambda), {prefix: 'home/myusername/*'});
120
+ ```
121
+
122
+
123
+ ###### `event`<sup>Required</sup> <a name="event" id="@gammarers/aws-secure-bucket.SecureBucket.addEventNotification.parameter.event"></a>
124
+
125
+ - *Type:* aws-cdk-lib.aws_s3.EventType
126
+
127
+ The event to trigger the notification.
128
+
129
+ ---
130
+
131
+ ###### `dest`<sup>Required</sup> <a name="dest" id="@gammarers/aws-secure-bucket.SecureBucket.addEventNotification.parameter.dest"></a>
132
+
133
+ - *Type:* aws-cdk-lib.aws_s3.IBucketNotificationDestination
134
+
135
+ The notification destination (Lambda, SNS Topic or SQS Queue).
136
+
137
+ ---
138
+
139
+ ###### `filters`<sup>Required</sup> <a name="filters" id="@gammarers/aws-secure-bucket.SecureBucket.addEventNotification.parameter.filters"></a>
140
+
141
+ - *Type:* aws-cdk-lib.aws_s3.NotificationKeyFilter
142
+
143
+ S3 object key filter rules to determine which objects trigger this event.
144
+
145
+ Each filter must include a `prefix` and/or `suffix`
146
+ that will be matched against the s3 object key. Refer to the S3 Developer Guide
147
+ for details about allowed filter rules.
148
+
149
+ ---
150
+
151
+ ##### `addObjectCreatedNotification` <a name="addObjectCreatedNotification" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectCreatedNotification"></a>
152
+
153
+ ```typescript
154
+ public addObjectCreatedNotification(dest: IBucketNotificationDestination, filters: NotificationKeyFilter): void
155
+ ```
156
+
157
+ Subscribes a destination to receive notifications when an object is created in the bucket.
158
+
159
+ This is identical to calling
160
+ `onEvent(EventType.OBJECT_CREATED)`.
161
+
162
+ ###### `dest`<sup>Required</sup> <a name="dest" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectCreatedNotification.parameter.dest"></a>
163
+
164
+ - *Type:* aws-cdk-lib.aws_s3.IBucketNotificationDestination
165
+
166
+ The notification destination (see onEvent).
167
+
168
+ ---
169
+
170
+ ###### `filters`<sup>Required</sup> <a name="filters" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectCreatedNotification.parameter.filters"></a>
171
+
172
+ - *Type:* aws-cdk-lib.aws_s3.NotificationKeyFilter
173
+
174
+ Filters (see onEvent).
175
+
176
+ ---
177
+
178
+ ##### `addObjectRemovedNotification` <a name="addObjectRemovedNotification" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectRemovedNotification"></a>
179
+
180
+ ```typescript
181
+ public addObjectRemovedNotification(dest: IBucketNotificationDestination, filters: NotificationKeyFilter): void
182
+ ```
183
+
184
+ Subscribes a destination to receive notifications when an object is removed from the bucket.
185
+
186
+ This is identical to calling
187
+ `onEvent(EventType.OBJECT_REMOVED)`.
188
+
189
+ ###### `dest`<sup>Required</sup> <a name="dest" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectRemovedNotification.parameter.dest"></a>
190
+
191
+ - *Type:* aws-cdk-lib.aws_s3.IBucketNotificationDestination
192
+
193
+ The notification destination (see onEvent).
194
+
195
+ ---
196
+
197
+ ###### `filters`<sup>Required</sup> <a name="filters" id="@gammarers/aws-secure-bucket.SecureBucket.addObjectRemovedNotification.parameter.filters"></a>
198
+
199
+ - *Type:* aws-cdk-lib.aws_s3.NotificationKeyFilter
200
+
201
+ Filters (see onEvent).
202
+
203
+ ---
204
+
205
+ ##### `addToResourcePolicy` <a name="addToResourcePolicy" id="@gammarers/aws-secure-bucket.SecureBucket.addToResourcePolicy"></a>
206
+
207
+ ```typescript
208
+ public addToResourcePolicy(permission: PolicyStatement): AddToResourcePolicyResult
209
+ ```
210
+
211
+ Adds a statement to the resource policy for a principal (i.e. account/role/service) to perform actions on this bucket and/or its contents. Use `bucketArn` and `arnForObjects(keys)` to obtain ARNs for this bucket or objects.
212
+
213
+ Note that the policy statement may or may not be added to the policy.
214
+ For example, when an `IBucket` is created from an existing bucket,
215
+ it's not possible to tell whether the bucket already has a policy
216
+ attached, let alone to re-use that policy to add more statements to it.
217
+ So it's safest to do nothing in these cases.
218
+
219
+ ###### `permission`<sup>Required</sup> <a name="permission" id="@gammarers/aws-secure-bucket.SecureBucket.addToResourcePolicy.parameter.permission"></a>
220
+
221
+ - *Type:* aws-cdk-lib.aws_iam.PolicyStatement
222
+
223
+ the policy statement to be added to the bucket's policy.
224
+
225
+ ---
226
+
227
+ ##### `arnForObjects` <a name="arnForObjects" id="@gammarers/aws-secure-bucket.SecureBucket.arnForObjects"></a>
228
+
229
+ ```typescript
230
+ public arnForObjects(keyPattern: string): string
231
+ ```
232
+
233
+ Returns an ARN that represents all objects within the bucket that match the key pattern specified.
234
+
235
+ To represent all keys, specify ``"*"``.
236
+
237
+ If you need to specify a keyPattern with multiple components, concatenate them into a single string, e.g.:
238
+
239
+ arnForObjects(`home/${team}/${user}/*`)
240
+
241
+ ###### `keyPattern`<sup>Required</sup> <a name="keyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.arnForObjects.parameter.keyPattern"></a>
242
+
243
+ - *Type:* string
244
+
245
+ ---
246
+
247
+ ##### `enableEventBridgeNotification` <a name="enableEventBridgeNotification" id="@gammarers/aws-secure-bucket.SecureBucket.enableEventBridgeNotification"></a>
248
+
249
+ ```typescript
250
+ public enableEventBridgeNotification(): void
251
+ ```
252
+
253
+ Enables event bridge notification, causing all events below to be sent to EventBridge:.
254
+
255
+ Object Deleted (DeleteObject)
256
+ - Object Deleted (Lifecycle expiration)
257
+ - Object Restore Initiated
258
+ - Object Restore Completed
259
+ - Object Restore Expired
260
+ - Object Storage Class Changed
261
+ - Object Access Tier Changed
262
+ - Object ACL Updated
263
+ - Object Tags Added
264
+ - Object Tags Deleted
265
+
266
+ ##### `grantDelete` <a name="grantDelete" id="@gammarers/aws-secure-bucket.SecureBucket.grantDelete"></a>
267
+
268
+ ```typescript
269
+ public grantDelete(identity: IGrantable, objectsKeyPattern?: any): Grant
270
+ ```
271
+
272
+ Grants s3:DeleteObject* permission to an IAM principal for objects in this bucket.
273
+
274
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantDelete.parameter.identity"></a>
275
+
276
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
277
+
278
+ The principal.
279
+
280
+ ---
281
+
282
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantDelete.parameter.objectsKeyPattern"></a>
283
+
284
+ - *Type:* any
285
+
286
+ Restrict the permission to a certain key pattern (default '*').
287
+
288
+ ---
289
+
290
+ ##### `grantPublicAccess` <a name="grantPublicAccess" id="@gammarers/aws-secure-bucket.SecureBucket.grantPublicAccess"></a>
291
+
292
+ ```typescript
293
+ public grantPublicAccess(allowedActions: string, keyPrefix?: string): Grant
294
+ ```
295
+
296
+ Allows unrestricted access to objects from this bucket.
297
+
298
+ IMPORTANT: This permission allows anyone to perform actions on S3 objects
299
+ in this bucket, which is useful for when you configure your bucket as a
300
+ website and want everyone to be able to read objects in the bucket without
301
+ needing to authenticate.
302
+
303
+ Without arguments, this method will grant read ("s3:GetObject") access to
304
+ all objects ("*") in the bucket.
305
+
306
+ The method returns the `iam.Grant` object, which can then be modified
307
+ as needed. For example, you can add a condition that will restrict access only
308
+ to an IPv4 range like this:
309
+
310
+ const grant = bucket.grantPublicAccess();
311
+ grant.resourceStatement!.addCondition(‘IpAddress’, { “aws:SourceIp”: “54.240.143.0/24” });
312
+
313
+ Note that if this `IBucket` refers to an existing bucket, possibly not
314
+ managed by CloudFormation, this method will have no effect, since it's
315
+ impossible to modify the policy of an existing bucket.
316
+
317
+ ###### `allowedActions`<sup>Required</sup> <a name="allowedActions" id="@gammarers/aws-secure-bucket.SecureBucket.grantPublicAccess.parameter.allowedActions"></a>
318
+
319
+ - *Type:* string
320
+
321
+ the set of S3 actions to allow.
322
+
323
+ Default is "s3:GetObject".
324
+
325
+ ---
326
+
327
+ ###### `keyPrefix`<sup>Optional</sup> <a name="keyPrefix" id="@gammarers/aws-secure-bucket.SecureBucket.grantPublicAccess.parameter.keyPrefix"></a>
328
+
329
+ - *Type:* string
330
+
331
+ the prefix of S3 object keys (e.g. `home/*`). Default is "*".
332
+
333
+ ---
334
+
335
+ ##### `grantPut` <a name="grantPut" id="@gammarers/aws-secure-bucket.SecureBucket.grantPut"></a>
336
+
337
+ ```typescript
338
+ public grantPut(identity: IGrantable, objectsKeyPattern?: any): Grant
339
+ ```
340
+
341
+ Grants s3:PutObject* and s3:Abort* permissions for this bucket to an IAM principal.
342
+
343
+ If encryption is used, permission to use the key to encrypt the contents
344
+ of written files will also be granted to the same principal.
345
+
346
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantPut.parameter.identity"></a>
347
+
348
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
349
+
350
+ The principal.
351
+
352
+ ---
353
+
354
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantPut.parameter.objectsKeyPattern"></a>
355
+
356
+ - *Type:* any
357
+
358
+ Restrict the permission to a certain key pattern (default '*').
359
+
360
+ ---
361
+
362
+ ##### `grantPutAcl` <a name="grantPutAcl" id="@gammarers/aws-secure-bucket.SecureBucket.grantPutAcl"></a>
363
+
364
+ ```typescript
365
+ public grantPutAcl(identity: IGrantable, objectsKeyPattern?: string): Grant
366
+ ```
367
+
368
+ Grant the given IAM identity permissions to modify the ACLs of objects in the given Bucket.
369
+
370
+ If your application has the '@aws-cdk/aws-s3:grantWriteWithoutAcl' feature flag set,
371
+ calling `grantWrite` or `grantReadWrite` no longer grants permissions to modify the ACLs of the objects;
372
+ in this case, if you need to modify object ACLs, call this method explicitly.
373
+
374
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantPutAcl.parameter.identity"></a>
375
+
376
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
377
+
378
+ ---
379
+
380
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantPutAcl.parameter.objectsKeyPattern"></a>
381
+
382
+ - *Type:* string
383
+
384
+ ---
385
+
386
+ ##### `grantRead` <a name="grantRead" id="@gammarers/aws-secure-bucket.SecureBucket.grantRead"></a>
387
+
388
+ ```typescript
389
+ public grantRead(identity: IGrantable, objectsKeyPattern?: any): Grant
390
+ ```
391
+
392
+ Grant read permissions for this bucket and it's contents to an IAM principal (Role/Group/User).
393
+
394
+ If encryption is used, permission to use the key to decrypt the contents
395
+ of the bucket will also be granted to the same principal.
396
+
397
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantRead.parameter.identity"></a>
398
+
399
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
400
+
401
+ The principal.
402
+
403
+ ---
404
+
405
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantRead.parameter.objectsKeyPattern"></a>
406
+
407
+ - *Type:* any
408
+
409
+ Restrict the permission to a certain key pattern (default '*').
410
+
411
+ ---
412
+
413
+ ##### `grantReadWrite` <a name="grantReadWrite" id="@gammarers/aws-secure-bucket.SecureBucket.grantReadWrite"></a>
414
+
415
+ ```typescript
416
+ public grantReadWrite(identity: IGrantable, objectsKeyPattern?: any): Grant
417
+ ```
418
+
419
+ Grants read/write permissions for this bucket and it's contents to an IAM principal (Role/Group/User).
420
+
421
+ If an encryption key is used, permission to use the key for
422
+ encrypt/decrypt will also be granted.
423
+
424
+ Before CDK version 1.85.0, this method granted the `s3:PutObject*` permission that included `s3:PutObjectAcl`,
425
+ which could be used to grant read/write object access to IAM principals in other accounts.
426
+ If you want to get rid of that behavior, update your CDK version to 1.85.0 or later,
427
+ and make sure the `@aws-cdk/aws-s3:grantWriteWithoutAcl` feature flag is set to `true`
428
+ in the `context` key of your cdk.json file.
429
+ If you've already updated, but still need the principal to have permissions to modify the ACLs,
430
+ use the `grantPutAcl` method.
431
+
432
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantReadWrite.parameter.identity"></a>
433
+
434
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
435
+
436
+ ---
437
+
438
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantReadWrite.parameter.objectsKeyPattern"></a>
439
+
440
+ - *Type:* any
441
+
442
+ ---
443
+
444
+ ##### `grantWrite` <a name="grantWrite" id="@gammarers/aws-secure-bucket.SecureBucket.grantWrite"></a>
445
+
446
+ ```typescript
447
+ public grantWrite(identity: IGrantable, objectsKeyPattern?: any, allowedActionPatterns?: string[]): Grant
448
+ ```
449
+
450
+ Grant write permissions to this bucket to an IAM principal.
451
+
452
+ If encryption is used, permission to use the key to encrypt the contents
453
+ of written files will also be granted to the same principal.
454
+
455
+ Before CDK version 1.85.0, this method granted the `s3:PutObject*` permission that included `s3:PutObjectAcl`,
456
+ which could be used to grant read/write object access to IAM principals in other accounts.
457
+ If you want to get rid of that behavior, update your CDK version to 1.85.0 or later,
458
+ and make sure the `@aws-cdk/aws-s3:grantWriteWithoutAcl` feature flag is set to `true`
459
+ in the `context` key of your cdk.json file.
460
+ If you've already updated, but still need the principal to have permissions to modify the ACLs,
461
+ use the `grantPutAcl` method.
462
+
463
+ ###### `identity`<sup>Required</sup> <a name="identity" id="@gammarers/aws-secure-bucket.SecureBucket.grantWrite.parameter.identity"></a>
464
+
465
+ - *Type:* aws-cdk-lib.aws_iam.IGrantable
466
+
467
+ ---
468
+
469
+ ###### `objectsKeyPattern`<sup>Optional</sup> <a name="objectsKeyPattern" id="@gammarers/aws-secure-bucket.SecureBucket.grantWrite.parameter.objectsKeyPattern"></a>
470
+
471
+ - *Type:* any
472
+
473
+ ---
474
+
475
+ ###### `allowedActionPatterns`<sup>Optional</sup> <a name="allowedActionPatterns" id="@gammarers/aws-secure-bucket.SecureBucket.grantWrite.parameter.allowedActionPatterns"></a>
476
+
477
+ - *Type:* string[]
478
+
479
+ ---
480
+
481
+ ##### `onCloudTrailEvent` <a name="onCloudTrailEvent" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailEvent"></a>
482
+
483
+ ```typescript
484
+ public onCloudTrailEvent(id: string, options?: OnCloudTrailBucketEventOptions): Rule
485
+ ```
486
+
487
+ Define a CloudWatch event that triggers when something happens to this repository.
488
+
489
+ Requires that there exists at least one CloudTrail Trail in your account
490
+ that captures the event. This method will not create the Trail.
491
+
492
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailEvent.parameter.id"></a>
493
+
494
+ - *Type:* string
495
+
496
+ The id of the rule.
497
+
498
+ ---
499
+
500
+ ###### `options`<sup>Optional</sup> <a name="options" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailEvent.parameter.options"></a>
501
+
502
+ - *Type:* aws-cdk-lib.aws_s3.OnCloudTrailBucketEventOptions
503
+
504
+ Options for adding the rule.
505
+
506
+ ---
507
+
508
+ ##### `onCloudTrailPutObject` <a name="onCloudTrailPutObject" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailPutObject"></a>
509
+
510
+ ```typescript
511
+ public onCloudTrailPutObject(id: string, options?: OnCloudTrailBucketEventOptions): Rule
512
+ ```
513
+
514
+ Defines an AWS CloudWatch event that triggers when an object is uploaded to the specified paths (keys) in this bucket using the PutObject API call.
515
+
516
+ Note that some tools like `aws s3 cp` will automatically use either
517
+ PutObject or the multipart upload API depending on the file size,
518
+ so using `onCloudTrailWriteObject` may be preferable.
519
+
520
+ Requires that there exists at least one CloudTrail Trail in your account
521
+ that captures the event. This method will not create the Trail.
522
+
523
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailPutObject.parameter.id"></a>
524
+
525
+ - *Type:* string
526
+
527
+ The id of the rule.
528
+
529
+ ---
530
+
531
+ ###### `options`<sup>Optional</sup> <a name="options" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailPutObject.parameter.options"></a>
532
+
533
+ - *Type:* aws-cdk-lib.aws_s3.OnCloudTrailBucketEventOptions
534
+
535
+ Options for adding the rule.
536
+
537
+ ---
538
+
539
+ ##### `onCloudTrailWriteObject` <a name="onCloudTrailWriteObject" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailWriteObject"></a>
540
+
541
+ ```typescript
542
+ public onCloudTrailWriteObject(id: string, options?: OnCloudTrailBucketEventOptions): Rule
543
+ ```
544
+
545
+ Defines an AWS CloudWatch event that triggers when an object at the specified paths (keys) in this bucket are written to.
546
+
547
+ This includes
548
+ the events PutObject, CopyObject, and CompleteMultipartUpload.
549
+
550
+ Note that some tools like `aws s3 cp` will automatically use either
551
+ PutObject or the multipart upload API depending on the file size,
552
+ so using this method may be preferable to `onCloudTrailPutObject`.
553
+
554
+ Requires that there exists at least one CloudTrail Trail in your account
555
+ that captures the event. This method will not create the Trail.
556
+
557
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailWriteObject.parameter.id"></a>
558
+
559
+ - *Type:* string
560
+
561
+ The id of the rule.
562
+
563
+ ---
564
+
565
+ ###### `options`<sup>Optional</sup> <a name="options" id="@gammarers/aws-secure-bucket.SecureBucket.onCloudTrailWriteObject.parameter.options"></a>
566
+
567
+ - *Type:* aws-cdk-lib.aws_s3.OnCloudTrailBucketEventOptions
568
+
569
+ Options for adding the rule.
570
+
571
+ ---
572
+
573
+ ##### `s3UrlForObject` <a name="s3UrlForObject" id="@gammarers/aws-secure-bucket.SecureBucket.s3UrlForObject"></a>
574
+
575
+ ```typescript
576
+ public s3UrlForObject(key?: string): string
577
+ ```
578
+
579
+ The S3 URL of an S3 object. For example:.
580
+
581
+ `s3://onlybucket`
582
+ - `s3://bucket/key`
583
+
584
+ ###### `key`<sup>Optional</sup> <a name="key" id="@gammarers/aws-secure-bucket.SecureBucket.s3UrlForObject.parameter.key"></a>
585
+
586
+ - *Type:* string
587
+
588
+ The S3 key of the object.
589
+
590
+ If not specified, the S3 URL of the
591
+ bucket is returned.
592
+
593
+ ---
594
+
595
+ ##### `transferAccelerationUrlForObject` <a name="transferAccelerationUrlForObject" id="@gammarers/aws-secure-bucket.SecureBucket.transferAccelerationUrlForObject"></a>
596
+
597
+ ```typescript
598
+ public transferAccelerationUrlForObject(key?: string, options?: TransferAccelerationUrlOptions): string
599
+ ```
600
+
601
+ The https Transfer Acceleration URL of an S3 object.
602
+
603
+ Specify `dualStack: true` at the options
604
+ for dual-stack endpoint (connect to the bucket over IPv6). For example:
605
+
606
+ - `https://bucket.s3-accelerate.amazonaws.com`
607
+ - `https://bucket.s3-accelerate.amazonaws.com/key`
608
+
609
+ ###### `key`<sup>Optional</sup> <a name="key" id="@gammarers/aws-secure-bucket.SecureBucket.transferAccelerationUrlForObject.parameter.key"></a>
610
+
611
+ - *Type:* string
612
+
613
+ The S3 key of the object.
614
+
615
+ If not specified, the URL of the
616
+ bucket is returned.
617
+
618
+ ---
619
+
620
+ ###### `options`<sup>Optional</sup> <a name="options" id="@gammarers/aws-secure-bucket.SecureBucket.transferAccelerationUrlForObject.parameter.options"></a>
621
+
622
+ - *Type:* aws-cdk-lib.aws_s3.TransferAccelerationUrlOptions
623
+
624
+ Options for generating URL.
625
+
626
+ ---
627
+
628
+ ##### `urlForObject` <a name="urlForObject" id="@gammarers/aws-secure-bucket.SecureBucket.urlForObject"></a>
629
+
630
+ ```typescript
631
+ public urlForObject(key?: string): string
632
+ ```
633
+
634
+ The https URL of an S3 object. Specify `regional: false` at the options for non-regional URLs. For example:.
635
+
636
+ `https://s3.us-west-1.amazonaws.com/onlybucket`
637
+ - `https://s3.us-west-1.amazonaws.com/bucket/key`
638
+ - `https://s3.cn-north-1.amazonaws.com.cn/china-bucket/mykey`
639
+
640
+ ###### `key`<sup>Optional</sup> <a name="key" id="@gammarers/aws-secure-bucket.SecureBucket.urlForObject.parameter.key"></a>
641
+
642
+ - *Type:* string
643
+
644
+ The S3 key of the object.
645
+
646
+ If not specified, the URL of the
647
+ bucket is returned.
648
+
649
+ ---
650
+
651
+ ##### `virtualHostedUrlForObject` <a name="virtualHostedUrlForObject" id="@gammarers/aws-secure-bucket.SecureBucket.virtualHostedUrlForObject"></a>
652
+
653
+ ```typescript
654
+ public virtualHostedUrlForObject(key?: string, options?: VirtualHostedStyleUrlOptions): string
655
+ ```
656
+
657
+ The virtual hosted-style URL of an S3 object. Specify `regional: false` at the options for non-regional URL. For example:.
658
+
659
+ `https://only-bucket.s3.us-west-1.amazonaws.com`
660
+ - `https://bucket.s3.us-west-1.amazonaws.com/key`
661
+ - `https://bucket.s3.amazonaws.com/key`
662
+ - `https://china-bucket.s3.cn-north-1.amazonaws.com.cn/mykey`
663
+
664
+ ###### `key`<sup>Optional</sup> <a name="key" id="@gammarers/aws-secure-bucket.SecureBucket.virtualHostedUrlForObject.parameter.key"></a>
665
+
666
+ - *Type:* string
667
+
668
+ The S3 key of the object.
669
+
670
+ If not specified, the URL of the
671
+ bucket is returned.
672
+
673
+ ---
674
+
675
+ ###### `options`<sup>Optional</sup> <a name="options" id="@gammarers/aws-secure-bucket.SecureBucket.virtualHostedUrlForObject.parameter.options"></a>
676
+
677
+ - *Type:* aws-cdk-lib.aws_s3.VirtualHostedStyleUrlOptions
678
+
679
+ Options for generating URL.
680
+
681
+ ---
682
+
683
+ ##### `addCorsRule` <a name="addCorsRule" id="@gammarers/aws-secure-bucket.SecureBucket.addCorsRule"></a>
684
+
685
+ ```typescript
686
+ public addCorsRule(rule: CorsRule): void
687
+ ```
688
+
689
+ Adds a cross-origin access configuration for objects in an Amazon S3 bucket.
690
+
691
+ ###### `rule`<sup>Required</sup> <a name="rule" id="@gammarers/aws-secure-bucket.SecureBucket.addCorsRule.parameter.rule"></a>
692
+
693
+ - *Type:* aws-cdk-lib.aws_s3.CorsRule
694
+
695
+ The CORS configuration rule to add.
696
+
697
+ ---
698
+
699
+ ##### `addInventory` <a name="addInventory" id="@gammarers/aws-secure-bucket.SecureBucket.addInventory"></a>
700
+
701
+ ```typescript
702
+ public addInventory(inventory: Inventory): void
703
+ ```
704
+
705
+ Add an inventory configuration.
706
+
707
+ ###### `inventory`<sup>Required</sup> <a name="inventory" id="@gammarers/aws-secure-bucket.SecureBucket.addInventory.parameter.inventory"></a>
708
+
709
+ - *Type:* aws-cdk-lib.aws_s3.Inventory
710
+
711
+ configuration to add.
712
+
713
+ ---
714
+
715
+ ##### `addLifecycleRule` <a name="addLifecycleRule" id="@gammarers/aws-secure-bucket.SecureBucket.addLifecycleRule"></a>
716
+
717
+ ```typescript
718
+ public addLifecycleRule(rule: LifecycleRule): void
719
+ ```
720
+
721
+ Add a lifecycle rule to the bucket.
722
+
723
+ ###### `rule`<sup>Required</sup> <a name="rule" id="@gammarers/aws-secure-bucket.SecureBucket.addLifecycleRule.parameter.rule"></a>
724
+
725
+ - *Type:* aws-cdk-lib.aws_s3.LifecycleRule
726
+
727
+ The rule to add.
728
+
729
+ ---
730
+
731
+ ##### `addMetric` <a name="addMetric" id="@gammarers/aws-secure-bucket.SecureBucket.addMetric"></a>
732
+
733
+ ```typescript
734
+ public addMetric(metric: BucketMetrics): void
735
+ ```
736
+
737
+ Adds a metrics configuration for the CloudWatch request metrics from the bucket.
738
+
739
+ ###### `metric`<sup>Required</sup> <a name="metric" id="@gammarers/aws-secure-bucket.SecureBucket.addMetric.parameter.metric"></a>
740
+
741
+ - *Type:* aws-cdk-lib.aws_s3.BucketMetrics
742
+
743
+ The metric configuration to add.
744
+
745
+ ---
746
+
747
+ #### Static Functions <a name="Static Functions" id="Static Functions"></a>
748
+
749
+ | **Name** | **Description** |
750
+ | --- | --- |
751
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.isConstruct">isConstruct</a></code> | Checks if `x` is a construct. |
752
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.isOwnedResource">isOwnedResource</a></code> | Returns true if the construct was created by CDK, and false otherwise. |
753
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.isResource">isResource</a></code> | Check whether the given construct is a Resource. |
754
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.fromBucketArn">fromBucketArn</a></code> | *No description.* |
755
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.fromBucketAttributes">fromBucketAttributes</a></code> | Creates a Bucket construct that represents an external bucket. |
756
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.fromBucketName">fromBucketName</a></code> | *No description.* |
757
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.fromCfnBucket">fromCfnBucket</a></code> | Create a mutable `IBucket` based on a low-level `CfnBucket`. |
758
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.validateBucketName">validateBucketName</a></code> | Thrown an exception if the given bucket name is not valid. |
759
+
760
+ ---
761
+
762
+ ##### ~~`isConstruct`~~ <a name="isConstruct" id="@gammarers/aws-secure-bucket.SecureBucket.isConstruct"></a>
763
+
764
+ ```typescript
765
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
766
+
767
+ SecureBucket.isConstruct(x: any)
768
+ ```
769
+
770
+ Checks if `x` is a construct.
771
+
772
+ ###### `x`<sup>Required</sup> <a name="x" id="@gammarers/aws-secure-bucket.SecureBucket.isConstruct.parameter.x"></a>
773
+
774
+ - *Type:* any
775
+
776
+ Any object.
777
+
778
+ ---
779
+
780
+ ##### `isOwnedResource` <a name="isOwnedResource" id="@gammarers/aws-secure-bucket.SecureBucket.isOwnedResource"></a>
781
+
782
+ ```typescript
783
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
784
+
785
+ SecureBucket.isOwnedResource(construct: IConstruct)
786
+ ```
787
+
788
+ Returns true if the construct was created by CDK, and false otherwise.
789
+
790
+ ###### `construct`<sup>Required</sup> <a name="construct" id="@gammarers/aws-secure-bucket.SecureBucket.isOwnedResource.parameter.construct"></a>
791
+
792
+ - *Type:* constructs.IConstruct
793
+
794
+ ---
795
+
796
+ ##### `isResource` <a name="isResource" id="@gammarers/aws-secure-bucket.SecureBucket.isResource"></a>
797
+
798
+ ```typescript
799
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
800
+
801
+ SecureBucket.isResource(construct: IConstruct)
802
+ ```
803
+
804
+ Check whether the given construct is a Resource.
805
+
806
+ ###### `construct`<sup>Required</sup> <a name="construct" id="@gammarers/aws-secure-bucket.SecureBucket.isResource.parameter.construct"></a>
807
+
808
+ - *Type:* constructs.IConstruct
809
+
810
+ ---
811
+
812
+ ##### `fromBucketArn` <a name="fromBucketArn" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketArn"></a>
813
+
814
+ ```typescript
815
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
816
+
817
+ SecureBucket.fromBucketArn(scope: Construct, id: string, bucketArn: string)
818
+ ```
819
+
820
+ ###### `scope`<sup>Required</sup> <a name="scope" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketArn.parameter.scope"></a>
821
+
822
+ - *Type:* constructs.Construct
823
+
824
+ ---
825
+
826
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketArn.parameter.id"></a>
827
+
828
+ - *Type:* string
829
+
830
+ ---
831
+
832
+ ###### `bucketArn`<sup>Required</sup> <a name="bucketArn" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketArn.parameter.bucketArn"></a>
833
+
834
+ - *Type:* string
835
+
836
+ ---
837
+
838
+ ##### `fromBucketAttributes` <a name="fromBucketAttributes" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketAttributes"></a>
839
+
840
+ ```typescript
841
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
842
+
843
+ SecureBucket.fromBucketAttributes(scope: Construct, id: string, attrs: BucketAttributes)
844
+ ```
845
+
846
+ Creates a Bucket construct that represents an external bucket.
847
+
848
+ ###### `scope`<sup>Required</sup> <a name="scope" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketAttributes.parameter.scope"></a>
849
+
850
+ - *Type:* constructs.Construct
851
+
852
+ The parent creating construct (usually `this`).
853
+
854
+ ---
855
+
856
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketAttributes.parameter.id"></a>
857
+
858
+ - *Type:* string
859
+
860
+ The construct's name.
861
+
862
+ ---
863
+
864
+ ###### `attrs`<sup>Required</sup> <a name="attrs" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketAttributes.parameter.attrs"></a>
865
+
866
+ - *Type:* aws-cdk-lib.aws_s3.BucketAttributes
867
+
868
+ A `BucketAttributes` object.
869
+
870
+ Can be obtained from a call to
871
+ `bucket.export()` or manually created.
872
+
873
+ ---
874
+
875
+ ##### `fromBucketName` <a name="fromBucketName" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketName"></a>
876
+
877
+ ```typescript
878
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
879
+
880
+ SecureBucket.fromBucketName(scope: Construct, id: string, bucketName: string)
881
+ ```
882
+
883
+ ###### `scope`<sup>Required</sup> <a name="scope" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketName.parameter.scope"></a>
884
+
885
+ - *Type:* constructs.Construct
886
+
887
+ ---
888
+
889
+ ###### `id`<sup>Required</sup> <a name="id" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketName.parameter.id"></a>
890
+
891
+ - *Type:* string
892
+
893
+ ---
894
+
895
+ ###### `bucketName`<sup>Required</sup> <a name="bucketName" id="@gammarers/aws-secure-bucket.SecureBucket.fromBucketName.parameter.bucketName"></a>
896
+
897
+ - *Type:* string
898
+
899
+ ---
900
+
901
+ ##### `fromCfnBucket` <a name="fromCfnBucket" id="@gammarers/aws-secure-bucket.SecureBucket.fromCfnBucket"></a>
902
+
903
+ ```typescript
904
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
905
+
906
+ SecureBucket.fromCfnBucket(cfnBucket: CfnBucket)
907
+ ```
908
+
909
+ Create a mutable `IBucket` based on a low-level `CfnBucket`.
910
+
911
+ ###### `cfnBucket`<sup>Required</sup> <a name="cfnBucket" id="@gammarers/aws-secure-bucket.SecureBucket.fromCfnBucket.parameter.cfnBucket"></a>
912
+
913
+ - *Type:* aws-cdk-lib.aws_s3.CfnBucket
914
+
915
+ ---
916
+
917
+ ##### `validateBucketName` <a name="validateBucketName" id="@gammarers/aws-secure-bucket.SecureBucket.validateBucketName"></a>
918
+
919
+ ```typescript
920
+ import { SecureBucket } from '@gammarers/aws-secure-bucket'
921
+
922
+ SecureBucket.validateBucketName(physicalName: string)
923
+ ```
924
+
925
+ Thrown an exception if the given bucket name is not valid.
926
+
927
+ ###### `physicalName`<sup>Required</sup> <a name="physicalName" id="@gammarers/aws-secure-bucket.SecureBucket.validateBucketName.parameter.physicalName"></a>
928
+
929
+ - *Type:* string
930
+
931
+ name of the bucket.
932
+
933
+ ---
934
+
935
+ #### Properties <a name="Properties" id="Properties"></a>
936
+
937
+ | **Name** | **Type** | **Description** |
938
+ | --- | --- | --- |
939
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
940
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.env">env</a></code> | <code>aws-cdk-lib.ResourceEnvironment</code> | The environment this resource belongs to. |
941
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.stack">stack</a></code> | <code>aws-cdk-lib.Stack</code> | The stack in which this resource is defined. |
942
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketArn">bucketArn</a></code> | <code>string</code> | The ARN of the bucket. |
943
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketDomainName">bucketDomainName</a></code> | <code>string</code> | The IPv4 DNS name of the specified bucket. |
944
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketDualStackDomainName">bucketDualStackDomainName</a></code> | <code>string</code> | The IPv6 DNS name of the specified bucket. |
945
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketName">bucketName</a></code> | <code>string</code> | The name of the bucket. |
946
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketRegionalDomainName">bucketRegionalDomainName</a></code> | <code>string</code> | The regional domain name of the specified bucket. |
947
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketWebsiteDomainName">bucketWebsiteDomainName</a></code> | <code>string</code> | The Domain name of the static website. |
948
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.bucketWebsiteUrl">bucketWebsiteUrl</a></code> | <code>string</code> | The URL of the static website. |
949
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.encryptionKey">encryptionKey</a></code> | <code>aws-cdk-lib.aws_kms.IKey</code> | Optional KMS encryption key associated with this bucket. |
950
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.isWebsite">isWebsite</a></code> | <code>boolean</code> | If this bucket has been configured for static website hosting. |
951
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucket.property.policy">policy</a></code> | <code>aws-cdk-lib.aws_s3.BucketPolicy</code> | The resource policy associated with this bucket. |
952
+
953
+ ---
954
+
955
+ ##### `node`<sup>Required</sup> <a name="node" id="@gammarers/aws-secure-bucket.SecureBucket.property.node"></a>
956
+
957
+ ```typescript
958
+ public readonly node: Node;
959
+ ```
960
+
961
+ - *Type:* constructs.Node
962
+
963
+ The tree node.
964
+
965
+ ---
966
+
967
+ ##### `env`<sup>Required</sup> <a name="env" id="@gammarers/aws-secure-bucket.SecureBucket.property.env"></a>
968
+
969
+ ```typescript
970
+ public readonly env: ResourceEnvironment;
971
+ ```
972
+
973
+ - *Type:* aws-cdk-lib.ResourceEnvironment
974
+
975
+ The environment this resource belongs to.
976
+
977
+ For resources that are created and managed by the CDK
978
+ (generally, those created by creating new class instances like Role, Bucket, etc.),
979
+ this is always the same as the environment of the stack they belong to;
980
+ however, for imported resources
981
+ (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
982
+ that might be different than the stack they were imported into.
983
+
984
+ ---
985
+
986
+ ##### `stack`<sup>Required</sup> <a name="stack" id="@gammarers/aws-secure-bucket.SecureBucket.property.stack"></a>
987
+
988
+ ```typescript
989
+ public readonly stack: Stack;
990
+ ```
991
+
992
+ - *Type:* aws-cdk-lib.Stack
993
+
994
+ The stack in which this resource is defined.
995
+
996
+ ---
997
+
998
+ ##### `bucketArn`<sup>Required</sup> <a name="bucketArn" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketArn"></a>
999
+
1000
+ ```typescript
1001
+ public readonly bucketArn: string;
1002
+ ```
1003
+
1004
+ - *Type:* string
1005
+
1006
+ The ARN of the bucket.
1007
+
1008
+ ---
1009
+
1010
+ ##### `bucketDomainName`<sup>Required</sup> <a name="bucketDomainName" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketDomainName"></a>
1011
+
1012
+ ```typescript
1013
+ public readonly bucketDomainName: string;
1014
+ ```
1015
+
1016
+ - *Type:* string
1017
+
1018
+ The IPv4 DNS name of the specified bucket.
1019
+
1020
+ ---
1021
+
1022
+ ##### `bucketDualStackDomainName`<sup>Required</sup> <a name="bucketDualStackDomainName" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketDualStackDomainName"></a>
1023
+
1024
+ ```typescript
1025
+ public readonly bucketDualStackDomainName: string;
1026
+ ```
1027
+
1028
+ - *Type:* string
1029
+
1030
+ The IPv6 DNS name of the specified bucket.
1031
+
1032
+ ---
1033
+
1034
+ ##### `bucketName`<sup>Required</sup> <a name="bucketName" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketName"></a>
1035
+
1036
+ ```typescript
1037
+ public readonly bucketName: string;
1038
+ ```
1039
+
1040
+ - *Type:* string
1041
+
1042
+ The name of the bucket.
1043
+
1044
+ ---
1045
+
1046
+ ##### `bucketRegionalDomainName`<sup>Required</sup> <a name="bucketRegionalDomainName" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketRegionalDomainName"></a>
1047
+
1048
+ ```typescript
1049
+ public readonly bucketRegionalDomainName: string;
1050
+ ```
1051
+
1052
+ - *Type:* string
1053
+
1054
+ The regional domain name of the specified bucket.
1055
+
1056
+ ---
1057
+
1058
+ ##### `bucketWebsiteDomainName`<sup>Required</sup> <a name="bucketWebsiteDomainName" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketWebsiteDomainName"></a>
1059
+
1060
+ ```typescript
1061
+ public readonly bucketWebsiteDomainName: string;
1062
+ ```
1063
+
1064
+ - *Type:* string
1065
+
1066
+ The Domain name of the static website.
1067
+
1068
+ ---
1069
+
1070
+ ##### `bucketWebsiteUrl`<sup>Required</sup> <a name="bucketWebsiteUrl" id="@gammarers/aws-secure-bucket.SecureBucket.property.bucketWebsiteUrl"></a>
1071
+
1072
+ ```typescript
1073
+ public readonly bucketWebsiteUrl: string;
1074
+ ```
1075
+
1076
+ - *Type:* string
1077
+
1078
+ The URL of the static website.
1079
+
1080
+ ---
1081
+
1082
+ ##### `encryptionKey`<sup>Optional</sup> <a name="encryptionKey" id="@gammarers/aws-secure-bucket.SecureBucket.property.encryptionKey"></a>
1083
+
1084
+ ```typescript
1085
+ public readonly encryptionKey: IKey;
1086
+ ```
1087
+
1088
+ - *Type:* aws-cdk-lib.aws_kms.IKey
1089
+
1090
+ Optional KMS encryption key associated with this bucket.
1091
+
1092
+ ---
1093
+
1094
+ ##### `isWebsite`<sup>Optional</sup> <a name="isWebsite" id="@gammarers/aws-secure-bucket.SecureBucket.property.isWebsite"></a>
1095
+
1096
+ ```typescript
1097
+ public readonly isWebsite: boolean;
1098
+ ```
1099
+
1100
+ - *Type:* boolean
1101
+
1102
+ If this bucket has been configured for static website hosting.
1103
+
1104
+ ---
1105
+
1106
+ ##### `policy`<sup>Optional</sup> <a name="policy" id="@gammarers/aws-secure-bucket.SecureBucket.property.policy"></a>
1107
+
1108
+ ```typescript
1109
+ public readonly policy: BucketPolicy;
1110
+ ```
1111
+
1112
+ - *Type:* aws-cdk-lib.aws_s3.BucketPolicy
1113
+
1114
+ The resource policy associated with this bucket.
1115
+
1116
+ If `autoCreatePolicy` is true, a `BucketPolicy` will be created upon the
1117
+ first call to addToResourcePolicy(s).
1118
+
1119
+ ---
1120
+
1121
+
1122
+ ## Structs <a name="Structs" id="Structs"></a>
1123
+
1124
+ ### SecureBucketProps <a name="SecureBucketProps" id="@gammarers/aws-secure-bucket.SecureBucketProps"></a>
1125
+
1126
+ #### Initializer <a name="Initializer" id="@gammarers/aws-secure-bucket.SecureBucketProps.Initializer"></a>
1127
+
1128
+ ```typescript
1129
+ import { SecureBucketProps } from '@gammarers/aws-secure-bucket'
1130
+
1131
+ const secureBucketProps: SecureBucketProps = { ... }
1132
+ ```
1133
+
1134
+ #### Properties <a name="Properties" id="Properties"></a>
1135
+
1136
+ | **Name** | **Type** | **Description** |
1137
+ | --- | --- | --- |
1138
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.bucketName">bucketName</a></code> | <code>string</code> | *No description.* |
1139
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.encryption">encryption</a></code> | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketEncryption">SecureBucketEncryption</a></code> | *No description.* |
1140
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.eventBridgeEnabled">eventBridgeEnabled</a></code> | <code>boolean</code> | *No description.* |
1141
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.lifecycleRules">lifecycleRules</a></code> | <code>aws-cdk-lib.aws_s3.LifecycleRule[]</code> | *No description.* |
1142
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.objectOwnership">objectOwnership</a></code> | <code><a href="#@gammarers/aws-secure-bucket.SecureObjectOwnership">SecureObjectOwnership</a></code> | *No description.* |
1143
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketProps.property.versioned">versioned</a></code> | <code>boolean</code> | *No description.* |
1144
+
1145
+ ---
1146
+
1147
+ ##### `bucketName`<sup>Optional</sup> <a name="bucketName" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.bucketName"></a>
1148
+
1149
+ ```typescript
1150
+ public readonly bucketName: string;
1151
+ ```
1152
+
1153
+ - *Type:* string
1154
+
1155
+ ---
1156
+
1157
+ ##### `encryption`<sup>Optional</sup> <a name="encryption" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.encryption"></a>
1158
+
1159
+ ```typescript
1160
+ public readonly encryption: SecureBucketEncryption;
1161
+ ```
1162
+
1163
+ - *Type:* <a href="#@gammarers/aws-secure-bucket.SecureBucketEncryption">SecureBucketEncryption</a>
1164
+
1165
+ ---
1166
+
1167
+ ##### `eventBridgeEnabled`<sup>Optional</sup> <a name="eventBridgeEnabled" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.eventBridgeEnabled"></a>
1168
+
1169
+ ```typescript
1170
+ public readonly eventBridgeEnabled: boolean;
1171
+ ```
1172
+
1173
+ - *Type:* boolean
1174
+
1175
+ ---
1176
+
1177
+ ##### `lifecycleRules`<sup>Optional</sup> <a name="lifecycleRules" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.lifecycleRules"></a>
1178
+
1179
+ ```typescript
1180
+ public readonly lifecycleRules: LifecycleRule[];
1181
+ ```
1182
+
1183
+ - *Type:* aws-cdk-lib.aws_s3.LifecycleRule[]
1184
+
1185
+ ---
1186
+
1187
+ ##### `objectOwnership`<sup>Optional</sup> <a name="objectOwnership" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.objectOwnership"></a>
1188
+
1189
+ ```typescript
1190
+ public readonly objectOwnership: SecureObjectOwnership;
1191
+ ```
1192
+
1193
+ - *Type:* <a href="#@gammarers/aws-secure-bucket.SecureObjectOwnership">SecureObjectOwnership</a>
1194
+
1195
+ ---
1196
+
1197
+ ##### `versioned`<sup>Optional</sup> <a name="versioned" id="@gammarers/aws-secure-bucket.SecureBucketProps.property.versioned"></a>
1198
+
1199
+ ```typescript
1200
+ public readonly versioned: boolean;
1201
+ ```
1202
+
1203
+ - *Type:* boolean
1204
+
1205
+ ---
1206
+
1207
+
1208
+
1209
+ ## Enums <a name="Enums" id="Enums"></a>
1210
+
1211
+ ### SecureBucketEncryption <a name="SecureBucketEncryption" id="@gammarers/aws-secure-bucket.SecureBucketEncryption"></a>
1212
+
1213
+ #### Members <a name="Members" id="Members"></a>
1214
+
1215
+ | **Name** | **Description** |
1216
+ | --- | --- |
1217
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketEncryption.KMS_MANAGED">KMS_MANAGED</a></code> | Server-side KMS encryption with a master key managed by KMS. |
1218
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureBucketEncryption.S3_MANAGED">S3_MANAGED</a></code> | Server-side encryption with a master key managed by S3. |
1219
+
1220
+ ---
1221
+
1222
+ ##### `KMS_MANAGED` <a name="KMS_MANAGED" id="@gammarers/aws-secure-bucket.SecureBucketEncryption.KMS_MANAGED"></a>
1223
+
1224
+ Server-side KMS encryption with a master key managed by KMS.
1225
+
1226
+ ---
1227
+
1228
+
1229
+ ##### `S3_MANAGED` <a name="S3_MANAGED" id="@gammarers/aws-secure-bucket.SecureBucketEncryption.S3_MANAGED"></a>
1230
+
1231
+ Server-side encryption with a master key managed by S3.
1232
+
1233
+ ---
1234
+
1235
+
1236
+ ### SecureObjectOwnership <a name="SecureObjectOwnership" id="@gammarers/aws-secure-bucket.SecureObjectOwnership"></a>
1237
+
1238
+ The ObjectOwnership of the bucket.
1239
+
1240
+ > [https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html](https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html)
1241
+
1242
+ #### Members <a name="Members" id="Members"></a>
1243
+
1244
+ | **Name** | **Description** |
1245
+ | --- | --- |
1246
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureObjectOwnership.BUCKET_OWNER_ENFORCED">BUCKET_OWNER_ENFORCED</a></code> | ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket. |
1247
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureObjectOwnership.BUCKET_OWNER_PREFERRED">BUCKET_OWNER_PREFERRED</a></code> | Objects uploaded to the bucket change ownership to the bucket owner . |
1248
+ | <code><a href="#@gammarers/aws-secure-bucket.SecureObjectOwnership.OBJECT_WRITER">OBJECT_WRITER</a></code> | The uploading account will own the object. |
1249
+
1250
+ ---
1251
+
1252
+ ##### `BUCKET_OWNER_ENFORCED` <a name="BUCKET_OWNER_ENFORCED" id="@gammarers/aws-secure-bucket.SecureObjectOwnership.BUCKET_OWNER_ENFORCED"></a>
1253
+
1254
+ ACLs are disabled, and the bucket owner automatically owns and has full control over every object in the bucket.
1255
+
1256
+ ACLs no longer affect permissions to data in the S3 bucket.
1257
+ The bucket uses policies to define access control.
1258
+
1259
+ ---
1260
+
1261
+
1262
+ ##### `BUCKET_OWNER_PREFERRED` <a name="BUCKET_OWNER_PREFERRED" id="@gammarers/aws-secure-bucket.SecureObjectOwnership.BUCKET_OWNER_PREFERRED"></a>
1263
+
1264
+ Objects uploaded to the bucket change ownership to the bucket owner .
1265
+
1266
+ ---
1267
+
1268
+
1269
+ ##### `OBJECT_WRITER` <a name="OBJECT_WRITER" id="@gammarers/aws-secure-bucket.SecureObjectOwnership.OBJECT_WRITER"></a>
1270
+
1271
+ The uploading account will own the object.
1272
+
1273
+ ---
1274
+