Skip to content

feat(assume): add --export-as option#942

Open
QuentinBtd wants to merge 1 commit into
fwdcloudsec:mainfrom
QuentinBtd:feat/add_export_as_to_assume
Open

feat(assume): add --export-as option#942
QuentinBtd wants to merge 1 commit into
fwdcloudsec:mainfrom
QuentinBtd:feat/add_export_as_to_assume

Conversation

@QuentinBtd
Copy link
Copy Markdown

Description

This PR implements the feature requested in #821 by adding support for exporting credentials to ~/.aws/credentials under a custom profile name.

What changed

  • Added a new assume flag: --export-as

    • Example: assume <source-profile> --export-as <new-profile-name>
  • Updated export flow to:

    • Trigger credential export when --export-as is provided (even without --export)
    • Use the provided custom profile name as-is
  • Extended credential export implementation with:

    • ExportCredsToProfileWithOptions(profileName, creds, applySuffix bool)

Behavior details

  • Existing behavior is unchanged for --export:
    • ExportCredentialSuffix is still applied when configured.
  • New behavior for --export-as:
    • ExportCredentialSuffix is intentionally not applied.
    • The destination profile name is exactly the value passed to --export-as.

Closes #821.

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.

--export with a new name

1 participant