Skip to content

Commit

Permalink
fix: fix AWS_EC2_METADATA_DISABLED logic error (#393)
Browse files Browse the repository at this point in the history
🤦‍♂️
  • Loading branch information
messense authored Dec 7, 2023
1 parent 25a35b6 commit c9d2458
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/aws/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ pub struct DefaultLoader {
impl DefaultLoader {
/// Create a new CredentialLoader
pub fn new(client: Client, config: Config) -> Self {
let imds_v2_loader = config
.ec2_metadata_disabled
.then(|| IMDSv2Loader::new(client.clone()));
let imds_v2_loader = if config.ec2_metadata_disabled {
None
} else {
Some(IMDSv2Loader::new(client.clone()))
};
Self {
client,
config,
Expand Down

0 comments on commit c9d2458

Please sign in to comment.