|Do you know where your variables are?|
Paws questionsby Krambambuli (Curate)
|on May 01, 2017 at 18:53 UTC||Need Help??|
Krambambuli has asked for the wisdom of the Perl Monks concerning the following question:
hoping that someone out there might know the answers and would be kind enough to respond, here my two questions. Trying to get acquainted with Amazon services and Paws, I've set up my ~/.aws/credentials to be
The simple code I'm playing with is like
And here the two things I'm unhappy with.
1. If I launch the above cod as
$ AWS_ACCESS_KEY="MY_ACCESS_KEY_ID" AWS_SECRET_KEY="MY_SECRET_ACCESS_KEY" ./test_paws.pl
it works. But if I launch it as
it doesn't, and I get an error message that says
The security token included in the request is invalidI cannot spot the error in the credentials file, and it seems to me that it is OK, but is simply ignored, although it _should_ be considered. So, is there anything I need to do to get the default credentials properly working...?
2. The documentation says that the default 'caller' is HTTP::Tiny. LWP can be used instead if wanted, and the above code uses it OK. I'm unsure about the second caller spec; if I omit it, i.e have
then the call to AssumeRole is done with HTTP:Tiny, whereas the call for ListAllMetrics is done as expected via LWP. Is that expected behavior? Shouldn't the caller used for getting the credentials be the same as the one for ListAllMetrics, even without 'saying it again'?
Many thanks in advance.