How to set volume name from cli

mspices

When logged in to the AWS EC2 Management Console, the list of Volumes has, as its first column, "Name" (followed by "Volume ID", etc).

For instances created through AWS CLI (using aws ec2 run-instances), a volume gets created automatically, and the corresponding Name field is empty. How can I set the name programmatically?

Also, is there any implication for giving it a name (e.g. does it have to be unique, and is the name used by something?) I would like to have it as a useful info, for managing my volumes from the console.

saurabh14292

"Name" is just a Tag. A key. You can specify it as below :

aws ec2 run-instances \
    --image-id ami-abc12345 \
    --count 1 \
    --instance-type t2.micro \
    --key-name MyKeyPair \
    --subnet-id subnet-6e7f829e \
    --tag-specifications 'ResourceType=instance,Tags=[{Key=webserver,Value=production}]' 'ResourceType=volume,Tags=[{Key=Name,Value=cc123}]'

This will create required EC2 instance and default EBS volume with tag "Name" which has value of "cc123".

Reference : https://docs.aws.amazon.com/cli/latest/reference/ec2/run-instances.html

You can launch an instance and specify tags for the instance, volumes, or both. The following example applies a tag with a key of webserver and value of production to the instance. The command also applies a tag with a key of cost-center and a value of cc123 to any EBS volume that's created (in this case, the root volume).

Regarding implications, you can have any value to the key. It is not required to be unique. However, what you have to note is that, the tags (Key-Value pairs) should reflect the real-world as to identify the resources.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to set instance name from cli

How to set volume of audio object?

Set ALSA master volume from C code

How to set a slider's volume from the audio mixers's volume in Unity?

How to set name of AAR output from Gradle

How do I set the name of the default profile in AWS CLI?

How to set app volume separately from system volume ( iOS device volume physical keys )?

How to set a Mixer's volume to a slider's volume in Unity?

How to give a name to a docker volume mounted from an external drive

How to set volume in Phaser 3?

Codeigniter - How to set name property from database

How do I set Youtube iframe volume from an outside component

How to set Videoview Volume Programmatically?

How to set image name from cli

How to set name of columns from rows values?

Set volume from terminal

How to change the default volume name in the /media path?

How to get Drive Letter and Name (volume label)

How can I set the gnome date/time from the cli?

Set system sounds volume from command line

How to mute, unmute and set all output and input audio devices to full volume from command line in ubuntu?

ember-cli How to set default value from form select?

Print volume name from each array value

How can I select an output and set my configuration for pulse audio volume control from the terminal?

How to hide hard disk size in volume name?

How to set app.json manifest items from the CLI?

How to set profile name in AWS CLI when using instance profile

How can I set an AWS EC2 instance's name tag from the instance itself without the AWS CLI?

How to set volume of Wechat App Notification Volume everytime I log in?

TOP Ranking

  1. 1

    Failed to listen on localhost:8000 (reason: Cannot assign requested address)

  2. 2

    Loopback Error: connect ECONNREFUSED 127.0.0.1:3306 (MAMP)

  3. 3

    How to import an asset in swift using Bundle.main.path() in a react-native native module

  4. 4

    pump.io port in URL

  5. 5

    Compiler error CS0246 (type or namespace not found) on using Ninject in ASP.NET vNext

  6. 6

    BigQuery - concatenate ignoring NULL

  7. 7

    ngClass error (Can't bind ngClass since it isn't a known property of div) in Angular 11.0.3

  8. 8

    ggplotly no applicable method for 'plotly_build' applied to an object of class "NULL" if statements

  9. 9

    Spring Boot JPA PostgreSQL Web App - Internal Authentication Error

  10. 10

    How to remove the extra space from right in a webview?

  11. 11

    java.lang.NullPointerException: Cannot read the array length because "<local3>" is null

  12. 12

    Jquery different data trapped from direct mousedown event and simulation via $(this).trigger('mousedown');

  13. 13

    flutter: dropdown item programmatically unselect problem

  14. 14

    How to use merge windows unallocated space into Ubuntu using GParted?

  15. 15

    Change dd-mm-yyyy date format of dataframe date column to yyyy-mm-dd

  16. 16

    Nuget add packages gives access denied errors

  17. 17

    Svchost high CPU from Microsoft.BingWeather app errors

  18. 18

    Can't pre-populate phone number and message body in SMS link on iPhones when SMS app is not running in the background

  19. 19

    12.04.3--- Dconf Editor won't show com>canonical>unity option

  20. 20

    Any way to remove trailing whitespace *FOR EDITED* lines in Eclipse [for Java]?

  21. 21

    maven-jaxb2-plugin cannot generate classes due to two declarations cause a collision in ObjectFactory class

HotTag

Archive