Configuration question/feedback #1261
Replies: 2 comments 4 replies
-
You can use Check out the developer guide section on environment based config and let us know if you still have questions. |
Beta Was this translation helpful? Give feedback.
-
Online here: And then when it points to the github examples: I typically follow the outlined examples (and will get code review questions if I'm deviating from online examples which makes sense), but was wanting to configure everything from either the profile or from env variables pushed down into our containers directly from our integration with AWS as that seems like the "best practices" and most "flexible" and "easiest" way to configure it. So, instead of my code using the above linked examples, I just use the suggested: SecretsManagerClient.fromEnvironment() which seems more inline with the "best practices" way? Looking through the other Kotlin examples, they all seem to be instead showing a manual way of configuration, which makes me "feel" like I'm doing something wrong, but the more I become involved with AWS services and development, the more I want the Across different services and programming language integration points with AWS with different engineers, we're having to stay on top of ensuring they don't hard code a value such as a region or use different env variables that aren't standard AWS variables. Usually they're going down the wrong decision tree like I did when starting with the examples. And so far it feels like the best way to configure AWS services is through the environment and locally using profiles as a developer to manage different test instances easier and test/staging/prod rollouts easier. |
Beta Was this translation helpful? Give feedback.
-
I might be missing something, but when using the
aws-sdk-kotlin
, I really want to utilize two things out of the box:AWS_PROFILE
env variable, configure everything through my local.aws/config
unless I decide to pass down another AWS Env/Java System variable to "override a profile setting"This will make things easier for when people are using multiple profiles such as localstack profile for switching between them as developers. As a dev, locally I want to just change my
AWS_PROFILE
env variable and have it take effect in my environment rather than multiple ones.To give an example of this operating as I expect it to... When I use the JavaScript JDK from: https://github.com/aws/aws-sdk-js-v3
I am able to do configuration with no code touch points like so:
☝️ , then from the outside of my container/process I can pass in just the
AWS_PROFILE
env variable and the AWS-SDK-JS will use my profile information and configure it from there. However, when using the aws-sdk-kotlin I am finding:localstack
So, maybe I'm missing something, but this is what I have to add as a code touch point right now:
And I have to keep these 3 env variables configured:
at all times so that I can switch between using localstack profile as well as my regular SSO sign on profile that I have. I would prefer:
AWS_PROFILE
env configuration variable and all my profile information lives in my~/.aws/config
Here is my
localstack
profile (for reference). The JS SDK isn't perfect in that I have to add a few extra endpoint url's in the profile sections, but it does work with them once I get them correct without having to add code to read them.Ref: https://docs.localstack.cloud/user-guide/integrations/aws-cli/#configuring-a-custom-profile
Beta Was this translation helpful? Give feedback.
All reactions