fix: Use InstanceMetadataProvider directly

Rusoto's ChainProvider swallows the error message produced by the underlying InstanceMetadataProvider
(see d59d716f09/rusoto/credential/src/lib.rs (L397)) making it hard for us to know why it's not working in our staging cluster.
pull/24376/head
Marko Mikulicic 2021-03-15 14:40:07 +01:00 committed by kodiakhq[bot]
parent 91a92e668a
commit 8bd7a39607
1 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ use futures::{
Stream, StreamExt, TryStreamExt,
};
use rusoto_core::ByteStream;
use rusoto_credential::{ChainProvider, StaticProvider};
use rusoto_credential::{InstanceMetadataProvider, StaticProvider};
use rusoto_s3::S3;
use snafu::{futures::TryStreamExt as _, OptionExt, ResultExt, Snafu};
use std::convert::TryFrom;
@ -311,7 +311,7 @@ impl AmazonS3 {
(None, Some(_)) => return Err(Error::MissingAccessKey),
(Some(_), None) => return Err(Error::MissingSecretAccessKey),
_ => {
let credentials_provider = ChainProvider::new();
let credentials_provider = InstanceMetadataProvider::new();
rusoto_s3::S3Client::new_with(http_client, credentials_provider, region)
}
};