ListTrafficPolicyInstancesByHostedZoneCommand

Gets information about the traffic policy instances that you created in a specified hosted zone.

After you submit a CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. For more information, see the State response element.

Route 53 returns a maximum of 100 items in each response. If you have a lot of traffic policy instances, you can use the MaxItems parameter to list them in groups of up to 100.

Example Syntax

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

import { Route53Client, ListTrafficPolicyInstancesByHostedZoneCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, ListTrafficPolicyInstancesByHostedZoneCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // ListTrafficPolicyInstancesByHostedZoneRequest
  HostedZoneId: "STRING_VALUE", // required
  TrafficPolicyInstanceNameMarker: "STRING_VALUE",
  TrafficPolicyInstanceTypeMarker: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS",
  MaxItems: Number("int"),
};
const command = new ListTrafficPolicyInstancesByHostedZoneCommand(input);
const response = await client.send(command);
// { // ListTrafficPolicyInstancesByHostedZoneResponse
//   TrafficPolicyInstances: [ // TrafficPolicyInstances // required
//     { // TrafficPolicyInstance
//       Id: "STRING_VALUE", // required
//       HostedZoneId: "STRING_VALUE", // required
//       Name: "STRING_VALUE", // required
//       TTL: Number("long"), // required
//       State: "STRING_VALUE", // required
//       Message: "STRING_VALUE", // required
//       TrafficPolicyId: "STRING_VALUE", // required
//       TrafficPolicyVersion: Number("int"), // required
//       TrafficPolicyType: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS", // required
//     },
//   ],
//   TrafficPolicyInstanceNameMarker: "STRING_VALUE",
//   TrafficPolicyInstanceTypeMarker: "SOA" || "A" || "TXT" || "NS" || "CNAME" || "MX" || "NAPTR" || "PTR" || "SRV" || "SPF" || "AAAA" || "CAA" || "DS" || "TLSA" || "SSHFP" || "SVCB" || "HTTPS",
//   IsTruncated: true || false, // required
//   MaxItems: Number("int"), // required
// };

ListTrafficPolicyInstancesByHostedZoneCommand Input

Parameter
Type
Description
HostedZoneId
Required
string | undefined

The ID of the hosted zone that you want to list traffic policy instances for.

MaxItems
number | undefined

The maximum number of traffic policy instances to be included in the response body for this request. If you have more than MaxItems traffic policy instances, the value of the IsTruncated element in the response is true, and the values of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker represent the first traffic policy instance that Amazon Route 53 will return if you submit another request.

TrafficPolicyInstanceNameMarker
string | undefined

If the value of IsTruncated in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another ListTrafficPolicyInstances request. For the value of trafficpolicyinstancename, specify the value of TrafficPolicyInstanceNameMarker from the previous response, which is the name of the first traffic policy instance in the next group of traffic policy instances.

If the value of IsTruncated in the previous response was false, there are no more traffic policy instances to get.

TrafficPolicyInstanceTypeMarker
RRType | undefined

If the value of IsTruncated in the previous response is true, you have more traffic policy instances. To get more traffic policy instances, submit another ListTrafficPolicyInstances request. For the value of trafficpolicyinstancetype, specify the value of TrafficPolicyInstanceTypeMarker from the previous response, which is the type of the first traffic policy instance in the next group of traffic policy instances.

If the value of IsTruncated in the previous response was false, there are no more traffic policy instances to get.

ListTrafficPolicyInstancesByHostedZoneCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
IsTruncated
Required
boolean | undefined

A flag that indicates whether there are more traffic policy instances to be listed. If the response was truncated, you can get the next group of traffic policy instances by submitting another ListTrafficPolicyInstancesByHostedZone request and specifying the values of HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker in the corresponding request parameters.

MaxItems
Required
number | undefined

The value that you specified for the MaxItems parameter in the ListTrafficPolicyInstancesByHostedZone request that produced the current response.

TrafficPolicyInstances
Required
TrafficPolicyInstance[] | undefined

A list that contains one TrafficPolicyInstance element for each traffic policy instance that matches the elements in the request.

TrafficPolicyInstanceNameMarker
string | undefined

If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the first traffic policy instance in the next group of traffic policy instances.

TrafficPolicyInstanceTypeMarker
RRType | undefined

If IsTruncated is true, TrafficPolicyInstanceTypeMarker is the DNS type of the resource record sets that are associated with the first traffic policy instance in the next group of traffic policy instances.

Throws

Name
Fault
Details
InvalidInput
client

The input is not valid.

NoSuchHostedZone
client

No hosted zone exists with the ID that you specified.

NoSuchTrafficPolicyInstance
client

No traffic policy instance exists with the specified ID.

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