From d3697053c90c8de609be8b6a2e882c9d7af356db Mon Sep 17 00:00:00 2001 From: Denton Gentry Date: Sun, 4 Jul 2021 18:58:58 -0700 Subject: [PATCH] hostinfo: add AWS Fargate. Several other AWS services like App Run and Lightsail Containers appear to be layers atop Fargate, to the point that we cannot easily tell them apart from within the container. Contacting the metadata service would distinguish them, but doing that from inside tailscaled seems uncalled for. Just report them as Fargate. Signed-off-by: Denton Gentry --- hostinfo/hostinfo.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hostinfo/hostinfo.go b/hostinfo/hostinfo.go index 9f4099e61..791da939c 100644 --- a/hostinfo/hostinfo.go +++ b/hostinfo/hostinfo.go @@ -28,6 +28,7 @@ const ( AWSLambda = EnvType("lm") Heroku = EnvType("hr") AzureAppService = EnvType("az") + AWSFargate = EnvType("fg") TestCase = EnvType("tc") ) @@ -60,6 +61,9 @@ func getEnvType() EnvType { if inAzureAppService() { return AzureAppService } + if inAWSFargate() { + return AWSFargate + } return "" } @@ -129,3 +133,10 @@ func inAzureAppService() bool { } return false } + +func inAWSFargate() bool { + if os.Getenv("AWS_EXECUTION_ENV") == "AWS_ECS_FARGATE" { + return true + } + return false +}