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

Generate will include invalid characters in profile names #825

Open
timwisbauer opened this issue Jan 30, 2025 · 0 comments
Open

Generate will include invalid characters in profile names #825

timwisbauer opened this issue Jan 30, 2025 · 0 comments

Comments

@timwisbauer
Copy link

Problem

We're in the unfortunate position to have [] in our AWS account names like this: Company Name [production].

granted sso generate happily generates a config with these account names, but using them results in an error. Is it possible to automatically strip these characters out?

Example generated config:

[profile Company-Name-[production]/RoleName]
granted_sso_start_url      = https://<REDACTED>.awsapps.com/start
granted_sso_region         = <REDACTED>
granted_sso_account_id     = <REDACTED>
granted_sso_role_name      = <REDACTED>
common_fate_generated_from = aws-sso
credential_process         = granted credential-process --profile Company-Name-[production]/RoleName

The profile doesn't appear in the list when I run assume, but when I attempt to use the profile via environment variable I get:

❯ export AWS_PROFILE='Company-Name-[production]/RoleName'
❯ aws sts get-caller-identity

Error when retrieving credentials from custom-process: [!] The profile Company-Name-[production]/RoleName cannot be loaded because the name contains one or more of these characters '\][;'"'
[i] Try renaming the profile to 'Company-Name-[production]/RoleName'
[✘] profile not found

Alternative Solutions Considered

For now I've just been renaming the generated profiles manually. I've also re-generated using the template parameter and account ID instead. Both of these work fine TBH, but it'd be nice to have the generate command automatically remove the invalid characters.

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

No branches or pull requests

1 participant