TagResourceCommand

This operation tags a resource.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { DataExchangeClient, TagResourceCommand } from "@aws-sdk/client-dataexchange"; // ES Modules import
// const { DataExchangeClient, TagResourceCommand } = require("@aws-sdk/client-dataexchange"); // CommonJS import
const client = new DataExchangeClient(config);
const input = { // TagResourceRequest
  ResourceArn: "STRING_VALUE", // required
  Tags: { // MapOf__string // required
    "<keys>": "STRING_VALUE",
  },
};
const command = new TagResourceCommand(input);
const response = await client.send(command);
// {};

TagResourceCommand Input

See TagResourceCommandInput for more details

Parameter
Type
Description
ResourceArn
Required
string | undefined

An Amazon Resource Name (ARN) that uniquely identifies an AWS resource.

Tags
Required
Record<string, string> | undefined

A label that consists of a customer-defined key and an optional value.

TagResourceCommand Output

See TagResourceCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.

Throws

Name
Fault
Details
DataExchangeServiceException
Base exception class for all service exceptions from DataExchange service.