A new S3Client needs to be constructed whenever the template is uploaded to a new region. This isn't currently happening because region is not being passed as an argument to GetCredentialProviderWithRoleAssumptions when building the cacheKey within the GetS3Service function. This results in GetS3Service not seeing the request as a new cacheKey and the first S3Client is reused when it should not be.
Fixes org-formation/org-formation-cli#569
A new
S3Client
needs to be constructed whenever the template is uploaded to a new region. This isn't currently happening becauseregion
is not being passed as an argument toGetCredentialProviderWithRoleAssumptions
when building thecacheKey
within theGetS3Service
function. This results inGetS3Service
not seeing the request as a newcacheKey
and the firstS3Client
is reused when it should not be.