You can add tags to your existing resources to identify and categorize them. Tags enable you to make an inventory of your resources.

A tag is a combination of a key and a value. If a tag with the same key already exists for the specified resource, no new tag is created. Instead, the value of the existing tag is updated.

You can also add tags to instances when launching them, and to snapshots when creating them. For more information, see Creating / Launching Instances and Creating a Snapshot of a Volume.

To add tags to your load balancers, see Adding or Removing Tags in LBU.

The following procedures are available:

Adding or Removing Tags Using Cockpit

  1. Click the page corresponding to the type of resource you want to tag.

  2. Select the resource you want to tag.
    The resource is selected.

  3. Click Tags  .
    The UPDATE TAGS dialog box appears.

  4. To add a Name tag to the resource, enter the name of your resource in the Value field next to the Name key that is automatically added.

  5. To add another tag to the resource, click  and enter a key and a value.

    The tag value is optional. You can add a tag by specifying a key only.


    The tag value must contain 255 characters maximum. However, there is no maximum length for the tag key.

  6. To remove a tag, click  .

  7. Click Ok to validate.
    The tags are added to or removed from the selected resource.

    You can update the key or value of existing tags at any time. To do so, select the resource and click Tags  .

Adding or Removing Tags Using AWS CLI

Adding Tags

  • To add one or more tags, use the create-tags command following this syntax:

    Request sample
    $> aws ec2 create-tags \
    	--profile YOUR_PROFILE \
    	--resources sg-12345678 i-12345678\
    	--tags Key=Name,Value=SG1 Key=Name2,Value=I1 \
    	--endpoint https://fcu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.
    • resources: The ID of one or more resources to which you want to add the tag. For more information, see About Tags > Resource Types.

      If you specify several resources, each tag is added to each one of them.

    • tags: The tags you want to add to the specified resources. This attribute contains the following elements that you need to specify for each tag:
      • key: The key of the tag.
      • value: The value of the tag.

        If you want to specify a key only, you can set the value element to an empty string.


        The tag value must contain 255 characters maximum. However, there is no maximum length for the tag key.

    • endpoint: The endpoint corresponding to the Region you want to send the request to.

The specified tags are added to the specified resources.

Removing Tags

  • To remove one or more tags, use the delete-tags command following this syntax:

    Request sample
    $> aws ec2 delete-tags \
    	--profile YOUR_PROFILE \
    	--resources sg-12345678 i-12345678 \
    	--tags Key=Name,Value=SG1 Key=Name2,Value=I1 \
    	--endpoint https://fcu.eu-west-2.outscale.com

    This command contains the following attributes that you need to specify:

    • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.
    • resources: The ID of one or more resources from which you want to remove the specified tags.

      If you specify several resources, the tags are removed from all of them.

    • tags: The tags you want to delete from the specified resources. This attribute contains the following elements that you need to specify for each tag:
      • key: The key of the tag.

      • (optional) value: The value of the tag.

        - If you do not specify any value, all tags with the same key are removed from the specified resource.

        - If you set the value as an empty string, the tag is removed only if its value is set to an empty string.

    • endpoint: The endpoint corresponding to the Region you want to send the request to.

The specified tags are removed from the specified resources.
 


Windows® is a registered trademark of Microsoft Corporation in the United States and/or other countries.

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.

See Legal Mentions.