Closed nmussy closed 5 months ago
@nmussy Thank you for creating an issue.
If you have experience with aws-iot-device-sdk-v2
, can you provide us with a snippet or maybe even a PR?
I don't have any experience with it, just did a quick issue lookup in the v1 repo, sorry to say š
@markostru I looked at it when I did the implementation (was not aware of this limitation) but v2 required some binary that caused issues when run on lambda. There has been a change to aws-crt (the cause of the issue) that does provide a "solution". It's still a bit hacky but I think I could make it work using something like this https://github.com/awslabs/aws-crt-nodejs/issues/467#issuecomment-2047870650 @nmussy Thanks for the detailed issue :)
@Lewenhaupt Are you planning to try? That would be awesome.
@ServerlessLife yeah I'll give it a go š need a reason to keep learning nvim as well so it's the perfect opportunity š
Yeah the aws-crt didn't work fully. It did support the config file, but not sso based Auth. I think I got it working by using a credentials provider from the sdk and then retrieving the resolved credentials from that.
Given the following
~/.aws/config
file, set up to handle a basic AWS Organizationmain
main account andsub
sub account:The env
AWS_PROFILE=sub
variable is correctly detected, butsspy
only tries to access~/.aws/credentials
:This seems to be a limitation of
aws-iot-device-sdk-js
, but was supposedly fixed inaws-iot-device-sdk-v2
, see https://github.com/aws/aws-iot-device-sdk-js/issues/307This can be worked around by manually generating credentials and loading them in your env using the AWS CLI: