Skip to content

Commit

Permalink
fix(credential-provider-node): handle string value `AWS_EC2_METADATA_…
Browse files Browse the repository at this point in the history
…DISABLED=false` (#6823)

Setting the environment variable `AWS_EC2_METADATA_DISABLED` to
"false" causes the condition to evaluate as `true`, which disables
the IMDS credentials check.
  • Loading branch information
upsetbit authored Jan 28, 2025
1 parent f9e0982 commit 9ad490a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/credential-provider-node/src/remoteProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const remoteProvider = async (
return chain(fromHttp(init), fromContainerMetadata(init));
}

if (process.env[ENV_IMDS_DISABLED]) {
if (process.env[ENV_IMDS_DISABLED] && process.env[ENV_IMDS_DISABLED] !== "false") {
return async () => {
throw new CredentialsProviderError("EC2 Instance Metadata Service access disabled", { logger: init.logger });
};
Expand Down

0 comments on commit 9ad490a

Please # to comment.