-
I am new to CDK. Using Java CDK to add a Lambda. Goal is to add an Eventbridge.Scheduler to trigger the Lambda. For this I need to add sts:AssumeRole in trust relationship for the Lambda Role. How can I do that? Here is my code:
So lambdaExecutionRole is the IAM role CDK creates. I tried
Also tried creating a PolicyStatement
What I am missing? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You have your order of operations incorrect. Create the role that you wish to use for the Lambda function first. Add the requisite service principal information. Then pass that to the lambda function builder. |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
You have your order of operations incorrect.
Create the role that you wish to use for the Lambda function first. Add the requisite service principal information. Then pass that to the lambda function builder.