-
all examples about how to create config show loading config from environment (~/.aws/xxx)
I don't want to load from environment, I want to hardcode the credentials in python, for example, I can hardcode everything:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
In general you should prefer to use the credential providers that come with the SDK to get credentials securely, since it isn't secure to hardcode credentials into your application. That said, if you need to do this, you can take a dependency on From there, it would look like: let creds = Credentials::from_keys("akid", "secret_key", None);
let conf = Config::builder()
.credentials_provider(creds)
.region(Region::new("us-east-1"))
.build();
let client = Client::from_conf(conf); |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
-
For reference: In AWS SDK v1 the hard coded credential provider can be created via |
Beta Was this translation helpful? Give feedback.
In general you should prefer to use the credential providers that come with the SDK to get credentials securely, since it isn't secure to hardcode credentials into your application.
That said, if you need to do this, you can take a dependency on
aws-types
with the featurehardcoded-credentials
enabled. This will allow you to use theCredentials::from_keys
method.From there, it would look like: