Skip to content

(cloudfront): explicit OAI for S3Origin doesn't work for cloudfront. #18185

@DarshanAwachat

Description

@DarshanAwachat

General Issue

General Issue

The Question

When I try to associate OAI by passing the props in the S3Origin, it doesn't work
const s3Origin = new S3Origin(Bucket, {originAccessIdentity: oai});
While it works when no OAI is passed, A new OAI is created for the same bucket
const s3Origin = new S3Origin(Bucket)

I create the OAI by using cloudfront.OriginAccessIdentity

const oai = new cloudfront.OriginAccessIdentity(this, 'OAI',{
   comment: "This is for OAI"
})

CDK CLI Version

1.126.0

Framework Version

No response

Node.js Version

No response

OS

Windows

Language

Typescript

Language Version

No response

Other information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-cloudfrontRelated to Amazon CloudFrontbugThis issue is a bug.effort/smallSmall work item – less than a day of effortp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions