|
| 1 | +#+STARTUP: inlineimages |
| 2 | + |
| 3 | +* AwsSsoConfigGenerator |
| 4 | + |
| 5 | +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. |
| 6 | + |
| 7 | +** Downloads |
| 8 | + |
| 9 | +Available downloads for macOS (x86 and m series), linux (x86 and arm64) and windows. |
| 10 | + |
| 11 | +*** macOS |
| 12 | + |
| 13 | +On macOS you will get a popup if you run without doing the below. |
| 14 | + |
| 15 | +~Apple could not verify “aws-sso-config-generator” is free of malware that may harm your Mac or compromise your privacy.~ |
| 16 | + |
| 17 | +#+caption: macOS Apple popup could not verify |
| 18 | +[[file:./images/macos-popup.png]] |
| 19 | + |
| 20 | +**** Allow executable to not be quarantined |
| 21 | + |
| 22 | +Make sure to only do this for verified executable downloaded from https://github.com/djgoku/aws-sso-config-generator or built locally. |
| 23 | + |
| 24 | +#+begin_example |
| 25 | +xattr -dr com.apple.quarantine ~/aws-sso-config-generator |
| 26 | +chmod +x ~/aws-sso-config-generator |
| 27 | +#+end_example |
| 28 | + |
| 29 | +** Usage |
| 30 | +*Note: if no parameters are passed user will be prompted for ~region~ and ~start_url~.* |
| 31 | + |
| 32 | +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/#/~. |
| 33 | + |
| 34 | +#+begin_example |
| 35 | +aws-sso-config-generator --region us-west-2 --start-url https://<example>.awsapps.com/start/#/ |
| 36 | +#+end_example |
| 37 | + |
| 38 | +#+begin_example |
| 39 | +aws-sso-config-generator -r us-west-2 -u https://<example>.awsapps.com/start/#/ |
| 40 | +#+end_example |
| 41 | + |
| 42 | +** Parameters |
| 43 | + |
| 44 | +| Option | Type | Example | Description | |
| 45 | +|---------------------+--------+-------------------------------------------+-------------------------------------------| |
| 46 | +| --region or -r | string | -r us-west-2 | Region where AWS access portal is hosted. | |
| 47 | +| --start-url or -u | string | -u https://<example>.awsapps.com/start/#/ | The URL for the AWS access portal | |
| 48 | +| --help or -h | N/A | -h | Help menu | |
| 49 | + |
| 50 | +** Example Config (~/.aws/sso.generated) |
| 51 | + |
| 52 | +#+begin_example |
| 53 | +# config generated via https://github.com/djgoku/aws-sso-config-generator |
| 54 | +# |
| 55 | +# This requires AWS CLI v2 |
| 56 | +# |
| 57 | +# 1. log into aws sso via `aws sso login --profile use-any-profile-name` |
| 58 | +# 2. validate `AWS_PROFILE=use-any-profile-name aws sts get-caller-identity` |
| 59 | + |
| 60 | +# AWS_CONFIG_FILE=~/.aws/config.generated AWS_PROFILE=1111111-RoleName aws sts get-caller-identity |
| 61 | +[profile 1111111-RoleName] |
| 62 | +sso_start_url = https://<example>.awsapps.com/start/#/ |
| 63 | +sso_region = us-east-2 |
| 64 | +sso_account_id = 1111111 |
| 65 | +sso_role_name = RoleName |
| 66 | +region = us-west-2 |
| 67 | +output = json |
| 68 | +#+end_example |
| 69 | + |
| 70 | +** Development |
| 71 | + |
| 72 | +1. Clone repository |
| 73 | +2. ~devbox run do-all~ |
| 74 | + |
| 75 | +** FAQ |
| 76 | + |
| 77 | +*** Why am I seeing an old version of an aws-sso-config-generator? |
| 78 | + |
| 79 | +You might need to clean-up old resources from a previous version and re-run the application. |
| 80 | + |
| 81 | +#+begin_example |
| 82 | +./burrito_out/aws_sso_config_generator maintenance uninstall |
| 83 | +[w] This will uninstall the application runtime for this Burrito binary! |
| 84 | +[?] Please confirm this action [y/n]: y |
| 85 | +y |
| 86 | +[i] Deleting directory: /home/devbox/.local/share/.burrito/aws_sso_config_generator_erts-15.2.2_0.1.0 |
| 87 | +[i] Uninstall complete! |
| 88 | +[i] Quitting. |
| 89 | +#+end_example |
| 90 | + |
| 91 | +*** How do these binaries work? |
| 92 | + |
| 93 | +We are using [[https://github.com/burrito-elixir/burrito][burrito]] which packages everything required to run the application into a self-extracting executable. Once ran the application is extracted and then ran. |
| 94 | + |
| 95 | +** References |
| 96 | +*** Elixir |
| 97 | +- https://github.com/burrito-elixir/burrito |
| 98 | +- https://github.com/aws-beam/aws-elixir |
| 99 | + |
| 100 | +*** Other |
| 101 | +- https://github.com/jetify-com/devbox |
| 102 | +- https://stackoverflow.com/a/71850591 |
| 103 | +- https://docs.aws.amazon.com/singlesignon/latest/OIDCAPIReference/Welcome.html |
0 commit comments