diff --git a/control/controlclient/hostinfo_linux.go b/control/controlclient/hostinfo_linux.go index e79eaaa89..364e1098b 100644 --- a/control/controlclient/hostinfo_linux.go +++ b/control/controlclient/hostinfo_linux.go @@ -62,6 +62,9 @@ func osVersionLinux() string { if inKnative() { attrBuf.WriteString("; env=kn") } + if inAwsLambda() { + attrBuf.WriteString("; env=lm") + } attr := attrBuf.String() id := m["ID"] @@ -121,3 +124,14 @@ func inKnative() bool { } return false } + +func inAwsLambda() bool { + // https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html + if os.Getenv("AWS_LAMBDA_FUNCTION_NAME") != "" && + os.Getenv("AWS_LAMBDA_FUNCTION_VERSION") != "" && + os.Getenv("AWS_LAMBDA_INITIALIZATION_TYPE") != "" && + os.Getenv("AWS_LAMBDA_RUNTIME_API") != "" { + return true + } + return false +}