feat: Support role_arn and source_profile for IAM role assumption#83
Merged
huseyinbabal merged 1 commit intomasterfrom Jan 15, 2026
Merged
feat: Support role_arn and source_profile for IAM role assumption#83huseyinbabal merged 1 commit intomasterfrom
huseyinbabal merged 1 commit intomasterfrom
Conversation
Add support for assuming IAM roles using role_arn and source_profile configuration in ~/.aws/config. This is a common pattern for: - Cross-account AWS access - Least-privilege access patterns - Chained role assumption Implementation: - Parse role_arn, source_profile, external_id, role_session_name, duration_seconds from config file - Recursively resolve source_profile credentials (supports chained roles) - Call STS AssumeRole API with SigV4 signed requests - Cache temporary credentials with automatic refresh before expiration - Integrate into credential chain (priority 3, after SSO) Supported config options: - role_arn (required): ARN of role to assume - source_profile (required): Profile for source credentials - external_id (optional): For cross-account trust policies - role_session_name (optional): Custom session name - duration_seconds (optional): Session duration - region (optional): Region for STS endpoint Closes #13
1fd11f2 to
360eb0e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add support for assuming IAM roles using
role_arnandsource_profileconfiguration in~/.aws/config. This is a common pattern in enterprise environments for cross-account access and least-privilege security.Closes #13
Changes
role_arn,source_profile,external_id,role_session_name,duration_seconds,regionsource_profilecan point to another profile that also uses role assumption (chained roles)Example Configuration
Supported Options
role_arnsource_profileexternal_idrole_session_nametaws-session)duration_secondsregionTesting