context-provider: Context loading fails when /etc/passwd is not available #18824
Labels
@aws-cdk/aws-ec2
Related to Amazon Elastic Compute Cloud
bug
This issue is a bug.
needs-reproduction
This issue needs reproduction.
p2
What is the problem?
My CDK stack uses an external VPC via
Vpc.fromLookup()
. In my CD (inside Docker) it is failing to load context because,/etc/passwd
is not available.I believe the root cause of this is that when attempting to assume the "lookup-role" CDK attempts to use the OS username from
os.userInfo()
for the STS role name, but does not have a fallback ifos.userInfo()
fails:aws-cdk/packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Lines 344 to 355 in e89688e
aws-cdk/packages/aws-cdk/lib/api/aws-auth/sdk-provider.ts
Lines 461 to 463 in e89688e
Reproduction Steps
Unfortunately I'm not sure a straightforward way to provide a snippet because it's a strange environment I'm working in. If you'd like me to create one though, I can do it, please ask.
What did you expect to happen?
Context loading should succeed even if /etc/passwd isn't available (try/catch)
What actually happened?
The deployment failed.
The following warning was printed:
The final error was:
CDK CLI Version
2.10.0
Framework Version
2.10.0
Node.js Version
16
OS
Linux
Language
Typescript
Language Version
No response
Other information
This previously worked in v1.132 and stopped working when I upgraded to v2.10.0.
I am setting
CDK_HOME
as described in #7530The text was updated successfully, but these errors were encountered: