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

Added Support for performing Assume role with Athena Connections #2471

Merged
merged 5 commits into from May 13, 2024

Conversation

thatguyfig
Copy link
Contributor

Features and Changes

Provides the UI and backend for performing an assume role before running Athena queries. Since the getAthenaInstance function is used to obtain a client, this can also be used to interact with sts beforehand before returning the client with embedded credentials - this also incorporates the JavaScript v3 SDK.

I'm not to sure how the errors are propagated up the UI but it seems to work pretty well - so that should be one area to improve. Also the session is currently defaults to 900 seconds which could be too short for some beefy queries.

@thatguyfig
Copy link
Contributor Author

thatguyfig commented May 2, 2024

There is another PR floating around that referenced my issue, but the code seems like it could work for the auto mode to assume another role for the app as a whole.

#2438

@thatguyfig
Copy link
Contributor Author

#2442

@cleaton
Copy link

cleaton commented May 2, 2024

There is another PR floating around that referenced my issue, but the code seems completely half-baked

#2438

the upgraded SDK allows configuring credentials via aws cli config file, can add assume role configuration in there and auto will pick it up.

@thatguyfig
Copy link
Contributor Author

There is another PR floating around that referenced my issue, but the code seems completely half-baked

#2438

the upgraded SDK allows configuring credentials via aws cli config file, can add assume role configuration in there and auto will pick it up.

Yes that is possible, but that doesn't offer a solution for when you have different connections in different accounts and need to be able to assume a specific role.

With this approach the assume role is tied to the connection and can be specified when you set it up so it can be created by the users themselves.

@cleaton
Copy link

cleaton commented May 2, 2024

There is another PR floating around that referenced my issue, but the code seems completely half-baked
#2438

the upgraded SDK allows configuring credentials via aws cli config file, can add assume role configuration in there and auto will pick it up.

Yes that is possible, but that doesn't offer a solution for when you have different connections in different accounts and need to be able to assume a specific role.

With this approach the assume role is tied to the connection and can be specified when you set it up so it can be created by the users themselves.

Sorry I think there is some misunderstanding here, I did not mean our PRs are equal or anything I only referenced it as a possible workaround as there was no PR mentioned there yet.

We want the same thing and this is a nice solution so I’m all for adding this instead, thank you for sharing it 👍

Copy link
Member

@jdorn jdorn left a comment

Choose a reason for hiding this comment

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

Thanks for contributing! Left a few comments

packages/back-end/src/services/athena.ts Outdated Show resolved Hide resolved
packages/back-end/src/services/athena.ts Outdated Show resolved Hide resolved
packages/front-end/components/Settings/AthenaForm.tsx Outdated Show resolved Hide resolved
packages/front-end/components/Settings/AthenaForm.tsx Outdated Show resolved Hide resolved
@thatguyfig
Copy link
Contributor Author

Thanks @jdorn - issues have been addressed, please could re-review?

@thatguyfig
Copy link
Contributor Author

bump

@jdorn jdorn merged commit b7a759b into growthbook:main May 13, 2024
2 of 3 checks passed
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.

None yet

3 participants