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

Enabling long-running jobs to use federated STS assume role authentication for AWS resources. #34440

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

prodriguezdefino
Copy link
Contributor

@prodriguezdefino prodriguezdefino commented Mar 26, 2025

Currently long-running jobs, being those streaming or batch based, have limited options to authenticate against AWS services when running outside of AWS. In fact, the only viable option for batch pipelines or streaming pipelines that execute for more than X hours is to use a StaticCredentialsProvider configuration, this approach imposes some scrutiny given that the use of such provider is discouraged in favor of using temporary credentials.

AWSOptions enables the configuration of a provider named StsAssumeRoleWithWebIdentityCredentialsProvider which will use short-lived credentials and uses OIDC web identity tokens to authenticate the AWS sdk in a federated way. The problem this implementation presents is that once a web identity token is created it normally has a predefined expiration date, for which the AWS requests will fail after the expiration time is reached.

This change implements a StsAssumeRoleWithDynamicWebIdentityCredentialsProvider which can be configured with a FQCN in charge of providing fresh web id tokens that can be used to authenticate against AWS services in a federated way. The implementation delegates to the class StsAssumeRoleWithWebIdentityCredentialsProvider most of the logic, but creates the authentication request dynamically and attaches a refreshed web id token for all credential resolution requests.

Also, a simple Google ADC web id token provider (GoogleADCIdTokenProvider) is included for convenience, this enables XLang Dataflow pipelines to be configured without the need of including any Java code.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@prodriguezdefino
Copy link
Contributor Author

fixes #34441

@prodriguezdefino
Copy link
Contributor Author

Run Java_Amazon-Web-Services2_IO_Direct PreCommit

@prodriguezdefino prodriguezdefino marked this pull request as ready for review March 27, 2025 01:10
Copy link
Contributor

Assigning reviewers. If you would like to opt out of this review, comment assign to next reviewer:

R: @m-trieu for label java.
R: @chamikaramj for label io.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant