Search code examples
aws-lambdaaws-cloudformation-custom-resource

allowing cloudformation in one region to access a lambda backed custom resource in a different region


I have a lambda backed custom resource in us-east-2. When I run a cloudformation template in us-east-2 it works just fine. When I go to us-east-1 and try the same cloudformation template, I get an error:

Function not found: arn:aws:lambda:us-east-1:account-id:function:func_name (Service: AWSLambda; Status Code: 404; Error Code: ResourceNotFoundException;

There is VPC peering between the two VPCs, but that doesn't seem to make any difference. And when I try to deploy the same function in the same account in a different region, I get an error, I need to find a solution.


Solution

  • I do not think it is possible for a CloudFormation template in one Region to refer to a Lambda Custom Resource in another Region.

    You will need to duplicate the function in any region where you wish it to be used as a Custom Resource.