Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get volume-id from ec2 instance-id #1

Open
rollrat opened this issue Nov 25, 2022 · 2 comments
Open

Get volume-id from ec2 instance-id #1

rollrat opened this issue Nov 25, 2022 · 2 comments

Comments

@rollrat
Copy link
Member

rollrat commented Nov 25, 2022

aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=i-asdfasdfasdf | jq '.Volumes[0].VolumeId'
@rollrat rollrat changed the title Get volume-id from ec2 instance Get volume-id from ec2 instance-id Nov 25, 2022
@roseberr
Copy link
Contributor

export ebsId=$(aws ec2 describe-volumes --filters Name=attachment.instance-id,Values=$instanceId --query 'Volumes[0].VolumeId' --output text)

@rollrat
Copy link
Member Author

rollrat commented Nov 26, 2022

usage: ^MNote: AWS CLI version 2, the latest major version of the AWS CLI, is now stable and recommended for general use. For more information, see the AWS CLI version 2 installation instructions at: https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help
aws: error: argument --instance-id: expected one argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants