From 69030363a00d6a33d2527e0d6749181766452793 Mon Sep 17 00:00:00 2001 From: Ben Chaimberg Date: Thu, 13 May 2021 09:32:45 -0700 Subject: [PATCH] fix lint errors --- packages/@aws-cdk/aws-lambda/lib/function-base.ts | 8 ++++---- packages/@aws-cdk/aws-lambda/package.json | 4 +++- packages/@aws-cdk/aws-lambda/test/function.test.ts | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/packages/@aws-cdk/aws-lambda/lib/function-base.ts b/packages/@aws-cdk/aws-lambda/lib/function-base.ts index a49c4c4f91581..4912360f59e0b 100644 --- a/packages/@aws-cdk/aws-lambda/lib/function-base.ts +++ b/packages/@aws-cdk/aws-lambda/lib/function-base.ts @@ -404,7 +404,7 @@ export abstract class FunctionBase extends Resource implements IFunction, ec2.IC principal: returnPrincipal, sourceAccount: sourceAccount, sourceArn: sourceArn, - } + }; }; // Try some specific common classes first. @@ -422,9 +422,9 @@ export abstract class FunctionBase extends Resource implements IFunction, ec2.IC const conditionKeysAreSupported = conditionKeys.every(key => supportedConditions.includes(key)); if (conditionOperatorsAreSupported && conditionKeysAreSupported) { - sourceAccount = conditions['ArnEquals']['aws:SourceAccount']; - sourceArn = conditions['ArnEquals']['aws:SourceArn']; - principal = principal['principal']; + sourceAccount = conditions.ArnEquals['aws:SourceAccount']; + sourceArn = conditions.ArnEquals['aws:SourceArn']; + principal = principal.principal; } else { throw new Error(`PrincipalWithConditions had unsupported conditions for Lambda permission statement: ${conditions}. ` + 'Supported operators: [ArnEquals]; supported conditions: [aws:SourceArn, aws:SourceAccount]'); diff --git a/packages/@aws-cdk/aws-lambda/package.json b/packages/@aws-cdk/aws-lambda/package.json index 6279fa92e0518..dc5d073fceaf7 100644 --- a/packages/@aws-cdk/aws-lambda/package.json +++ b/packages/@aws-cdk/aws-lambda/package.json @@ -181,7 +181,9 @@ "announce": false }, "nozem": { - "ostools": ["docker"] + "ostools": [ + "docker" + ] }, "maturity": "stable", "publishConfig": { diff --git a/packages/@aws-cdk/aws-lambda/test/function.test.ts b/packages/@aws-cdk/aws-lambda/test/function.test.ts index 6a264447db0ca..c8a5e3139c141 100644 --- a/packages/@aws-cdk/aws-lambda/test/function.test.ts +++ b/packages/@aws-cdk/aws-lambda/test/function.test.ts @@ -230,14 +230,14 @@ describe('function', () => { 'aws:SourceAccount': 'source-account', 'aws:SourceArn': 'source-arn', }, - }) + }), })).toThrow(/PrincipalWithConditions had unsupported conditions for Lambda permission statement/); expect(() => fn.addPermission('F2', { principal: new iam.PrincipalWithConditions(new iam.ServicePrincipal('my-service'), { ArnEquals: { 's3:DataAccessPointArn': 'data-access-point-arn', }, - }) + }), })).toThrow(/PrincipalWithConditions had unsupported conditions for Lambda permission statement/); });