ListTrafficPolicyInstancesCommand

Gets information about the traffic policy instances that you created by using the current Amazon Web Services account.

After you submit 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, ListTrafficPolicyInstancesCommand } from "@aws-sdk/client-route-53"; // ES Modules import
// const { Route53Client, ListTrafficPolicyInstancesCommand } = require("@aws-sdk/client-route-53"); // CommonJS import
const client = new Route53Client(config);
const input = { // ListTrafficPolicyInstancesRequest
  HostedZoneIdMarker: "STRING_VALUE",
  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 ListTrafficPolicyInstancesCommand(input);
const response = await client.send(command);
// { // ListTrafficPolicyInstancesResponse
//   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
//     },
//   ],
//   HostedZoneIdMarker: "STRING_VALUE",
//   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
// };

ListTrafficPolicyInstancesCommand Input

Parameter
Type
Description
HostedZoneIdMarker
string | undefined

If the value of IsTruncated in the previous response was true, you have more traffic policy instances. To get more traffic policy instances, submit another ListTrafficPolicyInstances request. For the value of HostedZoneId, specify the value of HostedZoneIdMarker from the previous response, which is the hosted zone ID 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.

MaxItems
number | undefined

The maximum number of traffic policy instances that you want Amazon Route 53 to return in response to a ListTrafficPolicyInstances 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 in the next group of MaxItems traffic policy instances.

TrafficPolicyInstanceNameMarker
string | undefined

If the value of IsTruncated in the previous response was 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 was 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.

ListTrafficPolicyInstancesCommand 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 more traffic policy instances by calling ListTrafficPolicyInstances again and specifying the values of the HostedZoneIdMarker, TrafficPolicyInstanceNameMarker, and TrafficPolicyInstanceTypeMarker in the corresponding request parameters.

MaxItems
Required
number | undefined

The value that you specified for the MaxItems parameter in the call to ListTrafficPolicyInstances 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.

HostedZoneIdMarker
string | undefined

If IsTruncated is true, HostedZoneIdMarker is the ID of the hosted zone of the first traffic policy instance that Route 53 will return if you submit another ListTrafficPolicyInstances request.

TrafficPolicyInstanceNameMarker
string | undefined

If IsTruncated is true, TrafficPolicyInstanceNameMarker is the name of the first traffic policy instance that Route 53 will return if you submit another ListTrafficPolicyInstances request.

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 that Amazon Route 53 will return if you submit another ListTrafficPolicyInstances request.

Throws

Name
Fault
Details
InvalidInput
client

The input is not valid.

NoSuchTrafficPolicyInstance
client

No traffic policy instance exists with the specified ID.

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