From 00650e5b6565c5b903aa63ba358650134c2c40b8 Mon Sep 17 00:00:00 2001 From: Danny Schofield Date: Wed, 15 May 2024 12:48:45 -0400 Subject: [PATCH] resourceop cdk: skip assume role if TELOHASE_BYPASS_ASSUME_ROLE is set Sometimes people want to assume roles via terraform or CDK and defer to their local credentials. In this case, let them override it with an environment variable. --- resourceoperation/cdk.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/resourceoperation/cdk.go b/resourceoperation/cdk.go index ff5c504..f152ef6 100644 --- a/resourceoperation/cdk.go +++ b/resourceoperation/cdk.go @@ -137,6 +137,10 @@ func synthCDK(creds *sts.Credentials, acct resource.Account, stack resource.Stac } func authAWS(acct resource.Account, arn string, consoleUI runner.ConsoleUI) (*sts.Credentials, string, error) { + if os.Getenv("TELOPHASE_BYPASS_ASSUME_ROLE") != "" { + return nil, "us-east-1", nil + } + var svc *sts.STS sess := session.Must(awssess.DefaultSession()) svc = sts.New(sess)