Skip to content

Commit cc23acc

Browse files
authored
fix: pass external_id for credential process and IAM (#790)
1 parent b165600 commit cc23acc

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

pkg/cfaws/assumer_aws_credential_process.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ func (cpa *CredentialProcessAssumer) AssumeTerminal(ctx context.Context, c *Prof
7676
aro.TokenProvider = MfaTokenProvider
7777
}
7878
aro.Duration = configOpts.Duration
79+
if c.AWSConfig.ExternalID != "" {
80+
aro.ExternalID = &c.AWSConfig.ExternalID
81+
}
7982
})
8083
return stsp.Retrieve(ctx)
8184
}

pkg/cfaws/assumer_aws_iam.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ func (aia *AwsIamAssumer) AssumeTerminal(ctx context.Context, c *Profile, config
9898
aro.TokenProvider = MfaTokenProvider
9999
}
100100
aro.Duration = configOpts.Duration
101-
101+
if c.AWSConfig.ExternalID != "" {
102+
aro.ExternalID = &c.AWSConfig.ExternalID
103+
}
102104
/**If the mfa_serial is defined on the root profile, we need to set it in this config so that the aws SDK knows to prompt for MFA token:
103105
*[profile base]
104106
*region = us-west-2

0 commit comments

Comments
 (0)