简体   繁体   中英

Delete OpsWorks EC2 instance using AWS CLI

I'm trying to delete an instance using this command:

aws opsworks delete-instance --instance-id i-04bcd091c06c14e86

But I'm getting an error:

An error occurred (ValidationException) when calling the DeleteInstance operation: Please provide a valid OpsWorks instance ID, not an EC2 instance ID

I got the instance using

aws ec2 describe-instances | grep InstanceId

How do I get an opsworks instance?

If you need the OpsWorks instance ID then you need to use the OpsWorks version of the describe-instances command :

aws opsworks describe-instances

Edit: If you just want to delete an EC2 instance that is not a part of a stack, use:

aws ec2 terminate-instances --instance-ids <instance-id>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM