GetTagsCommand

Returns a list of tags that are associated with a resource group, specified by an Amazon resource name (ARN).

Minimum permissions

To run this command, you must have the following permissions:

  • resource-groups:GetTags

Example Syntax

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

import { ResourceGroupsClient, GetTagsCommand } from "@aws-sdk/client-resource-groups"; // ES Modules import
// const { ResourceGroupsClient, GetTagsCommand } = require("@aws-sdk/client-resource-groups"); // CommonJS import
const client = new ResourceGroupsClient(config);
const input = { // GetTagsInput
  Arn: "STRING_VALUE", // required
};
const command = new GetTagsCommand(input);
const response = await client.send(command);
// { // GetTagsOutput
//   Arn: "STRING_VALUE",
//   Tags: { // Tags
//     "<keys>": "STRING_VALUE",
//   },
// };

GetTagsCommand Input

See GetTagsCommandInput for more details

Parameter
Type
Description
Arn
Required
string | undefined

The Amazon resource name (ARN) of the resource group whose tags you want to retrieve.

GetTagsCommand Output

See GetTagsCommandOutput for details

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
Arn
string | undefined

TheAmazon resource name (ARN) of the tagged resource group.

Tags
Record<string, string> | undefined

The tags associated with the specified resource group.

Throws

Name
Fault
Details
BadRequestException
client

The request includes one or more parameters that violate validation rules.

ForbiddenException
client

The caller isn't authorized to make the request. Check permissions.

InternalServerErrorException
server

An internal error occurred while processing the request. Try again later.

MethodNotAllowedException
client

The request uses an HTTP method that isn't allowed for the specified resource.

NotFoundException
client

One or more of the specified resources don't exist.

TooManyRequestsException
client

You've exceeded throttling limits by making too many requests in a period of time.

ResourceGroupsServiceException
Base exception class for all service exceptions from ResourceGroups service.