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 upFix assuming a role with an AWS profile #5739
Conversation
pmuens
approved these changes
Jan 23, 2019
pmuens
added
the
pr/in-review
label
Jan 23, 2019
pmuens
self-assigned this
Jan 23, 2019
pmuens
added this to In progress
in Serverless
via automation
Jan 23, 2019
pmuens
reviewed
Jan 23, 2019
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 ( |
Serverless
automation
moved this from In progress
to Needs review
Jan 23, 2019
pmuens
requested changes
Jan 23, 2019
D'oh just messed something with the reviews up. Sorry Pretty sure we're super close to get this in though. |
This comment has been minimized.
This comment has been minimized.
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.. |
piohhmy
changed the title
Fix broken profiles
Fix assuming a role with an AWS profile
Jan 24, 2019
This comment has been minimized.
This comment has been minimized.
This also looks like it will fix #5713 |
This comment has been minimized.
This comment has been minimized.
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 |
piohhmy
added some commits
Jan 26, 2019
This comment has been minimized.
This comment has been minimized.
@pmuens test added as requested |
johnf
referenced this pull request
Jan 27, 2019
Closed
Setting --profile or --aws-profile keeps stack from getting deployed from version 1.36.0 #5673
pmuens
added some commits
Jan 28, 2019
Serverless
automation
moved this from Needs review
to Reviewer approved
Jan 28, 2019
pmuens
approved these changes
Jan 28, 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 |
piohhmy commentedJan 23, 2019
What did you implement:
Closes #5673 and #5675
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
lib/plugins/aws/provider/awsProvider.js
How can we verify it:
Try to do any serverless CLI action with an --aws-profile set. Even a simple
sls info --aws-profile <profile-name>
will hang in versions 1.36+. This PR fixes it.Todos:
Is this ready for review?: YES
Is it a breaking change?: NO