Reconsider the default aws:skipMetadataCheck setting
See original GitHub issueIn #1288 we disabled the metadata check in order to speed Pulumi up.
Unfortunately, this breaks Pulumi when running with an EC2 instance role, meaning lots of scenarios like self hosted CI/CD runners will not work.
It’s possible of course to fix this by setting the environment variable AWS_EC2_METADATA_DISABLED=false
or pulumi config set aws:skipMetadataApiCheck false
, but the it’s extremely difficult to figure that out unless you inherently know about this setting. This default setting seems to be violating the principal of least surprise and is causing a headache for those users who are setting Pulumi up in CI/CD.
To rectify this, we need to either:
- Provide concrete information back to the user about how to fix this. This might involve intercepting the AWS SDK calls and injecting information about why they’re getting this information
- Consider setting the default value back to
false
it might be possible to intercept the error message, which currently looks a bit like this:
Error: NoCredentialProviders: no valid providers in chain
caused by: EnvAccessKeyNotFound: failed to find credentials in the environment.
SharedCredsLoad: failed to load profile, .
EC2RoleRequestError: no EC2 instance role found
caused by: RequestCanceled: EC2 IMDS access disabled via AWS_EC2_METADATA_DISABLED env var
But this comes from the AWS SDK, so we’d need to trap the error
Issue Analytics
- State:
- Created 2 years ago
- Reactions:15
- Comments:10 (1 by maintainers)
This is still a problem. It would be great if we can get the default changed back, or at least fix the fact that the environment variable isn’t being picked up properly by the TF provider at the bottom of the chain.
AFAICT this problem manifests with the unhelpful error message
Dropping this here to help lost people like previous-me looking for an answer. The answer is: