1 Answer
- Newest
- Most votes
- Most comments
0
The sample code you're given isn't really applicable in Lambda (because there isn't a sys.argv[0]
to reference) - but I'm going to assume that it isn't the actual code you're using.
What is in the variable id
- have you checked to make sure that it is a valid instance id and it is an instance id that you own?
Second, if your account is part of an Organization could the permissions be denied by a Service Control Policy?
Otherwise, the IAM troubleshooting guide might be of assistance.
Relevant content
- asked 5 months ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 4 months ago
id variable is the instance id that we are getting from the alarms detail. Yes it is a valid instance id. But the command ec2.monitor_instances(InstanceIds=[id]) should work right?
Sure will check for Service Control Policy.
Yes, that command should work - that you're getting UnauthorizedOperation means it's a permissions problem.
Okay Thankyou.