Hi all,
I was in the process of automating my SSO login and was ultimately trying to read aws-adfs configuration from my profile using aws configure get and could NOT, for the life of me, get it to print anything.
$ aws configure get --profile PROFILE adfs_config.adfs_user
$
After much screaming and cursing, I dug into aws-cli and basically found this:
https://github.com/aws/aws-cli/blob/2.32.17/awscli/customizations/configure/get.py#L58
TL;DR aws configure considers dots as separators for configuration sections, so aws-adfs configuration keys cannot be queried using aws-cli.
Various solutions include:
- replacing dots with underscores in the config keys
[profile PROFILE]
region = us-west-1
adfs_config_adfs_user = remi.cardona@example.com
...
- using sections as supported by
.aws/config:
[profile PROFILE]
region = us-west-1
adfs_config =
adfs_user = remi.cardona@example.com
That last one seems the "prettiest", though I would suggest using botocore to read the configuration (instead of python's configparser directly):
https://github.com/boto/botocore/blob/develop/botocore/configloader.py#L183
Thanks!
Hi all,
I was in the process of automating my SSO login and was ultimately trying to read aws-adfs configuration from my profile using
aws configure getand could NOT, for the life of me, get it to print anything.$ aws configure get --profile PROFILE adfs_config.adfs_user $After much screaming and cursing, I dug into
aws-cliand basically found this:https://github.com/aws/aws-cli/blob/2.32.17/awscli/customizations/configure/get.py#L58
TL;DR
aws configureconsiders dots as separators for configuration sections, so aws-adfs configuration keys cannot be queried using aws-cli.Various solutions include:
.aws/config:That last one seems the "prettiest", though I would suggest using botocore to read the configuration (instead of python's
configparserdirectly):https://github.com/boto/botocore/blob/develop/botocore/configloader.py#L183
Thanks!