Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: DOC-2644



Panel
bgColor#F6F5F5
borderWidth0

Include Page
INCL:_RC-General-Sent-TagDescription
INCL:_RC-General-Sent-TagDescription

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.

Include Page
INCL:_RC-toc-task-choice
INCL:_RC-toc-task-choice

Table of Contents

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 
    Awesome Icon
    size16px
    iconfa-tag
    .
    The 
    Status
    colourBlue
    titleUpdate 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 

    Awesome Icon
    size16px
    iconfa-plus
    and enter a key and a value.

    Tip

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

    Include Page
    INCL:_RC-General-Note-TagValue
    INCL:_RC-General-Note-TagValue

  6. To remove a tag, click 

    Awesome Icon
    size16px
    iconfa-minus
    .

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

    Info

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

    Awesome Icon
    size16px
    iconfa-tag
    .


Adding or Removing Tags Using AWS CLI

Adding Tags

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

    Code Block
    languagetext
    titleRequest 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

    Include Page
    INCL:_RC-General-SentPart-AWSCLIattributes
    INCL:_RC-General-SentPart-AWSCLIattributes

    • Include Page
      INCL:_RC-General-SentPart-AWSCLIProfile
      INCL:_RC-General-SentPart-AWSCLIProfile
    • resources: The ID of one or more resources to which you want to add the tag. For more information, see About Tags > Resource Types.

      Info

      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.

        Tip

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

        Include Page
        INCL:_RC-General-Note-TagValue
        INCL:_RC-General-Note-TagValue

    • Include Page
      INCL:_RC-General-SentPart-AWSCLIEndpoint
      INCL:_RC-General-SentPart-AWSCLIEndpoint

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:

    Code Block
    languagetext
    titleRequest 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

    Include Page
    INCL:_RC-General-SentPart-AWSCLIattributes
    INCL:_RC-General-SentPart-AWSCLIattributes

    • Include Page
      INCL:_RC-General-SentPart-AWSCLIProfile
      INCL:_RC-General-SentPart-AWSCLIProfile
    • resources: The ID of one or more resources from which you want to remove the specified tags.

      Info

      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.

        Info

        - 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.


    • Include Page
      INCL:_RC-General-SentPart-AWSCLIEndpoint
      INCL:_RC-General-SentPart-AWSCLIEndpoint

The specified tags are removed from the specified resources.
 





Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleRelated Pages


Panel
borderColor#FFFFFF
bgColor#F6F5F5
borderWidth2
titleBGColor#E6E6E6
borderStylesolid
titleCorresponding API Methods





Include Page
INCL:_RC-General-Panel-AWSLegalMentions
INCL:_RC-General-Panel-AWSLegalMentions