{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Route53.Types.HealthCheckConfig
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Route53.Types.HealthCheckConfig where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53.Internal
import Amazonka.Route53.Types.AlarmIdentifier
import Amazonka.Route53.Types.HealthCheckRegion
import Amazonka.Route53.Types.HealthCheckType
import Amazonka.Route53.Types.InsufficientDataHealthStatus

-- | A complex type that contains information about the health check.
--
-- /See:/ 'newHealthCheckConfig' smart constructor.
data HealthCheckConfig = HealthCheckConfig'
  { -- | The number of consecutive health checks that an endpoint must pass or
    -- fail for Amazon Route 53 to change the current status of the endpoint
    -- from unhealthy to healthy or vice versa. For more information, see
    -- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Amazon Route 53 Determines Whether an Endpoint Is Healthy>
    -- in the /Amazon Route 53 Developer Guide/.
    --
    -- If you don\'t specify a value for @FailureThreshold@, the default value
    -- is three health checks.
    HealthCheckConfig -> Maybe Natural
failureThreshold :: Prelude.Maybe Prelude.Natural,
    -- | The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route
    -- 53 to perform health checks on. If you don\'t specify a value for
    -- @IPAddress@, Route 53 sends a DNS request to resolve the domain name
    -- that you specify in @FullyQualifiedDomainName@ at the interval that you
    -- specify in @RequestInterval@. Using an IP address returned by DNS, Route
    -- 53 then checks the health of the endpoint.
    --
    -- Use one of the following formats for the value of @IPAddress@:
    --
    -- -   __IPv4 address__: four values between 0 and 255, separated by
    --     periods (.), for example, @192.0.2.44@.
    --
    -- -   __IPv6 address__: eight groups of four hexadecimal values, separated
    --     by colons (:), for example,
    --     @2001:0db8:85a3:0000:0000:abcd:0001:2345@. You can also shorten IPv6
    --     addresses as described in RFC 5952, for example,
    --     @2001:db8:85a3::abcd:1:2345@.
    --
    -- If the endpoint is an EC2 instance, we recommend that you create an
    -- Elastic IP address, associate it with your EC2 instance, and specify the
    -- Elastic IP address for @IPAddress@. This ensures that the IP address of
    -- your instance will never change.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName FullyQualifiedDomainName>.
    --
    -- Constraints: Route 53 can\'t check the health of endpoints for which the
    -- IP address is in local, private, non-routable, or multicast ranges. For
    -- more information about IP addresses for which you can\'t create health
    -- checks, see the following documents:
    --
    -- -   <https://tools.ietf.org/html/rfc5735 RFC 5735, Special Use IPv4 Addresses>
    --
    -- -   <https://tools.ietf.org/html/rfc6598 RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space>
    --
    -- -   <https://tools.ietf.org/html/rfc5156 RFC 5156, Special-Use IPv6 Addresses>
    --
    -- When the value of @Type@ is @CALCULATED@ or @CLOUDWATCH_METRIC@, omit
    -- @IPAddress@.
    HealthCheckConfig -> Maybe Text
iPAddress :: Prelude.Maybe Prelude.Text,
    -- | Specify whether you want Amazon Route 53 to send the value of
    -- @FullyQualifiedDomainName@ to the endpoint in the @client_hello@ message
    -- during TLS negotiation. This allows the endpoint to respond to @HTTPS@
    -- health check requests with the applicable SSL\/TLS certificate.
    --
    -- Some endpoints require that @HTTPS@ requests include the host name in
    -- the @client_hello@ message. If you don\'t enable SNI, the status of the
    -- health check will be @SSL alert handshake_failure@. A health check can
    -- also have that status for other reasons. If SNI is enabled and you\'re
    -- still getting the error, check the SSL\/TLS configuration on your
    -- endpoint and confirm that your certificate is valid.
    --
    -- The SSL\/TLS certificate on your endpoint includes a domain name in the
    -- @Common Name@ field and possibly several more in the
    -- @Subject Alternative Names@ field. One of the domain names in the
    -- certificate should match the value that you specify for
    -- @FullyQualifiedDomainName@. If the endpoint responds to the
    -- @client_hello@ message with a certificate that does not include the
    -- domain name that you specified in @FullyQualifiedDomainName@, a health
    -- checker will retry the handshake. In the second attempt, the health
    -- checker will omit @FullyQualifiedDomainName@ from the @client_hello@
    -- message.
    HealthCheckConfig -> Maybe Bool
enableSNI :: Prelude.Maybe Prelude.Bool,
    -- | Stops Route 53 from performing health checks. When you disable a health
    -- check, here\'s what happens:
    --
    -- -   __Health checks that check the health of endpoints:__ Route 53 stops
    --     submitting requests to your application, server, or other resource.
    --
    -- -   __Calculated health checks:__ Route 53 stops aggregating the status
    --     of the referenced health checks.
    --
    -- -   __Health checks that monitor CloudWatch alarms:__ Route 53 stops
    --     monitoring the corresponding CloudWatch metrics.
    --
    -- After you disable a health check, Route 53 considers the status of the
    -- health check to always be healthy. If you configured DNS failover, Route
    -- 53 continues to route traffic to the corresponding resources. If you
    -- want to stop routing traffic to a resource, change the value of
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-Inverted Inverted>.
    --
    -- Charges for a health check still apply when the health check is
    -- disabled. For more information, see
    -- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
    HealthCheckConfig -> Maybe Bool
disabled :: Prelude.Maybe Prelude.Bool,
    -- | If the value of Type is @HTTP_STR_MATCH@ or @HTTPS_STR_MATCH@, the
    -- string that you want Amazon Route 53 to search for in the response body
    -- from the specified resource. If the string appears in the response body,
    -- Route 53 considers the resource healthy.
    --
    -- Route 53 considers case when searching for @SearchString@ in the
    -- response body.
    HealthCheckConfig -> Maybe Text
searchString :: Prelude.Maybe Prelude.Text,
    -- | The number of child health checks that are associated with a
    -- @CALCULATED@ health check that Amazon Route 53 must consider healthy for
    -- the @CALCULATED@ health check to be considered healthy. To specify the
    -- child health checks that you want to associate with a @CALCULATED@
    -- health check, use the
    -- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-ChildHealthChecks ChildHealthChecks>
    -- element.
    --
    -- Note the following:
    --
    -- -   If you specify a number greater than the number of child health
    --     checks, Route 53 always considers this health check to be unhealthy.
    --
    -- -   If you specify @0@, Route 53 always considers this health check to
    --     be healthy.
    HealthCheckConfig -> Maybe Natural
healthThreshold :: Prelude.Maybe Prelude.Natural,
    -- | A complex type that contains one @Region@ element for each region from
    -- which you want Amazon Route 53 health checkers to check the specified
    -- endpoint.
    --
    -- If you don\'t specify any regions, Route 53 health checkers
    -- automatically performs checks from all of the regions that are listed
    -- under __Valid Values__.
    --
    -- If you update a health check to remove a region that has been performing
    -- health checks, Route 53 will briefly continue to perform checks from
    -- that region to ensure that some health checkers are always checking the
    -- endpoint (for example, if you replace three regions with four different
    -- regions).
    HealthCheckConfig -> Maybe (NonEmpty HealthCheckRegion)
regions :: Prelude.Maybe (Prelude.NonEmpty HealthCheckRegion),
    -- | The path, if any, that you want Amazon Route 53 to request when
    -- performing health checks. The path can be any value for which your
    -- endpoint will return an HTTP status code of 2xx or 3xx when the endpoint
    -- is healthy, for example, the file \/docs\/route53-health-check.html. You
    -- can also include query string parameters, for example,
    -- @\/welcome.html?language=jp&login=y@.
    HealthCheckConfig -> Maybe Text
resourcePath :: Prelude.Maybe Prelude.Text,
    -- | When CloudWatch has insufficient data about the metric to determine the
    -- alarm state, the status that you want Amazon Route 53 to assign to the
    -- health check:
    --
    -- -   @Healthy@: Route 53 considers the health check to be healthy.
    --
    -- -   @Unhealthy@: Route 53 considers the health check to be unhealthy.
    --
    -- -   @LastKnownStatus@: Route 53 uses the status of the health check from
    --     the last time that CloudWatch had sufficient data to determine the
    --     alarm state. For new health checks that have no last known status,
    --     the default status for the health check is healthy.
    HealthCheckConfig -> Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus :: Prelude.Maybe InsufficientDataHealthStatus,
    -- | A complex type that identifies the CloudWatch alarm that you want Amazon
    -- Route 53 health checkers to use to determine whether the specified
    -- health check is healthy.
    HealthCheckConfig -> Maybe AlarmIdentifier
alarmIdentifier :: Prelude.Maybe AlarmIdentifier,
    -- | Specify whether you want Amazon Route 53 to measure the latency between
    -- health checkers in multiple Amazon Web Services regions and your
    -- endpoint, and to display CloudWatch latency graphs on the __Health
    -- Checks__ page in the Route 53 console.
    --
    -- You can\'t change the value of @MeasureLatency@ after you create a
    -- health check.
    HealthCheckConfig -> Maybe Bool
measureLatency :: Prelude.Maybe Prelude.Bool,
    -- | Specify whether you want Amazon Route 53 to invert the status of a
    -- health check, for example, to consider a health check unhealthy when it
    -- otherwise would be considered healthy.
    HealthCheckConfig -> Maybe Bool
inverted :: Prelude.Maybe Prelude.Bool,
    -- | Amazon Route 53 behavior depends on whether you specify a value for
    -- @IPAddress@.
    --
    -- __If you specify a value for__ @IPAddress@:
    --
    -- Amazon Route 53 sends health check requests to the specified IPv4 or
    -- IPv6 address and passes the value of @FullyQualifiedDomainName@ in the
    -- @Host@ header for all health checks except TCP health checks. This is
    -- typically the fully qualified DNS name of the endpoint on which you want
    -- Route 53 to perform health checks.
    --
    -- When Route 53 checks the health of an endpoint, here is how it
    -- constructs the @Host@ header:
    --
    -- -   If you specify a value of @80@ for @Port@ and @HTTP@ or
    --     @HTTP_STR_MATCH@ for @Type@, Route 53 passes the value of
    --     @FullyQualifiedDomainName@ to the endpoint in the Host header.
    --
    -- -   If you specify a value of @443@ for @Port@ and @HTTPS@ or
    --     @HTTPS_STR_MATCH@ for @Type@, Route 53 passes the value of
    --     @FullyQualifiedDomainName@ to the endpoint in the @Host@ header.
    --
    -- -   If you specify another value for @Port@ and any value except @TCP@
    --     for @Type@, Route 53 passes @FullyQualifiedDomainName:Port@ to the
    --     endpoint in the @Host@ header.
    --
    -- If you don\'t specify a value for @FullyQualifiedDomainName@, Route 53
    -- substitutes the value of @IPAddress@ in the @Host@ header in each of the
    -- preceding cases.
    --
    -- __If you don\'t specify a value for__ @IPAddress@:
    --
    -- Route 53 sends a DNS request to the domain that you specify for
    -- @FullyQualifiedDomainName@ at the interval that you specify for
    -- @RequestInterval@. Using an IPv4 address that DNS returns, Route 53 then
    -- checks the health of the endpoint.
    --
    -- If you don\'t specify a value for @IPAddress@, Route 53 uses only IPv4
    -- to send health checks to the endpoint. If there\'s no resource record
    -- set with a type of A for the name that you specify for
    -- @FullyQualifiedDomainName@, the health check fails with a \"DNS
    -- resolution failed\" error.
    --
    -- If you want to check the health of weighted, latency, or failover
    -- resource record sets and you choose to specify the endpoint only by
    -- @FullyQualifiedDomainName@, we recommend that you create a separate
    -- health check for each endpoint. For example, create a health check for
    -- each HTTP server that is serving content for www.example.com. For the
    -- value of @FullyQualifiedDomainName@, specify the domain name of the
    -- server (such as us-east-2-www.example.com), not the name of the resource
    -- record sets (www.example.com).
    --
    -- In this configuration, if you create a health check for which the value
    -- of @FullyQualifiedDomainName@ matches the name of the resource record
    -- sets and you then associate the health check with those resource record
    -- sets, health check results will be unpredictable.
    --
    -- In addition, if the value that you specify for @Type@ is @HTTP@,
    -- @HTTPS@, @HTTP_STR_MATCH@, or @HTTPS_STR_MATCH@, Route 53 passes the
    -- value of @FullyQualifiedDomainName@ in the @Host@ header, as it does
    -- when you specify a value for @IPAddress@. If the value of @Type@ is
    -- @TCP@, Route 53 doesn\'t pass a @Host@ header.
    HealthCheckConfig -> Maybe Text
fullyQualifiedDomainName :: Prelude.Maybe Prelude.Text,
    -- | (CALCULATED Health Checks Only) A complex type that contains one
    -- @ChildHealthCheck@ element for each health check that you want to
    -- associate with a @CALCULATED@ health check.
    HealthCheckConfig -> Maybe [Text]
childHealthChecks :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) for the Route 53 Application Recovery
    -- Controller routing control.
    --
    -- For more information about Route 53 Application Recovery Controller, see
    -- <https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route-53-recovery.html Route 53 Application Recovery Controller Developer Guide.>.
    HealthCheckConfig -> Maybe Text
routingControlArn :: Prelude.Maybe Prelude.Text,
    -- | The number of seconds between the time that Amazon Route 53 gets a
    -- response from your endpoint and the time that it sends the next health
    -- check request. Each Route 53 health checker makes requests at this
    -- interval.
    --
    -- You can\'t change the value of @RequestInterval@ after you create a
    -- health check.
    --
    -- If you don\'t specify a value for @RequestInterval@, the default value
    -- is @30@ seconds.
    HealthCheckConfig -> Maybe Natural
requestInterval :: Prelude.Maybe Prelude.Natural,
    -- | The port on the endpoint that you want Amazon Route 53 to perform health
    -- checks on.
    --
    -- Don\'t specify a value for @Port@ when you specify a value for @Type@ of
    -- @CLOUDWATCH_METRIC@ or @CALCULATED@.
    HealthCheckConfig -> Maybe Natural
port :: Prelude.Maybe Prelude.Natural,
    -- | The type of health check that you want to create, which indicates how
    -- Amazon Route 53 determines whether an endpoint is healthy.
    --
    -- You can\'t change the value of @Type@ after you create a health check.
    --
    -- You can create the following types of health checks:
    --
    -- -   __HTTP__: Route 53 tries to establish a TCP connection. If
    --     successful, Route 53 submits an HTTP request and waits for an HTTP
    --     status code of 200 or greater and less than 400.
    --
    -- -   __HTTPS__: Route 53 tries to establish a TCP connection. If
    --     successful, Route 53 submits an HTTPS request and waits for an HTTP
    --     status code of 200 or greater and less than 400.
    --
    --     If you specify @HTTPS@ for the value of @Type@, the endpoint must
    --     support TLS v1.0 or later.
    --
    -- -   __HTTP_STR_MATCH__: Route 53 tries to establish a TCP connection. If
    --     successful, Route 53 submits an HTTP request and searches the first
    --     5,120 bytes of the response body for the string that you specify in
    --     @SearchString@.
    --
    -- -   __HTTPS_STR_MATCH__: Route 53 tries to establish a TCP connection.
    --     If successful, Route 53 submits an @HTTPS@ request and searches the
    --     first 5,120 bytes of the response body for the string that you
    --     specify in @SearchString@.
    --
    -- -   __TCP__: Route 53 tries to establish a TCP connection.
    --
    -- -   __CLOUDWATCH_METRIC__: The health check is associated with a
    --     CloudWatch alarm. If the state of the alarm is @OK@, the health
    --     check is considered healthy. If the state is @ALARM@, the health
    --     check is considered unhealthy. If CloudWatch doesn\'t have
    --     sufficient data to determine whether the state is @OK@ or @ALARM@,
    --     the health check status depends on the setting for
    --     @InsufficientDataHealthStatus@: @Healthy@, @Unhealthy@, or
    --     @LastKnownStatus@.
    --
    -- -   __CALCULATED__: For health checks that monitor the status of other
    --     health checks, Route 53 adds up the number of health checks that
    --     Route 53 health checkers consider to be healthy and compares that
    --     number with the value of @HealthThreshold@.
    --
    -- -   __RECOVERY_CONTROL__: The health check is assocated with a Route53
    --     Application Recovery Controller routing control. If the routing
    --     control state is @ON@, the health check is considered healthy. If
    --     the state is @OFF@, the health check is considered unhealthy.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Route 53 Determines Whether an Endpoint Is Healthy>
    -- in the /Amazon Route 53 Developer Guide/.
    HealthCheckConfig -> HealthCheckType
type' :: HealthCheckType
  }
  deriving (HealthCheckConfig -> HealthCheckConfig -> Bool
(HealthCheckConfig -> HealthCheckConfig -> Bool)
-> (HealthCheckConfig -> HealthCheckConfig -> Bool)
-> Eq HealthCheckConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HealthCheckConfig -> HealthCheckConfig -> Bool
$c/= :: HealthCheckConfig -> HealthCheckConfig -> Bool
== :: HealthCheckConfig -> HealthCheckConfig -> Bool
$c== :: HealthCheckConfig -> HealthCheckConfig -> Bool
Prelude.Eq, ReadPrec [HealthCheckConfig]
ReadPrec HealthCheckConfig
Int -> ReadS HealthCheckConfig
ReadS [HealthCheckConfig]
(Int -> ReadS HealthCheckConfig)
-> ReadS [HealthCheckConfig]
-> ReadPrec HealthCheckConfig
-> ReadPrec [HealthCheckConfig]
-> Read HealthCheckConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HealthCheckConfig]
$creadListPrec :: ReadPrec [HealthCheckConfig]
readPrec :: ReadPrec HealthCheckConfig
$creadPrec :: ReadPrec HealthCheckConfig
readList :: ReadS [HealthCheckConfig]
$creadList :: ReadS [HealthCheckConfig]
readsPrec :: Int -> ReadS HealthCheckConfig
$creadsPrec :: Int -> ReadS HealthCheckConfig
Prelude.Read, Int -> HealthCheckConfig -> ShowS
[HealthCheckConfig] -> ShowS
HealthCheckConfig -> String
(Int -> HealthCheckConfig -> ShowS)
-> (HealthCheckConfig -> String)
-> ([HealthCheckConfig] -> ShowS)
-> Show HealthCheckConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HealthCheckConfig] -> ShowS
$cshowList :: [HealthCheckConfig] -> ShowS
show :: HealthCheckConfig -> String
$cshow :: HealthCheckConfig -> String
showsPrec :: Int -> HealthCheckConfig -> ShowS
$cshowsPrec :: Int -> HealthCheckConfig -> ShowS
Prelude.Show, (forall x. HealthCheckConfig -> Rep HealthCheckConfig x)
-> (forall x. Rep HealthCheckConfig x -> HealthCheckConfig)
-> Generic HealthCheckConfig
forall x. Rep HealthCheckConfig x -> HealthCheckConfig
forall x. HealthCheckConfig -> Rep HealthCheckConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HealthCheckConfig x -> HealthCheckConfig
$cfrom :: forall x. HealthCheckConfig -> Rep HealthCheckConfig x
Prelude.Generic)

-- |
-- Create a value of 'HealthCheckConfig' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'failureThreshold', 'healthCheckConfig_failureThreshold' - The number of consecutive health checks that an endpoint must pass or
-- fail for Amazon Route 53 to change the current status of the endpoint
-- from unhealthy to healthy or vice versa. For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Amazon Route 53 Determines Whether an Endpoint Is Healthy>
-- in the /Amazon Route 53 Developer Guide/.
--
-- If you don\'t specify a value for @FailureThreshold@, the default value
-- is three health checks.
--
-- 'iPAddress', 'healthCheckConfig_iPAddress' - The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route
-- 53 to perform health checks on. If you don\'t specify a value for
-- @IPAddress@, Route 53 sends a DNS request to resolve the domain name
-- that you specify in @FullyQualifiedDomainName@ at the interval that you
-- specify in @RequestInterval@. Using an IP address returned by DNS, Route
-- 53 then checks the health of the endpoint.
--
-- Use one of the following formats for the value of @IPAddress@:
--
-- -   __IPv4 address__: four values between 0 and 255, separated by
--     periods (.), for example, @192.0.2.44@.
--
-- -   __IPv6 address__: eight groups of four hexadecimal values, separated
--     by colons (:), for example,
--     @2001:0db8:85a3:0000:0000:abcd:0001:2345@. You can also shorten IPv6
--     addresses as described in RFC 5952, for example,
--     @2001:db8:85a3::abcd:1:2345@.
--
-- If the endpoint is an EC2 instance, we recommend that you create an
-- Elastic IP address, associate it with your EC2 instance, and specify the
-- Elastic IP address for @IPAddress@. This ensures that the IP address of
-- your instance will never change.
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName FullyQualifiedDomainName>.
--
-- Constraints: Route 53 can\'t check the health of endpoints for which the
-- IP address is in local, private, non-routable, or multicast ranges. For
-- more information about IP addresses for which you can\'t create health
-- checks, see the following documents:
--
-- -   <https://tools.ietf.org/html/rfc5735 RFC 5735, Special Use IPv4 Addresses>
--
-- -   <https://tools.ietf.org/html/rfc6598 RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space>
--
-- -   <https://tools.ietf.org/html/rfc5156 RFC 5156, Special-Use IPv6 Addresses>
--
-- When the value of @Type@ is @CALCULATED@ or @CLOUDWATCH_METRIC@, omit
-- @IPAddress@.
--
-- 'enableSNI', 'healthCheckConfig_enableSNI' - Specify whether you want Amazon Route 53 to send the value of
-- @FullyQualifiedDomainName@ to the endpoint in the @client_hello@ message
-- during TLS negotiation. This allows the endpoint to respond to @HTTPS@
-- health check requests with the applicable SSL\/TLS certificate.
--
-- Some endpoints require that @HTTPS@ requests include the host name in
-- the @client_hello@ message. If you don\'t enable SNI, the status of the
-- health check will be @SSL alert handshake_failure@. A health check can
-- also have that status for other reasons. If SNI is enabled and you\'re
-- still getting the error, check the SSL\/TLS configuration on your
-- endpoint and confirm that your certificate is valid.
--
-- The SSL\/TLS certificate on your endpoint includes a domain name in the
-- @Common Name@ field and possibly several more in the
-- @Subject Alternative Names@ field. One of the domain names in the
-- certificate should match the value that you specify for
-- @FullyQualifiedDomainName@. If the endpoint responds to the
-- @client_hello@ message with a certificate that does not include the
-- domain name that you specified in @FullyQualifiedDomainName@, a health
-- checker will retry the handshake. In the second attempt, the health
-- checker will omit @FullyQualifiedDomainName@ from the @client_hello@
-- message.
--
-- 'disabled', 'healthCheckConfig_disabled' - Stops Route 53 from performing health checks. When you disable a health
-- check, here\'s what happens:
--
-- -   __Health checks that check the health of endpoints:__ Route 53 stops
--     submitting requests to your application, server, or other resource.
--
-- -   __Calculated health checks:__ Route 53 stops aggregating the status
--     of the referenced health checks.
--
-- -   __Health checks that monitor CloudWatch alarms:__ Route 53 stops
--     monitoring the corresponding CloudWatch metrics.
--
-- After you disable a health check, Route 53 considers the status of the
-- health check to always be healthy. If you configured DNS failover, Route
-- 53 continues to route traffic to the corresponding resources. If you
-- want to stop routing traffic to a resource, change the value of
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-Inverted Inverted>.
--
-- Charges for a health check still apply when the health check is
-- disabled. For more information, see
-- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
--
-- 'searchString', 'healthCheckConfig_searchString' - If the value of Type is @HTTP_STR_MATCH@ or @HTTPS_STR_MATCH@, the
-- string that you want Amazon Route 53 to search for in the response body
-- from the specified resource. If the string appears in the response body,
-- Route 53 considers the resource healthy.
--
-- Route 53 considers case when searching for @SearchString@ in the
-- response body.
--
-- 'healthThreshold', 'healthCheckConfig_healthThreshold' - The number of child health checks that are associated with a
-- @CALCULATED@ health check that Amazon Route 53 must consider healthy for
-- the @CALCULATED@ health check to be considered healthy. To specify the
-- child health checks that you want to associate with a @CALCULATED@
-- health check, use the
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-ChildHealthChecks ChildHealthChecks>
-- element.
--
-- Note the following:
--
-- -   If you specify a number greater than the number of child health
--     checks, Route 53 always considers this health check to be unhealthy.
--
-- -   If you specify @0@, Route 53 always considers this health check to
--     be healthy.
--
-- 'regions', 'healthCheckConfig_regions' - A complex type that contains one @Region@ element for each region from
-- which you want Amazon Route 53 health checkers to check the specified
-- endpoint.
--
-- If you don\'t specify any regions, Route 53 health checkers
-- automatically performs checks from all of the regions that are listed
-- under __Valid Values__.
--
-- If you update a health check to remove a region that has been performing
-- health checks, Route 53 will briefly continue to perform checks from
-- that region to ensure that some health checkers are always checking the
-- endpoint (for example, if you replace three regions with four different
-- regions).
--
-- 'resourcePath', 'healthCheckConfig_resourcePath' - The path, if any, that you want Amazon Route 53 to request when
-- performing health checks. The path can be any value for which your
-- endpoint will return an HTTP status code of 2xx or 3xx when the endpoint
-- is healthy, for example, the file \/docs\/route53-health-check.html. You
-- can also include query string parameters, for example,
-- @\/welcome.html?language=jp&login=y@.
--
-- 'insufficientDataHealthStatus', 'healthCheckConfig_insufficientDataHealthStatus' - When CloudWatch has insufficient data about the metric to determine the
-- alarm state, the status that you want Amazon Route 53 to assign to the
-- health check:
--
-- -   @Healthy@: Route 53 considers the health check to be healthy.
--
-- -   @Unhealthy@: Route 53 considers the health check to be unhealthy.
--
-- -   @LastKnownStatus@: Route 53 uses the status of the health check from
--     the last time that CloudWatch had sufficient data to determine the
--     alarm state. For new health checks that have no last known status,
--     the default status for the health check is healthy.
--
-- 'alarmIdentifier', 'healthCheckConfig_alarmIdentifier' - A complex type that identifies the CloudWatch alarm that you want Amazon
-- Route 53 health checkers to use to determine whether the specified
-- health check is healthy.
--
-- 'measureLatency', 'healthCheckConfig_measureLatency' - Specify whether you want Amazon Route 53 to measure the latency between
-- health checkers in multiple Amazon Web Services regions and your
-- endpoint, and to display CloudWatch latency graphs on the __Health
-- Checks__ page in the Route 53 console.
--
-- You can\'t change the value of @MeasureLatency@ after you create a
-- health check.
--
-- 'inverted', 'healthCheckConfig_inverted' - Specify whether you want Amazon Route 53 to invert the status of a
-- health check, for example, to consider a health check unhealthy when it
-- otherwise would be considered healthy.
--
-- 'fullyQualifiedDomainName', 'healthCheckConfig_fullyQualifiedDomainName' - Amazon Route 53 behavior depends on whether you specify a value for
-- @IPAddress@.
--
-- __If you specify a value for__ @IPAddress@:
--
-- Amazon Route 53 sends health check requests to the specified IPv4 or
-- IPv6 address and passes the value of @FullyQualifiedDomainName@ in the
-- @Host@ header for all health checks except TCP health checks. This is
-- typically the fully qualified DNS name of the endpoint on which you want
-- Route 53 to perform health checks.
--
-- When Route 53 checks the health of an endpoint, here is how it
-- constructs the @Host@ header:
--
-- -   If you specify a value of @80@ for @Port@ and @HTTP@ or
--     @HTTP_STR_MATCH@ for @Type@, Route 53 passes the value of
--     @FullyQualifiedDomainName@ to the endpoint in the Host header.
--
-- -   If you specify a value of @443@ for @Port@ and @HTTPS@ or
--     @HTTPS_STR_MATCH@ for @Type@, Route 53 passes the value of
--     @FullyQualifiedDomainName@ to the endpoint in the @Host@ header.
--
-- -   If you specify another value for @Port@ and any value except @TCP@
--     for @Type@, Route 53 passes @FullyQualifiedDomainName:Port@ to the
--     endpoint in the @Host@ header.
--
-- If you don\'t specify a value for @FullyQualifiedDomainName@, Route 53
-- substitutes the value of @IPAddress@ in the @Host@ header in each of the
-- preceding cases.
--
-- __If you don\'t specify a value for__ @IPAddress@:
--
-- Route 53 sends a DNS request to the domain that you specify for
-- @FullyQualifiedDomainName@ at the interval that you specify for
-- @RequestInterval@. Using an IPv4 address that DNS returns, Route 53 then
-- checks the health of the endpoint.
--
-- If you don\'t specify a value for @IPAddress@, Route 53 uses only IPv4
-- to send health checks to the endpoint. If there\'s no resource record
-- set with a type of A for the name that you specify for
-- @FullyQualifiedDomainName@, the health check fails with a \"DNS
-- resolution failed\" error.
--
-- If you want to check the health of weighted, latency, or failover
-- resource record sets and you choose to specify the endpoint only by
-- @FullyQualifiedDomainName@, we recommend that you create a separate
-- health check for each endpoint. For example, create a health check for
-- each HTTP server that is serving content for www.example.com. For the
-- value of @FullyQualifiedDomainName@, specify the domain name of the
-- server (such as us-east-2-www.example.com), not the name of the resource
-- record sets (www.example.com).
--
-- In this configuration, if you create a health check for which the value
-- of @FullyQualifiedDomainName@ matches the name of the resource record
-- sets and you then associate the health check with those resource record
-- sets, health check results will be unpredictable.
--
-- In addition, if the value that you specify for @Type@ is @HTTP@,
-- @HTTPS@, @HTTP_STR_MATCH@, or @HTTPS_STR_MATCH@, Route 53 passes the
-- value of @FullyQualifiedDomainName@ in the @Host@ header, as it does
-- when you specify a value for @IPAddress@. If the value of @Type@ is
-- @TCP@, Route 53 doesn\'t pass a @Host@ header.
--
-- 'childHealthChecks', 'healthCheckConfig_childHealthChecks' - (CALCULATED Health Checks Only) A complex type that contains one
-- @ChildHealthCheck@ element for each health check that you want to
-- associate with a @CALCULATED@ health check.
--
-- 'routingControlArn', 'healthCheckConfig_routingControlArn' - The Amazon Resource Name (ARN) for the Route 53 Application Recovery
-- Controller routing control.
--
-- For more information about Route 53 Application Recovery Controller, see
-- <https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route-53-recovery.html Route 53 Application Recovery Controller Developer Guide.>.
--
-- 'requestInterval', 'healthCheckConfig_requestInterval' - The number of seconds between the time that Amazon Route 53 gets a
-- response from your endpoint and the time that it sends the next health
-- check request. Each Route 53 health checker makes requests at this
-- interval.
--
-- You can\'t change the value of @RequestInterval@ after you create a
-- health check.
--
-- If you don\'t specify a value for @RequestInterval@, the default value
-- is @30@ seconds.
--
-- 'port', 'healthCheckConfig_port' - The port on the endpoint that you want Amazon Route 53 to perform health
-- checks on.
--
-- Don\'t specify a value for @Port@ when you specify a value for @Type@ of
-- @CLOUDWATCH_METRIC@ or @CALCULATED@.
--
-- 'type'', 'healthCheckConfig_type' - The type of health check that you want to create, which indicates how
-- Amazon Route 53 determines whether an endpoint is healthy.
--
-- You can\'t change the value of @Type@ after you create a health check.
--
-- You can create the following types of health checks:
--
-- -   __HTTP__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTP request and waits for an HTTP
--     status code of 200 or greater and less than 400.
--
-- -   __HTTPS__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTPS request and waits for an HTTP
--     status code of 200 or greater and less than 400.
--
--     If you specify @HTTPS@ for the value of @Type@, the endpoint must
--     support TLS v1.0 or later.
--
-- -   __HTTP_STR_MATCH__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTP request and searches the first
--     5,120 bytes of the response body for the string that you specify in
--     @SearchString@.
--
-- -   __HTTPS_STR_MATCH__: Route 53 tries to establish a TCP connection.
--     If successful, Route 53 submits an @HTTPS@ request and searches the
--     first 5,120 bytes of the response body for the string that you
--     specify in @SearchString@.
--
-- -   __TCP__: Route 53 tries to establish a TCP connection.
--
-- -   __CLOUDWATCH_METRIC__: The health check is associated with a
--     CloudWatch alarm. If the state of the alarm is @OK@, the health
--     check is considered healthy. If the state is @ALARM@, the health
--     check is considered unhealthy. If CloudWatch doesn\'t have
--     sufficient data to determine whether the state is @OK@ or @ALARM@,
--     the health check status depends on the setting for
--     @InsufficientDataHealthStatus@: @Healthy@, @Unhealthy@, or
--     @LastKnownStatus@.
--
-- -   __CALCULATED__: For health checks that monitor the status of other
--     health checks, Route 53 adds up the number of health checks that
--     Route 53 health checkers consider to be healthy and compares that
--     number with the value of @HealthThreshold@.
--
-- -   __RECOVERY_CONTROL__: The health check is assocated with a Route53
--     Application Recovery Controller routing control. If the routing
--     control state is @ON@, the health check is considered healthy. If
--     the state is @OFF@, the health check is considered unhealthy.
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Route 53 Determines Whether an Endpoint Is Healthy>
-- in the /Amazon Route 53 Developer Guide/.
newHealthCheckConfig ::
  -- | 'type''
  HealthCheckType ->
  HealthCheckConfig
newHealthCheckConfig :: HealthCheckType -> HealthCheckConfig
newHealthCheckConfig HealthCheckType
pType_ =
  HealthCheckConfig' :: Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> Maybe (NonEmpty HealthCheckRegion)
-> Maybe Text
-> Maybe InsufficientDataHealthStatus
-> Maybe AlarmIdentifier
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> HealthCheckType
-> HealthCheckConfig
HealthCheckConfig'
    { $sel:failureThreshold:HealthCheckConfig' :: Maybe Natural
failureThreshold =
        Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:iPAddress:HealthCheckConfig' :: Maybe Text
iPAddress = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enableSNI:HealthCheckConfig' :: Maybe Bool
enableSNI = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:disabled:HealthCheckConfig' :: Maybe Bool
disabled = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:searchString:HealthCheckConfig' :: Maybe Text
searchString = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:healthThreshold:HealthCheckConfig' :: Maybe Natural
healthThreshold = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:regions:HealthCheckConfig' :: Maybe (NonEmpty HealthCheckRegion)
regions = Maybe (NonEmpty HealthCheckRegion)
forall a. Maybe a
Prelude.Nothing,
      $sel:resourcePath:HealthCheckConfig' :: Maybe Text
resourcePath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:insufficientDataHealthStatus:HealthCheckConfig' :: Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus = Maybe InsufficientDataHealthStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:alarmIdentifier:HealthCheckConfig' :: Maybe AlarmIdentifier
alarmIdentifier = Maybe AlarmIdentifier
forall a. Maybe a
Prelude.Nothing,
      $sel:measureLatency:HealthCheckConfig' :: Maybe Bool
measureLatency = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:inverted:HealthCheckConfig' :: Maybe Bool
inverted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:fullyQualifiedDomainName:HealthCheckConfig' :: Maybe Text
fullyQualifiedDomainName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:childHealthChecks:HealthCheckConfig' :: Maybe [Text]
childHealthChecks = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:routingControlArn:HealthCheckConfig' :: Maybe Text
routingControlArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:requestInterval:HealthCheckConfig' :: Maybe Natural
requestInterval = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:port:HealthCheckConfig' :: Maybe Natural
port = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:type':HealthCheckConfig' :: HealthCheckType
type' = HealthCheckType
pType_
    }

-- | The number of consecutive health checks that an endpoint must pass or
-- fail for Amazon Route 53 to change the current status of the endpoint
-- from unhealthy to healthy or vice versa. For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Amazon Route 53 Determines Whether an Endpoint Is Healthy>
-- in the /Amazon Route 53 Developer Guide/.
--
-- If you don\'t specify a value for @FailureThreshold@, the default value
-- is three health checks.
healthCheckConfig_failureThreshold :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Natural)
healthCheckConfig_failureThreshold :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_failureThreshold = (HealthCheckConfig -> Maybe Natural)
-> (HealthCheckConfig -> Maybe Natural -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Natural
failureThreshold :: Maybe Natural
$sel:failureThreshold:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
failureThreshold} -> Maybe Natural
failureThreshold) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Natural
a -> HealthCheckConfig
s {$sel:failureThreshold:HealthCheckConfig' :: Maybe Natural
failureThreshold = Maybe Natural
a} :: HealthCheckConfig)

-- | The IPv4 or IPv6 IP address of the endpoint that you want Amazon Route
-- 53 to perform health checks on. If you don\'t specify a value for
-- @IPAddress@, Route 53 sends a DNS request to resolve the domain name
-- that you specify in @FullyQualifiedDomainName@ at the interval that you
-- specify in @RequestInterval@. Using an IP address returned by DNS, Route
-- 53 then checks the health of the endpoint.
--
-- Use one of the following formats for the value of @IPAddress@:
--
-- -   __IPv4 address__: four values between 0 and 255, separated by
--     periods (.), for example, @192.0.2.44@.
--
-- -   __IPv6 address__: eight groups of four hexadecimal values, separated
--     by colons (:), for example,
--     @2001:0db8:85a3:0000:0000:abcd:0001:2345@. You can also shorten IPv6
--     addresses as described in RFC 5952, for example,
--     @2001:db8:85a3::abcd:1:2345@.
--
-- If the endpoint is an EC2 instance, we recommend that you create an
-- Elastic IP address, associate it with your EC2 instance, and specify the
-- Elastic IP address for @IPAddress@. This ensures that the IP address of
-- your instance will never change.
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-FullyQualifiedDomainName FullyQualifiedDomainName>.
--
-- Constraints: Route 53 can\'t check the health of endpoints for which the
-- IP address is in local, private, non-routable, or multicast ranges. For
-- more information about IP addresses for which you can\'t create health
-- checks, see the following documents:
--
-- -   <https://tools.ietf.org/html/rfc5735 RFC 5735, Special Use IPv4 Addresses>
--
-- -   <https://tools.ietf.org/html/rfc6598 RFC 6598, IANA-Reserved IPv4 Prefix for Shared Address Space>
--
-- -   <https://tools.ietf.org/html/rfc5156 RFC 5156, Special-Use IPv6 Addresses>
--
-- When the value of @Type@ is @CALCULATED@ or @CLOUDWATCH_METRIC@, omit
-- @IPAddress@.
healthCheckConfig_iPAddress :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Text)
healthCheckConfig_iPAddress :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_iPAddress = (HealthCheckConfig -> Maybe Text)
-> (HealthCheckConfig -> Maybe Text -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Text
iPAddress :: Maybe Text
$sel:iPAddress:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
iPAddress} -> Maybe Text
iPAddress) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Text
a -> HealthCheckConfig
s {$sel:iPAddress:HealthCheckConfig' :: Maybe Text
iPAddress = Maybe Text
a} :: HealthCheckConfig)

-- | Specify whether you want Amazon Route 53 to send the value of
-- @FullyQualifiedDomainName@ to the endpoint in the @client_hello@ message
-- during TLS negotiation. This allows the endpoint to respond to @HTTPS@
-- health check requests with the applicable SSL\/TLS certificate.
--
-- Some endpoints require that @HTTPS@ requests include the host name in
-- the @client_hello@ message. If you don\'t enable SNI, the status of the
-- health check will be @SSL alert handshake_failure@. A health check can
-- also have that status for other reasons. If SNI is enabled and you\'re
-- still getting the error, check the SSL\/TLS configuration on your
-- endpoint and confirm that your certificate is valid.
--
-- The SSL\/TLS certificate on your endpoint includes a domain name in the
-- @Common Name@ field and possibly several more in the
-- @Subject Alternative Names@ field. One of the domain names in the
-- certificate should match the value that you specify for
-- @FullyQualifiedDomainName@. If the endpoint responds to the
-- @client_hello@ message with a certificate that does not include the
-- domain name that you specified in @FullyQualifiedDomainName@, a health
-- checker will retry the handshake. In the second attempt, the health
-- checker will omit @FullyQualifiedDomainName@ from the @client_hello@
-- message.
healthCheckConfig_enableSNI :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Bool)
healthCheckConfig_enableSNI :: (Maybe Bool -> f (Maybe Bool))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_enableSNI = (HealthCheckConfig -> Maybe Bool)
-> (HealthCheckConfig -> Maybe Bool -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Bool
enableSNI :: Maybe Bool
$sel:enableSNI:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
enableSNI} -> Maybe Bool
enableSNI) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Bool
a -> HealthCheckConfig
s {$sel:enableSNI:HealthCheckConfig' :: Maybe Bool
enableSNI = Maybe Bool
a} :: HealthCheckConfig)

-- | Stops Route 53 from performing health checks. When you disable a health
-- check, here\'s what happens:
--
-- -   __Health checks that check the health of endpoints:__ Route 53 stops
--     submitting requests to your application, server, or other resource.
--
-- -   __Calculated health checks:__ Route 53 stops aggregating the status
--     of the referenced health checks.
--
-- -   __Health checks that monitor CloudWatch alarms:__ Route 53 stops
--     monitoring the corresponding CloudWatch metrics.
--
-- After you disable a health check, Route 53 considers the status of the
-- health check to always be healthy. If you configured DNS failover, Route
-- 53 continues to route traffic to the corresponding resources. If you
-- want to stop routing traffic to a resource, change the value of
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-Inverted Inverted>.
--
-- Charges for a health check still apply when the health check is
-- disabled. For more information, see
-- <http://aws.amazon.com/route53/pricing/ Amazon Route 53 Pricing>.
healthCheckConfig_disabled :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Bool)
healthCheckConfig_disabled :: (Maybe Bool -> f (Maybe Bool))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_disabled = (HealthCheckConfig -> Maybe Bool)
-> (HealthCheckConfig -> Maybe Bool -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Bool
disabled :: Maybe Bool
$sel:disabled:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
disabled} -> Maybe Bool
disabled) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Bool
a -> HealthCheckConfig
s {$sel:disabled:HealthCheckConfig' :: Maybe Bool
disabled = Maybe Bool
a} :: HealthCheckConfig)

-- | If the value of Type is @HTTP_STR_MATCH@ or @HTTPS_STR_MATCH@, the
-- string that you want Amazon Route 53 to search for in the response body
-- from the specified resource. If the string appears in the response body,
-- Route 53 considers the resource healthy.
--
-- Route 53 considers case when searching for @SearchString@ in the
-- response body.
healthCheckConfig_searchString :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Text)
healthCheckConfig_searchString :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_searchString = (HealthCheckConfig -> Maybe Text)
-> (HealthCheckConfig -> Maybe Text -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Text
searchString :: Maybe Text
$sel:searchString:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
searchString} -> Maybe Text
searchString) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Text
a -> HealthCheckConfig
s {$sel:searchString:HealthCheckConfig' :: Maybe Text
searchString = Maybe Text
a} :: HealthCheckConfig)

-- | The number of child health checks that are associated with a
-- @CALCULATED@ health check that Amazon Route 53 must consider healthy for
-- the @CALCULATED@ health check to be considered healthy. To specify the
-- child health checks that you want to associate with a @CALCULATED@
-- health check, use the
-- <https://docs.aws.amazon.com/Route53/latest/APIReference/API_UpdateHealthCheck.html#Route53-UpdateHealthCheck-request-ChildHealthChecks ChildHealthChecks>
-- element.
--
-- Note the following:
--
-- -   If you specify a number greater than the number of child health
--     checks, Route 53 always considers this health check to be unhealthy.
--
-- -   If you specify @0@, Route 53 always considers this health check to
--     be healthy.
healthCheckConfig_healthThreshold :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Natural)
healthCheckConfig_healthThreshold :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_healthThreshold = (HealthCheckConfig -> Maybe Natural)
-> (HealthCheckConfig -> Maybe Natural -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Natural
healthThreshold :: Maybe Natural
$sel:healthThreshold:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
healthThreshold} -> Maybe Natural
healthThreshold) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Natural
a -> HealthCheckConfig
s {$sel:healthThreshold:HealthCheckConfig' :: Maybe Natural
healthThreshold = Maybe Natural
a} :: HealthCheckConfig)

-- | A complex type that contains one @Region@ element for each region from
-- which you want Amazon Route 53 health checkers to check the specified
-- endpoint.
--
-- If you don\'t specify any regions, Route 53 health checkers
-- automatically performs checks from all of the regions that are listed
-- under __Valid Values__.
--
-- If you update a health check to remove a region that has been performing
-- health checks, Route 53 will briefly continue to perform checks from
-- that region to ensure that some health checkers are always checking the
-- endpoint (for example, if you replace three regions with four different
-- regions).
healthCheckConfig_regions :: Lens.Lens' HealthCheckConfig (Prelude.Maybe (Prelude.NonEmpty HealthCheckRegion))
healthCheckConfig_regions :: (Maybe (NonEmpty HealthCheckRegion)
 -> f (Maybe (NonEmpty HealthCheckRegion)))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_regions = (HealthCheckConfig -> Maybe (NonEmpty HealthCheckRegion))
-> (HealthCheckConfig
    -> Maybe (NonEmpty HealthCheckRegion) -> HealthCheckConfig)
-> Lens
     HealthCheckConfig
     HealthCheckConfig
     (Maybe (NonEmpty HealthCheckRegion))
     (Maybe (NonEmpty HealthCheckRegion))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe (NonEmpty HealthCheckRegion)
regions :: Maybe (NonEmpty HealthCheckRegion)
$sel:regions:HealthCheckConfig' :: HealthCheckConfig -> Maybe (NonEmpty HealthCheckRegion)
regions} -> Maybe (NonEmpty HealthCheckRegion)
regions) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe (NonEmpty HealthCheckRegion)
a -> HealthCheckConfig
s {$sel:regions:HealthCheckConfig' :: Maybe (NonEmpty HealthCheckRegion)
regions = Maybe (NonEmpty HealthCheckRegion)
a} :: HealthCheckConfig) ((Maybe (NonEmpty HealthCheckRegion)
  -> f (Maybe (NonEmpty HealthCheckRegion)))
 -> HealthCheckConfig -> f HealthCheckConfig)
-> ((Maybe (NonEmpty HealthCheckRegion)
     -> f (Maybe (NonEmpty HealthCheckRegion)))
    -> Maybe (NonEmpty HealthCheckRegion)
    -> f (Maybe (NonEmpty HealthCheckRegion)))
-> (Maybe (NonEmpty HealthCheckRegion)
    -> f (Maybe (NonEmpty HealthCheckRegion)))
-> HealthCheckConfig
-> f HealthCheckConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
-> Iso
     (Maybe (NonEmpty HealthCheckRegion))
     (Maybe (NonEmpty HealthCheckRegion))
     (Maybe (NonEmpty HealthCheckRegion))
     (Maybe (NonEmpty HealthCheckRegion))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
  (NonEmpty HealthCheckRegion)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The path, if any, that you want Amazon Route 53 to request when
-- performing health checks. The path can be any value for which your
-- endpoint will return an HTTP status code of 2xx or 3xx when the endpoint
-- is healthy, for example, the file \/docs\/route53-health-check.html. You
-- can also include query string parameters, for example,
-- @\/welcome.html?language=jp&login=y@.
healthCheckConfig_resourcePath :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Text)
healthCheckConfig_resourcePath :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_resourcePath = (HealthCheckConfig -> Maybe Text)
-> (HealthCheckConfig -> Maybe Text -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Text
resourcePath :: Maybe Text
$sel:resourcePath:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
resourcePath} -> Maybe Text
resourcePath) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Text
a -> HealthCheckConfig
s {$sel:resourcePath:HealthCheckConfig' :: Maybe Text
resourcePath = Maybe Text
a} :: HealthCheckConfig)

-- | When CloudWatch has insufficient data about the metric to determine the
-- alarm state, the status that you want Amazon Route 53 to assign to the
-- health check:
--
-- -   @Healthy@: Route 53 considers the health check to be healthy.
--
-- -   @Unhealthy@: Route 53 considers the health check to be unhealthy.
--
-- -   @LastKnownStatus@: Route 53 uses the status of the health check from
--     the last time that CloudWatch had sufficient data to determine the
--     alarm state. For new health checks that have no last known status,
--     the default status for the health check is healthy.
healthCheckConfig_insufficientDataHealthStatus :: Lens.Lens' HealthCheckConfig (Prelude.Maybe InsufficientDataHealthStatus)
healthCheckConfig_insufficientDataHealthStatus :: (Maybe InsufficientDataHealthStatus
 -> f (Maybe InsufficientDataHealthStatus))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_insufficientDataHealthStatus = (HealthCheckConfig -> Maybe InsufficientDataHealthStatus)
-> (HealthCheckConfig
    -> Maybe InsufficientDataHealthStatus -> HealthCheckConfig)
-> Lens
     HealthCheckConfig
     HealthCheckConfig
     (Maybe InsufficientDataHealthStatus)
     (Maybe InsufficientDataHealthStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus :: Maybe InsufficientDataHealthStatus
$sel:insufficientDataHealthStatus:HealthCheckConfig' :: HealthCheckConfig -> Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus} -> Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe InsufficientDataHealthStatus
a -> HealthCheckConfig
s {$sel:insufficientDataHealthStatus:HealthCheckConfig' :: Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus = Maybe InsufficientDataHealthStatus
a} :: HealthCheckConfig)

-- | A complex type that identifies the CloudWatch alarm that you want Amazon
-- Route 53 health checkers to use to determine whether the specified
-- health check is healthy.
healthCheckConfig_alarmIdentifier :: Lens.Lens' HealthCheckConfig (Prelude.Maybe AlarmIdentifier)
healthCheckConfig_alarmIdentifier :: (Maybe AlarmIdentifier -> f (Maybe AlarmIdentifier))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_alarmIdentifier = (HealthCheckConfig -> Maybe AlarmIdentifier)
-> (HealthCheckConfig
    -> Maybe AlarmIdentifier -> HealthCheckConfig)
-> Lens
     HealthCheckConfig
     HealthCheckConfig
     (Maybe AlarmIdentifier)
     (Maybe AlarmIdentifier)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe AlarmIdentifier
alarmIdentifier :: Maybe AlarmIdentifier
$sel:alarmIdentifier:HealthCheckConfig' :: HealthCheckConfig -> Maybe AlarmIdentifier
alarmIdentifier} -> Maybe AlarmIdentifier
alarmIdentifier) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe AlarmIdentifier
a -> HealthCheckConfig
s {$sel:alarmIdentifier:HealthCheckConfig' :: Maybe AlarmIdentifier
alarmIdentifier = Maybe AlarmIdentifier
a} :: HealthCheckConfig)

-- | Specify whether you want Amazon Route 53 to measure the latency between
-- health checkers in multiple Amazon Web Services regions and your
-- endpoint, and to display CloudWatch latency graphs on the __Health
-- Checks__ page in the Route 53 console.
--
-- You can\'t change the value of @MeasureLatency@ after you create a
-- health check.
healthCheckConfig_measureLatency :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Bool)
healthCheckConfig_measureLatency :: (Maybe Bool -> f (Maybe Bool))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_measureLatency = (HealthCheckConfig -> Maybe Bool)
-> (HealthCheckConfig -> Maybe Bool -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Bool
measureLatency :: Maybe Bool
$sel:measureLatency:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
measureLatency} -> Maybe Bool
measureLatency) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Bool
a -> HealthCheckConfig
s {$sel:measureLatency:HealthCheckConfig' :: Maybe Bool
measureLatency = Maybe Bool
a} :: HealthCheckConfig)

-- | Specify whether you want Amazon Route 53 to invert the status of a
-- health check, for example, to consider a health check unhealthy when it
-- otherwise would be considered healthy.
healthCheckConfig_inverted :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Bool)
healthCheckConfig_inverted :: (Maybe Bool -> f (Maybe Bool))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_inverted = (HealthCheckConfig -> Maybe Bool)
-> (HealthCheckConfig -> Maybe Bool -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Bool
inverted :: Maybe Bool
$sel:inverted:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
inverted} -> Maybe Bool
inverted) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Bool
a -> HealthCheckConfig
s {$sel:inverted:HealthCheckConfig' :: Maybe Bool
inverted = Maybe Bool
a} :: HealthCheckConfig)

-- | Amazon Route 53 behavior depends on whether you specify a value for
-- @IPAddress@.
--
-- __If you specify a value for__ @IPAddress@:
--
-- Amazon Route 53 sends health check requests to the specified IPv4 or
-- IPv6 address and passes the value of @FullyQualifiedDomainName@ in the
-- @Host@ header for all health checks except TCP health checks. This is
-- typically the fully qualified DNS name of the endpoint on which you want
-- Route 53 to perform health checks.
--
-- When Route 53 checks the health of an endpoint, here is how it
-- constructs the @Host@ header:
--
-- -   If you specify a value of @80@ for @Port@ and @HTTP@ or
--     @HTTP_STR_MATCH@ for @Type@, Route 53 passes the value of
--     @FullyQualifiedDomainName@ to the endpoint in the Host header.
--
-- -   If you specify a value of @443@ for @Port@ and @HTTPS@ or
--     @HTTPS_STR_MATCH@ for @Type@, Route 53 passes the value of
--     @FullyQualifiedDomainName@ to the endpoint in the @Host@ header.
--
-- -   If you specify another value for @Port@ and any value except @TCP@
--     for @Type@, Route 53 passes @FullyQualifiedDomainName:Port@ to the
--     endpoint in the @Host@ header.
--
-- If you don\'t specify a value for @FullyQualifiedDomainName@, Route 53
-- substitutes the value of @IPAddress@ in the @Host@ header in each of the
-- preceding cases.
--
-- __If you don\'t specify a value for__ @IPAddress@:
--
-- Route 53 sends a DNS request to the domain that you specify for
-- @FullyQualifiedDomainName@ at the interval that you specify for
-- @RequestInterval@. Using an IPv4 address that DNS returns, Route 53 then
-- checks the health of the endpoint.
--
-- If you don\'t specify a value for @IPAddress@, Route 53 uses only IPv4
-- to send health checks to the endpoint. If there\'s no resource record
-- set with a type of A for the name that you specify for
-- @FullyQualifiedDomainName@, the health check fails with a \"DNS
-- resolution failed\" error.
--
-- If you want to check the health of weighted, latency, or failover
-- resource record sets and you choose to specify the endpoint only by
-- @FullyQualifiedDomainName@, we recommend that you create a separate
-- health check for each endpoint. For example, create a health check for
-- each HTTP server that is serving content for www.example.com. For the
-- value of @FullyQualifiedDomainName@, specify the domain name of the
-- server (such as us-east-2-www.example.com), not the name of the resource
-- record sets (www.example.com).
--
-- In this configuration, if you create a health check for which the value
-- of @FullyQualifiedDomainName@ matches the name of the resource record
-- sets and you then associate the health check with those resource record
-- sets, health check results will be unpredictable.
--
-- In addition, if the value that you specify for @Type@ is @HTTP@,
-- @HTTPS@, @HTTP_STR_MATCH@, or @HTTPS_STR_MATCH@, Route 53 passes the
-- value of @FullyQualifiedDomainName@ in the @Host@ header, as it does
-- when you specify a value for @IPAddress@. If the value of @Type@ is
-- @TCP@, Route 53 doesn\'t pass a @Host@ header.
healthCheckConfig_fullyQualifiedDomainName :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Text)
healthCheckConfig_fullyQualifiedDomainName :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_fullyQualifiedDomainName = (HealthCheckConfig -> Maybe Text)
-> (HealthCheckConfig -> Maybe Text -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Text
fullyQualifiedDomainName :: Maybe Text
$sel:fullyQualifiedDomainName:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
fullyQualifiedDomainName} -> Maybe Text
fullyQualifiedDomainName) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Text
a -> HealthCheckConfig
s {$sel:fullyQualifiedDomainName:HealthCheckConfig' :: Maybe Text
fullyQualifiedDomainName = Maybe Text
a} :: HealthCheckConfig)

-- | (CALCULATED Health Checks Only) A complex type that contains one
-- @ChildHealthCheck@ element for each health check that you want to
-- associate with a @CALCULATED@ health check.
healthCheckConfig_childHealthChecks :: Lens.Lens' HealthCheckConfig (Prelude.Maybe [Prelude.Text])
healthCheckConfig_childHealthChecks :: (Maybe [Text] -> f (Maybe [Text]))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_childHealthChecks = (HealthCheckConfig -> Maybe [Text])
-> (HealthCheckConfig -> Maybe [Text] -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe [Text]
childHealthChecks :: Maybe [Text]
$sel:childHealthChecks:HealthCheckConfig' :: HealthCheckConfig -> Maybe [Text]
childHealthChecks} -> Maybe [Text]
childHealthChecks) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe [Text]
a -> HealthCheckConfig
s {$sel:childHealthChecks:HealthCheckConfig' :: Maybe [Text]
childHealthChecks = Maybe [Text]
a} :: HealthCheckConfig) ((Maybe [Text] -> f (Maybe [Text]))
 -> HealthCheckConfig -> f HealthCheckConfig)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> HealthCheckConfig
-> f HealthCheckConfig
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Amazon Resource Name (ARN) for the Route 53 Application Recovery
-- Controller routing control.
--
-- For more information about Route 53 Application Recovery Controller, see
-- <https://docs.aws.amazon.com/r53recovery/latest/dg/what-is-route-53-recovery.html Route 53 Application Recovery Controller Developer Guide.>.
healthCheckConfig_routingControlArn :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Text)
healthCheckConfig_routingControlArn :: (Maybe Text -> f (Maybe Text))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_routingControlArn = (HealthCheckConfig -> Maybe Text)
-> (HealthCheckConfig -> Maybe Text -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Text
routingControlArn :: Maybe Text
$sel:routingControlArn:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
routingControlArn} -> Maybe Text
routingControlArn) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Text
a -> HealthCheckConfig
s {$sel:routingControlArn:HealthCheckConfig' :: Maybe Text
routingControlArn = Maybe Text
a} :: HealthCheckConfig)

-- | The number of seconds between the time that Amazon Route 53 gets a
-- response from your endpoint and the time that it sends the next health
-- check request. Each Route 53 health checker makes requests at this
-- interval.
--
-- You can\'t change the value of @RequestInterval@ after you create a
-- health check.
--
-- If you don\'t specify a value for @RequestInterval@, the default value
-- is @30@ seconds.
healthCheckConfig_requestInterval :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Natural)
healthCheckConfig_requestInterval :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_requestInterval = (HealthCheckConfig -> Maybe Natural)
-> (HealthCheckConfig -> Maybe Natural -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Natural
requestInterval :: Maybe Natural
$sel:requestInterval:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
requestInterval} -> Maybe Natural
requestInterval) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Natural
a -> HealthCheckConfig
s {$sel:requestInterval:HealthCheckConfig' :: Maybe Natural
requestInterval = Maybe Natural
a} :: HealthCheckConfig)

-- | The port on the endpoint that you want Amazon Route 53 to perform health
-- checks on.
--
-- Don\'t specify a value for @Port@ when you specify a value for @Type@ of
-- @CLOUDWATCH_METRIC@ or @CALCULATED@.
healthCheckConfig_port :: Lens.Lens' HealthCheckConfig (Prelude.Maybe Prelude.Natural)
healthCheckConfig_port :: (Maybe Natural -> f (Maybe Natural))
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_port = (HealthCheckConfig -> Maybe Natural)
-> (HealthCheckConfig -> Maybe Natural -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {Maybe Natural
port :: Maybe Natural
$sel:port:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
port} -> Maybe Natural
port) (\s :: HealthCheckConfig
s@HealthCheckConfig' {} Maybe Natural
a -> HealthCheckConfig
s {$sel:port:HealthCheckConfig' :: Maybe Natural
port = Maybe Natural
a} :: HealthCheckConfig)

-- | The type of health check that you want to create, which indicates how
-- Amazon Route 53 determines whether an endpoint is healthy.
--
-- You can\'t change the value of @Type@ after you create a health check.
--
-- You can create the following types of health checks:
--
-- -   __HTTP__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTP request and waits for an HTTP
--     status code of 200 or greater and less than 400.
--
-- -   __HTTPS__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTPS request and waits for an HTTP
--     status code of 200 or greater and less than 400.
--
--     If you specify @HTTPS@ for the value of @Type@, the endpoint must
--     support TLS v1.0 or later.
--
-- -   __HTTP_STR_MATCH__: Route 53 tries to establish a TCP connection. If
--     successful, Route 53 submits an HTTP request and searches the first
--     5,120 bytes of the response body for the string that you specify in
--     @SearchString@.
--
-- -   __HTTPS_STR_MATCH__: Route 53 tries to establish a TCP connection.
--     If successful, Route 53 submits an @HTTPS@ request and searches the
--     first 5,120 bytes of the response body for the string that you
--     specify in @SearchString@.
--
-- -   __TCP__: Route 53 tries to establish a TCP connection.
--
-- -   __CLOUDWATCH_METRIC__: The health check is associated with a
--     CloudWatch alarm. If the state of the alarm is @OK@, the health
--     check is considered healthy. If the state is @ALARM@, the health
--     check is considered unhealthy. If CloudWatch doesn\'t have
--     sufficient data to determine whether the state is @OK@ or @ALARM@,
--     the health check status depends on the setting for
--     @InsufficientDataHealthStatus@: @Healthy@, @Unhealthy@, or
--     @LastKnownStatus@.
--
-- -   __CALCULATED__: For health checks that monitor the status of other
--     health checks, Route 53 adds up the number of health checks that
--     Route 53 health checkers consider to be healthy and compares that
--     number with the value of @HealthThreshold@.
--
-- -   __RECOVERY_CONTROL__: The health check is assocated with a Route53
--     Application Recovery Controller routing control. If the routing
--     control state is @ON@, the health check is considered healthy. If
--     the state is @OFF@, the health check is considered unhealthy.
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-determining-health-of-endpoints.html How Route 53 Determines Whether an Endpoint Is Healthy>
-- in the /Amazon Route 53 Developer Guide/.
healthCheckConfig_type :: Lens.Lens' HealthCheckConfig HealthCheckType
healthCheckConfig_type :: (HealthCheckType -> f HealthCheckType)
-> HealthCheckConfig -> f HealthCheckConfig
healthCheckConfig_type = (HealthCheckConfig -> HealthCheckType)
-> (HealthCheckConfig -> HealthCheckType -> HealthCheckConfig)
-> Lens
     HealthCheckConfig HealthCheckConfig HealthCheckType HealthCheckType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HealthCheckConfig' {HealthCheckType
type' :: HealthCheckType
$sel:type':HealthCheckConfig' :: HealthCheckConfig -> HealthCheckType
type'} -> HealthCheckType
type') (\s :: HealthCheckConfig
s@HealthCheckConfig' {} HealthCheckType
a -> HealthCheckConfig
s {$sel:type':HealthCheckConfig' :: HealthCheckType
type' = HealthCheckType
a} :: HealthCheckConfig)

instance Core.FromXML HealthCheckConfig where
  parseXML :: [Node] -> Either String HealthCheckConfig
parseXML [Node]
x =
    Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> Maybe (NonEmpty HealthCheckRegion)
-> Maybe Text
-> Maybe InsufficientDataHealthStatus
-> Maybe AlarmIdentifier
-> Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> HealthCheckType
-> HealthCheckConfig
HealthCheckConfig'
      (Maybe Natural
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Natural
 -> Maybe (NonEmpty HealthCheckRegion)
 -> Maybe Text
 -> Maybe InsufficientDataHealthStatus
 -> Maybe AlarmIdentifier
 -> Maybe Bool
 -> Maybe Bool
 -> Maybe Text
 -> Maybe [Text]
 -> Maybe Text
 -> Maybe Natural
 -> Maybe Natural
 -> HealthCheckType
 -> HealthCheckConfig)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe Text
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Natural
      -> Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FailureThreshold")
      Either
  String
  (Maybe Text
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Natural
   -> Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Natural
      -> Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IPAddress")
      Either
  String
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Natural
   -> Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe Natural
      -> Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"EnableSNI")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe Natural
   -> Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Disabled")
      Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SearchString")
      Either
  String
  (Maybe Natural
   -> Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Natural)
-> Either
     String
     (Maybe (NonEmpty HealthCheckRegion)
      -> Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"HealthThreshold")
      Either
  String
  (Maybe (NonEmpty HealthCheckRegion)
   -> Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe (NonEmpty HealthCheckRegion))
-> Either
     String
     (Maybe Text
      -> Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Regions" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe (NonEmpty HealthCheckRegion)))
-> Either String (Maybe (NonEmpty HealthCheckRegion))
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String (NonEmpty HealthCheckRegion))
-> [Node] -> Either String (Maybe (NonEmpty HealthCheckRegion))
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String (NonEmpty HealthCheckRegion)
forall a. FromXML a => Text -> [Node] -> Either String (NonEmpty a)
Core.parseXMLList1 Text
"Region")
                  )
      Either
  String
  (Maybe Text
   -> Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe InsufficientDataHealthStatus
      -> Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ResourcePath")
      Either
  String
  (Maybe InsufficientDataHealthStatus
   -> Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe InsufficientDataHealthStatus)
-> Either
     String
     (Maybe AlarmIdentifier
      -> Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text -> Either String (Maybe InsufficientDataHealthStatus)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"InsufficientDataHealthStatus")
      Either
  String
  (Maybe AlarmIdentifier
   -> Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe AlarmIdentifier)
-> Either
     String
     (Maybe Bool
      -> Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe AlarmIdentifier)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"AlarmIdentifier")
      Either
  String
  (Maybe Bool
   -> Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Bool
      -> Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MeasureLatency")
      Either
  String
  (Maybe Bool
   -> Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Bool)
-> Either
     String
     (Maybe Text
      -> Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Inverted")
      Either
  String
  (Maybe Text
   -> Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [Text]
      -> Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"FullyQualifiedDomainName")
      Either
  String
  (Maybe [Text]
   -> Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe [Text])
-> Either
     String
     (Maybe Text
      -> Maybe Natural
      -> Maybe Natural
      -> HealthCheckType
      -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"ChildHealthChecks"
                      Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                      Either String [Node]
-> ([Node] -> Either String (Maybe [Text]))
-> Either String (Maybe [Text])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Text])
-> [Node] -> Either String (Maybe [Text])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Text]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"ChildHealthCheck")
                  )
      Either
  String
  (Maybe Text
   -> Maybe Natural
   -> Maybe Natural
   -> HealthCheckType
   -> HealthCheckConfig)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Natural
      -> Maybe Natural -> HealthCheckType -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RoutingControlArn")
      Either
  String
  (Maybe Natural
   -> Maybe Natural -> HealthCheckType -> HealthCheckConfig)
-> Either String (Maybe Natural)
-> Either
     String (Maybe Natural -> HealthCheckType -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RequestInterval")
      Either
  String (Maybe Natural -> HealthCheckType -> HealthCheckConfig)
-> Either String (Maybe Natural)
-> Either String (HealthCheckType -> HealthCheckConfig)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Port")
      Either String (HealthCheckType -> HealthCheckConfig)
-> Either String HealthCheckType -> Either String HealthCheckConfig
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String HealthCheckType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"Type")

instance Prelude.Hashable HealthCheckConfig

instance Prelude.NFData HealthCheckConfig

instance Core.ToXML HealthCheckConfig where
  toXML :: HealthCheckConfig -> XML
toXML HealthCheckConfig' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe (NonEmpty HealthCheckRegion)
Maybe Text
Maybe AlarmIdentifier
Maybe InsufficientDataHealthStatus
HealthCheckType
type' :: HealthCheckType
port :: Maybe Natural
requestInterval :: Maybe Natural
routingControlArn :: Maybe Text
childHealthChecks :: Maybe [Text]
fullyQualifiedDomainName :: Maybe Text
inverted :: Maybe Bool
measureLatency :: Maybe Bool
alarmIdentifier :: Maybe AlarmIdentifier
insufficientDataHealthStatus :: Maybe InsufficientDataHealthStatus
resourcePath :: Maybe Text
regions :: Maybe (NonEmpty HealthCheckRegion)
healthThreshold :: Maybe Natural
searchString :: Maybe Text
disabled :: Maybe Bool
enableSNI :: Maybe Bool
iPAddress :: Maybe Text
failureThreshold :: Maybe Natural
$sel:type':HealthCheckConfig' :: HealthCheckConfig -> HealthCheckType
$sel:port:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
$sel:requestInterval:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
$sel:routingControlArn:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
$sel:childHealthChecks:HealthCheckConfig' :: HealthCheckConfig -> Maybe [Text]
$sel:fullyQualifiedDomainName:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
$sel:inverted:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
$sel:measureLatency:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
$sel:alarmIdentifier:HealthCheckConfig' :: HealthCheckConfig -> Maybe AlarmIdentifier
$sel:insufficientDataHealthStatus:HealthCheckConfig' :: HealthCheckConfig -> Maybe InsufficientDataHealthStatus
$sel:resourcePath:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
$sel:regions:HealthCheckConfig' :: HealthCheckConfig -> Maybe (NonEmpty HealthCheckRegion)
$sel:healthThreshold:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
$sel:searchString:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
$sel:disabled:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
$sel:enableSNI:HealthCheckConfig' :: HealthCheckConfig -> Maybe Bool
$sel:iPAddress:HealthCheckConfig' :: HealthCheckConfig -> Maybe Text
$sel:failureThreshold:HealthCheckConfig' :: HealthCheckConfig -> Maybe Natural
..} =
    [XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"FailureThreshold" Name -> Maybe Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Natural
failureThreshold,
        Name
"IPAddress" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
iPAddress,
        Name
"EnableSNI" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
enableSNI,
        Name
"Disabled" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
disabled,
        Name
"SearchString" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
searchString,
        Name
"HealthThreshold" Name -> Maybe Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Natural
healthThreshold,
        Name
"Regions"
          Name -> XML -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe XML -> XML
forall a. ToXML a => a -> XML
Core.toXML
            (Name -> NonEmpty HealthCheckRegion -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"Region" (NonEmpty HealthCheckRegion -> XML)
-> Maybe (NonEmpty HealthCheckRegion) -> Maybe XML
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty HealthCheckRegion)
regions),
        Name
"ResourcePath" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
resourcePath,
        Name
"InsufficientDataHealthStatus"
          Name -> Maybe InsufficientDataHealthStatus -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe InsufficientDataHealthStatus
insufficientDataHealthStatus,
        Name
"AlarmIdentifier" Name -> Maybe AlarmIdentifier -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe AlarmIdentifier
alarmIdentifier,
        Name
"MeasureLatency" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
measureLatency,
        Name
"Inverted" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
inverted,
        Name
"FullyQualifiedDomainName"
          Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
fullyQualifiedDomainName,
        Name
"ChildHealthChecks"
          Name -> XML -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe XML -> XML
forall a. ToXML a => a -> XML
Core.toXML
            ( Name -> [Text] -> XML
forall a. (IsList a, ToXML (Item a)) => Name -> a -> XML
Core.toXMLList Name
"ChildHealthCheck"
                ([Text] -> XML) -> Maybe [Text] -> Maybe XML
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
childHealthChecks
            ),
        Name
"RoutingControlArn" Name -> Maybe Text -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Text
routingControlArn,
        Name
"RequestInterval" Name -> Maybe Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Natural
requestInterval,
        Name
"Port" Name -> Maybe Natural -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Natural
port,
        Name
"Type" Name -> HealthCheckType -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= HealthCheckType
type'
      ]