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
+47Lines changed: 47 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,6 +113,53 @@ The configuration maps directly to [CloudFormation LifecycleConfiguration Rules]
113
113
114
114
These rules are added to the default lifecycle rules that Lift adds (intelligent tiering and old version cleanup).
115
115
116
+
### ACL support
117
+
118
+
Since April 2023, S3 buckets have ACLs disabled by default. However, many tools and libraries (including PHP's [Flysystem](https://github.com/thephpleague/flysystem), used by Laravel) send ACL headers on S3 operations. Without enabling ACLs, these operations will fail.
119
+
120
+
To let the bucket accept ACL headers while keeping the bucket owner in full control:
121
+
122
+
```yaml
123
+
constructs:
124
+
storage:
125
+
type: storage
126
+
allowAcl: true
127
+
```
128
+
129
+
This sets the S3 bucket's [Object Ownership](https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) to `BucketOwnerPreferred` and grants `s3:GetObjectAcl` and `s3:PutObjectAcl` permissions to Lambda functions.
130
+
131
+
### CORS
132
+
133
+
To allow browser-based uploads (e.g. via presigned URLs), you can configure CORS on the bucket.
134
+
135
+
**Simple form** — allow a single origin with default methods (`GET`, `PUT`, `DELETE`) and all headers:
136
+
137
+
```yaml
138
+
constructs:
139
+
storage:
140
+
type: storage
141
+
cors: "${construct:website.url}"
142
+
```
143
+
144
+
Use `cors: "*"` to allow all origins.
145
+
146
+
**Full form** — define complete CORS rules (property names can be camelCase or PascalCase):
147
+
148
+
```yaml
149
+
constructs:
150
+
storage:
151
+
type: storage
152
+
cors:
153
+
- allowedOrigins:
154
+
- "${construct:website.url}"
155
+
allowedMethods:
156
+
- PUT
157
+
allowedHeaders:
158
+
- "*"
159
+
```
160
+
161
+
The full form maps directly to [CloudFormation CorsRules](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-s3-bucket-corsconfiguration-corsrule.html).
162
+
116
163
## Extensions
117
164
118
165
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