Tool to generate an AWS config file (~/.aws/config) (our file is saved to ~/.aws/config.generated) after authenticating and authorizing AWS SSO IAM Identity Center.
Available downloads for macOS (x86 and m series), linux (x86 and arm64) and windows.
This repository ships an aqua registry at its root
(registry.yaml). Until the package is merged into the official
aqua-registry, you can install
directly from this repo’s registry by pointing mise or aqua at it. Both tools
download the release binary for your OS/arch and verify it against the
release’s aws-sso-config-generator-checksums.txt.
With mise (set the registry via the
MISE_AQUA_REGISTRIES env var, or persist it under [settings] /
aqua.registries in your config):
MISE_AQUA_REGISTRIES=https://github.com/djgoku/aws-sso-config-generator \ mise use -g "aqua:djgoku/aws-sso-config-generator@latest" # or pin a specific version MISE_AQUA_REGISTRIES=https://github.com/djgoku/aws-sso-config-generator \ mise use -g "aqua:djgoku/aws-sso-config-generator@0.4.1"
With aqua directly, add the registry and
package to your aqua.yaml:
registries:
- name: djgoku
type: github_content
repo_owner: djgoku
repo_name: aws-sso-config-generator
ref: main # a tag/commit is safer than a branch
path: registry.yaml
packages:
- name: djgoku/aws-sso-config-generator@0.4.1
registry: djgoku
Then run aqua install. (Both remote forms resolve the file from the default
branch, so they work once registry.yaml is present there.)
Releases after 0.4.2 ship packslip.sigstore.json, a signed list of every
binary’s digest, platform, and command name. This repo’s release workflow
signs it.
With mise 2026.9.2 or later, this installs the binary for your platform. mise
first verifies the signature, project, version, and digest. (mise holds new
releases back 24 hours by default via minimum_release_age.)
mise use -g packslip:github.com/djgoku/aws-sso-config-generator
To verify a manual download with the packslip CLI,
download the binary and packslip.sigstore.json from the same release, then
run the command below. ps1_iiyjlwltyd4utkfftgvbpsxwvq is this repository’s
signer fingerprint. With it, verify fails for a bundle signed by any other
repository, including one that later takes this repository’s name.
packslip verify packslip.sigstore.json \ --pin ps1_iiyjlwltyd4utkfftgvbpsxwvq \ --artifact aws-sso-config-generator-macos-m1
A mise install needs no extra steps. If you download the macOS binary with a browser, macOS quarantines it, and running it shows this popup:
Apple could not verify “aws-sso-config-generator” is free of malware that may harm your Mac or compromise your privacy.
Verify the binary with packslip first, as in Verify with packslip above. Then clear the quarantine flag and make the binary executable:
xattr -dr com.apple.quarantine ~/aws-sso-config-generator chmod +x ~/aws-sso-config-generator
More information here https://apple.stackexchange.com/a/436677
Note: if no parameters are passed user will be prompted for ~region~ and ~start_url~.
Example call of aws-sso-config-generator where AWS access portal is in us-west-2 with a url of https://<example>.awsapps.com/start/#/.
aws-sso-config-generator --region us-west-2 --sso-region us-east-1 --start-url https://<example>.awsapps.com/start/#/
aws-sso-config-generator -r us-west-2 --sso-region us-east-1 -u https://<example>.awsapps.com/start/#/
| Option | Type | Example | Description | Default |
|---|---|---|---|---|
| –sso-region | string | –sso-region us-west-2 | Region where AWS resources are hosted. | |
| –region or -r | string | -r us-west-2 | Region where AWS access portal is hosted. | |
| –start-url or -u | string | -u https://<example>.awsapps.com/start/#/ | The URL for the AWS access portal | |
| –help or -h | N/A | -h | Help menu | |
| –template or -t | string | -t ~/.aws/config.template.json | JSON template file to re-kap accounts and roles | ~/.aws/config.template.json |
| –out or -o | string | -o ~/.aws/config.generated | Output file for generated AWS config file | ~/.aws/config.generated |
| –sso-session-name | string | –sso-session-name my-sso | SSO Session name used in IAM Identity Center config (non-legacy). | my-sso |
| –device-code | N/A | –device-code | Will use the device code XXX-XXX instead of PKCE |
More about this config type: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html
~/.aws/config.generated:
# config generated via https://github.com/djgoku/aws-sso-config-generator # # This requires AWS CLI v2 # # 1. log into aws sso via `aws sso login --profile use-any-profile-name` # 2. validate `AWS_PROFILE=use-any-profile-name aws sts get-caller-identity` # AWS_CONFIG_FILE=~/.aws/config.generated AWS_PROFILE=1111111-ReadOnly aws sts get-caller-identity [profile 1111111-ReadOnly] sso_session = my-sso sso_account_id = 1111111 sso_role_name = ReadOnly region = us-west-2 output = json # AWS_CONFIG_FILE=~/.aws/config.generated AWS_PROFILE=1111111-ReadOnly aws sts get-caller-identity [profile 1111111-ReadOnly] sso_session = my-sso sso_account_id = 1111111 sso_role_name = ReadOnly region = us-west-2 output = json [sso-session my-sso] sso_region = us-east-2 sso_start_url = https://<example>.awsapps.com/start/#/ sso_registration_scopes = sso:account:access
~/.aws/config.generated:
# config generated via https://github.com/djgoku/aws-sso-config-generator # # This requires AWS CLI v2 # # 1. log into aws sso via `aws sso login --profile use-any-profile-name` # 2. validate `AWS_PROFILE=use-any-profile-name aws sts get-caller-identity` # AWS_CONFIG_FILE=~/.aws/config.generated-legacy AWS_PROFILE=1111111-ReadOnly aws sts get-caller-identity [profile 1111111-ReadOnly] sso_start_url = https://<example>.awsapps.com/start/#/ sso_region = us-east-2 sso_account_id = 1111111 sso_role_name = ReadOnly region = us-west-2 output = json # AWS_CONFIG_FILE=~/.aws/config.generated-legacy AWS_PROFILE=1111111-ReadOnly aws sts get-caller-identity [profile 1111111-ReadOnly] sso_start_url = https://<example>.awsapps.com/start/#/ sso_region = us-east-2 sso_account_id = 1111111 sso_role_name = ReadOnly region = us-west-2 output = json
In the template.json structure, the values under the accounts and roles keys are used to replace their respective keys during config generation. For example:
"111111"inaccountswill be replaced with"dev""Admin"inroleswill be replaced with""(empty string)
~/.aws/config.template:
{
"accounts": {
"111111": "dev",
"222222": "uat",
"333333": "prod"
},
"roles": {
"Admin": "",
"ReadOnly": "read"
}
}
- Clone repository
mise install(installs the toolchain, hex/rebar, and node deps via hooks)mise run test- fetch deps, run tests, check formatting
Other tasks:
mise run do-all- full local release build (all Burrito targets)
Note (testing Burrito builds): the wrapper extracts its payload to
~~/Library/Application Support/.burrito/<app>_erts-<erts>_<version>~ and reuses
it on every launch. A rebuilt binary at the same version will keep running the
old extracted payload - run ./burrito_out/<binary> maintenance uninstall
before re-testing a rebuild.
mise run escript- build the escript variantmise run gen-workflows- regenerate GitHub Actions YAML from the Pkl sourcesmise run version-info-only- print the current mix.exs version
| Method | Mermaid Diagram |
|---|---|
| PKCE via aws-sso-config-generator | images/aws-sso-config-generator-authorization-code-pkce-flow.md |
| PKCE via aws cli | images/aws-sso-auth-code-pkce-flow.md |
| Device Code via aws-sso-config-generator | images/aws-sso-config-generator-device-code-flow.md |
| Device Code via aws cli | images/aws-sso-device-code-flow.md |
You might need to clean-up old resources from a previous version and re-run the application.
./burrito_out/aws_sso_config_generator maintenance uninstall [w] This will uninstall the application runtime for this Burrito binary! [?] Please confirm this action [y/n]: y y [i] Deleting directory: /home/devbox/.local/share/.burrito/aws_sso_config_generator_erts-15.2.2_0.1.0 [i] Uninstall complete! [i] Quitting.
We are using burrito which packages everything required to run the application into a self-extracting executable. Once ran the application is extracted and then ran.
- https://github.com/jetify-com/devbox
- https://stackoverflow.com/a/71850591 - Process for
aws-sso-config-generatorand any others to build tooling like this.
- https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html
- https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html
- https://aws.amazon.com/blogs/developer/aws-cli-adds-pkce-based-authorization-for-sso/ - Announcement of AWS CLI adding PKCE
- https://github.com/aws/aws-cli/commit/130005af5ea6a75705ed528aaf06d533f449bef9 - Implementing PKCE in AWS CLI

