Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix assuming a role with an AWS profile #5739
What did you implement:
How did you implement it:
Identified that the one line change in #5650 introduced the regression. Changed the clone to be less aggressive to allow tests in #5650 to still pass while fixing the usage of profiles. Honestly, did not look more into exactly why this fixes it, but confirmed it does fix it. I assume it has to do with the deepCopy breaking something once the credentials are passed to sdk in line 269 of
How can we verify it:
Try to do any serverless CLI action with an --aws-profile set. Even a simple
Is this ready for review?: YES
Great! Thanks for working on a fix @piohhmy
Can you add a regression test which reproduced the old behavior so that we can be sure that we won't break it again?
I tried to reproduce the issue with my setup, but (un)forunately running (
Ah ok, thanks for taking a look at it @pmuens! I gave it another quick look and you're right, it appears this bug is only when assuming a role via STS. e.g. when you have an aws profile that looks like:
At first glance it may be tricky to write a test case for this as it relies on the AWS SDK behavior of actually getting the async credentials. Perhaps a unit test with some stubbing would be the way to go over an integration test. I can give it a shot in next couple days if this can wait..
Great! Thanks for taking the time to look into this and explaining the behavior @piohhmy
Yes that sounds like a good plan. I'd also vote for a simple unit test here. You should find enough examples where we stub the AWS SDK in the test file(s).
Let us know if you need any help
referenced this pull request
Jan 27, 2019
Great! Thanks for taking the time to update this @piohhmy
I just pushed merged
Tested it and it works on my end.
Will merge once the build is green