External Id Authentication for Eventbridge cross account events

0

Hi,

i have 2 aws accounts and i use eventbridge to emit events from x account to y account.

i have configured the respective roles on both emitting side and receiving side and they work perfectly well.

As a security measure i want to use an external id when giving access to resources for other accounts, which is recommended in aws iam docs.

i have surfed the internet for a while but couldn't find any examples or guides that helps me in achieving this.

i know that i can add a condition on receiving role policy with that external id from docs but unable to figure out how to send the external id when calling the put events.

i use python with boto3 sdk. the answer need not by language specific. i would be glad if an approach is suggested.

1 Answer
0

You pass the ExternalId when you assume the role. See:

You should always specify the external ID in your AssumeRole API calls. 

Check this link, assume_role, for an example code on passing the ExternalId when assuming the role.

So, the code running in account-x wants to put an event in account-y. The code in account-x just needs to add the ExternalId as a part of the assume role call to get credentials for account-y.

profile pictureAWS
EXPERT
kentrad
answered a year ago
  • can you guide me to do this with some code examples using python?

    i have gone through those docs previously also. but couldn't find what is the exact implementation that has to be changed.

    from emitting side we are just calling the event bridge put events method.

    also i am curious that is this external id passing applicable to eventbridge events as its basically an aws serviced and not a third party service

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