pub struct AwsCredentials {
pub access_key_id: String,
pub secret_access_key: String,
pub session_token: Option<String>,
}Expand description
AWS credentials loaded from environment variables, ECS task role, or IMDSv2.
Fields§
§access_key_id: String§secret_access_key: String§session_token: Option<String>Implementations§
Source§impl AwsCredentials
impl AwsCredentials
Sourcepub fn from_env_or_imds() -> Result<Self, AwsError>
pub fn from_env_or_imds() -> Result<Self, AwsError>
Load credentials. Strategy (in order):
- Static env vars:
AWS_ACCESS_KEY_ID+AWS_SECRET_ACCESS_KEY - ECS task role:
AWS_CONTAINER_CREDENTIALS_RELATIVE_URI - IMDSv2: EC2 instance role
Trait Implementations§
Source§impl Clone for AwsCredentials
impl Clone for AwsCredentials
Source§fn clone(&self) -> AwsCredentials
fn clone(&self) -> AwsCredentials
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AwsCredentials
impl RefUnwindSafe for AwsCredentials
impl Send for AwsCredentials
impl Sync for AwsCredentials
impl Unpin for AwsCredentials
impl UnsafeUnpin for AwsCredentials
impl UnwindSafe for AwsCredentials
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more