@@ -84,7 +84,7 @@ const resolveRegion = async (
84
84
*/
85
85
export const getDefaultRoleAssumer = (
86
86
stsOptions : STSRoleAssumerOptions ,
87
- stsClientCtor : new ( options : STSClientConfig ) => STSClient
87
+ STSClient : new ( options : STSClientConfig ) => STSClient
88
88
) : RoleAssumer => {
89
89
let stsClient : STSClient ;
90
90
let closureSourceCreds : AwsCredentialIdentity ;
@@ -104,7 +104,8 @@ export const getDefaultRoleAssumer = (
104
104
) ;
105
105
const isCompatibleRequestHandler = ! isH2 ( requestHandler ) ;
106
106
107
- stsClient = new stsClientCtor ( {
107
+ stsClient = new STSClient ( {
108
+ profile : stsOptions ?. parentClientConfig ?. profile ,
108
109
// A hack to make sts client uses the credential in current closure.
109
110
credentialDefaultProvider : ( ) => async ( ) => closureSourceCreds ,
110
111
region : resolvedRegion ,
@@ -146,7 +147,7 @@ export type RoleAssumerWithWebIdentity = (
146
147
*/
147
148
export const getDefaultRoleAssumerWithWebIdentity = (
148
149
stsOptions : STSRoleAssumerOptions ,
149
- stsClientCtor : new ( options : STSClientConfig ) => STSClient
150
+ STSClient : new ( options : STSClientConfig ) => STSClient
150
151
) : RoleAssumerWithWebIdentity => {
151
152
let stsClient : STSClient ;
152
153
return async ( params ) => {
@@ -164,7 +165,8 @@ export const getDefaultRoleAssumerWithWebIdentity = (
164
165
) ;
165
166
const isCompatibleRequestHandler = ! isH2 ( requestHandler ) ;
166
167
167
- stsClient = new stsClientCtor ( {
168
+ stsClient = new STSClient ( {
169
+ profile : stsOptions ?. parentClientConfig ?. profile ,
168
170
region : resolvedRegion ,
169
171
requestHandler : isCompatibleRequestHandler ? ( requestHandler as any ) : undefined ,
170
172
logger : logger as any ,
0 commit comments