Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable the plugin to assume a role #40

Closed
wants to merge 2 commits into from

Conversation

sihil
Copy link
Contributor

@sihil sihil commented Apr 19, 2018

We have a requirement to get data from a Kinesis stream in a different AWS account.

This PR adds a new role_arn config option that takes an AWS role ARN that will be assumed. This role is assumed from either the default or profile credentials. The newly created credential provider is used only for accessing the kinesis stream. Both dynamo and cloudwatch access by the KCL continue to be done using the underlying credential provider and so these resources are in the home account rather than the account containing the stream.

@sihil
Copy link
Contributor Author

sihil commented Apr 19, 2018

Based on the other PRs I don't think this is responsible for the broken build. Is that something that is likely to be looked at?

@sihil sihil force-pushed the sihil/assume-role branch from 1bf31da to 7c04b37 Compare April 25, 2018 13:43
@sihil sihil force-pushed the sihil/assume-role branch from 7c04b37 to 4284588 Compare May 3, 2018 17:22
@sihil
Copy link
Contributor Author

sihil commented May 3, 2018

❗️I've rebased this over #41 to show that it builds - naturally it shouldn't be merged until that has been.

@sihil sihil force-pushed the sihil/assume-role branch 2 times, most recently from 934a6ed to ebfdfc9 Compare October 18, 2018 15:32
@sihil sihil mentioned this pull request Oct 18, 2018
@sihil
Copy link
Contributor Author

sihil commented Oct 18, 2018

I've now rebased this against master as the build has been fixed.

Also the creation of #47 has made me notice that #34 exists. Don't mind which gets merged, but this has been running in PROD for several months now.

@sihil
Copy link
Contributor Author

sihil commented Nov 16, 2018

Hi @robbavey - I've noticed a number of PRs subsequent to this get reviewed and merged. Do I need to do something to get this picked up by someone?

@robbavey
Copy link
Contributor

@sihil Thanks for the reminder - I missed this when I was merging the other PRs. Let me take a look and get back to you

Copy link
Contributor

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small ask, but other than that, this is a great PR and will be happy to merge - thanks for the contribution


# If a role ARN is set then assume the role as a new layer over the credentials already created
unless @role_arn.nil?
session_id = "worker" + worker_id
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to add an extra configuration parameter role_session_name for the sake of consistency with other logstash aws plugins (this is in the common aws mixin gem shared by most aws plugins)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useful to know. Will look at this today and see what the best approach is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've looked at adopting the mixin for this plugin. Unfortunately the mixin isn't flexible enough to cover all of the options currently in this plugin (e.g. profile can't be specified).

The ideal solution would be to re-work the mixin so these are available everywhere and the credential logic isn't duplicated. However for the time being I'll rework this using the same naming convention and duplicate the logic internally.

@sihil sihil force-pushed the sihil/assume-role branch from 479e416 to a07a86c Compare January 2, 2019 15:35
@sihil sihil force-pushed the sihil/assume-role branch from a07a86c to 56722bf Compare January 2, 2019 16:08
@sihil
Copy link
Contributor Author

sihil commented Jan 2, 2019

@robbavey I've addressed your comment. I think the build is failing on master too but I haven't figured out why. I'm also going to deploy my changes to our production environment to confirm they work as expected but can't see why they wouldn't. (Although the more recent KCL requires kinesis:ListShards permission so I haven't been able to get that completed today.)

Copy link
Contributor

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sihil The changes look good from this end - I'll be happy to merge this in once you give me the go ahead to do so. The build failure is unrelated - it pertains to a change made on logstash master this morning, and should be fixed now - I'll kick off a rebuild

I'll do a follow-up PR to update the asciidoc, changelog and plugin versions once that has merged, and should be able to get this published shortly.

Thanks for the contribution!

@sihil
Copy link
Contributor Author

sihil commented Jan 3, 2019

Thanks @robbavey! This has been on our prod stack for a few hours now without any issues. Will be glad to no longer be on a fork 😀

@robbavey
Copy link
Contributor

robbavey commented Jan 3, 2019

@sihil I've added your commits to a new PR (#57), which includes the doc changes, version bumps, etc that we need in order to be able to publish the gem.

@robbavey
Copy link
Contributor

robbavey commented Jan 4, 2019

@sihil PR #57 which incorporated these changes has been merged, and the plugin published. Thank you again for your contribution!

@sihil
Copy link
Contributor Author

sihil commented Jan 5, 2019

Closing as this has been superseded by #57

@sihil sihil closed this Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants