[cloudfront-origins] Expose the OriginAccessIdentity from S3Origin #9859
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
@aws-cdk/aws-cloudfront-origins
Related to CloudFront Origins for the CDK CloudFront Library
effort/small
Small work item – less than a day of effort
feature-request
A feature should be added or improved.
good first issue
Related to contributions. See CONTRIBUTING.md
in-progress
This issue is being actively worked on.
p2
See #9811 for original discussion/motivation.
In some cases, a user may want to gain access to the automatically-created origin access identity (OAI) from
S3Origin
to reference it in an explicit bucket policy.Use Case
If using an imported bucket, the OAI will not be granted read access to the bucket. A user may need to explicitly create a bucket policy in this case and reference the OAI to do so.
Proposed Solution
Expose an optional property on
S3Origin
oforiginAccessIdentity?
that delegates down to theS3BucketOrigin.originAccessIdentity
(if present). Care will need to be taken to handle the situation properly where: (1) the underlying origin is an HttpOrigin; or (2) the origin hasn't been bound yet.This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: