Skip to content

Commit

Permalink
chore(logs): fix method name typo (#28416)
Browse files Browse the repository at this point in the history
Fix typo in method name (`convertArnPrincpalToAccountId` -> `convertArnPrincipalToAccountId`) and another `princpal` typo. 

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
paulhcsun authored Dec 18, 2023
1 parent 0b2ba1c commit 0e30fcc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-iam/lib/principals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ export class CompositePrincipal extends PrincipalBase {

public get policyFragment(): PrincipalPolicyFragment {
// We only have a problem with conditions if we are trying to render composite
// princpals into a single statement (which is when `policyFragment` would get called)
// principals into a single statement (which is when `policyFragment` would get called)
for (const p of this._principals) {
const fragment = p.policyFragment;
if (fragment.conditions && Object.keys(fragment.conditions).length > 0) {
Expand Down
4 changes: 2 additions & 2 deletions packages/aws-cdk-lib/aws-logs/lib/log-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,12 @@ abstract class LogGroupBase extends Resource implements ILogGroup {
this.policy = new ResourcePolicy(this, 'Policy');
}
this.policy.document.addStatements(statement.copy({
principals: statement.principals.map(p => this.convertArnPrincpalToAccountId(p)),
principals: statement.principals.map(p => this.convertArnPrincipalToAccountId(p)),
}));
return { statementAdded: true, policyDependable: this.policy };
}

private convertArnPrincpalToAccountId(principal: iam.IPrincipal) {
private convertArnPrincipalToAccountId(principal: iam.IPrincipal) {
if (principal.principalAccount) {
// we use ArnPrincipal here because the constructor inserts the argument
// into the template without mutating it, which means that there is no
Expand Down

0 comments on commit 0e30fcc

Please sign in to comment.