Skip to main content

traffic_policy_versions

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

Overview

Nametraffic_policy_versions
TypeResource
Idaws.route53.traffic_policy_versions

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
list_traffic_policy_versionsselectid, regiontrafficpolicyversion, maxitemsGets information about all of the versions for a specified traffic policy. Traffic policy versions are listed in numerical order by VersionNumber.
create_traffic_policy_versioninsertid, regionCreates a new version of an existing traffic policy. When you create a new version of a traffic policy, you specify the ID of the traffic policy that you want to update and a JSON-formatted document that describes the new version. You use traffic policies to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com). You can create a maximum of 1000 versions of a traffic policy. If you reach the limit and need to create another version, you'll need to start a new traffic policy.

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 for which you want to create a new version.
regionstringAWS region (default: us-east-1)
maxitemsstringThe maximum number of traffic policy versions that you want Amazon Route 53 to include in the response body for this request. If the specified traffic policy has more than MaxItems versions, the value of IsTruncated in the response is true, and the value of the TrafficPolicyVersionMarker element is the ID of the first version that Route 53 will return if you submit another request.
trafficpolicyversionstringFor your first request to ListTrafficPolicyVersions, don't include the TrafficPolicyVersionMarker parameter. If you have more traffic policy versions than the value of MaxItems, ListTrafficPolicyVersions returns only the first group of MaxItems versions. To get more traffic policy versions, submit another ListTrafficPolicyVersions request. For the value of TrafficPolicyVersionMarker, specify the value of TrafficPolicyVersionMarker in the previous response.

SELECT examples

Gets information about all of the versions for a specified traffic policy. Traffic policy versions are listed in numerical order by VersionNumber.

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

INSERT examples

Creates a new version of an existing traffic policy. When you create a new version of a traffic policy, you specify the ID of the traffic policy that you want to update and a JSON-formatted document that describes the new version. You use traffic policies to create multiple DNS resource record sets for one domain name (such as example.com) or one subdomain name (such as www.example.com). You can create a maximum of 1000 versions of a traffic policy. If you reach the limit and need to create another version, you'll need to start a new traffic policy.

INSERT INTO aws.route53.traffic_policy_versions (
Document,
Comment,
id,
region
)
SELECT
'{{ Document }}',
'{{ Comment }}',
'{{ id }}',
'{{ region }}'
RETURNING
location,
traffic_policy
;