- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
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
ChangeTagsForResourceCommand Input
Parameter | Type | Description |
---|
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.
|
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 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 |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Throws
Name | Fault | Details |
---|
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 |
ThrottlingException | client | The limit on the number of requests per second was exceeded. |
Route53ServiceException | Base exception class for all service exceptions from Route53 service. |