ChangeTagsForResourceCommand

Adds, edits, or deletes tags for a health check or a hosted zone.

For information about using tags for cost allocation, see Using Cost Allocation Tags  in the Billing and Cost Management User Guide.

Example Syntax

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

import { Route53Client, ChangeTagsForResourceCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, ChangeTagsForResourceCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // ChangeTagsForResourceRequest
  ResourceType: "healthcheck" || "hostedzone", // required
  ResourceId: "STRING_VALUE", // required
  AddTags: [ // TagList
    { // Tag
      Key: "STRING_VALUE",
      Value: "STRING_VALUE",
    },
  ],
  RemoveTagKeys: [ // TagKeyList
    "STRING_VALUE",
  ],
};
const command = new ChangeTagsForResourceCommand(input);
const response = await client.send(command);
// {};

Example Usage

 There was an error loading the code editor. Retry

ChangeTagsForResourceCommand Input

Parameter
Type
Description
ResourceId
Required
string | undefined

The ID of the resource for which you want to add, change, or delete tags.

ResourceType
Required
TagResourceType | undefined

The type of the resource.

  • The resource type for health checks is healthcheck.

  • The resource type for hosted zones is hostedzone.

AddTags
Tag[] | undefined

A complex type that contains a list of the tags that you want to add to the specified health check or hosted zone and/or the tags that you want to edit Value for.

You can add a maximum of 10 tags to a health check or a hosted zone.

RemoveTagKeys
string[] | undefined

A complex type that contains a list of the tags that you want to delete from the specified health check or hosted zone. You can specify up to 10 keys.

ChangeTagsForResourceCommand Output

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

Throws

Name
Fault
Details
InvalidInput
client

The input is not valid.

NoSuchHealthCheck
client

No health check exists with the specified ID.

NoSuchHostedZone
client

No hosted zone exists with the ID that you specified.

PriorRequestNotComplete
client

If Amazon Route 53 can't process a request before the next request arrives, it will reject subsequent requests for the same hosted zone and return an HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for the same request, we recommend that you wait, in intervals of increasing duration, before you try the request again.

ThrottlingException
client

The limit on the number of requests per second was exceeded.

Route53ServiceException
Base exception class for all service exceptions from Route53 service.