aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.68k stars 3.93k forks source link

CLI: 1 second delay when not running on an EC2 instance #32131

Open rix0rrr opened 1 day ago

rix0rrr commented 1 day ago

Describe the bug

Even when not running on an EC2 instance, the new CLI default credential provider will try to hit IMDS with a timeout of 1 second when it needs to figure out the region:

[11:52:10] Unable to retrieve AWS region from IMDS: Error: Error fetching metadata token: TimeoutError: Socket timed out without establishing a connection within 1000 ms

Regression Issue

Last Known Working CDK Version

No response

Expected Behavior

Don't try the EC2 credentials provider if we're not on an EC2 instance

Current Behavior

It does do it.

Reproduction Steps

Run the CDK CLI with -vvv

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

-

Framework Version

No response

Node.js Version

-

OS

-

Language

TypeScript

Language Version

No response

Other information

No response

khushail commented 1 day ago

opened by the core team. Marking as P1