Skip to content

Commit 70b9f63

Browse files
authored
chore(cloudfront): remove the originId property from OriginBase (#9380)
This property is no longer used, and OriginBase is a publicly available class of the module. BREAKING CHANGE: the property OriginBase.originId has been removed ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 056bcaf commit 70b9f63

File tree

1 file changed

+1
-15
lines changed
  • packages/@aws-cdk/aws-cloudfront/lib

1 file changed

+1
-15
lines changed

packages/@aws-cdk/aws-cloudfront/lib/origin.ts

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,6 @@ export abstract class OriginBase implements IOrigin {
8686
private readonly connectionAttempts?: number;
8787
private readonly customHeaders?: Record<string, string>;
8888

89-
private originId?: string;
90-
9189
protected constructor(domainName: string, props: OriginProps = {}) {
9290
validateIntInRangeOrUndefined('connectionTimeout', 1, 10, props.connectionTimeout?.toSeconds());
9391
validateIntInRangeOrUndefined('connectionAttempts', 1, 3, props.connectionAttempts, false);
@@ -99,22 +97,10 @@ export abstract class OriginBase implements IOrigin {
9997
this.customHeaders = props.customHeaders;
10098
}
10199

102-
/**
103-
* The unique id for this origin.
104-
*
105-
* Cannot be accesed until bind() is called.
106-
*/
107-
public get id(): string {
108-
if (!this.originId) { throw new Error('Cannot access originId until `bind` is called.'); }
109-
return this.originId;
110-
}
111-
112100
/**
113101
* Binds the origin to the associated Distribution. Can be used to grant permissions, create dependent resources, etc.
114102
*/
115103
public bind(_scope: Construct, options: OriginBindOptions): OriginBindConfig {
116-
this.originId = options.originId;
117-
118104
const s3OriginConfig = this.renderS3OriginConfig();
119105
const customOriginConfig = this.renderCustomOriginConfig();
120106

@@ -124,7 +110,7 @@ export abstract class OriginBase implements IOrigin {
124110

125111
return { originProperty: {
126112
domainName: this.domainName,
127-
id: this.id,
113+
id: options.originId,
128114
originPath: this.originPath,
129115
connectionAttempts: this.connectionAttempts,
130116
connectionTimeout: this.connectionTimeout?.toSeconds(),

0 commit comments

Comments
 (0)