Using The Go SDK
Using Environment Settings With v1
There’s a version 2 of the AWS SDK for Go, but sometimes you have no choice but to stay on version 1. You might be using an alternative DynamoDB client that has a nicer API that the one provided by AWS.
Now, let’s say you want have the client read the API keys from environment variables. You may be setting up the client in a way similar to this:
Running this will give you this error:
Now, it’s possible to get the API keys from the environment with the session configured this way. What you’ll need to do is set the environment variable AWS_SDK_LOAD_CONFIG
to true
. Doing so should actually clear this error and your client will start working as expected.
If you don’t want to do that, and just use the API keys provided in the environment, you can explicitly enable using shared configuration:
This bypasses the AWS_SDK_LOAD_CONFIG
setting completely.
Last updated