You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the CDK cannot determine the IAM role you are using based on just the function ARN.
You will need to use fromFunctionAttributes() for your use case, and explicitly specify the IAM role. Most likely the IAM role is also defined outside of the CDK app, so it will also have to be imported. Your code will look something like -
github-actionsbot
added
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
and removed
closing-soon
This issue will automatically close in 4 days unless further comments are made.
labels
Sep 22, 2020
NGL321
added
guidance
Question that needs advice or information.
and removed
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
labels
Dec 23, 2021
/**
* Import a lambda function into the CDK using its ARN
*/
public static fromFunctionArn(scope: Construct, id: string, functionArn: string): IFunction {
return Function.fromFunctionAttributes(scope, id, { functionArn });
}
lambda.Function.fromFunctionArn is not returning the role
Reproduction Steps
What did you expect to happen?
fromFunctionArn() returns all information needed to add a destination.
What actually happened?
It throws following error:
No child with id:....
Environment
Other
It seems like, that the role information is getting lost after calling fromFunctionArn().
aws-cdk/packages/@aws-cdk/aws-lambda/lib/function.ts
Line 362 in ad9a705
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: