From d7460e5e13dc27f4e151908b39ba222846113f94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20G=C3=A5rdebrink?= Date: Sun, 17 Dec 2023 23:05:54 +0000 Subject: [PATCH] Make ViaServicePrincipal return same account as base principal --- packages/aws-cdk-lib/aws-kms/lib/via-service-principal.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/aws-cdk-lib/aws-kms/lib/via-service-principal.ts b/packages/aws-cdk-lib/aws-kms/lib/via-service-principal.ts index 85305f2db7a7e..9b31f039fb5a0 100644 --- a/packages/aws-cdk-lib/aws-kms/lib/via-service-principal.ts +++ b/packages/aws-cdk-lib/aws-kms/lib/via-service-principal.ts @@ -9,6 +9,7 @@ export class ViaServicePrincipal extends iam.PrincipalBase { constructor(private readonly serviceName: string, basePrincipal?: iam.IPrincipal) { super(); this.basePrincipal = basePrincipal ? basePrincipal : new iam.AnyPrincipal(); + this.principalAccount = basePrincipal.principalAccount; } public addToPrincipalPolicy(_statement: iam.PolicyStatement): iam.AddToPrincipalPolicyResult {