(lambda): Imported functions don't have account & region set correctly #17053
Labels
@aws-cdk/aws-lambda
Related to AWS Lambda
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/small
Small work item – less than a day of effort
p2
What is the problem?
Importing a lambda function from ARN using
fromFunctionArn
does not result in the correct region and account being used from the ARN.Looking at the code this is a similar bug to #11199,
environmentFromArn
is not provided in theImport
Reproduction Steps
Either
or
What did you expect to happen?
Expected
lambda.env.region === 'us-east-1'
andlambda.env.account === '123456789012'
What actually happened?
lambda.env == scope.env
The environment details are derived from the stack environment rather than the provided ARN, preventing activities like a Lambda Invoke action to a different region in the same account as the CloudFormation
Region
always points to the same account.CDK CLI Version
1.128.0 (build 1d3883a)
Framework Version
No response
Node.js Version
v16.7.0
OS
Amazon Linux
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: