From d649a5d92cd9fc56231f6e9a169945a4bc8d146d Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Thu, 10 Sep 2020 16:50:23 +0200 Subject: [PATCH] Use a custom user-agent so AWS can track usage Signed-off-by: Nicolas De Loof --- ecs/sdk.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ecs/sdk.go b/ecs/sdk.go index e11ac7097..b3e6fc58f 100644 --- a/ecs/sdk.go +++ b/ecs/sdk.go @@ -22,12 +22,12 @@ import ( "strings" "time" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/docker/compose-cli/api/compose" "github.com/docker/compose-cli/api/secrets" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/cloudformation" "github.com/aws/aws-sdk-go/service/cloudformation/cloudformationiface" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" @@ -56,7 +56,10 @@ type sdk struct { SM secretsmanageriface.SecretsManagerAPI } -func newSDK(sess client.ConfigProvider) sdk { +func newSDK(sess *session.Session) sdk { + sess.Handlers.Build.PushBack(func(r *request.Request) { + request.AddToUserAgent(r, "Docker CLI") + }) return sdk{ ECS: ecs.New(sess), EC2: ec2.New(sess),