Skip to main content

traffic_policy_instances

Creates, updates, deletes, gets or lists a traffic_policy_instances resource.

Overview

Nametraffic_policy_instances
TypeResource
Idaws.route53.traffic_policy_instances

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
hosted_zone_idstringThe ID of the hosted zone that Amazon Route 53 created resource record sets in.
idstringThe ID that Amazon Route 53 assigned to the new traffic policy instance.
messagestringIf State is Failed, an explanation of the reason for the failure. If State is another value, Message is empty.
namestringThe DNS name, such as www.example.com, for which Amazon Route 53 responds to queries by using the resource record sets that are associated with this traffic policy instance.
statestringThe value of State is one of the following values: Applied Amazon Route 53 has finished creating resource record sets, and changes have propagated to all Route 53 edge locations. Creating Route 53 is creating the resource record sets. Use GetTrafficPolicyInstance to confirm that the CreateTrafficPolicyInstance request completed successfully. Failed Route 53 wasn't able to create or update the resource record sets. When the value of State is Failed, see Message for an explanation of what caused the request to fail.
ttlintegerThe TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted zone.
traffic_policy_idstringThe ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.
traffic_policy_typestringThe DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic policy instance.
traffic_policy_versionintegerThe version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_traffic_policy_instanceselectid, regionGets information about a specified traffic policy instance. Use GetTrafficPolicyInstance with the id of new traffic policy instance to confirm that the CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request completed successfully. For more information, see the State response element. In the Route 53 console, traffic policy instances are known as policy records.
list_traffic_policy_instancesselectregionhostedzoneid, trafficpolicyinstancename, trafficpolicyinstancetype, maxitemsGets 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.
create_traffic_policy_instanceinsertregion, HostedZoneId, TrafficPolicyId, TrafficPolicyVersionCreates resource record sets in a specified hosted zone based on the settings in a specified traffic policy version. In addition, CreateTrafficPolicyInstance associates the resource record sets with a specified domain name (such as example.com) or subdomain name (such as www.example.com). Amazon Route 53 responds to DNS queries for the domain or subdomain name by using the resource record sets that CreateTrafficPolicyInstance created. After you submit an CreateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. Use GetTrafficPolicyInstance with the id of new traffic policy instance to confirm that the CreateTrafficPolicyInstance request completed successfully. For more information, see the State response element.
update_traffic_policy_instanceupdateid, region, TrafficPolicyId, TrafficPolicyVersionAfter you submit a UpdateTrafficPolicyInstance request, there's a brief delay while Route 53 creates the resource record sets that are specified in the traffic policy definition. Use GetTrafficPolicyInstance with the id of updated traffic policy instance confirm that the UpdateTrafficPolicyInstance request completed successfully. For more information, see the State response element. Updates the resource record sets in a specified hosted zone that were created based on the settings in a specified traffic policy version. When you update a traffic policy instance, Amazon Route 53 continues to respond to DNS queries for the root resource record set name (such as example.com) while it replaces one group of resource record sets with another. Route 53 performs the following operations: Route 53 creates a new group of resource record sets based on the specified traffic policy. This is true regardless of how significant the differences are between the existing resource record sets and the new resource record sets. When all of the new resource record sets have been created, Route 53 starts to respond to DNS queries for the root resource record set name (such as example.com) by using the new resource record sets. Route 53 deletes the old group of resource record sets that are associated with the root resource record set name.
delete_traffic_policy_instancedeleteid, regionDeletes a traffic policy instance and all of the resource record sets that Amazon Route 53 created when you created the instance. In the Route 53 console, traffic policy instances are known as policy records.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe ID of the traffic policy instance that you want to delete. When you delete a traffic policy instance, Amazon Route 53 also deletes all of the resource record sets that were created when you created the traffic policy instance.
regionstringAWS region (default: us-east-1)
hostedzoneidstringIf 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.
maxitemsstringThe 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.
trafficpolicyinstancenamestringIf 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.
trafficpolicyinstancetypestringIf 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.

SELECT examples

Gets information about a specified traffic policy instance. Use GetTrafficPolicyInstance with the id of new traffic policy instance to confirm that the CreateTrafficPolicyInstance or an UpdateTrafficPolicyInstance request completed successfully. For more information, see the State response element. In the Route 53 console, traffic policy instances are known as policy records.

SELECT
hosted_zone_id,
id,
message,
name,
state,
ttl,
traffic_policy_id,
traffic_policy_type,
traffic_policy_version
FROM aws.route53.traffic_policy_instances
WHERE id = '{{ id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates resource record sets in a specified hosted zone based on the settings in a specified traffic policy version. In addition, CreateTrafficPolicyInstance associates the resource record sets with a specified domain name (such as example.com) or subdomain name (such as www.example.com). Amazon Route 53 responds to DNS queries for the domain or subdomain name by using the resource record sets that CreateTrafficPolicyInstance created. After you submit an CreateTrafficPolicyInstance request, there's a brief delay while Amazon Route 53 creates the resource record sets that are specified in the traffic policy definition. Use GetTrafficPolicyInstance with the id of new traffic policy instance to confirm that the CreateTrafficPolicyInstance request completed successfully. For more information, see the State response element.

INSERT INTO aws.route53.traffic_policy_instances (
HostedZoneId,
Name,
TTL,
TrafficPolicyId,
TrafficPolicyVersion,
region
)
SELECT
'{{ HostedZoneId }}' /* required */,
'{{ Name }}',
{{ TTL }},
'{{ TrafficPolicyId }}' /* required */,
{{ TrafficPolicyVersion }} /* required */,
'{{ region }}'
RETURNING
hosted_zone_id,
id,
message,
name,
state,
ttl,
traffic_policy_id,
traffic_policy_type,
traffic_policy_version
;

UPDATE examples

After you submit a UpdateTrafficPolicyInstance request, there's a brief delay while Route 53 creates the resource record sets that are specified in the traffic policy definition. Use GetTrafficPolicyInstance with the id of updated traffic policy instance confirm that the UpdateTrafficPolicyInstance request completed successfully. For more information, see the State response element. Updates the resource record sets in a specified hosted zone that were created based on the settings in a specified traffic policy version. When you update a traffic policy instance, Amazon Route 53 continues to respond to DNS queries for the root resource record set name (such as example.com) while it replaces one group of resource record sets with another. Route 53 performs the following operations: Route 53 creates a new group of resource record sets based on the specified traffic policy. This is true regardless of how significant the differences are between the existing resource record sets and the new resource record sets. When all of the new resource record sets have been created, Route 53 starts to respond to DNS queries for the root resource record set name (such as example.com) by using the new resource record sets. Route 53 deletes the old group of resource record sets that are associated with the root resource record set name.

UPDATE aws.route53.traffic_policy_instances
SET
TTL = {{ TTL }},
TrafficPolicyId = '{{ TrafficPolicyId }}',
TrafficPolicyVersion = {{ TrafficPolicyVersion }}
WHERE
id = '{{ id }}' --required
AND region = '{{ region }}' --required
AND TrafficPolicyId = '{{ TrafficPolicyId }}' --required
AND TrafficPolicyVersion = '{{ TrafficPolicyVersion }}' --required
RETURNING
hosted_zone_id,
id,
message,
name,
state,
ttl,
traffic_policy_id,
traffic_policy_type,
traffic_policy_version;

DELETE examples

Deletes a traffic policy instance and all of the resource record sets that Amazon Route 53 created when you created the instance. In the Route 53 console, traffic policy instances are known as policy records.

DELETE FROM aws.route53.traffic_policy_instances
WHERE id = '{{ id }}' --required
AND region = '{{ region }}' --required
;