I have a Lambda function defined in CDK. I'm using this Lambda to invoke a State Machine and for that I would need to provide it some Policies. The way I tried was the following:
const stepFunctionsPolicy = new PolicyStatement({
effect: Effect.ALLOW,
actions: ["states:*"],
resources: ['*']
})
MachineLambda.addToRolePolicy(stepFunctionsPolicy) //Added the Policy to the Lambda's Role
This is a workaround, but ideally, I would like to provide AWS Managed Policies, instead of manually defining each policy, to this Lambda function (specifically the AWSStepFunctionsFullAccess)?