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

Support reading the credentials from the ~/.aws/credentials file within the Spark cluster #123

Closed
wants to merge 1 commit into from

Conversation

julienrf
Copy link
Collaborator

@julienrf julienrf commented Mar 30, 2024

Currently, the users of the migrator have to provide their AWS credentials through the config.yaml file. According to the description of #122, in some cases it is desirable to also read the AWS credentials from the user profile (~/.aws/credentials).

This PR addresses this need by using a capability of the Hadoop connector to set a custom AWS credentials provider. We set it to com.amazonaws.auth.profile.ProfileCredentialsProvider, which is the standard profile credentials provider from the AWS SDK.

Ultimately, if necessary we could make this configurable and allow our users to supply which credentials provider to use. This would give them full control on that.

According to #122 (comment), this PR fixes #122.

@julienrf julienrf changed the title Add the default ProfileCredentialsProvider to the credentials provider chain Support reading the credentials from the ~/.aws/credentials file within the Spark cluster Apr 1, 2024
@julienrf julienrf marked this pull request as ready for review April 1, 2024 12:15
@julienrf
Copy link
Collaborator Author

julienrf commented Apr 1, 2024

After a second thought, I wonder if we should also support reading credentials from environment variables (see also awslabs/emr-dynamodb-connector#185).

@tarzanek
Copy link
Contributor

tarzanek commented Apr 2, 2024

ideal way is to read from everywhere with some order of preference (and stick to spark ways https://spark.apache.org/docs/latest/configuration.html#dynamically-loading-spark-properties or similar with pre-defined hierarchy and inheritance)

@tarzanek
Copy link
Contributor

tarzanek commented Apr 2, 2024

@julienrf just fix the commit message - add a reference to
#122
(but don't close it)

I'd like to merge this to fix the credentials to the ones provided by config.yaml

Then in later PRs we can tackle env or assumed role approaches for DynamoDB access

@tarzanek
Copy link
Contributor

tarzanek commented Apr 2, 2024

merged by 00412dc
closing

@tarzanek tarzanek closed this Apr 2, 2024
@julienrf julienrf deleted the aws-credentials branch April 18, 2024 08:31
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.

DynamoDB migration is unable to read credentials.
2 participants