diff --git a/packages/aws-cdk-lib/aws-kms/lib/key.ts b/packages/aws-cdk-lib/aws-kms/lib/key.ts index 3b267d79d0c14..1619b4ccd3f04 100644 --- a/packages/aws-cdk-lib/aws-kms/lib/key.ts +++ b/packages/aws-cdk-lib/aws-kms/lib/key.ts @@ -260,18 +260,18 @@ abstract class KeyBase extends Resource implements IKey { if (!iam.principalIsOwnedResource(grantee.grantPrincipal)) { return false; } - const bucketStack = Stack.of(this); + const keyStack = Stack.of(this); const identityStack = Stack.of(grantee.grantPrincipal); - return bucketStack.region !== identityStack.region; + return keyStack.region !== identityStack.region; } private isGranteeFromAnotherAccount(grantee: iam.IGrantable): boolean { if (!iam.principalIsOwnedResource(grantee.grantPrincipal)) { return false; } - const bucketStack = Stack.of(this); + const keyStack = Stack.of(this); const identityStack = Stack.of(grantee.grantPrincipal); - return bucketStack.account !== identityStack.account; + return keyStack.account !== identityStack.account; } }