Is there a way to start and stop instances from the command line through awscli?

0

I was wondering if there was a specific aws <command> that I can run from the terminal.

profile picture
已提問 4 個月前檢視次數 241 次
1 個回答
2
已接受的答案

There sure is. Here’s stop

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/stop-instances.html

Example

aws ec2 stop-instances \
    --instance-ids i-1234567890abcdef0

And here’s start

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/ec2/start-instances.html

Example

aws ec2 start-instances \
    --instance-ids i-1234567890abcdef0
profile picture
專家
已回答 4 個月前
profile picture
專家
已審閱 4 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南