From e7ecd702a863e53f45f6cec97f7b1d406e1a22b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20G=C3=A5rdebrink?= Date: Sun, 17 Dec 2023 20:20:43 +0000 Subject: [PATCH] Change name to reflect that Stack is for a key, not a bucket This was most likely a mistake after someone used code from the Bucket construct --- packages/aws-cdk-lib/aws-kms/lib/key.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; } }