File tree Expand file tree Collapse file tree 2 files changed +12
-18
lines changed
codegen/smithy-aws-typescript-codegen/src/main/resources/software/amazon/smithy/aws/typescript/codegen Expand file tree Collapse file tree 2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change @@ -38,16 +38,13 @@ export const getDefaultRoleAssumer = (
38
38
stsOptions : Pick < STSClientConfig , "logger" | "region" > ,
39
39
stsClientCtor : new ( options : STSClientConfig ) => STSClient
40
40
) : RoleAssumer => {
41
- let stsClient : STSClient ;
42
41
return async ( sourceCreds , params ) => {
43
- if ( ! stsClient ) {
44
- const { logger, region } = stsOptions ;
45
- stsClient = new stsClientCtor ( {
46
- logger,
47
- credentials : sourceCreds ,
48
- region : decorateDefaultRegion ( region ) ,
49
- } ) ;
50
- }
42
+ const { logger, region } = stsOptions ;
43
+ const stsClient = new stsClientCtor ( {
44
+ logger,
45
+ credentials : sourceCreds ,
46
+ region : decorateDefaultRegion ( region ) ,
47
+ } ) ;
51
48
const { Credentials } = await stsClient . send ( new AssumeRoleCommand ( params ) ) ;
52
49
if ( ! Credentials || ! Credentials . AccessKeyId || ! Credentials . SecretAccessKey ) {
53
50
throw new Error ( `Invalid response from STS.assumeRole call with role ${ params . RoleArn } ` ) ;
Original file line number Diff line number Diff line change @@ -38,16 +38,13 @@ export const getDefaultRoleAssumer = (
38
38
stsOptions : Pick < STSClientConfig , "logger" | "region" > ,
39
39
stsClientCtor : new ( options : STSClientConfig ) => STSClient
40
40
) : RoleAssumer => {
41
- let stsClient : STSClient ;
42
41
return async ( sourceCreds , params ) => {
43
- if ( ! stsClient ) {
44
- const { logger, region } = stsOptions ;
45
- stsClient = new stsClientCtor ( {
46
- logger,
47
- credentials : sourceCreds ,
48
- region : decorateDefaultRegion ( region ) ,
49
- } ) ;
50
- }
42
+ const { logger, region } = stsOptions ;
43
+ const stsClient = new stsClientCtor ( {
44
+ logger,
45
+ credentials : sourceCreds ,
46
+ region : decorateDefaultRegion ( region ) ,
47
+ } ) ;
51
48
const { Credentials } = await stsClient . send ( new AssumeRoleCommand ( params ) ) ;
52
49
if ( ! Credentials || ! Credentials . AccessKeyId || ! Credentials . SecretAccessKey ) {
53
50
throw new Error ( `Invalid response from STS.assumeRole call with role ${ params . RoleArn } ` ) ;
You can’t perform that action at this time.
0 commit comments