8
8
getRuntimeKey ,
9
9
type TestStack ,
10
10
} from '@aws-lambda-powertools/testing-utils' ;
11
- import { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda' ;
11
+ import type { TestNodejsFunction } from '@aws-lambda-powertools/testing-utils/resources/lambda' ;
12
12
import { TestDynamodbTable } from '@aws-lambda-powertools/testing-utils/resources/dynamodb' ;
13
13
import { marshall } from '@aws-sdk/util-dynamodb' ;
14
14
import { CfnOutput , Duration , RemovalPolicy , Stack } from 'aws-cdk-lib' ;
@@ -18,15 +18,15 @@ import {
18
18
ConfigurationType ,
19
19
DeploymentStrategy ,
20
20
HostedConfiguration ,
21
- IEnvironment ,
21
+ type IEnvironment ,
22
22
RolloutStrategy ,
23
- CfnHostedConfigurationVersion ,
23
+ type CfnHostedConfigurationVersion ,
24
24
} from 'aws-cdk-lib/aws-appconfig' ;
25
25
import { Effect , PolicyStatement } from 'aws-cdk-lib/aws-iam' ;
26
26
import type { SecretProps } from 'aws-cdk-lib/aws-secretsmanager' ;
27
27
import { Secret } from 'aws-cdk-lib/aws-secretsmanager' ;
28
28
import type { StringParameterProps } from 'aws-cdk-lib/aws-ssm' ;
29
- import { IStringParameter , StringParameter } from 'aws-cdk-lib/aws-ssm' ;
29
+ import { type IStringParameter , StringParameter } from 'aws-cdk-lib/aws-ssm' ;
30
30
import {
31
31
AwsCustomResource ,
32
32
AwsCustomResourcePolicy ,
@@ -266,7 +266,7 @@ class TestAppConfigWithProfiles extends Construct {
266
266
}
267
267
) ;
268
268
269
- profiles . forEach ( ( profile ) => {
269
+ for ( const profile of profiles ) {
270
270
const config = new HostedConfiguration (
271
271
testStack . stack ,
272
272
`hc-${ randomUUID ( ) } ` ,
@@ -291,7 +291,7 @@ class TestAppConfigWithProfiles extends Construct {
291
291
config . node . defaultChild as CfnHostedConfigurationVersion
292
292
) . applyRemovalPolicy ( RemovalPolicy . DESTROY ) ;
293
293
this . profiles . push ( config ) ;
294
- } ) ;
294
+ } ;
295
295
}
296
296
297
297
/**
@@ -300,7 +300,9 @@ class TestAppConfigWithProfiles extends Construct {
300
300
* @param fn The function to add the environment variables to
301
301
*/
302
302
public addEnvVariablesToFunction ( fn : TestNodejsFunction ) : void {
303
+ // biome-ignore lint/style/noNonNullAssertion: we know this is called after the AppConfig resources are created
303
304
fn . addEnvironment ( 'APPLICATION_NAME' , this . application . name ! ) ;
305
+ // biome-ignore lint/style/noNonNullAssertion: we know this is called after the AppConfig resources are created
304
306
fn . addEnvironment ( 'ENVIRONMENT_NAME' , this . environment . name ! ) ;
305
307
fn . addEnvironment (
306
308
'FREEFORM_JSON_NAME' ,
@@ -326,9 +328,10 @@ class TestAppConfigWithProfiles extends Construct {
326
328
* @param fn The function to grant access to the profiles
327
329
*/
328
330
public grantReadData ( fn : TestNodejsFunction ) : void {
329
- this . profiles . forEach ( ( profile ) => {
331
+ for ( const profile of this . profiles ) {
330
332
const appConfigConfigurationArn = Stack . of ( fn ) . formatArn ( {
331
333
service : 'appconfig' ,
334
+ // biome-ignore lint/style/noNonNullAssertion: we know this is called after the AppConfig resources are created
332
335
resource : `application/${ profile . application . applicationId } /environment/${ profile . deployTo ! [ 0 ] . environmentId } /configuration/${ profile . configurationProfileId } ` ,
333
336
} ) ;
334
337
@@ -342,7 +345,7 @@ class TestAppConfigWithProfiles extends Construct {
342
345
resources : [ appConfigConfigurationArn ] ,
343
346
} )
344
347
) ;
345
- } ) ;
348
+ } ;
346
349
}
347
350
}
348
351
0 commit comments