Skip to content

Commit

Permalink
resourceop cdk: skip assume role if TELOHASE_BYPASS_ASSUME_ROLE is set
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dschofie committed May 15, 2024
1 parent cdc2193 commit 00650e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions resourceoperation/cdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 00650e5

Please sign in to comment.