Struct rusoto_credential::InstanceMetadataProvider [−][src]
pub struct InstanceMetadataProvider { /* fields omitted */ }Expand description
Provides AWS credentials from a resource’s IAM role.
The provider has a default timeout of 30 seconds. While it should work well for most setups,
you can change the timeout using the set_timeout method.
Examples
use std::time::Duration;
use rusoto_credential::InstanceMetadataProvider;
let mut provider = InstanceMetadataProvider::new();
// you can overwrite the default timeout like this:
provider.set_timeout(Duration::from_secs(60));The source location can be changed from the default of 169.254.169.254:
use std::time::Duration;
use rusoto_credential::InstanceMetadataProvider;
let mut provider = InstanceMetadataProvider::new();
// you can overwrite the default endpoint like this:
provider.set_ip_addr_with_port("127.0.0.1", "8080");Implementations
Set the timeout on the provider to the specified duration.
Allow overriding host and port of instance metadata service.
Trait Implementations
fn credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Produce a new AwsCredentials future.
Auto Trait Implementations
impl !RefUnwindSafe for InstanceMetadataProvider
impl Send for InstanceMetadataProvider
impl Sync for InstanceMetadataProvider
impl Unpin for InstanceMetadataProvider
impl !UnwindSafe for InstanceMetadataProvider
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more