You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/storage.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,6 +91,28 @@ constructs:
91
91
encryption: kms
92
92
```
93
93
94
+
### Lifecycle rules
95
+
96
+
You can configure custom [S3 lifecycle rules](https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html) to automatically delete or transition objects:
97
+
98
+
```yaml
99
+
constructs:
100
+
avatars:
101
+
type: storage
102
+
lifecycleRules:
103
+
- prefix: tmp/
104
+
expirationInDays: 1
105
+
- prefix: cache/
106
+
expirationInDays: 7
107
+
```
108
+
109
+
The configuration maps directly to [CloudFormation LifecycleConfiguration Rules](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-lifecycleconfig-rule.html) with the following conveniences:
110
+
111
+
- `Status: Enabled` is added by default (can be overridden)
112
+
- Property names can be written in camelCase (e.g. `expirationInDays`) or PascalCase (e.g. `ExpirationInDays`)
113
+
114
+
These rules are added to the default lifecycle rules that Lift adds (intelligent tiering and old version cleanup).
115
+
94
116
## Extensions
95
117
96
118
You can specify an `extensions` property on the storage construct to extend the underlying CloudFormation resources. In the exemple below, the S3 Bucket CloudFormation resource generated by the `avatars` storage construct will be extended with the new `AccessControl: PublicRead` CloudFormation property.
0 commit comments