Skip to content

Commit

Permalink
Change name to reflect that Stack is for a key, not a bucket
Browse files Browse the repository at this point in the history
This was most likely a mistake after someone used code from the Bucket construct
  • Loading branch information
pergardebrink committed Dec 17, 2023
1 parent 76ff0b8 commit e7ecd70
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/aws-cdk-lib/aws-kms/lib/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e7ecd70

Please sign in to comment.