withPrincipal
public Permission.Builder.Build withPrincipal(software.amazon.awscdk.PolicyPrincipal value)
The entity for which you are granting permission to invoke the Lambda
function. This entity can be any valid AWS service principal, such as
s3.amazonaws.com or sns.amazonaws.com, or, if you are granting
cross-account permission, an AWS account ID. For example, you might want
to allow a custom application in another AWS account to push events to
Lambda by invoking your function.
The principal can be either an AccountPrincipal or a ServicePrincipal.