Help in setting up a Lambda in Account A to be Invoked and use a Custom Resource Service Token in Account B Using CloudFormation

0

Pls help I have a Lambda function in Account A that I need to use as a service token for a custom resource in Account B.

Pleas help with a Cloudformation Setup

Below is my Setup

Account A Resource

Resources:
  MyLambdaFunction:
    Type: AWS::Lambda::Function
    Properties:
      FunctionName: MyLambdaFunction
      Handler: index.handler
      Role: arn:aws:iam::<Account A ID>:role/LambdaExecutionRole
      Code:
        S3Bucket: my-bucket
        S3Key: my-lambda-code.zip
      Runtime: python3.8
      Timeout: 60

Account B Resource

Resources:
  MyCustomResource:
    Type: "Custom::MyCustomResource"
    Properties:
      ServiceToken: "arn:aws:lambda:AccountA:region:function:MyLambdaFunction"
1 Answer
3
Accepted Answer

Hi,

Please, follow precisely the guidance of this Knowledge Center article: https://repost.aws/knowledge-center/cloudformation-lambda-custom-resource

It is the solution for what you're trying to achieve via your CloudFormation templates.

Best,

Didier

profile pictureAWS
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago
profile picture
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions