Skip to content

Commit

Permalink
fixup! docs(cloudfront): deprecate fromOriginAccessIdentityName
Browse files Browse the repository at this point in the history
  • Loading branch information
dbartholomae committed Jun 18, 2022
1 parent 5948f8c commit add8357
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/@aws-cdk/aws-cloudfront/test/oai.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Template } from '@aws-cdk/assertions';
import * as cdk from '@aws-cdk/core';
import { testDeprecated } from '@aws-cdk/cdk-build-tools';
import { OriginAccessIdentity } from '../lib';

describe('Origin Access Identity', () => {
Expand Down Expand Up @@ -61,6 +62,14 @@ describe('Origin Access Identity', () => {
});
});

testDeprecated('Builds ARN of CloudFront user for fromOriginAccessIdentityName', () => {
const stack = new cdk.Stack();

const oai = OriginAccessIdentity.fromOriginAccessIdentityName(stack, 'OAI', 'OAITest');

expect(oai.grantPrincipal.policyFragment.principalJson.AWS[0]).toMatch(/:iam::cloudfront:user\/CloudFront Origin Access Identity OAITest$/);
});

test('Builds ARN of CloudFront user for fromOriginAccessIdentityId', () => {
const stack = new cdk.Stack();

Expand Down

0 comments on commit add8357

Please sign in to comment.