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

Add withAssumedRole, deprecate assumeRole #75

Merged
merged 5 commits into from
Sep 3, 2024
Merged

Add withAssumedRole, deprecate assumeRole #75

merged 5 commits into from
Sep 3, 2024

Conversation

pbrisbin
Copy link
Member

@pbrisbin pbrisbin commented Sep 3, 2024

assumeRole does not spawn a background thread to refresh credentials.
This means that if the block goes on long enough, expired credentials
errors will start happening.

withAssumedRole addresses this. I chose to make a new function under a
different name for two reasons:

  1. The fixed function incurs a MonadUnliftIO constraint. Users could
    stay on the deprecated function if they're not able to quickly
    organize things to satisfy this constraint.
  2. The naming better matches the analogous Amazonka function1.

Footnotes

  1. https://hackage.haskell.org/package/amazonka-2.0/docs/Amazonka-Auth-STS.html#v:fromAssumedRole

`assumeRole` does not spawn a background thread to refresh credentials.
This means that if the block goes on long enough, expired credentials
errors will start happening.

`withAssumedRole` addresses this. I chose to make a new function under a
different name for two reasons:

1. The fixed function incurs a `MonadUnliftIO` constraint. Users could
   stay on the deprecated function if they're not able to quickly
   organize things to satisfy this constraint.
2. The naming better matches the analogous Amazonka function[^1].

[^1]: https://hackage.haskell.org/package/amazonka-2.0/docs/Amazonka-Auth-STS.html#v:fromAssumedRole
@pbrisbin pbrisbin requested a review from a team as a code owner September 3, 2024 15:01
@pbrisbin pbrisbin requested review from joelmccracken and removed request for a team September 3, 2024 15:01
@pbrisbin pbrisbin enabled auto-merge (rebase) September 3, 2024 15:07
src/Stackctl/AWS/Core.hs Outdated Show resolved Hide resolved
@pbrisbin pbrisbin merged commit 9c0e43f into main Sep 3, 2024
5 checks passed
@pbrisbin pbrisbin deleted the pb/assume branch September 3, 2024 20:48
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