twitchscience / kinsumer

Native Go consumer for AWS Kinesis streams.
Other
134 stars 35 forks source link

Issue reading kinesis stream across different aws accounts #48

Closed rhythmsharma closed 5 years ago

rhythmsharma commented 5 years ago

Hi,

I am trying to initialize a new Kinsumer Interface to read kinesis stream across different AWS accounts. I want to use different session and config credentials for it but not able to find any method which kinsumer supports currently. Could someone can guide how can I make use of Kinsumer to read streams across aws accounts. I have a kinesis client object as well. Can I make use of it to initialize kinsumer interface?

garethlewin commented 5 years ago

Hi @rhythmsharma you have two options.

The first is to create an aws-sdk-go session that uses sts to assume a role in the other account. Then youse the kinsumer method NewWithSession to initialize kinsumer with that session.

Alternatively, if you already have a kinesis client object you can create a dynamodb client object as well and call NewWithInterfaces

rhythmsharma commented 5 years ago

Thanks @GarethLewin for the response. NewWithInterfaces solves my purpose. I am able to initialize kinsumer using it.