(cloudfront): Cannot set Origin Access Control on Object Lambda Access Point origin #26405
Labels
@aws-cdk/aws-cloudfront
Related to Amazon CloudFront
bug
This issue is a bug.
needs-triage
This issue or PR still needs to be triaged.
Describe the bug
I have a CloudFront distribution with an Object Lambda Access Point (OLAP) origin to serve S3 objects. The distribution construct uses an HttpOrigin with the OLAP's domain name (from its alias). Origin Access Control is set up using CfnOriginAccessControl. The origin access control ID is set on the underlying CfnDistribution. Attempting to deploy results in an CloudFront API 400 response. But I can set origin access control on the origin via the AWS console and the origin's type is S3 in the console.
Expected Behavior
The origin access control policy is applied to the distribution's default origin.
Current Behavior
The stack named [redacted] failed to deploy: UPDATE_ROLLBACK_COMPLETE: Resource handler returned message: "Invalid request provided: Illegal configuration: The origin type and OAC origin type differ. (Service: CloudFront, Status Code: 400, Request ID: [redacted])" (RequestToken: [redacted], HandlerErrorCode: InvalidRequest)
Reproduction Steps
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.86.0
Framework Version
No response
Node.js Version
18.14.0
OS
linux
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: