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.
Parameters:
-
id
(TrafficPolicyInstanceId)
–
The ID of the traffic policy instance that you want to update.
-
ttl
(TTL)
–
The TTL that you want Amazon Route 53 to assign to all of the updated resource record sets.
-
traffic_policy_id
(TrafficPolicyId)
–
The ID of the traffic policy that you want Amazon Route 53 to use to update resource record sets for the specified traffic policy instance.
-
traffic_policy_version
(TrafficPolicyVersion)
–
The version of the traffic policy that you want Amazon Route 53 to use to update resource record sets for the specified traffic policy instance.
Raises:
-
ConflictingTypes
–
You tried to update a traffic policy instance by using a traffic policy version that has a different DNS type than the current type for the instance. You specified the type in the JSON document in the CreateTrafficPolicy or CreateTrafficPolicyVersionrequest.
-
InvalidInput
–
-
NoSuchTrafficPolicy
–
No traffic policy exists with the specified ID.
-
NoSuchTrafficPolicyInstance
–
No traffic policy instance exists with the specified ID.
-
PriorRequestNotComplete
–
If Amazon Route 53 can't process a request before the next request arrives, it will reject subsequent requests for the same hosted zone and return an HTTP 400 error (Bad request). If Route 53 returns this error repeatedly for the same request, we recommend that you wait, in intervals of increasing duration, before you try the request again.
-
UnknownServiceError
–
The service returned an error code this client does not model.
Source code in docs_src/capo_route_53/_services/route53.py
| def update_traffic_policy_instance(
self,
id: "capo_route_53.types.traffic_policy_instance_id.TrafficPolicyInstanceId",
ttl: "capo_route_53.types.ttl.TTL",
traffic_policy_id: "capo_route_53.types.traffic_policy_id.TrafficPolicyId",
traffic_policy_version: "capo_route_53.types.traffic_policy_version.TrafficPolicyVersion",
*,
config_overrides: Optional[Route53ClientConfig] = None,
) -> "capo_route_53.types.update_traffic_policy_instance_response.UpdateTrafficPolicyInstanceResponse":
"""<note> <p>After you submit a <code>UpdateTrafficPolicyInstance</code> request, there's a brief delay while Route 53 creates the resource record sets that are specified in the traffic policy definition. Use <code>GetTrafficPolicyInstance</code> with the <code>id</code> of updated traffic policy instance confirm that the <code>UpdateTrafficPolicyInstance</code> request completed successfully. For more information, see the <code>State</code> response element.</p> </note> <p>Updates the resource record sets in a specified hosted zone that were created based on the settings in a specified traffic policy version.</p> <p>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:</p> <ol> <li> <p>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. </p> </li> <li> <p>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.</p> </li> <li> <p>Route 53 deletes the old group of resource record sets that are associated with the root resource record set name.</p> </li> </ol>
Args:
id: <p>The ID of the traffic policy instance that you want to update.</p>
ttl: <p>The TTL that you want Amazon Route 53 to assign to all of the updated resource record sets.</p>
traffic_policy_id: <p>The ID of the traffic policy that you want Amazon Route 53 to use to update resource record sets for the specified traffic policy instance.</p>
traffic_policy_version: <p>The version of the traffic policy that you want Amazon Route 53 to use to update resource record sets for the specified traffic policy instance.</p>
Raises:
capo_route_53.errors.conflicting_types.ConflictingTypes: <p>You tried to update a traffic policy instance by using a traffic policy version that has a different DNS type than the current type for the instance. You specified the type in the JSON document in the <code>CreateTrafficPolicy</code> or <code>CreateTrafficPolicyVersion</code>request. </p>
capo_route_53.errors.invalid_input.InvalidInput: <p>The input is not valid.</p>
capo_route_53.errors.no_such_traffic_policy.NoSuchTrafficPolicy: <p>No traffic policy exists with the specified ID.</p>
capo_route_53.errors.no_such_traffic_policy_instance.NoSuchTrafficPolicyInstance: <p>No traffic policy instance exists with the specified ID.</p>
capo_route_53.errors.prior_request_not_complete.PriorRequestNotComplete: <p>If Amazon Route 53 can't process a request before the next request arrives, it will reject subsequent requests for the same hosted zone and return an <code>HTTP 400 error</code> (<code>Bad request</code>). If Route 53 returns this error repeatedly for the same request, we recommend that you wait, in intervals of increasing duration, before you try the request again.</p>
capo_route_53.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_route_53.types.update_traffic_policy_instance_request.UpdateTrafficPolicyInstanceRequest]",
) -> OperationResponse[
"capo_route_53.types.update_traffic_policy_instance_response.UpdateTrafficPolicyInstanceResponse"
]:
import capo_route_53._operations.aws_dns_v20130401.update_traffic_policy_instance
output, http_response = (
capo_route_53._operations.aws_dns_v20130401.update_traffic_policy_instance.update_traffic_policy_instance(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("UpdateTrafficPolicyInstance")
)
input_: capo_route_53.types.update_traffic_policy_instance_request.UpdateTrafficPolicyInstanceRequest = {
"id": id,
"ttl": ttl,
"traffic_policy_id": traffic_policy_id,
"traffic_policy_version": traffic_policy_version,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|