-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing support for CORS in S3 Bucket properties #2101
Labels
@aws-cdk/aws-s3
Related to Amazon S3
feature-request
A feature should be added or improved.
guidance
Question that needs advice or information.
Comments
For those interested, I might have found a workaround for that :
|
workeitel
added a commit
to workeitel/aws-cdk
that referenced
this issue
Jun 12, 2019
Add CORS Property to S3 Bucket for configuring bucket cross-origin access rules. You can either specify the metrics as properties: new Bucket(stack, 'Bucket', { cors: [ { allowedHeaders: [ "*" ], allowedMethods: [ "GET" ], allowedOrigins: [ "*" ], exposedHeaders: [ "Date" ], id: "myCORSRuleId1", maxAge: 3600 } ] }); Or use the `addCors` function: const bucket = new Bucket(stack, 'Bucket'); bucket.addCors({ allowedMethods: ["GET", "HEAD"], allowedOrigins: ["https://example.com"] });
workeitel
added a commit
to workeitel/aws-cdk
that referenced
this issue
Jun 12, 2019
Add CORS Property to S3 Bucket for configuring bucket cross-origin access rules. You can either specify the metrics as properties: new Bucket(stack, 'Bucket', { cors: [ { allowedHeaders: [ "*" ], allowedMethods: [ "GET" ], allowedOrigins: [ "*" ], exposedHeaders: [ "Date" ], id: "myCORSRuleId1", maxAge: 3600 } ] }); Or use the `addCors` function: const bucket = new Bucket(stack, 'Bucket'); bucket.addCors({ allowedMethods: ["GET", "HEAD"], allowedOrigins: ["https://example.com"] });
workeitel
added a commit
to workeitel/aws-cdk
that referenced
this issue
Jun 13, 2019
Add CORS Property to S3 Bucket for configuring bucket cross-origin access rules. You can either specify the metrics as properties: new Bucket(stack, 'Bucket', { cors: [ { allowedHeaders: [ "*" ], allowedMethods: [ "GET" ], allowedOrigins: [ "*" ], exposedHeaders: [ "Date" ], id: "myCORSRuleId1", maxAge: 3600 } ] }); Or use the `addCors` function: const bucket = new Bucket(stack, 'Bucket'); bucket.addCors({ allowedMethods: ["GET", "HEAD"], allowedOrigins: ["https://example.com"] });
rix0rrr
pushed a commit
that referenced
this issue
Jun 17, 2019
This was referenced Aug 22, 2019
SomayaB
added
needs-triage
This issue or PR still needs to be triaged.
@aws-cdk/aws-s3
Related to Amazon S3
guidance
Question that needs advice or information.
labels
Sep 7, 2019
SomayaB
added
feature-request
A feature should be added or improved.
and removed
needs-triage
This issue or PR still needs to be triaged.
labels
Sep 17, 2019
This should be closed by #2843. Let me know if this isn't the case. Closing now, please reopen if this is still a problem. |
This was referenced Dec 12, 2019
This was referenced Dec 13, 2019
This was referenced Jan 20, 2020
This was referenced Sep 24, 2024
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
@aws-cdk/aws-s3
Related to Amazon S3
feature-request
A feature should be added or improved.
guidance
Question that needs advice or information.
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 underlyingCfnBucket
.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 :
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 theconstruct
method, and profit from the rest of the implementation, instead of duplicating the whole class)
The text was updated successfully, but these errors were encountered: