pub struct Route53Dns {
zone: String,
hosted_zone_id: String,
transport: Box<dyn Transport>,
retry: RetryPolicy,
wait_for_propagation: bool,
propagation_timeout: Duration,
poll_interval: Duration,
ttl: u32,
txt_ttl: u32,
txt: TxtRecords,
caa: CaaRecords,
}Expand description
The production DnsProvider: writes and removes the TXT and CAA
records in one Route53 hosted zone. See the module docs for the operating
rules — propagation, retries, quotas and the credential’s scope.
Fields§
§zone: String§hosted_zone_id: String§transport: Box<dyn Transport>§retry: RetryPolicy§wait_for_propagation: bool§propagation_timeout: Duration§poll_interval: Duration§ttl: u32The TTL on the CAA record this provider writes, matching the
address records beside it at the apex.
txt_ttl: u32The TTL on the TXT records this provider writes. Short, because an
ACME DNS-01 challenge value is only needed for the length of one
validation and a short TTL keeps a withdrawn or replaced value from
lingering in downstream caches.
txt: TxtRecords§caa: CaaRecordsImplementations§
Source§impl Route53Dns
impl Route53Dns
Sourcepub fn new(
zone: impl Into<String>,
hosted_zone_id: impl Into<String>,
credentials: Arc<InstanceCredentials>,
) -> Self
pub fn new( zone: impl Into<String>, hosted_zone_id: impl Into<String>, credentials: Arc<InstanceCredentials>, ) -> Self
A provider for zone, writing to hosted zone hosted_zone_id, over
the real network.
Starts with empty local bookkeeping — the same starting state every
provider in this crate has. Every write this provider makes is an
UPSERT of the whole set it holds for a name, so a value the zone
carries from a previous process is replaced by the first publish at
that name rather than added to.
pub(crate) fn with_transport( zone: impl Into<String>, hosted_zone_id: impl Into<String>, transport: Box<dyn Transport>, ) -> Self
Sourcepub fn with_retry_policy(self, retry: RetryPolicy) -> Self
pub fn with_retry_policy(self, retry: RetryPolicy) -> Self
Overrides the retry policy for throttled or transient failures.
Sourcepub fn with_propagation_wait(self, wait: bool) -> Self
pub fn with_propagation_wait(self, wait: bool) -> Self
Whether DnsProvider::publish_txt waits for the change to reach
INSYNC before returning. Default true; see the module docs for
why that is the honest default. Turning it off trades that guarantee
for lower publish latency.
Sourcepub fn with_propagation_timeout(self, timeout: Duration) -> Self
pub fn with_propagation_timeout(self, timeout: Duration) -> Self
How long DnsProvider::publish_txt will wait for INSYNC before
giving up and returning DnsError::Backend. Default 30 seconds.
Sourcepub fn with_poll_interval(self, interval: Duration) -> Self
pub fn with_poll_interval(self, interval: Duration) -> Self
How long DnsProvider::publish_txt waits between GetChange polls
while a change is PENDING. Default 500 milliseconds.
A Route53 change reaches INSYNC in tens of seconds, so the default
is sized for that rather than for how fast a caller can learn the
answer. Lowering it costs one API call per poll.
Sourcepub fn accepts(&self, host: &str) -> bool
pub fn accepts(&self, host: &str) -> bool
Whether host is under this provider’s zone.
A deployment answers this zone with a single-label wildcard DNS
record (*.<zone>), and RFC 1034 wildcards match exactly one label.
So host must be the zone itself (the apex, for CAA) or exactly
one label below it (_acme-challenge.<zone>) — never two or more.
fn check(&self, host: &str) -> Result<(), DnsError>
fn backend_error(&self, host: &str, message: String) -> DnsError
Sourcefn call_with_retry(
&self,
method: &str,
path: &str,
query: &[(String, String)],
body: String,
host_for_errors: &str,
) -> Result<String, DnsError>
fn call_with_retry( &self, method: &str, path: &str, query: &[(String, String)], body: String, host_for_errors: &str, ) -> Result<String, DnsError>
Issues one API call, retrying on throttling or a server error per
Self::retry.
Sourcefn classify(&self, host: &str, status: u16, message: &str) -> DnsError
fn classify(&self, host: &str, status: u16, message: &str) -> DnsError
Maps a non-retried API error to the right DnsError variant.
Sourcefn await_propagation(&self, change_id: &str) -> Result<(), DnsError>
fn await_propagation(&self, change_id: &str) -> Result<(), DnsError>
Polls GetChange until change_id reaches INSYNC, or gives up
after Self::propagation_timeout.
fn submit_change( &self, host: &str, action: &str, rtype: &str, ttl: u32, values: &[String], ) -> Result<String, DnsError>
Trait Implementations§
Source§impl Debug for Route53Dns
impl Debug for Route53Dns
Source§impl DnsProvider for Route53Dns
impl DnsProvider for Route53Dns
Source§fn publish_txt(&self, host: &str, value: &str) -> Result<(), DnsError>
fn publish_txt(&self, host: &str, value: &str) -> Result<(), DnsError>
value to the set of TXT values published at host, leaving
any other values at that name untouched. Read more