Replies: 2 comments 2 replies
-
Environment variables take priority over profile files in the default provider. If you want to force it to use the profile file instead of the env var, you can supply it with a |
Beta Was this translation helpful? Give feedback.
0 replies
-
But is there a decent way for me to provide the region and credentials that
I've loaded myself? Or else is there a way to have the program terminate
with a decent error message when loading the config? Because right now what
happens is that everything works until the first time the API is called,
and then that call returns an error when it would be much nicer to have
service startup fail instead ..
Cheers
…On Mon, 28 Nov 2022, 21:50 John DiSanti, ***@***.***> wrote:
Environment variables take priority over profile files
<https://docs.rs/aws-config/0.51.0/aws_config/default_provider/region/fn.default_provider.html>
in the default provider. If you want to force it to use the profile file
instead of the env var, you can supply it with a ProfileFileRegionProvider
<https://docs.rs/aws-config/0.51.0/aws_config/profile/struct.ProfileFileRegionProvider.html>
directly instead of aws_config::default_provider::region::Builder....
—
Reply to this email directly, view it on GitHub
<#672 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAQEGFLJEPQROEES6XYXZ3WKUSK5ANCNFSM6AAAAAASNZOJXA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm writing a non-AWS deployed service that is using AWS features - Cognito, specifically. And I'm wanting to be able to programmatically construct the
SdkConfig
object, mostly so that I can better control how the values are loaded and the errors that are thrown when they aren't available. As it is right now, when loading anSdkConfig
using the standard way, if there are no credentials provided then it all works fine until you come to actually use it!What I've done so far is:
Where
aws_region
is a field that, for now, is hard-coded but is going to be loaded from my configuration in time. This seems to work fine, right up until you run the program with the AWS_REGION environment variable set. As soon as you do that, the configured value is ignored in favour of that environment variable. :(Is there some correct way to achieve this? Or am I just wasting my time?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions