Skip to content

Commit

Permalink
docs(cloudfront): deprecate originAccessIdentityName property
Browse files Browse the repository at this point in the history
  • Loading branch information
dbartholomae committed Jun 17, 2022
1 parent ccc7f81 commit 9506d28
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront-origins/lib/s3-origin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@ class S3BucketOrigin extends cloudfront.OriginBase {
}

protected renderS3OriginConfig(): cloudfront.CfnDistribution.S3OriginConfigProperty | undefined {
return { originAccessIdentity: `origin-access-identity/cloudfront/${this.originAccessIdentity.originAccessIdentityName}` };
return { originAccessIdentity: `origin-access-identity/cloudfront/${this.originAccessIdentity.originAccessIdentityId}` };
}
}
14 changes: 11 additions & 3 deletions packages/@aws-cdk/aws-cloudfront/lib/origin-access-identity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export interface OriginAccessIdentityProps {
*/
export interface IOriginAccessIdentity extends cdk.IResource, iam.IGrantable {
/**
* The Origin Access Identity Name
* The Origin Access Identity Id (physical id)
* It is misnamed and superseded by the correctly named originAccessIdentityId
*
* @deprecated use originAccessIdentityId instead
*/
readonly originAccessIdentityName: string;

Expand All @@ -33,7 +36,10 @@ export interface IOriginAccessIdentity extends cdk.IResource, iam.IGrantable {

abstract class OriginAccessIdentityBase extends cdk.Resource {
/**
* The Origin Access Identity Name (physical id)
* The Origin Access Identity Id (physical id)
* It is misnamed and superseded by the correctly named originAccessIdentityId
*
* @deprecated use originAccessIdentityId instead
*/
public abstract readonly originAccessIdentityName: string;

Expand Down Expand Up @@ -120,9 +126,11 @@ export class OriginAccessIdentity extends OriginAccessIdentityBase implements IO
public readonly grantPrincipal: iam.IPrincipal;

/**
* The Origin Access Identity Name (physical id)
* The Origin Access Identity Id (physical id)
* It is misnamed and superseded by the correctly named originAccessIdentityId
*
* @attribute
* @deprecated use originAccessIdentityId instead
*/
public get originAccessIdentityName() {
return this.originAccessIdentityId;
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ export class CloudFrontWebDistribution extends cdk.Resource implements IDistribu
}));

s3OriginConfig = {
originAccessIdentity: `origin-access-identity/cloudfront/${originConfig.s3OriginSource.originAccessIdentity.originAccessIdentityName}`,
originAccessIdentity: `origin-access-identity/cloudfront/${originConfig.s3OriginSource.originAccessIdentity.originAccessIdentityId}`,
};
} else {
s3OriginConfig = {};
Expand Down

0 comments on commit 9506d28

Please sign in to comment.