-
Notifications
You must be signed in to change notification settings - Fork 4.9k
fix(aws-lambda): fetch ecs environment variable failure caused by the phase change #9460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
5793134
to
213a496
Compare
Manually tested in the following cases:
I will try to add another test case to test ECS environment variable fetching |
1a4dc3b
to
f0e7525
Compare
0a5a5bf
to
517b356
Compare
Test added. |
Co-authored-by: Datong Sun <[email protected]>
Sorry for the ignorance here, but I think I need this fix but in Kong Konnect. |
@chan-vince I'm not sure about it, maybe you can reach out the Konnect help for an answer :) |
Hi @chan-vince - I'm the overall product lead for Konnect. Once you update your runtimes (Gateway dataplanes) to a version that has this fix included, you should be good-to-go. |
Thanks for jumping in @rosskukulinski 😀 My dataplanes are using the I don't see this PR number in the release notes for any version up and including 3.0.0, so I assume I have to wait a bit. P.S. I have a fair amount of technical feedback on Konnect in general; off topic here but let me know if you're interested. |
@chan-vince Since this was just merged 15 days ago, it'll go out in the next gateway release which should be 3.1. It's also been backported to the 2.8.x release branch so it'll go out in the next 2.8 patch release On the Konnect feedback - would love to hear that. You can reach me at firstname -at- konghq dot com. |
Summary
This PR fixes a bug that the aws-lambda plugin failed to get environment variables in ECS which leads to unable to fetch ECS task role credentials.
This bug is introduced since #8900, in which the moment of the step
require "kong.plugins.aws-lambda.iam-ecs-credentials"
is changed from happening in package load(init phase) to only in function call(access phase). Since in the Nginx process environment, only those environment variables exposed through theenv
Nginx config directory can be fetched byos.getenv
in Lua code(with an exception that env vars can all be fetched in the init phase, and most of the Kong code that usingos.getenv
relies on this). So after #8900, fetching ECS environment variables will fail.Sorry for bringing this bug in, and this also shows that a full integration test with the AWS environment is really needed for this plugin.
Full changelog
Issue reference
Fix FTI-4340