Checkboxes for prior research
Describe the bug
If you use sts.assumeRole to get session credentials for an assumed role and then pass those credentials to a client the case mis-match means you recieve the TypeError: Cannot read property 'byteLength' of undef described in #2282
This doesn't feel like a documentation error as in #3268, as I am trying to use SDK objects to populate SDK objects.
SDK version number
"@aws-sdk/client-iam": "^3.154.0", "@aws-sdk/client-sts": "^3.168.0"
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 14 via aws/codebuild/standard:5.0
Reproduction Steps
const sts = new STS()
const assumeRoleResponse = await sts.assumeRole({ "RoleArn": `arn:aws:iam::${accountId}:role/${roleName}`, "RoleSessionName": sessionName" })
const iam = new IAM({ credentials: assumeRoleResponse.Credentials})
const response = await iam.listPolicies({ "Scope": "AWS, "MaxItems": 1 })
Observed Behavior
TypeError: Cannot read property 'byteLength' of undefined as per #2282
Expected Behavior
I would expect to be able to use the returned Credentials object as the credentials for constructing a subsequent client object.
Possible Solution
No response
Additional Information/Context
Work-around to avoid error:
const sts = new STS()
const assumeRoleResponse = await sts.assumeRole({ "RoleArn": `arn:aws:iam::${accountId}:role/${roleName}`, "RoleSessionName": sessionName" })
const iam = new IAM({ credentials: {
accessKeyId: assumeRoleResponse.Credentials.AccessKeyId,
secretAccessKey: assumeRoleResponse.Credentials.SecretAccessKey,
sessionToken: assumeRoleResponse.Credentials.SessionToken
}})
const response = await iam.listPolicies({ "Scope": "AWS, "MaxItems": 1 })
Checkboxes for prior research
Describe the bug
If you use sts.assumeRole to get session credentials for an assumed role and then pass those credentials to a client the case mis-match means you recieve the
TypeError: Cannot read property 'byteLength' of undefdescribed in #2282This doesn't feel like a documentation error as in #3268, as I am trying to use SDK objects to populate SDK objects.
SDK version number
"@aws-sdk/client-iam": "^3.154.0", "@aws-sdk/client-sts": "^3.168.0"
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
Node 14 via aws/codebuild/standard:5.0
Reproduction Steps
Observed Behavior
TypeError: Cannot read property 'byteLength' of undefinedas per #2282Expected Behavior
I would expect to be able to use the returned Credentials object as the credentials for constructing a subsequent client object.
Possible Solution
No response
Additional Information/Context
Work-around to avoid error: