[DRIVERS-2623] AWS Lambda metadata detection logic is too permissive Created: 04/May/23  Updated: 20/Oct/23  Resolved: 20/Oct/23

Status: Closed
Project: Drivers
Component/s: FaaS, Handshake
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Shane Harvey Assignee: Shane Harvey
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Issue split
split to CDRIVER-4636 AWS Lambda metadata detection logic i... Closed
split to CSHARP-4638 AWS Lambda metadata detection logic i... Closed
split to CXX-2688 AWS Lambda metadata detection logic i... Closed
split to GODRIVER-2833 AWS Lambda metadata detection logic i... Closed
split to MOTOR-1129 AWS Lambda metadata detection logic i... Closed
split to NODE-5260 AWS Lambda metadata detection logic i... Closed
split to PHPC-2224 AWS Lambda metadata detection logic i... Closed
split to PYTHON-3704 AWS Lambda metadata detection logic i... Closed
split to RUBY-3251 AWS Lambda metadata detection logic i... Closed
split to RUST-1645 AWS Lambda metadata detection logic i... Closed
split to JAVA-4957 AWS Lambda metadata detection logic i... Closed
Related
Driver Changes: Needed
Downstream Changes Summary:

Teams that have already implemented DRIVERS-2209 must tweak the AWS lambda detection logic as described in this commit:
Message: DRIVERS-2623 AWS_EXECUTION_ENV must start with "AWS_Lambda_" (#1414)
Branch: master
https://github.com/mongodb/specifications/commit/2de99bcce0c2b84a57a089194b43932d2a281e02

Other teams should implement this change at the same time as DRIVERS-2209.

Engineering Lead: Abraham Egnor Abraham Egnor
Start date:
Driver Compliance:
Key Status/Resolution FixVersion
CDRIVER-4636 Fixed 1.25.0
CXX-2688 Fixed 3.9.0
CSHARP-4638 Fixed 2.20.0
GODRIVER-2833 Fixed 1.12.0
JAVA-4957 Duplicate
NODE-5260 Fixed 5.5.0
MOTOR-1129 Duplicate
PYTHON-3704 Duplicate
PHPC-2224 Done
RUBY-3251 Duplicate
RUST-1645 Fixed 2.6.0

 Description   

DRIVERS-2209 outlined that if the AWS_EXECUTION_ENV env var is present, the app is running on AWS Lambda. This turns out to be too permissive because AWS_EXECUTION_ENV is used in other non-Lambda envs. For example the Windows evergreen machines have AWS_EXECUTION_ENV=EC2.

According to Lambda env var docs, I believe the driver needs to validate that the AWS_EXECUTION_ENV var begins with the "AWS_Lambda_" prefix:

  • AWS_EXECUTION_ENV – The runtime identifier, prefixed by AWS_Lambda_ (for example, AWS_Lambda_java8). This environment variable is not defined for custom runtimes (for example, runtimes that use the provided or provided.al2 identifiers).
    ...
  • AWS_LAMBDA_RUNTIME_API – (Custom runtime) The host and port of the runtime API.


 Comments   
Comment by Githook User [ 05/May/23 ]

Author:

{'name': 'Shane Harvey', 'email': 'shnhrv@gmail.com', 'username': 'ShaneHarvey'}

Message: DRIVERS-2623 AWS_EXECUTION_ENV must start with "AWS_Lambda_" (#1414)
Branch: master
https://github.com/mongodb/specifications/commit/2de99bcce0c2b84a57a089194b43932d2a281e02

Comment by Shane Harvey [ 05/May/23 ]

PR: https://github.com/mongodb/specifications/pull/1414

Generated at Thu Feb 08 08:26:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.