Missing support for CORS in S3 Bucket properties #2101
Closed
Description
I cannot use the provided Bucket
construct if I want to enable CORS on my bucket as there is no way to pass it to the underlying CfnBucket
.
And I'm not aware of techniques that would prevent me to add this without copy-pasting the whole Bucket
class to just modify the constructor.
(
By the way, in order to enable easier customisation, it might worth writing provided constructs like this :
export class Bucket extends BucketBase {
constructor(scope: cdk.Construct, id: string, props: BucketProps = {}) {
super(scope, id);
this.construct(props)
}
private construct(props: BucketProps ) {
// construction code here
const resource = new CfnBucket(this, 'Resource', {...
}
}
So that if I want to customize how the CfnXXX resource is built from my params, I can just extends the Bucket
class, overwrite only the construct
method, and profit from the rest of the implementation, instead of duplicating the whole class
)