I'm working on a lambda script which works */ locally only /*.
I'ld like to extend the usage of this script in another regions. To do this, I want to update my script, so I'm starting with a :
print(ec2c.describe_regions())
When I test it, it says :
module initialization error: An error occurred (UnauthorizedOperation) when calling the DescribeRegions operation: You are not authorized to perform this operation.
however, my policy contains ec2:DescribeRegions in the Action :
{
"roleName": "ec2_scan_role",
"policies": [
{
"document": {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:StartInstances",
"ec2:DescribeRegions",
"ec2:StopInstances",
"ec2:DescribeInstanceStatus"
],
"Resource": "*"
}
[...]
What's wrong?!
Thanks,