question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-cloudfront): (fromLookupOriginAccessIdentity)

See original GitHub issue

Describe the feature

Thinking about dynamic infrastructure solutions where some resources are reused, such as a bucket to serve several cloudfront distributions permissioned via OriginAccessIdentity, the need was found to have a method for reading OriginAccessIdentities already created.

Use Case

I always get frustrated when I need to read or create dynamic CDNs and link to a unique bucket. I cant do this with only aws-cdk.

I had to make an adaptation using @aws-cdk/client-*.

Proposed Solution

static fromLookupOriginAccessIdentity(scope, id, { options... })

[IOriginAccessIdentity](https://docs.aws.amazon.com/cdk/api/v1/docs/@aws-cdk_aws-cloudfront.IOriginAccessIdentity.html)
**Reads** a OriginAccessIdentity by providing the OriginAccessIdentityName.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.27.0

Environment details (OS name and version, etc.)

MacOS 12.2.1

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
peterwoodworthcommented, Jun 11, 2022

Are you passing in the OAI ID? The name fromOriginAccessIdentityName is actually a misnomer. See here

0reactions
guilhermebccommented, Jun 22, 2022

fromOriginAccessIdentityName passing OAI Id works.

Read more comments on GitHub >

github_iconTop Results From Across the Web

class OriginAccessIdentity (construct) · AWS CDK
An origin access identity is a special CloudFront user that you can associate with Amazon S3 origins, so that you can secure all...
Read more >
(aws-cloudfront): Using Distribution construct OAI is not ...
What is the problem? Trying to implement a Cloudfront distribution to access a private website bucket. Using Distribution construct with ...
Read more >
Trying to grant cloudfront access to S3 bucket, but get "Policy ...
Amazon S3 bucket to store website const websiteBucket = new S3. ... originAccessIdentity: cloudFrontOAI, }), compress: true, ...
Read more >
@aws-cdk/aws-cloudfront | Yarn - Package Manager
Amazon CloudFront is a web service that speeds up distribution of your static and dynamic web content, such as .html, .css, .js, and...
Read more >
CDK pattern – Caching static assets with AWS S3 and ...
OriginAccessIdentity ( this, 'cloudfront-OAI', { comment: `OAI for ${cdnDomain}` } ); const siteBucket = new s3.Bucket(this, 'SiteBucket' ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found