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[profile instrument] source_profile = default role_arn = arn:aws:iam::MY_IAM_CODE:role/MY_ROLE region = us-east-1 [default] region = us-east-1 aws_secret_access_key = "MY_SECRET_ACCESS_KEY" aws_access_key_id = "MY_ACCESS_KEY_ID"
And here the two things I'm unhappy with.#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use Paws; use Paws::Net::LWPCaller; use Paws::Credential::AssumeRole; my $lwp_caller = new Paws::Net::LWPCaller( debug => 1 ); my $cloudwatch = Paws->service('CloudWatch', caller => $lwp_caller, credentials => Paws::Credential::Assum +eRole->new( RoleArn => 'arn:aws:iam::MY_IAM_CO +DE:role/MY_ROLE', RoleSessionName => 'just_kidding', caller => $lwp_caller, ), region => 'us-east-1', profile_name => 'instrument', ); #print Dumper( $cloudwatch ); #exit; my $res = $cloudwatch->ListAllMetrics( Dimensions => [], MetricName => 'MY_METRIC', Namespace => 'MY_NAMESPACE', #NextToken => '', ); print Dumper( $res ); exit;
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...?
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'?my $cloudwatch = Paws->service('CloudWatch', caller => $lwp_caller, credentials => Paws::Credential::Assum +eRole->new( RoleArn => 'arn:aws:iam::MY_IAM_CO +DE:role/MY_ROLE', RoleSessionName => 'just_kidding', #caller => $lwp_caller, ), region => 'us-east-1', profile_name => 'instrument', );
In reply to Paws questions by Krambambuli
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |