1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p><i>Public DNS and HTTP namespaces only.</i> A complex type that contains settings for an optional health check. If you specify settings for a health check, Cloud Map associates the health check with the records that you specify in <code>DnsConfig</code>.</p><important>
/// <p>If you specify a health check configuration, you can specify either <code>HealthCheckCustomConfig</code> or <code>HealthCheckConfig</code> but not both.</p>
/// </important>
/// <p>Health checks are basic Route&nbsp;53 health checks that monitor an Amazon Web Services endpoint. For information about pricing for health checks, see <a href="http://aws.amazon.com/route53/pricing/">Amazon Route&nbsp;53 Pricing</a>.</p>
/// <p>Note the following about configuring health checks.</p>
/// <dl>
/// <dt>
/// A and AAAA records
/// </dt>
/// <dd>
/// <p>If <code>DnsConfig</code> includes configurations for both <code>A</code> and <code>AAAA</code> records, Cloud Map creates a health check that uses the IPv4 address to check the health of the resource. If the endpoint tthat's specified by the IPv4 address is unhealthy, Route&nbsp;53 considers both the <code>A</code> and <code>AAAA</code> records to be unhealthy.</p>
/// </dd>
/// <dt>
/// CNAME records
/// </dt>
/// <dd>
/// <p>You can't specify settings for <code>HealthCheckConfig</code> when the <code>DNSConfig</code> includes <code>CNAME</code> for the value of <code>Type</code>. If you do, the <code>CreateService</code> request will fail with an <code>InvalidInput</code> error.</p>
/// </dd>
/// <dt>
/// Request interval
/// </dt>
/// <dd>
/// <p>A Route&nbsp;53 health checker in each health-checking Amazon Web Services Region sends a health check request to an endpoint every 30 seconds. On average, your endpoint receives a health check request about every two seconds. However, health checkers don't coordinate with one another. Therefore, you might sometimes see several requests in one second that's followed by a few seconds with no health checks at all.</p>
/// </dd>
/// <dt>
/// Health checking regions
/// </dt>
/// <dd>
/// <p>Health checkers perform checks from all Route&nbsp;53 health-checking Regions. For a list of the current Regions, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_HealthCheckConfig.html#Route53-Type-HealthCheckConfig-Regions">Regions</a>.</p>
/// </dd>
/// <dt>
/// Alias records
/// </dt>
/// <dd>
/// <p>When you register an instance, if you include the <code>AWS_ALIAS_DNS_NAME</code> attribute, Cloud Map creates a Route&nbsp;53 alias record. Note the following:</p>
/// <ul>
/// <li>
/// <p>Route&nbsp;53 automatically sets <code>EvaluateTargetHealth</code> to true for alias records. When <code>EvaluateTargetHealth</code> is true, the alias record inherits the health of the referenced Amazon Web Services resource. such as an ELB load balancer. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html#Route53-Type-AliasTarget-EvaluateTargetHealth">EvaluateTargetHealth</a>.</p></li>
/// <li>
/// <p>If you include <code>HealthCheckConfig</code> and then use the service to register an instance that creates an alias record, Route&nbsp;53 doesn't create the health check.</p></li>
/// </ul>
/// </dd>
/// <dt>
/// Charges for health checks
/// </dt>
/// <dd>
/// <p>Health checks are basic Route&nbsp;53 health checks that monitor an Amazon Web Services endpoint. For information about pricing for health checks, see <a href="http://aws.amazon.com/route53/pricing/">Amazon Route&nbsp;53 Pricing</a>.</p>
/// </dd>
/// </dl>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct HealthCheckConfig {
    /// <p>The type of health check that you want to create, which indicates how Route&nbsp;53 determines whether an endpoint is healthy.</p><important>
    /// <p>You can't change the value of <code>Type</code> after you create a health check.</p>
    /// </important>
    /// <p>You can create the following types of health checks:</p>
    /// <ul>
    /// <li>
    /// <p><b>HTTP</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.</p></li>
    /// <li>
    /// <p><b>HTTPS</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.</p><important>
    /// <p>If you specify HTTPS for the value of <code>Type</code>, the endpoint must support TLS v1.0 or later.</p>
    /// </important></li>
    /// <li>
    /// <p><b>TCP</b>: Route&nbsp;53 tries to establish a TCP connection.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, don't specify a value for <code>ResourcePath</code>.</p></li>
    /// </ul>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub r#type: crate::types::HealthCheckType,
    /// <p>The path that you want Route&nbsp;53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is <code>/docs/route53-health-check.html</code>. Route&nbsp;53 automatically adds the DNS name for the service. If you don't specify a value for <code>ResourcePath</code>, the default value is <code>/</code>.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, you must <i>not</i> specify a value for <code>ResourcePath</code>.</p>
    pub resource_path: ::std::option::Option<::std::string::String>,
    /// <p>The number of consecutive health checks that an endpoint must pass or fail for Route&nbsp;53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub failure_threshold: ::std::option::Option<i32>,
}
impl HealthCheckConfig {
    /// <p>The type of health check that you want to create, which indicates how Route&nbsp;53 determines whether an endpoint is healthy.</p><important>
    /// <p>You can't change the value of <code>Type</code> after you create a health check.</p>
    /// </important>
    /// <p>You can create the following types of health checks:</p>
    /// <ul>
    /// <li>
    /// <p><b>HTTP</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.</p></li>
    /// <li>
    /// <p><b>HTTPS</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.</p><important>
    /// <p>If you specify HTTPS for the value of <code>Type</code>, the endpoint must support TLS v1.0 or later.</p>
    /// </important></li>
    /// <li>
    /// <p><b>TCP</b>: Route&nbsp;53 tries to establish a TCP connection.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, don't specify a value for <code>ResourcePath</code>.</p></li>
    /// </ul>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn r#type(&self) -> &crate::types::HealthCheckType {
        &self.r#type
    }
    /// <p>The path that you want Route&nbsp;53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is <code>/docs/route53-health-check.html</code>. Route&nbsp;53 automatically adds the DNS name for the service. If you don't specify a value for <code>ResourcePath</code>, the default value is <code>/</code>.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, you must <i>not</i> specify a value for <code>ResourcePath</code>.</p>
    pub fn resource_path(&self) -> ::std::option::Option<&str> {
        self.resource_path.as_deref()
    }
    /// <p>The number of consecutive health checks that an endpoint must pass or fail for Route&nbsp;53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn failure_threshold(&self) -> ::std::option::Option<i32> {
        self.failure_threshold
    }
}
impl HealthCheckConfig {
    /// Creates a new builder-style object to manufacture [`HealthCheckConfig`](crate::types::HealthCheckConfig).
    pub fn builder() -> crate::types::builders::HealthCheckConfigBuilder {
        crate::types::builders::HealthCheckConfigBuilder::default()
    }
}

/// A builder for [`HealthCheckConfig`](crate::types::HealthCheckConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct HealthCheckConfigBuilder {
    pub(crate) r#type: ::std::option::Option<crate::types::HealthCheckType>,
    pub(crate) resource_path: ::std::option::Option<::std::string::String>,
    pub(crate) failure_threshold: ::std::option::Option<i32>,
}
impl HealthCheckConfigBuilder {
    /// <p>The type of health check that you want to create, which indicates how Route&nbsp;53 determines whether an endpoint is healthy.</p><important>
    /// <p>You can't change the value of <code>Type</code> after you create a health check.</p>
    /// </important>
    /// <p>You can create the following types of health checks:</p>
    /// <ul>
    /// <li>
    /// <p><b>HTTP</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.</p></li>
    /// <li>
    /// <p><b>HTTPS</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.</p><important>
    /// <p>If you specify HTTPS for the value of <code>Type</code>, the endpoint must support TLS v1.0 or later.</p>
    /// </important></li>
    /// <li>
    /// <p><b>TCP</b>: Route&nbsp;53 tries to establish a TCP connection.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, don't specify a value for <code>ResourcePath</code>.</p></li>
    /// </ul>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::HealthCheckType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of health check that you want to create, which indicates how Route&nbsp;53 determines whether an endpoint is healthy.</p><important>
    /// <p>You can't change the value of <code>Type</code> after you create a health check.</p>
    /// </important>
    /// <p>You can create the following types of health checks:</p>
    /// <ul>
    /// <li>
    /// <p><b>HTTP</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.</p></li>
    /// <li>
    /// <p><b>HTTPS</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.</p><important>
    /// <p>If you specify HTTPS for the value of <code>Type</code>, the endpoint must support TLS v1.0 or later.</p>
    /// </important></li>
    /// <li>
    /// <p><b>TCP</b>: Route&nbsp;53 tries to establish a TCP connection.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, don't specify a value for <code>ResourcePath</code>.</p></li>
    /// </ul>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::HealthCheckType>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of health check that you want to create, which indicates how Route&nbsp;53 determines whether an endpoint is healthy.</p><important>
    /// <p>You can't change the value of <code>Type</code> after you create a health check.</p>
    /// </important>
    /// <p>You can create the following types of health checks:</p>
    /// <ul>
    /// <li>
    /// <p><b>HTTP</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTP request and waits for an HTTP status code of 200 or greater and less than 400.</p></li>
    /// <li>
    /// <p><b>HTTPS</b>: Route&nbsp;53 tries to establish a TCP connection. If successful, Route&nbsp;53 submits an HTTPS request and waits for an HTTP status code of 200 or greater and less than 400.</p><important>
    /// <p>If you specify HTTPS for the value of <code>Type</code>, the endpoint must support TLS v1.0 or later.</p>
    /// </important></li>
    /// <li>
    /// <p><b>TCP</b>: Route&nbsp;53 tries to establish a TCP connection.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, don't specify a value for <code>ResourcePath</code>.</p></li>
    /// </ul>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn get_type(&self) -> &::std::option::Option<crate::types::HealthCheckType> {
        &self.r#type
    }
    /// <p>The path that you want Route&nbsp;53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is <code>/docs/route53-health-check.html</code>. Route&nbsp;53 automatically adds the DNS name for the service. If you don't specify a value for <code>ResourcePath</code>, the default value is <code>/</code>.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, you must <i>not</i> specify a value for <code>ResourcePath</code>.</p>
    pub fn resource_path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_path = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The path that you want Route&nbsp;53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is <code>/docs/route53-health-check.html</code>. Route&nbsp;53 automatically adds the DNS name for the service. If you don't specify a value for <code>ResourcePath</code>, the default value is <code>/</code>.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, you must <i>not</i> specify a value for <code>ResourcePath</code>.</p>
    pub fn set_resource_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_path = input;
        self
    }
    /// <p>The path that you want Route&nbsp;53 to request when performing health checks. The path can be any value that your endpoint returns an HTTP status code of a 2xx or 3xx format for when the endpoint is healthy. An example file is <code>/docs/route53-health-check.html</code>. Route&nbsp;53 automatically adds the DNS name for the service. If you don't specify a value for <code>ResourcePath</code>, the default value is <code>/</code>.</p>
    /// <p>If you specify <code>TCP</code> for <code>Type</code>, you must <i>not</i> specify a value for <code>ResourcePath</code>.</p>
    pub fn get_resource_path(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_path
    }
    /// <p>The number of consecutive health checks that an endpoint must pass or fail for Route&nbsp;53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn failure_threshold(mut self, input: i32) -> Self {
        self.failure_threshold = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of consecutive health checks that an endpoint must pass or fail for Route&nbsp;53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn set_failure_threshold(mut self, input: ::std::option::Option<i32>) -> Self {
        self.failure_threshold = input;
        self
    }
    /// <p>The number of consecutive health checks that an endpoint must pass or fail for Route&nbsp;53 to change the current status of the endpoint from unhealthy to healthy or the other way around. For more information, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html">How Route&nbsp;53 Determines Whether an Endpoint Is Healthy</a> in the <i>Route&nbsp;53 Developer Guide</i>.</p>
    pub fn get_failure_threshold(&self) -> &::std::option::Option<i32> {
        &self.failure_threshold
    }
    /// Consumes the builder and constructs a [`HealthCheckConfig`](crate::types::HealthCheckConfig).
    /// This method will fail if any of the following fields are not set:
    /// - [`r#type`](crate::types::builders::HealthCheckConfigBuilder::r#type)
    pub fn build(self) -> ::std::result::Result<crate::types::HealthCheckConfig, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::HealthCheckConfig {
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building HealthCheckConfig",
                )
            })?,
            resource_path: self.resource_path,
            failure_threshold: self.failure_threshold,
        })
    }
}