1 Answer
- Newest
- Most votes
- Most comments
0
If the instance is going from "successfully started" to a "stopped" state after about 1 second, it's possible that the instance is failing to launch properly.
You can try checking the instance's console output to see if there are any error messages that can help diagnose the issue.
- Go to the EC2 console.
- Select the instance that is failing to start.
- Click on the "Actions" button at the top of the page.
- Select "Instance Settings", then "Get System Log".
- Review the log output for any error messages that may indicate why the instance is failing to start.
You can also try updating the IAM policy to allow the user to describe instance status and see if that helps provide more information on why the instance is failing to start.
Here is an example of an updated IAM policy that allows the user to describe instance status:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:StartInstances",
"ec2:StopInstances"
],
"Resource": "arn:aws:ec2:::instance/*",
"Condition": {
"StringEquals": {
"aws:ResourceTag/Owner": "${aws:username}"
}
}
},
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstances",
"ec2:DescribeInstanceStatus"
],
"Resource": "*"
}
]
}
Remember to replace the existing IAM policy with the updated version and to retest the start/stop instance functionality with the IAM user.
answered a year ago
Relevant content
- Accepted Answerasked 2 years ago
- asked 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 7 months ago