Skip to main content

traffic_policies

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

Overview

Nametraffic_policies
TypeResource
Idaws.route53.traffic_policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
commentstringThe comment that you specify in the CreateTrafficPolicy request, if any.
documentstringThe definition of a traffic policy in JSON format. You specify the JSON document to use for a new traffic policy in the CreateTrafficPolicy request. For more information about the JSON format, see Traffic Policy Document Format.
idstringThe ID that Amazon Route 53 assigned to a traffic policy when you created it.
namestringThe name that you specified when you created the traffic policy.
typestringThe DNS type of the resource record sets that Amazon Route 53 creates when you use a traffic policy to create a traffic policy instance.
versionintegerThe version number that Amazon Route 53 assigns to a traffic policy. For a new traffic policy, the value of Version is always 1.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_traffic_policyselectid, version, regionGets information about a specific traffic policy version. For information about how of deleting a traffic policy affects the response from GetTrafficPolicy, see DeleteTrafficPolicy.
list_traffic_policiesselectregiontrafficpolicyid, maxitemsGets information about the latest version for every traffic policy that is associated with the current Amazon Web Services account. Policies are listed in the order that they were created in. For information about how of deleting a traffic policy affects the response from ListTrafficPolicies, see DeleteTrafficPolicy.
create_traffic_policyinsertregionCreates a traffic policy, which you use to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com).
update_traffic_policy_commentupdateid, version, regionUpdates the comment for a specified traffic policy version.
delete_traffic_policydeleteid, version, regionDeletes a traffic policy. When you delete a traffic policy, Route 53 sets a flag on the policy to indicate that it has been deleted. However, Route 53 never fully deletes the traffic policy. Note the following: Deleted traffic policies aren't listed if you run ListTrafficPolicies. There's no way to get a list of deleted policies. If you retain the ID of the policy, you can get information about the policy, including the traffic policy document, by running GetTrafficPolicy.

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 that you want to delete.
regionstringAWS region (default: us-east-1)
versionintegerThe version number of the traffic policy that you want to delete.
maxitemsstring(Optional) The maximum number of traffic policies that you want Amazon Route 53 to return in response to this request. If you have more than MaxItems traffic policies, the value of IsTruncated in the response is true, and the value of TrafficPolicyIdMarker is the ID of the first traffic policy that Route 53 will return if you submit another request.
trafficpolicyidstring(Conditional) For your first request to ListTrafficPolicies, don't include the TrafficPolicyIdMarker parameter. If you have more traffic policies than the value of MaxItems, ListTrafficPolicies returns only the first MaxItems traffic policies. To get the next group of policies, submit another request to ListTrafficPolicies. For the value of TrafficPolicyIdMarker, specify the value of TrafficPolicyIdMarker that was returned in the previous response.

SELECT examples

Gets information about a specific traffic policy version. For information about how of deleting a traffic policy affects the response from GetTrafficPolicy, see DeleteTrafficPolicy.

SELECT
comment,
document,
id,
name,
type,
version
FROM aws.route53.traffic_policies
WHERE id = '{{ id }}' -- required
AND version = '{{ version }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a traffic policy, which you use to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com).

INSERT INTO aws.route53.traffic_policies (
Name,
Document,
Comment,
region
)
SELECT
'{{ Name }}',
'{{ Document }}',
'{{ Comment }}',
'{{ region }}'
RETURNING
comment,
document,
id,
name,
type,
version
;

UPDATE examples

Updates the comment for a specified traffic policy version.

UPDATE aws.route53.traffic_policies
SET
Comment = '{{ Comment }}'
WHERE
id = '{{ id }}' --required
AND version = '{{ version }}' --required
AND region = '{{ region }}' --required
RETURNING
comment,
document,
id,
name,
type,
version;

DELETE examples

Deletes a traffic policy. When you delete a traffic policy, Route 53 sets a flag on the policy to indicate that it has been deleted. However, Route 53 never fully deletes the traffic policy. Note the following: Deleted traffic policies aren't listed if you run ListTrafficPolicies. There's no way to get a list of deleted policies. If you retain the ID of the policy, you can get information about the policy, including the traffic policy document, by running GetTrafficPolicy.

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