From b615c9e48e63788672419088ae2a28d68d2b9116 Mon Sep 17 00:00:00 2001 From: Erik Kristensen Date: Thu, 22 Feb 2024 18:10:07 -0700 Subject: [PATCH] fix: bug with operator check on optional session and external id (#83) --- pkg/awsutil/session.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/awsutil/session.go b/pkg/awsutil/session.go index 7674f7b0..5c7a0754 100644 --- a/pkg/awsutil/session.go +++ b/pkg/awsutil/session.go @@ -119,11 +119,11 @@ func (c *Credentials) rootSession() (*session.Session, error) { // if given a role to assume, overwrite the session credentials with assume role credentials if c.AssumeRoleArn != "" { sess.Config.Credentials = stscreds.NewCredentials(sess, c.AssumeRoleArn, func(p *stscreds.AssumeRoleProvider) { - if c.RoleSessionName == "" { + if c.RoleSessionName != "" { p.RoleSessionName = c.RoleSessionName } - if c.ExternalId == "" { + if c.ExternalId != "" { p.ExternalID = aws.String(c.ExternalId) } })