pub struct InstanceRoleCredentials { /* private fields */ }Expand description
A source of credentials for the EC2 instance role attached to this machine.
Implementations§
Source§impl InstanceRoleCredentials
impl InstanceRoleCredentials
Sourcepub fn from_env() -> Result<Option<Self>>
pub fn from_env() -> Result<Option<Self>>
A provider configured the way the AWS SDKs read it, or None when
AWS_EC2_METADATA_DISABLED turns instance role lookup off.
AWS_EC2_METADATA_SERVICE_ENDPOINT overrides the address, for a proxy
in front of the service or a test double.
Sourcepub async fn fetch(&self) -> Result<TemporaryCredentials>
pub async fn fetch(&self) -> Result<TemporaryCredentials>
Ask the metadata service for the role’s current credentials.
The service hands out the same credentials until about five minutes before they expire, so calling this early returns what a caller already holds.
Auto Trait Implementations§
impl !RefUnwindSafe for InstanceRoleCredentials
impl !UnwindSafe for InstanceRoleCredentials
impl Freeze for InstanceRoleCredentials
impl Send for InstanceRoleCredentials
impl Sync for InstanceRoleCredentials
impl Unpin for InstanceRoleCredentials
impl UnsafeUnpin for InstanceRoleCredentials
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