0

I have lambdas in N. Virginia and ireland region which put metadata on X-RAY and have another lambda in ireland region which fetch metadata from X-RAY. Now I want to fetch metadata from N. Virginia region in ireland region. How could I do this? Is it possible? I am using node js.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
ABCD
  • 730
  • 1
  • 13
  • 31

1 Answers1

1

I can't give you a copy/paste example right away as I am not quite that familiar with NodeJS, but I tested a bit and it seems t obe working as expected.

What you can do is initialize an SDK client (all runtimes have that preinstalled) and specify the region, in Python it goes like this:

import boto3
def lambda_handler(event, context):
    xray_client = boto3.client('xray', region_name='eu-central-1')
    xray_client.get_sampling_rules()

Check the documentation for NodeJS and you should be good to go.

NOTE: For Python, I noticed some of the provided methods in the documentations, don't actually work.

EDIT: To clarify, the sample I've provided was from a lambda function created in the us-east-1 region and it listed properly the sampling_rules from eu-central-1

AlexK
  • 1,380
  • 10
  • 17