tag_resource

FSx.Client.tag_resource(**kwargs)

Tags an Amazon FSx resource.

See also: AWS API Documentation

Request Syntax

response = client.tag_resource(
    ResourceARN='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
Parameters
  • ResourceARN (string) --

    [REQUIRED]

    The Amazon Resource Name (ARN) of the Amazon FSx resource that you want to tag.

  • Tags (list) --

    [REQUIRED]

    A list of tags for the resource. If a tag with a given key already exists, the value is replaced by the one specified in this parameter.

    • (dict) --

      Specifies a key-value pair for a resource tag.

      • Key (string) -- [REQUIRED]

        A value that specifies the TagKey , the name of the tag. Tag keys must be unique for the resource to which they are attached.

      • Value (string) -- [REQUIRED]

        A value that specifies the TagValue , the value assigned to the corresponding tag key. Tag values can be null and don't have to be unique in a tag set. For example, you can have a key-value pair in a tag set of finances : April and also of payroll : April .

Return type

dict

Returns

Response Syntax

{}

Response Structure

  • (dict) --

    The response object for the TagResource operation.

Exceptions

  • FSx.Client.exceptions.BadRequest
  • FSx.Client.exceptions.InternalServerError
  • FSx.Client.exceptions.ResourceNotFound
  • FSx.Client.exceptions.NotServiceResourceError
  • FSx.Client.exceptions.ResourceDoesNotSupportTagging

Examples

This operation tags an Amazon FSx resource.

response = client.tag_resource(
    ResourceARN='arn:aws:fsx:us-east-1:012345678912:file-system/fs-0498eed5fe91001ec',
    Tags=[
        {
            'Key': 'Name',
            'Value': 'MyFileSystem',
        },
    ],
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}