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 個回答
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
專家
kentrad
已回答 1 年前
  • 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

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南