let servicePrincipal: any = new iam.ServicePrincipal("lambda.amazonaws.com");
let policyDoc = new iam.PolicyDocument({
statements: [
new iam.PolicyStatement({
actions: ["sts:AssumeRole"],
principals: [servicePrincipal],
effect: iam.Effect.ALLOW,
resources: ["arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole"],
sid: ""
})
],
});
let accessRole: any = new iam.Role(this, 'git-access-role', {
assumedBy: servicePrincipal,
inlinePolicies: { policyDoc }
});
I'm creating a cdk lambda with a role that has AWSLambdaBasicExecutionRole but I get an error saying
A PolicyStatement used in an identity-based policy cannot specify any IAM principals
not quite sure...what does it mean and what should I do?