Seeking to assign an existing role to a lambda function created with CDK Here is what I am attempting:
const role1 = iam.Role.fromRoleArn(this, 'Role', 'ARN', {
mutable: true,
});
const lambda1 = new lambda.Function(this, 'lambda1', {
runtime: lambda.Runtime.PYTHON_3_7,
code: lambda.Code.asset('lambda/lambda1_function'),
handler: 'lambda_function.lambda_handler',
role:role1,
reservedConcurrentExecutions: 1
});
Encountering the following exception during cdk deploy:
The role defined for the function cannot be assumed by Lambda. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID:
Any assistance in resolving this issue would be greatly appreciated. Note: I am using typescript [email protected]