forked from 9652040795/aws-policies
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathec2-stop-start-policy
41 lines (30 loc) · 933 Bytes
/
ec2-stop-start-policy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
https://protechgurus.com/allow-iam-user-start-stop-reboot-ec2-instances/
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus",
"ec2:DescribeTags"
],
"Resource": "*"
},
{
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances",
"ec2:RebootInstances"
],
"Resource": "arn:aws:ec2:us-east-1:YOURAWSA/C:instance/INSTANCEID",
"arn:aws:ec2:us-east-1:YOURAWSA/C:instance/INSTANCEID"
}
]
}
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html
aws ec2 stop-instances --instance-ids i-0123ab456c789d01e --force
aws ec2 start-instances --instance-ids i-0123ab456c789d01e --force
aws ec2 stop-instances --instance-ids i-0123ab456c789d01e
aws ec2 start-instances --instance-ids i-0123ab456c789d01e