Describe the bug
OriginAccessIdentity.fromOriginAccessIdentityName asks for the OAI name, but actually needs the OAI id.
Set up the following bucket with a Cloudfront OAI name from a different account:
const bucket = new Bucket(this, "Bucket");
const originAccessIdentity =
OriginAccessIdentity.fromOriginAccessIdentityName(
this,
"OriginAccessIdentity",
"<add-OAI-name-here>"
);
bucket.grantRead(originAccessIdentity);
Then deploy.
Expected Behavior
The deployment should work.
Current Behavior
The deployment fails because what is needed is actually the OAI id, not the OAI name. This makes OriginAccessIdentity.fromOriginAccessIdentityName quite a misnomer.
Reproduction Steps
See above.
Possible Solution
Rename the method and internal properties to OriginAccessIdentity.fromOriginAccessIdentityId.
Additional Information/Context
Not sure if this bug is CDK-specific or a general CloudFormation problem.
CDK CLI Version
2.20.0
Framework Version
No response
Node.js Version
16
OS
Windows 11
Language
Typescript
Language Version
No response
Other information
No response
Describe the bug
OriginAccessIdentity.fromOriginAccessIdentityNameasks for the OAI name, but actually needs the OAI id.Set up the following bucket with a Cloudfront OAI name from a different account:
Then deploy.
Expected Behavior
The deployment should work.
Current Behavior
The deployment fails because what is needed is actually the OAI id, not the OAI name. This makes
OriginAccessIdentity.fromOriginAccessIdentityNamequite a misnomer.Reproduction Steps
See above.
Possible Solution
Rename the method and internal properties to
OriginAccessIdentity.fromOriginAccessIdentityId.Additional Information/Context
Not sure if this bug is CDK-specific or a general CloudFormation problem.
CDK CLI Version
2.20.0
Framework Version
No response
Node.js Version
16
OS
Windows 11
Language
Typescript
Language Version
No response
Other information
No response