I've been reading through documentation for some time. I can see examples for the JavaScript and Go SDK that show how to load the config file by setting the AWS_SDK_LOAD_CONFIG
environment variable to a truthy value. The documentation is here and here respectively.
However, for my requirements, I must use Java. I can't find an equivalent reference in the Java SDK. Which leads me to assume three things.
- Java's SDK doesn't use this variable
I'm pretty sure this might be the case, as just trying it didn't seem to get it to work.- Update: checking out both the Java SDK and Java SDK V2 and searching with
ack -i "AWS_SDK_LOAD_CONFIG"
shows that neither project use this variable.
- Java's SDK uses a different variable
- I think this is un-likely, as it would not be uniform with the other two SDKs.
- Java's SDK expects you to do this programmatically.
- Seems the most likely, yet I can't find how to do this. I must be using the wrong key-words or be overlooking something to get this behavior.
For clarity the profile I need to load is sbx
, which lives in my config, but has no adjacent value in the credentials file. Here is my ~/.aws/config file:
[profile shared]
output = json
region = us-west-2
adfs_config.ssl_verification = True
adfs_config.role_arn = ....
adfs_config.adfs_host = ....
adfs_config.adfs_user = ....
[profile sbx]
role_arn = ... (this is different from the adfs_config.role_arn above)
source_profile = shared
region = us-west-2
and ~/.aws/credentials file: (this file is automatically populated with the aws-adfs
command.
[shared]
aws_access_key_id = ....
aws_secret_access_key = ....
aws_session_token = ....
aws_security_token = ....
[profile shared]
should be[shared]
?