Skip to content

Commit fcb7231

Browse files
authored
chore(appconfig): compilation error in ts 4.2 and below because of using get in interface (#29226)
### Reason for this change There is a lint error which `get` syntax can't be used on interface before TS version 4.3 ### Description of changes Replace `get` with a regular function. ### Description of how you validated changes Unit test passed. ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 6c17ca5 commit fcb7231

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/aws-cdk-lib/aws-appconfig/lib/application.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export interface IApplication extends cdk.IResource {
7272
/**
7373
* Returns the list of associated environments.
7474
*/
75-
get environments(): IEnvironment[];
75+
environments(): IEnvironment[];
7676

7777
/**
7878
* Adds an extension defined by the action point and event destination
@@ -204,7 +204,7 @@ abstract class ApplicationBase extends cdk.Resource implements IApplication, IEx
204204
this._environments.push(environment);
205205
}
206206

207-
get environments(): IEnvironment[] {
207+
public environments(): IEnvironment[] {
208208
return this._environments;
209209
}
210210

packages/aws-cdk-lib/aws-appconfig/lib/configuration.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE
304304

305305
protected addExistingEnvironmentsToApplication() {
306306
this.deployTo?.forEach((environment) => {
307-
if (!this.application.environments.includes(environment)) {
307+
if (!this.application.environments().includes(environment)) {
308308
this.application.addExistingEnvironment(environment);
309309
}
310310
});
@@ -315,7 +315,7 @@ abstract class ConfigurationBase extends Construct implements IConfiguration, IE
315315
return;
316316
}
317317

318-
this.application.environments.forEach((environment) => {
318+
this.application.environments().forEach((environment) => {
319319
if ((this.deployTo && !this.deployTo.includes(environment))) {
320320
return;
321321
}

0 commit comments

Comments
 (0)