traffic_policy_instances
Creates, updates, deletes, gets or lists a traffic_policy_instances resource.
Overview
| Name | traffic_policy_instances |
| Type | Resource |
| Id | aws.route53.traffic_policy_instances |
Fields
The following fields are returned by SELECT queries:
- get_traffic_policy_instance
- list_traffic_policy_instances
| Name | Datatype | Description |
|---|---|---|
hosted_zone_id | string | The ID of the hosted zone that Amazon Route 53 created resource record sets in. |
id | string | The ID that Amazon Route 53 assigned to the new traffic policy instance. |
message | string | If State is Failed, an explanation of the reason for the failure. If State is another value, Message is empty. |
name | string | The 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. |
state | string | The 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. |
ttl | integer | The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted zone. |
traffic_policy_id | string | The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone. |
traffic_policy_type | string | The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic policy instance. |
traffic_policy_version | integer | The version of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone. |
| Name | Datatype | Description |
|---|---|---|
hosted_zone_id | string | The ID of the hosted zone that Amazon Route 53 created resource record sets in. |
id | string | The ID that Amazon Route 53 assigned to the new traffic policy instance. |
message | string | If State is Failed, an explanation of the reason for the failure. If State is another value, Message is empty. |
name | string | The 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. |
state | string | The 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. |
ttl | integer | The TTL that Amazon Route 53 assigned to all of the resource record sets that it created in the specified hosted zone. |
traffic_policy_id | string | The ID of the traffic policy that Amazon Route 53 used to create resource record sets in the specified hosted zone. |
traffic_policy_type | string | The DNS type that Amazon Route 53 assigned to all of the resource record sets that it created for this traffic policy instance. |
traffic_policy_version | integer | The 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_traffic_policy_instance | select | id, region | 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. | |
list_traffic_policy_instances | select | region | hostedzoneid, trafficpolicyinstancename, trafficpolicyinstancetype, maxitems | 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. |
create_traffic_policy_instance | insert | region, HostedZoneId, TrafficPolicyId, TrafficPolicyVersion | 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. | |
update_traffic_policy_instance | update | id, region, TrafficPolicyId, TrafficPolicyVersion | 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. | |
delete_traffic_policy_instance | delete | id, region | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The 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. |
region | string | AWS region (default: us-east-1) |
hostedzoneid | string | 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 | string | 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. |
trafficpolicyinstancename | string | 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. |
trafficpolicyinstancetype | string | 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. |
SELECT examples
- get_traffic_policy_instance
- list_traffic_policy_instances
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
;
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.
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 region = '{{ region }}' -- required
AND hostedzoneid = '{{ hostedzoneid }}'
AND trafficpolicyinstancename = '{{ trafficpolicyinstancename }}'
AND trafficpolicyinstancetype = '{{ trafficpolicyinstancetype }}'
AND maxitems = '{{ maxitems }}'
;
INSERT examples
- create_traffic_policy_instance
- Manifest
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
;
# Description fields are for documentation purposes
- name: traffic_policy_instances
props:
- name: region
value: "{{ region }}"
description: Required parameter for the traffic_policy_instances resource.
- name: HostedZoneId
value: "{{ HostedZoneId }}"
- name: Name
value: "{{ Name }}"
- name: TTL
value: {{ TTL }}
- name: TrafficPolicyId
value: "{{ TrafficPolicyId }}"
- name: TrafficPolicyVersion
value: {{ TrafficPolicyVersion }}
UPDATE examples
- update_traffic_policy_instance
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
- delete_traffic_policy_instance
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
;