{-# 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.CloudFront.Types.DistributionConfig
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CloudFront.Types.DistributionConfig where

import Amazonka.CloudFront.Types.Aliases
import Amazonka.CloudFront.Types.CacheBehaviors
import Amazonka.CloudFront.Types.CustomErrorResponses
import Amazonka.CloudFront.Types.DefaultCacheBehavior
import Amazonka.CloudFront.Types.HttpVersion
import Amazonka.CloudFront.Types.LoggingConfig
import Amazonka.CloudFront.Types.OriginGroups
import Amazonka.CloudFront.Types.Origins
import Amazonka.CloudFront.Types.PriceClass
import Amazonka.CloudFront.Types.Restrictions
import Amazonka.CloudFront.Types.ViewerCertificate
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A distribution configuration.
--
-- /See:/ 'newDistributionConfig' smart constructor.
data DistributionConfig = DistributionConfig'
  { -- | A complex type that contains information about CNAMEs (alternate domain
    -- names), if any, for this distribution.
    DistributionConfig -> Maybe Aliases
aliases :: Prelude.Maybe Aliases,
    -- | A complex type that contains zero or more @CacheBehavior@ elements.
    DistributionConfig -> Maybe CacheBehaviors
cacheBehaviors :: Prelude.Maybe CacheBehaviors,
    -- | The identifier of a continuous deployment policy. For more information,
    -- see @CreateContinuousDeploymentPolicy@.
    DistributionConfig -> Maybe Text
continuousDeploymentPolicyId :: Prelude.Maybe Prelude.Text,
    -- | A complex type that controls the following:
    --
    -- -   Whether CloudFront replaces HTTP status codes in the 4xx and 5xx
    --     range with custom error messages before returning the response to
    --     the viewer.
    --
    -- -   How long CloudFront caches HTTP status codes in the 4xx and 5xx
    --     range.
    --
    -- For more information about custom error pages, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html Customizing Error Responses>
    -- in the /Amazon CloudFront Developer Guide/.
    DistributionConfig -> Maybe CustomErrorResponses
customErrorResponses :: Prelude.Maybe CustomErrorResponses,
    -- | The object that you want CloudFront to request from your origin (for
    -- example, @index.html@) when a viewer requests the root URL for your
    -- distribution (@https:\/\/www.example.com@) instead of an object in your
    -- distribution (@https:\/\/www.example.com\/product-description.html@).
    -- Specifying a default root object avoids exposing the contents of your
    -- distribution.
    --
    -- Specify only the object name, for example, @index.html@. Don\'t add a
    -- @\/@ before the object name.
    --
    -- If you don\'t want to specify a default root object when you create a
    -- distribution, include an empty @DefaultRootObject@ element.
    --
    -- To delete the default root object from an existing distribution, update
    -- the distribution configuration and include an empty @DefaultRootObject@
    -- element.
    --
    -- To replace the default root object, update the distribution
    -- configuration and specify the new object.
    --
    -- For more information about the default root object, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html Creating a Default Root Object>
    -- in the /Amazon CloudFront Developer Guide/.
    DistributionConfig -> Maybe Text
defaultRootObject :: Prelude.Maybe Prelude.Text,
    -- | (Optional) Specify the maximum HTTP version(s) that you want viewers to
    -- use to communicate with CloudFront. The default value for new web
    -- distributions is @http2@. Viewers that don\'t support HTTP\/2
    -- automatically use an earlier HTTP version.
    --
    -- For viewers and CloudFront to use HTTP\/2, viewers must support TLSv1.2
    -- or later, and must support Server Name Indication (SNI).
    --
    -- For viewers and CloudFront to use HTTP\/3, viewers must support TLSv1.3
    -- and Server Name Indication (SNI). CloudFront supports HTTP\/3 connection
    -- migration to allow the viewer to switch networks without losing
    -- connection. For more information about connection migration, see
    -- <https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration Connection Migration>
    -- at RFC 9000. For more information about supported TLSv1.3 ciphers, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html Supported protocols and ciphers between viewers and CloudFront>.
    DistributionConfig -> Maybe HttpVersion
httpVersion :: Prelude.Maybe HttpVersion,
    -- | If you want CloudFront to respond to IPv6 DNS requests with an IPv6
    -- address for your distribution, specify @true@. If you specify @false@,
    -- CloudFront responds to IPv6 DNS requests with the DNS response code
    -- @NOERROR@ and with no IP addresses. This allows viewers to submit a
    -- second request, for an IPv4 address for your distribution.
    --
    -- In general, you should enable IPv6 if you have users on IPv6 networks
    -- who want to access your content. However, if you\'re using signed URLs
    -- or signed cookies to restrict access to your content, and if you\'re
    -- using a custom policy that includes the @IpAddress@ parameter to
    -- restrict the IP addresses that can access your content, don\'t enable
    -- IPv6. If you want to restrict access to some content by IP address and
    -- not restrict access to other content (or restrict access but not by IP
    -- address), you can create two distributions. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html Creating a Signed URL Using a Custom Policy>
    -- in the /Amazon CloudFront Developer Guide/.
    --
    -- If you\'re using an Route 53 Amazon Web Services Integration alias
    -- resource record set to route traffic to your CloudFront distribution,
    -- you need to create a second alias resource record set when both of the
    -- following are true:
    --
    -- -   You enable IPv6 for the distribution
    --
    -- -   You\'re using alternate domain names in the URLs for your objects
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name>
    -- in the /Route 53 Amazon Web Services Integration Developer Guide/.
    --
    -- If you created a CNAME resource record set, either with Route 53 Amazon
    -- Web Services Integration or with another DNS service, you don\'t need to
    -- make any changes. A CNAME record will route traffic to your distribution
    -- regardless of the IP address format of the viewer request.
    DistributionConfig -> Maybe Bool
isIPV6Enabled :: Prelude.Maybe Prelude.Bool,
    -- | A complex type that controls whether access logs are written for the
    -- distribution.
    --
    -- For more information about logging, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html Access Logs>
    -- in the /Amazon CloudFront Developer Guide/.
    DistributionConfig -> Maybe LoggingConfig
logging :: Prelude.Maybe LoggingConfig,
    -- | A complex type that contains information about origin groups for this
    -- distribution.
    DistributionConfig -> Maybe OriginGroups
originGroups :: Prelude.Maybe OriginGroups,
    -- | The price class that corresponds with the maximum price that you want to
    -- pay for CloudFront service. If you specify @PriceClass_All@, CloudFront
    -- responds to requests for your objects from all CloudFront edge
    -- locations.
    --
    -- If you specify a price class other than @PriceClass_All@, CloudFront
    -- serves your objects from the CloudFront edge location that has the
    -- lowest latency among the edge locations in your price class. Viewers who
    -- are in or near regions that are excluded from your specified price class
    -- may encounter slower performance.
    --
    -- For more information about price classes, see
    -- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html Choosing the Price Class for a CloudFront Distribution>
    -- in the /Amazon CloudFront Developer Guide/. For information about
    -- CloudFront pricing, including how price classes (such as Price Class
    -- 100) map to CloudFront regions, see
    -- <http://aws.amazon.com/cloudfront/pricing/ Amazon CloudFront Pricing>.
    DistributionConfig -> Maybe PriceClass
priceClass :: Prelude.Maybe PriceClass,
    -- | A complex type that identifies ways in which you want to restrict
    -- distribution of your content.
    DistributionConfig -> Maybe Restrictions
restrictions :: Prelude.Maybe Restrictions,
    -- | A Boolean that indicates whether this is a staging distribution. When
    -- this value is @true@, this is a staging distribution. When this value is
    -- @false@, this is not a staging distribution.
    DistributionConfig -> Maybe Bool
staging :: Prelude.Maybe Prelude.Bool,
    -- | A complex type that determines the distribution\'s SSL\/TLS
    -- configuration for communicating with viewers.
    DistributionConfig -> Maybe ViewerCertificate
viewerCertificate :: Prelude.Maybe ViewerCertificate,
    -- | A unique identifier that specifies the WAF web ACL, if any, to associate
    -- with this distribution. To specify a web ACL created using the latest
    -- version of WAF, use the ACL ARN, for example
    -- @arn:aws:wafv2:us-east-1:123456789012:global\/webacl\/ExampleWebACL\/473e64fd-f30b-4765-81a0-62ad96dd167a@.
    -- To specify a web ACL created using WAF Classic, use the ACL ID, for
    -- example @473e64fd-f30b-4765-81a0-62ad96dd167a@.
    --
    -- WAF is a web application firewall that lets you monitor the HTTP and
    -- HTTPS requests that are forwarded to CloudFront, and lets you control
    -- access to your content. Based on conditions that you specify, such as
    -- the IP addresses that requests originate from or the values of query
    -- strings, CloudFront responds to requests either with the requested
    -- content or with an HTTP 403 status code (Forbidden). You can also
    -- configure CloudFront to return a custom error page when a request is
    -- blocked. For more information about WAF, see the
    -- <https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html WAF Developer Guide>.
    DistributionConfig -> Maybe Text
webACLId :: Prelude.Maybe Prelude.Text,
    -- | A unique value (for example, a date-time stamp) that ensures that the
    -- request can\'t be replayed.
    --
    -- If the value of @CallerReference@ is new (regardless of the content of
    -- the @DistributionConfig@ object), CloudFront creates a new distribution.
    --
    -- If @CallerReference@ is a value that you already sent in a previous
    -- request to create a distribution, CloudFront returns a
    -- @DistributionAlreadyExists@ error.
    DistributionConfig -> Text
callerReference :: Prelude.Text,
    -- | A complex type that contains information about origins for this
    -- distribution.
    DistributionConfig -> Origins
origins :: Origins,
    -- | A complex type that describes the default cache behavior if you don\'t
    -- specify a @CacheBehavior@ element or if files don\'t match any of the
    -- values of @PathPattern@ in @CacheBehavior@ elements. You must create
    -- exactly one default cache behavior.
    DistributionConfig -> DefaultCacheBehavior
defaultCacheBehavior :: DefaultCacheBehavior,
    -- | A comment to describe the distribution. The comment cannot be longer
    -- than 128 characters.
    DistributionConfig -> Sensitive Text
comment :: Data.Sensitive Prelude.Text,
    -- | From this field, you can enable or disable the selected distribution.
    DistributionConfig -> Bool
enabled :: Prelude.Bool
  }
  deriving (DistributionConfig -> DistributionConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DistributionConfig -> DistributionConfig -> Bool
$c/= :: DistributionConfig -> DistributionConfig -> Bool
== :: DistributionConfig -> DistributionConfig -> Bool
$c== :: DistributionConfig -> DistributionConfig -> Bool
Prelude.Eq, Int -> DistributionConfig -> ShowS
[DistributionConfig] -> ShowS
DistributionConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DistributionConfig] -> ShowS
$cshowList :: [DistributionConfig] -> ShowS
show :: DistributionConfig -> String
$cshow :: DistributionConfig -> String
showsPrec :: Int -> DistributionConfig -> ShowS
$cshowsPrec :: Int -> DistributionConfig -> ShowS
Prelude.Show, forall x. Rep DistributionConfig x -> DistributionConfig
forall x. DistributionConfig -> Rep DistributionConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DistributionConfig x -> DistributionConfig
$cfrom :: forall x. DistributionConfig -> Rep DistributionConfig x
Prelude.Generic)

-- |
-- Create a value of 'DistributionConfig' 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:
--
-- 'aliases', 'distributionConfig_aliases' - A complex type that contains information about CNAMEs (alternate domain
-- names), if any, for this distribution.
--
-- 'cacheBehaviors', 'distributionConfig_cacheBehaviors' - A complex type that contains zero or more @CacheBehavior@ elements.
--
-- 'continuousDeploymentPolicyId', 'distributionConfig_continuousDeploymentPolicyId' - The identifier of a continuous deployment policy. For more information,
-- see @CreateContinuousDeploymentPolicy@.
--
-- 'customErrorResponses', 'distributionConfig_customErrorResponses' - A complex type that controls the following:
--
-- -   Whether CloudFront replaces HTTP status codes in the 4xx and 5xx
--     range with custom error messages before returning the response to
--     the viewer.
--
-- -   How long CloudFront caches HTTP status codes in the 4xx and 5xx
--     range.
--
-- For more information about custom error pages, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html Customizing Error Responses>
-- in the /Amazon CloudFront Developer Guide/.
--
-- 'defaultRootObject', 'distributionConfig_defaultRootObject' - The object that you want CloudFront to request from your origin (for
-- example, @index.html@) when a viewer requests the root URL for your
-- distribution (@https:\/\/www.example.com@) instead of an object in your
-- distribution (@https:\/\/www.example.com\/product-description.html@).
-- Specifying a default root object avoids exposing the contents of your
-- distribution.
--
-- Specify only the object name, for example, @index.html@. Don\'t add a
-- @\/@ before the object name.
--
-- If you don\'t want to specify a default root object when you create a
-- distribution, include an empty @DefaultRootObject@ element.
--
-- To delete the default root object from an existing distribution, update
-- the distribution configuration and include an empty @DefaultRootObject@
-- element.
--
-- To replace the default root object, update the distribution
-- configuration and specify the new object.
--
-- For more information about the default root object, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html Creating a Default Root Object>
-- in the /Amazon CloudFront Developer Guide/.
--
-- 'httpVersion', 'distributionConfig_httpVersion' - (Optional) Specify the maximum HTTP version(s) that you want viewers to
-- use to communicate with CloudFront. The default value for new web
-- distributions is @http2@. Viewers that don\'t support HTTP\/2
-- automatically use an earlier HTTP version.
--
-- For viewers and CloudFront to use HTTP\/2, viewers must support TLSv1.2
-- or later, and must support Server Name Indication (SNI).
--
-- For viewers and CloudFront to use HTTP\/3, viewers must support TLSv1.3
-- and Server Name Indication (SNI). CloudFront supports HTTP\/3 connection
-- migration to allow the viewer to switch networks without losing
-- connection. For more information about connection migration, see
-- <https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration Connection Migration>
-- at RFC 9000. For more information about supported TLSv1.3 ciphers, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html Supported protocols and ciphers between viewers and CloudFront>.
--
-- 'isIPV6Enabled', 'distributionConfig_isIPV6Enabled' - If you want CloudFront to respond to IPv6 DNS requests with an IPv6
-- address for your distribution, specify @true@. If you specify @false@,
-- CloudFront responds to IPv6 DNS requests with the DNS response code
-- @NOERROR@ and with no IP addresses. This allows viewers to submit a
-- second request, for an IPv4 address for your distribution.
--
-- In general, you should enable IPv6 if you have users on IPv6 networks
-- who want to access your content. However, if you\'re using signed URLs
-- or signed cookies to restrict access to your content, and if you\'re
-- using a custom policy that includes the @IpAddress@ parameter to
-- restrict the IP addresses that can access your content, don\'t enable
-- IPv6. If you want to restrict access to some content by IP address and
-- not restrict access to other content (or restrict access but not by IP
-- address), you can create two distributions. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html Creating a Signed URL Using a Custom Policy>
-- in the /Amazon CloudFront Developer Guide/.
--
-- If you\'re using an Route 53 Amazon Web Services Integration alias
-- resource record set to route traffic to your CloudFront distribution,
-- you need to create a second alias resource record set when both of the
-- following are true:
--
-- -   You enable IPv6 for the distribution
--
-- -   You\'re using alternate domain names in the URLs for your objects
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name>
-- in the /Route 53 Amazon Web Services Integration Developer Guide/.
--
-- If you created a CNAME resource record set, either with Route 53 Amazon
-- Web Services Integration or with another DNS service, you don\'t need to
-- make any changes. A CNAME record will route traffic to your distribution
-- regardless of the IP address format of the viewer request.
--
-- 'logging', 'distributionConfig_logging' - A complex type that controls whether access logs are written for the
-- distribution.
--
-- For more information about logging, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html Access Logs>
-- in the /Amazon CloudFront Developer Guide/.
--
-- 'originGroups', 'distributionConfig_originGroups' - A complex type that contains information about origin groups for this
-- distribution.
--
-- 'priceClass', 'distributionConfig_priceClass' - The price class that corresponds with the maximum price that you want to
-- pay for CloudFront service. If you specify @PriceClass_All@, CloudFront
-- responds to requests for your objects from all CloudFront edge
-- locations.
--
-- If you specify a price class other than @PriceClass_All@, CloudFront
-- serves your objects from the CloudFront edge location that has the
-- lowest latency among the edge locations in your price class. Viewers who
-- are in or near regions that are excluded from your specified price class
-- may encounter slower performance.
--
-- For more information about price classes, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html Choosing the Price Class for a CloudFront Distribution>
-- in the /Amazon CloudFront Developer Guide/. For information about
-- CloudFront pricing, including how price classes (such as Price Class
-- 100) map to CloudFront regions, see
-- <http://aws.amazon.com/cloudfront/pricing/ Amazon CloudFront Pricing>.
--
-- 'restrictions', 'distributionConfig_restrictions' - A complex type that identifies ways in which you want to restrict
-- distribution of your content.
--
-- 'staging', 'distributionConfig_staging' - A Boolean that indicates whether this is a staging distribution. When
-- this value is @true@, this is a staging distribution. When this value is
-- @false@, this is not a staging distribution.
--
-- 'viewerCertificate', 'distributionConfig_viewerCertificate' - A complex type that determines the distribution\'s SSL\/TLS
-- configuration for communicating with viewers.
--
-- 'webACLId', 'distributionConfig_webACLId' - A unique identifier that specifies the WAF web ACL, if any, to associate
-- with this distribution. To specify a web ACL created using the latest
-- version of WAF, use the ACL ARN, for example
-- @arn:aws:wafv2:us-east-1:123456789012:global\/webacl\/ExampleWebACL\/473e64fd-f30b-4765-81a0-62ad96dd167a@.
-- To specify a web ACL created using WAF Classic, use the ACL ID, for
-- example @473e64fd-f30b-4765-81a0-62ad96dd167a@.
--
-- WAF is a web application firewall that lets you monitor the HTTP and
-- HTTPS requests that are forwarded to CloudFront, and lets you control
-- access to your content. Based on conditions that you specify, such as
-- the IP addresses that requests originate from or the values of query
-- strings, CloudFront responds to requests either with the requested
-- content or with an HTTP 403 status code (Forbidden). You can also
-- configure CloudFront to return a custom error page when a request is
-- blocked. For more information about WAF, see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html WAF Developer Guide>.
--
-- 'callerReference', 'distributionConfig_callerReference' - A unique value (for example, a date-time stamp) that ensures that the
-- request can\'t be replayed.
--
-- If the value of @CallerReference@ is new (regardless of the content of
-- the @DistributionConfig@ object), CloudFront creates a new distribution.
--
-- If @CallerReference@ is a value that you already sent in a previous
-- request to create a distribution, CloudFront returns a
-- @DistributionAlreadyExists@ error.
--
-- 'origins', 'distributionConfig_origins' - A complex type that contains information about origins for this
-- distribution.
--
-- 'defaultCacheBehavior', 'distributionConfig_defaultCacheBehavior' - A complex type that describes the default cache behavior if you don\'t
-- specify a @CacheBehavior@ element or if files don\'t match any of the
-- values of @PathPattern@ in @CacheBehavior@ elements. You must create
-- exactly one default cache behavior.
--
-- 'comment', 'distributionConfig_comment' - A comment to describe the distribution. The comment cannot be longer
-- than 128 characters.
--
-- 'enabled', 'distributionConfig_enabled' - From this field, you can enable or disable the selected distribution.
newDistributionConfig ::
  -- | 'callerReference'
  Prelude.Text ->
  -- | 'origins'
  Origins ->
  -- | 'defaultCacheBehavior'
  DefaultCacheBehavior ->
  -- | 'comment'
  Prelude.Text ->
  -- | 'enabled'
  Prelude.Bool ->
  DistributionConfig
newDistributionConfig :: Text
-> Origins
-> DefaultCacheBehavior
-> Text
-> Bool
-> DistributionConfig
newDistributionConfig
  Text
pCallerReference_
  Origins
pOrigins_
  DefaultCacheBehavior
pDefaultCacheBehavior_
  Text
pComment_
  Bool
pEnabled_ =
    DistributionConfig'
      { $sel:aliases:DistributionConfig' :: Maybe Aliases
aliases = forall a. Maybe a
Prelude.Nothing,
        $sel:cacheBehaviors:DistributionConfig' :: Maybe CacheBehaviors
cacheBehaviors = forall a. Maybe a
Prelude.Nothing,
        $sel:continuousDeploymentPolicyId:DistributionConfig' :: Maybe Text
continuousDeploymentPolicyId = forall a. Maybe a
Prelude.Nothing,
        $sel:customErrorResponses:DistributionConfig' :: Maybe CustomErrorResponses
customErrorResponses = forall a. Maybe a
Prelude.Nothing,
        $sel:defaultRootObject:DistributionConfig' :: Maybe Text
defaultRootObject = forall a. Maybe a
Prelude.Nothing,
        $sel:httpVersion:DistributionConfig' :: Maybe HttpVersion
httpVersion = forall a. Maybe a
Prelude.Nothing,
        $sel:isIPV6Enabled:DistributionConfig' :: Maybe Bool
isIPV6Enabled = forall a. Maybe a
Prelude.Nothing,
        $sel:logging:DistributionConfig' :: Maybe LoggingConfig
logging = forall a. Maybe a
Prelude.Nothing,
        $sel:originGroups:DistributionConfig' :: Maybe OriginGroups
originGroups = forall a. Maybe a
Prelude.Nothing,
        $sel:priceClass:DistributionConfig' :: Maybe PriceClass
priceClass = forall a. Maybe a
Prelude.Nothing,
        $sel:restrictions:DistributionConfig' :: Maybe Restrictions
restrictions = forall a. Maybe a
Prelude.Nothing,
        $sel:staging:DistributionConfig' :: Maybe Bool
staging = forall a. Maybe a
Prelude.Nothing,
        $sel:viewerCertificate:DistributionConfig' :: Maybe ViewerCertificate
viewerCertificate = forall a. Maybe a
Prelude.Nothing,
        $sel:webACLId:DistributionConfig' :: Maybe Text
webACLId = forall a. Maybe a
Prelude.Nothing,
        $sel:callerReference:DistributionConfig' :: Text
callerReference = Text
pCallerReference_,
        $sel:origins:DistributionConfig' :: Origins
origins = Origins
pOrigins_,
        $sel:defaultCacheBehavior:DistributionConfig' :: DefaultCacheBehavior
defaultCacheBehavior = DefaultCacheBehavior
pDefaultCacheBehavior_,
        $sel:comment:DistributionConfig' :: Sensitive Text
comment = forall a. Iso' (Sensitive a) a
Data._Sensitive forall t b. AReview t b -> b -> t
Lens.# Text
pComment_,
        $sel:enabled:DistributionConfig' :: Bool
enabled = Bool
pEnabled_
      }

-- | A complex type that contains information about CNAMEs (alternate domain
-- names), if any, for this distribution.
distributionConfig_aliases :: Lens.Lens' DistributionConfig (Prelude.Maybe Aliases)
distributionConfig_aliases :: Lens' DistributionConfig (Maybe Aliases)
distributionConfig_aliases = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Aliases
aliases :: Maybe Aliases
$sel:aliases:DistributionConfig' :: DistributionConfig -> Maybe Aliases
aliases} -> Maybe Aliases
aliases) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Aliases
a -> DistributionConfig
s {$sel:aliases:DistributionConfig' :: Maybe Aliases
aliases = Maybe Aliases
a} :: DistributionConfig)

-- | A complex type that contains zero or more @CacheBehavior@ elements.
distributionConfig_cacheBehaviors :: Lens.Lens' DistributionConfig (Prelude.Maybe CacheBehaviors)
distributionConfig_cacheBehaviors :: Lens' DistributionConfig (Maybe CacheBehaviors)
distributionConfig_cacheBehaviors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe CacheBehaviors
cacheBehaviors :: Maybe CacheBehaviors
$sel:cacheBehaviors:DistributionConfig' :: DistributionConfig -> Maybe CacheBehaviors
cacheBehaviors} -> Maybe CacheBehaviors
cacheBehaviors) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe CacheBehaviors
a -> DistributionConfig
s {$sel:cacheBehaviors:DistributionConfig' :: Maybe CacheBehaviors
cacheBehaviors = Maybe CacheBehaviors
a} :: DistributionConfig)

-- | The identifier of a continuous deployment policy. For more information,
-- see @CreateContinuousDeploymentPolicy@.
distributionConfig_continuousDeploymentPolicyId :: Lens.Lens' DistributionConfig (Prelude.Maybe Prelude.Text)
distributionConfig_continuousDeploymentPolicyId :: Lens' DistributionConfig (Maybe Text)
distributionConfig_continuousDeploymentPolicyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Text
continuousDeploymentPolicyId :: Maybe Text
$sel:continuousDeploymentPolicyId:DistributionConfig' :: DistributionConfig -> Maybe Text
continuousDeploymentPolicyId} -> Maybe Text
continuousDeploymentPolicyId) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Text
a -> DistributionConfig
s {$sel:continuousDeploymentPolicyId:DistributionConfig' :: Maybe Text
continuousDeploymentPolicyId = Maybe Text
a} :: DistributionConfig)

-- | A complex type that controls the following:
--
-- -   Whether CloudFront replaces HTTP status codes in the 4xx and 5xx
--     range with custom error messages before returning the response to
--     the viewer.
--
-- -   How long CloudFront caches HTTP status codes in the 4xx and 5xx
--     range.
--
-- For more information about custom error pages, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html Customizing Error Responses>
-- in the /Amazon CloudFront Developer Guide/.
distributionConfig_customErrorResponses :: Lens.Lens' DistributionConfig (Prelude.Maybe CustomErrorResponses)
distributionConfig_customErrorResponses :: Lens' DistributionConfig (Maybe CustomErrorResponses)
distributionConfig_customErrorResponses = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe CustomErrorResponses
customErrorResponses :: Maybe CustomErrorResponses
$sel:customErrorResponses:DistributionConfig' :: DistributionConfig -> Maybe CustomErrorResponses
customErrorResponses} -> Maybe CustomErrorResponses
customErrorResponses) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe CustomErrorResponses
a -> DistributionConfig
s {$sel:customErrorResponses:DistributionConfig' :: Maybe CustomErrorResponses
customErrorResponses = Maybe CustomErrorResponses
a} :: DistributionConfig)

-- | The object that you want CloudFront to request from your origin (for
-- example, @index.html@) when a viewer requests the root URL for your
-- distribution (@https:\/\/www.example.com@) instead of an object in your
-- distribution (@https:\/\/www.example.com\/product-description.html@).
-- Specifying a default root object avoids exposing the contents of your
-- distribution.
--
-- Specify only the object name, for example, @index.html@. Don\'t add a
-- @\/@ before the object name.
--
-- If you don\'t want to specify a default root object when you create a
-- distribution, include an empty @DefaultRootObject@ element.
--
-- To delete the default root object from an existing distribution, update
-- the distribution configuration and include an empty @DefaultRootObject@
-- element.
--
-- To replace the default root object, update the distribution
-- configuration and specify the new object.
--
-- For more information about the default root object, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/DefaultRootObject.html Creating a Default Root Object>
-- in the /Amazon CloudFront Developer Guide/.
distributionConfig_defaultRootObject :: Lens.Lens' DistributionConfig (Prelude.Maybe Prelude.Text)
distributionConfig_defaultRootObject :: Lens' DistributionConfig (Maybe Text)
distributionConfig_defaultRootObject = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Text
defaultRootObject :: Maybe Text
$sel:defaultRootObject:DistributionConfig' :: DistributionConfig -> Maybe Text
defaultRootObject} -> Maybe Text
defaultRootObject) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Text
a -> DistributionConfig
s {$sel:defaultRootObject:DistributionConfig' :: Maybe Text
defaultRootObject = Maybe Text
a} :: DistributionConfig)

-- | (Optional) Specify the maximum HTTP version(s) that you want viewers to
-- use to communicate with CloudFront. The default value for new web
-- distributions is @http2@. Viewers that don\'t support HTTP\/2
-- automatically use an earlier HTTP version.
--
-- For viewers and CloudFront to use HTTP\/2, viewers must support TLSv1.2
-- or later, and must support Server Name Indication (SNI).
--
-- For viewers and CloudFront to use HTTP\/3, viewers must support TLSv1.3
-- and Server Name Indication (SNI). CloudFront supports HTTP\/3 connection
-- migration to allow the viewer to switch networks without losing
-- connection. For more information about connection migration, see
-- <https://www.rfc-editor.org/rfc/rfc9000.html#name-connection-migration Connection Migration>
-- at RFC 9000. For more information about supported TLSv1.3 ciphers, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html Supported protocols and ciphers between viewers and CloudFront>.
distributionConfig_httpVersion :: Lens.Lens' DistributionConfig (Prelude.Maybe HttpVersion)
distributionConfig_httpVersion :: Lens' DistributionConfig (Maybe HttpVersion)
distributionConfig_httpVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe HttpVersion
httpVersion :: Maybe HttpVersion
$sel:httpVersion:DistributionConfig' :: DistributionConfig -> Maybe HttpVersion
httpVersion} -> Maybe HttpVersion
httpVersion) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe HttpVersion
a -> DistributionConfig
s {$sel:httpVersion:DistributionConfig' :: Maybe HttpVersion
httpVersion = Maybe HttpVersion
a} :: DistributionConfig)

-- | If you want CloudFront to respond to IPv6 DNS requests with an IPv6
-- address for your distribution, specify @true@. If you specify @false@,
-- CloudFront responds to IPv6 DNS requests with the DNS response code
-- @NOERROR@ and with no IP addresses. This allows viewers to submit a
-- second request, for an IPv4 address for your distribution.
--
-- In general, you should enable IPv6 if you have users on IPv6 networks
-- who want to access your content. However, if you\'re using signed URLs
-- or signed cookies to restrict access to your content, and if you\'re
-- using a custom policy that includes the @IpAddress@ parameter to
-- restrict the IP addresses that can access your content, don\'t enable
-- IPv6. If you want to restrict access to some content by IP address and
-- not restrict access to other content (or restrict access but not by IP
-- address), you can create two distributions. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-creating-signed-url-custom-policy.html Creating a Signed URL Using a Custom Policy>
-- in the /Amazon CloudFront Developer Guide/.
--
-- If you\'re using an Route 53 Amazon Web Services Integration alias
-- resource record set to route traffic to your CloudFront distribution,
-- you need to create a second alias resource record set when both of the
-- following are true:
--
-- -   You enable IPv6 for the distribution
--
-- -   You\'re using alternate domain names in the URLs for your objects
--
-- For more information, see
-- <https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html Routing Traffic to an Amazon CloudFront Web Distribution by Using Your Domain Name>
-- in the /Route 53 Amazon Web Services Integration Developer Guide/.
--
-- If you created a CNAME resource record set, either with Route 53 Amazon
-- Web Services Integration or with another DNS service, you don\'t need to
-- make any changes. A CNAME record will route traffic to your distribution
-- regardless of the IP address format of the viewer request.
distributionConfig_isIPV6Enabled :: Lens.Lens' DistributionConfig (Prelude.Maybe Prelude.Bool)
distributionConfig_isIPV6Enabled :: Lens' DistributionConfig (Maybe Bool)
distributionConfig_isIPV6Enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Bool
isIPV6Enabled :: Maybe Bool
$sel:isIPV6Enabled:DistributionConfig' :: DistributionConfig -> Maybe Bool
isIPV6Enabled} -> Maybe Bool
isIPV6Enabled) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Bool
a -> DistributionConfig
s {$sel:isIPV6Enabled:DistributionConfig' :: Maybe Bool
isIPV6Enabled = Maybe Bool
a} :: DistributionConfig)

-- | A complex type that controls whether access logs are written for the
-- distribution.
--
-- For more information about logging, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html Access Logs>
-- in the /Amazon CloudFront Developer Guide/.
distributionConfig_logging :: Lens.Lens' DistributionConfig (Prelude.Maybe LoggingConfig)
distributionConfig_logging :: Lens' DistributionConfig (Maybe LoggingConfig)
distributionConfig_logging = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe LoggingConfig
logging :: Maybe LoggingConfig
$sel:logging:DistributionConfig' :: DistributionConfig -> Maybe LoggingConfig
logging} -> Maybe LoggingConfig
logging) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe LoggingConfig
a -> DistributionConfig
s {$sel:logging:DistributionConfig' :: Maybe LoggingConfig
logging = Maybe LoggingConfig
a} :: DistributionConfig)

-- | A complex type that contains information about origin groups for this
-- distribution.
distributionConfig_originGroups :: Lens.Lens' DistributionConfig (Prelude.Maybe OriginGroups)
distributionConfig_originGroups :: Lens' DistributionConfig (Maybe OriginGroups)
distributionConfig_originGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe OriginGroups
originGroups :: Maybe OriginGroups
$sel:originGroups:DistributionConfig' :: DistributionConfig -> Maybe OriginGroups
originGroups} -> Maybe OriginGroups
originGroups) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe OriginGroups
a -> DistributionConfig
s {$sel:originGroups:DistributionConfig' :: Maybe OriginGroups
originGroups = Maybe OriginGroups
a} :: DistributionConfig)

-- | The price class that corresponds with the maximum price that you want to
-- pay for CloudFront service. If you specify @PriceClass_All@, CloudFront
-- responds to requests for your objects from all CloudFront edge
-- locations.
--
-- If you specify a price class other than @PriceClass_All@, CloudFront
-- serves your objects from the CloudFront edge location that has the
-- lowest latency among the edge locations in your price class. Viewers who
-- are in or near regions that are excluded from your specified price class
-- may encounter slower performance.
--
-- For more information about price classes, see
-- <https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/PriceClass.html Choosing the Price Class for a CloudFront Distribution>
-- in the /Amazon CloudFront Developer Guide/. For information about
-- CloudFront pricing, including how price classes (such as Price Class
-- 100) map to CloudFront regions, see
-- <http://aws.amazon.com/cloudfront/pricing/ Amazon CloudFront Pricing>.
distributionConfig_priceClass :: Lens.Lens' DistributionConfig (Prelude.Maybe PriceClass)
distributionConfig_priceClass :: Lens' DistributionConfig (Maybe PriceClass)
distributionConfig_priceClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe PriceClass
priceClass :: Maybe PriceClass
$sel:priceClass:DistributionConfig' :: DistributionConfig -> Maybe PriceClass
priceClass} -> Maybe PriceClass
priceClass) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe PriceClass
a -> DistributionConfig
s {$sel:priceClass:DistributionConfig' :: Maybe PriceClass
priceClass = Maybe PriceClass
a} :: DistributionConfig)

-- | A complex type that identifies ways in which you want to restrict
-- distribution of your content.
distributionConfig_restrictions :: Lens.Lens' DistributionConfig (Prelude.Maybe Restrictions)
distributionConfig_restrictions :: Lens' DistributionConfig (Maybe Restrictions)
distributionConfig_restrictions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Restrictions
restrictions :: Maybe Restrictions
$sel:restrictions:DistributionConfig' :: DistributionConfig -> Maybe Restrictions
restrictions} -> Maybe Restrictions
restrictions) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Restrictions
a -> DistributionConfig
s {$sel:restrictions:DistributionConfig' :: Maybe Restrictions
restrictions = Maybe Restrictions
a} :: DistributionConfig)

-- | A Boolean that indicates whether this is a staging distribution. When
-- this value is @true@, this is a staging distribution. When this value is
-- @false@, this is not a staging distribution.
distributionConfig_staging :: Lens.Lens' DistributionConfig (Prelude.Maybe Prelude.Bool)
distributionConfig_staging :: Lens' DistributionConfig (Maybe Bool)
distributionConfig_staging = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Bool
staging :: Maybe Bool
$sel:staging:DistributionConfig' :: DistributionConfig -> Maybe Bool
staging} -> Maybe Bool
staging) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Bool
a -> DistributionConfig
s {$sel:staging:DistributionConfig' :: Maybe Bool
staging = Maybe Bool
a} :: DistributionConfig)

-- | A complex type that determines the distribution\'s SSL\/TLS
-- configuration for communicating with viewers.
distributionConfig_viewerCertificate :: Lens.Lens' DistributionConfig (Prelude.Maybe ViewerCertificate)
distributionConfig_viewerCertificate :: Lens' DistributionConfig (Maybe ViewerCertificate)
distributionConfig_viewerCertificate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe ViewerCertificate
viewerCertificate :: Maybe ViewerCertificate
$sel:viewerCertificate:DistributionConfig' :: DistributionConfig -> Maybe ViewerCertificate
viewerCertificate} -> Maybe ViewerCertificate
viewerCertificate) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe ViewerCertificate
a -> DistributionConfig
s {$sel:viewerCertificate:DistributionConfig' :: Maybe ViewerCertificate
viewerCertificate = Maybe ViewerCertificate
a} :: DistributionConfig)

-- | A unique identifier that specifies the WAF web ACL, if any, to associate
-- with this distribution. To specify a web ACL created using the latest
-- version of WAF, use the ACL ARN, for example
-- @arn:aws:wafv2:us-east-1:123456789012:global\/webacl\/ExampleWebACL\/473e64fd-f30b-4765-81a0-62ad96dd167a@.
-- To specify a web ACL created using WAF Classic, use the ACL ID, for
-- example @473e64fd-f30b-4765-81a0-62ad96dd167a@.
--
-- WAF is a web application firewall that lets you monitor the HTTP and
-- HTTPS requests that are forwarded to CloudFront, and lets you control
-- access to your content. Based on conditions that you specify, such as
-- the IP addresses that requests originate from or the values of query
-- strings, CloudFront responds to requests either with the requested
-- content or with an HTTP 403 status code (Forbidden). You can also
-- configure CloudFront to return a custom error page when a request is
-- blocked. For more information about WAF, see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html WAF Developer Guide>.
distributionConfig_webACLId :: Lens.Lens' DistributionConfig (Prelude.Maybe Prelude.Text)
distributionConfig_webACLId :: Lens' DistributionConfig (Maybe Text)
distributionConfig_webACLId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Maybe Text
webACLId :: Maybe Text
$sel:webACLId:DistributionConfig' :: DistributionConfig -> Maybe Text
webACLId} -> Maybe Text
webACLId) (\s :: DistributionConfig
s@DistributionConfig' {} Maybe Text
a -> DistributionConfig
s {$sel:webACLId:DistributionConfig' :: Maybe Text
webACLId = Maybe Text
a} :: DistributionConfig)

-- | A unique value (for example, a date-time stamp) that ensures that the
-- request can\'t be replayed.
--
-- If the value of @CallerReference@ is new (regardless of the content of
-- the @DistributionConfig@ object), CloudFront creates a new distribution.
--
-- If @CallerReference@ is a value that you already sent in a previous
-- request to create a distribution, CloudFront returns a
-- @DistributionAlreadyExists@ error.
distributionConfig_callerReference :: Lens.Lens' DistributionConfig Prelude.Text
distributionConfig_callerReference :: Lens' DistributionConfig Text
distributionConfig_callerReference = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Text
callerReference :: Text
$sel:callerReference:DistributionConfig' :: DistributionConfig -> Text
callerReference} -> Text
callerReference) (\s :: DistributionConfig
s@DistributionConfig' {} Text
a -> DistributionConfig
s {$sel:callerReference:DistributionConfig' :: Text
callerReference = Text
a} :: DistributionConfig)

-- | A complex type that contains information about origins for this
-- distribution.
distributionConfig_origins :: Lens.Lens' DistributionConfig Origins
distributionConfig_origins :: Lens' DistributionConfig Origins
distributionConfig_origins = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Origins
origins :: Origins
$sel:origins:DistributionConfig' :: DistributionConfig -> Origins
origins} -> Origins
origins) (\s :: DistributionConfig
s@DistributionConfig' {} Origins
a -> DistributionConfig
s {$sel:origins:DistributionConfig' :: Origins
origins = Origins
a} :: DistributionConfig)

-- | A complex type that describes the default cache behavior if you don\'t
-- specify a @CacheBehavior@ element or if files don\'t match any of the
-- values of @PathPattern@ in @CacheBehavior@ elements. You must create
-- exactly one default cache behavior.
distributionConfig_defaultCacheBehavior :: Lens.Lens' DistributionConfig DefaultCacheBehavior
distributionConfig_defaultCacheBehavior :: Lens' DistributionConfig DefaultCacheBehavior
distributionConfig_defaultCacheBehavior = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {DefaultCacheBehavior
defaultCacheBehavior :: DefaultCacheBehavior
$sel:defaultCacheBehavior:DistributionConfig' :: DistributionConfig -> DefaultCacheBehavior
defaultCacheBehavior} -> DefaultCacheBehavior
defaultCacheBehavior) (\s :: DistributionConfig
s@DistributionConfig' {} DefaultCacheBehavior
a -> DistributionConfig
s {$sel:defaultCacheBehavior:DistributionConfig' :: DefaultCacheBehavior
defaultCacheBehavior = DefaultCacheBehavior
a} :: DistributionConfig)

-- | A comment to describe the distribution. The comment cannot be longer
-- than 128 characters.
distributionConfig_comment :: Lens.Lens' DistributionConfig Prelude.Text
distributionConfig_comment :: Lens' DistributionConfig Text
distributionConfig_comment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Sensitive Text
comment :: Sensitive Text
$sel:comment:DistributionConfig' :: DistributionConfig -> Sensitive Text
comment} -> Sensitive Text
comment) (\s :: DistributionConfig
s@DistributionConfig' {} Sensitive Text
a -> DistributionConfig
s {$sel:comment:DistributionConfig' :: Sensitive Text
comment = Sensitive Text
a} :: DistributionConfig) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | From this field, you can enable or disable the selected distribution.
distributionConfig_enabled :: Lens.Lens' DistributionConfig Prelude.Bool
distributionConfig_enabled :: Lens' DistributionConfig Bool
distributionConfig_enabled = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DistributionConfig' {Bool
enabled :: Bool
$sel:enabled:DistributionConfig' :: DistributionConfig -> Bool
enabled} -> Bool
enabled) (\s :: DistributionConfig
s@DistributionConfig' {} Bool
a -> DistributionConfig
s {$sel:enabled:DistributionConfig' :: Bool
enabled = Bool
a} :: DistributionConfig)

instance Data.FromXML DistributionConfig where
  parseXML :: [Node] -> Either String DistributionConfig
parseXML [Node]
x =
    Maybe Aliases
-> Maybe CacheBehaviors
-> Maybe Text
-> Maybe CustomErrorResponses
-> Maybe Text
-> Maybe HttpVersion
-> Maybe Bool
-> Maybe LoggingConfig
-> Maybe OriginGroups
-> Maybe PriceClass
-> Maybe Restrictions
-> Maybe Bool
-> Maybe ViewerCertificate
-> Maybe Text
-> Text
-> Origins
-> DefaultCacheBehavior
-> Sensitive Text
-> Bool
-> DistributionConfig
DistributionConfig'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Aliases")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheBehaviors")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ContinuousDeploymentPolicyId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CustomErrorResponses")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"DefaultRootObject")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"HttpVersion")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"IsIPV6Enabled")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Logging")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"OriginGroups")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"PriceClass")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Restrictions")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Staging")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"ViewerCertificate")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"WebACLId")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"CallerReference")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Origins")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"DefaultCacheBehavior")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Comment")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String a
Data..@ Text
"Enabled")

instance Prelude.Hashable DistributionConfig where
  hashWithSalt :: Int -> DistributionConfig -> Int
hashWithSalt Int
_salt DistributionConfig' {Bool
Maybe Bool
Maybe Text
Maybe Aliases
Maybe CustomErrorResponses
Maybe HttpVersion
Maybe LoggingConfig
Maybe PriceClass
Maybe Restrictions
Maybe OriginGroups
Maybe ViewerCertificate
Maybe CacheBehaviors
Text
Sensitive Text
Origins
DefaultCacheBehavior
enabled :: Bool
comment :: Sensitive Text
defaultCacheBehavior :: DefaultCacheBehavior
origins :: Origins
callerReference :: Text
webACLId :: Maybe Text
viewerCertificate :: Maybe ViewerCertificate
staging :: Maybe Bool
restrictions :: Maybe Restrictions
priceClass :: Maybe PriceClass
originGroups :: Maybe OriginGroups
logging :: Maybe LoggingConfig
isIPV6Enabled :: Maybe Bool
httpVersion :: Maybe HttpVersion
defaultRootObject :: Maybe Text
customErrorResponses :: Maybe CustomErrorResponses
continuousDeploymentPolicyId :: Maybe Text
cacheBehaviors :: Maybe CacheBehaviors
aliases :: Maybe Aliases
$sel:enabled:DistributionConfig' :: DistributionConfig -> Bool
$sel:comment:DistributionConfig' :: DistributionConfig -> Sensitive Text
$sel:defaultCacheBehavior:DistributionConfig' :: DistributionConfig -> DefaultCacheBehavior
$sel:origins:DistributionConfig' :: DistributionConfig -> Origins
$sel:callerReference:DistributionConfig' :: DistributionConfig -> Text
$sel:webACLId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:viewerCertificate:DistributionConfig' :: DistributionConfig -> Maybe ViewerCertificate
$sel:staging:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:restrictions:DistributionConfig' :: DistributionConfig -> Maybe Restrictions
$sel:priceClass:DistributionConfig' :: DistributionConfig -> Maybe PriceClass
$sel:originGroups:DistributionConfig' :: DistributionConfig -> Maybe OriginGroups
$sel:logging:DistributionConfig' :: DistributionConfig -> Maybe LoggingConfig
$sel:isIPV6Enabled:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:httpVersion:DistributionConfig' :: DistributionConfig -> Maybe HttpVersion
$sel:defaultRootObject:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:customErrorResponses:DistributionConfig' :: DistributionConfig -> Maybe CustomErrorResponses
$sel:continuousDeploymentPolicyId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:cacheBehaviors:DistributionConfig' :: DistributionConfig -> Maybe CacheBehaviors
$sel:aliases:DistributionConfig' :: DistributionConfig -> Maybe Aliases
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Aliases
aliases
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CacheBehaviors
cacheBehaviors
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
continuousDeploymentPolicyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe CustomErrorResponses
customErrorResponses
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
defaultRootObject
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HttpVersion
httpVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isIPV6Enabled
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe LoggingConfig
logging
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OriginGroups
originGroups
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe PriceClass
priceClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Restrictions
restrictions
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
staging
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ViewerCertificate
viewerCertificate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
webACLId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
callerReference
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Origins
origins
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` DefaultCacheBehavior
defaultCacheBehavior
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Sensitive Text
comment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
enabled

instance Prelude.NFData DistributionConfig where
  rnf :: DistributionConfig -> ()
rnf DistributionConfig' {Bool
Maybe Bool
Maybe Text
Maybe Aliases
Maybe CustomErrorResponses
Maybe HttpVersion
Maybe LoggingConfig
Maybe PriceClass
Maybe Restrictions
Maybe OriginGroups
Maybe ViewerCertificate
Maybe CacheBehaviors
Text
Sensitive Text
Origins
DefaultCacheBehavior
enabled :: Bool
comment :: Sensitive Text
defaultCacheBehavior :: DefaultCacheBehavior
origins :: Origins
callerReference :: Text
webACLId :: Maybe Text
viewerCertificate :: Maybe ViewerCertificate
staging :: Maybe Bool
restrictions :: Maybe Restrictions
priceClass :: Maybe PriceClass
originGroups :: Maybe OriginGroups
logging :: Maybe LoggingConfig
isIPV6Enabled :: Maybe Bool
httpVersion :: Maybe HttpVersion
defaultRootObject :: Maybe Text
customErrorResponses :: Maybe CustomErrorResponses
continuousDeploymentPolicyId :: Maybe Text
cacheBehaviors :: Maybe CacheBehaviors
aliases :: Maybe Aliases
$sel:enabled:DistributionConfig' :: DistributionConfig -> Bool
$sel:comment:DistributionConfig' :: DistributionConfig -> Sensitive Text
$sel:defaultCacheBehavior:DistributionConfig' :: DistributionConfig -> DefaultCacheBehavior
$sel:origins:DistributionConfig' :: DistributionConfig -> Origins
$sel:callerReference:DistributionConfig' :: DistributionConfig -> Text
$sel:webACLId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:viewerCertificate:DistributionConfig' :: DistributionConfig -> Maybe ViewerCertificate
$sel:staging:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:restrictions:DistributionConfig' :: DistributionConfig -> Maybe Restrictions
$sel:priceClass:DistributionConfig' :: DistributionConfig -> Maybe PriceClass
$sel:originGroups:DistributionConfig' :: DistributionConfig -> Maybe OriginGroups
$sel:logging:DistributionConfig' :: DistributionConfig -> Maybe LoggingConfig
$sel:isIPV6Enabled:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:httpVersion:DistributionConfig' :: DistributionConfig -> Maybe HttpVersion
$sel:defaultRootObject:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:customErrorResponses:DistributionConfig' :: DistributionConfig -> Maybe CustomErrorResponses
$sel:continuousDeploymentPolicyId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:cacheBehaviors:DistributionConfig' :: DistributionConfig -> Maybe CacheBehaviors
$sel:aliases:DistributionConfig' :: DistributionConfig -> Maybe Aliases
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Aliases
aliases
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CacheBehaviors
cacheBehaviors
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
continuousDeploymentPolicyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomErrorResponses
customErrorResponses
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
defaultRootObject
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HttpVersion
httpVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isIPV6Enabled
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe LoggingConfig
logging
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe OriginGroups
originGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe PriceClass
priceClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Restrictions
restrictions
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
staging
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ViewerCertificate
viewerCertificate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
webACLId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
callerReference
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Origins
origins
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf DefaultCacheBehavior
defaultCacheBehavior
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Sensitive Text
comment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
enabled

instance Data.ToXML DistributionConfig where
  toXML :: DistributionConfig -> XML
toXML DistributionConfig' {Bool
Maybe Bool
Maybe Text
Maybe Aliases
Maybe CustomErrorResponses
Maybe HttpVersion
Maybe LoggingConfig
Maybe PriceClass
Maybe Restrictions
Maybe OriginGroups
Maybe ViewerCertificate
Maybe CacheBehaviors
Text
Sensitive Text
Origins
DefaultCacheBehavior
enabled :: Bool
comment :: Sensitive Text
defaultCacheBehavior :: DefaultCacheBehavior
origins :: Origins
callerReference :: Text
webACLId :: Maybe Text
viewerCertificate :: Maybe ViewerCertificate
staging :: Maybe Bool
restrictions :: Maybe Restrictions
priceClass :: Maybe PriceClass
originGroups :: Maybe OriginGroups
logging :: Maybe LoggingConfig
isIPV6Enabled :: Maybe Bool
httpVersion :: Maybe HttpVersion
defaultRootObject :: Maybe Text
customErrorResponses :: Maybe CustomErrorResponses
continuousDeploymentPolicyId :: Maybe Text
cacheBehaviors :: Maybe CacheBehaviors
aliases :: Maybe Aliases
$sel:enabled:DistributionConfig' :: DistributionConfig -> Bool
$sel:comment:DistributionConfig' :: DistributionConfig -> Sensitive Text
$sel:defaultCacheBehavior:DistributionConfig' :: DistributionConfig -> DefaultCacheBehavior
$sel:origins:DistributionConfig' :: DistributionConfig -> Origins
$sel:callerReference:DistributionConfig' :: DistributionConfig -> Text
$sel:webACLId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:viewerCertificate:DistributionConfig' :: DistributionConfig -> Maybe ViewerCertificate
$sel:staging:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:restrictions:DistributionConfig' :: DistributionConfig -> Maybe Restrictions
$sel:priceClass:DistributionConfig' :: DistributionConfig -> Maybe PriceClass
$sel:originGroups:DistributionConfig' :: DistributionConfig -> Maybe OriginGroups
$sel:logging:DistributionConfig' :: DistributionConfig -> Maybe LoggingConfig
$sel:isIPV6Enabled:DistributionConfig' :: DistributionConfig -> Maybe Bool
$sel:httpVersion:DistributionConfig' :: DistributionConfig -> Maybe HttpVersion
$sel:defaultRootObject:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:customErrorResponses:DistributionConfig' :: DistributionConfig -> Maybe CustomErrorResponses
$sel:continuousDeploymentPolicyId:DistributionConfig' :: DistributionConfig -> Maybe Text
$sel:cacheBehaviors:DistributionConfig' :: DistributionConfig -> Maybe CacheBehaviors
$sel:aliases:DistributionConfig' :: DistributionConfig -> Maybe Aliases
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ Name
"Aliases" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Aliases
aliases,
        Name
"CacheBehaviors" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe CacheBehaviors
cacheBehaviors,
        Name
"ContinuousDeploymentPolicyId"
          forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
continuousDeploymentPolicyId,
        Name
"CustomErrorResponses" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe CustomErrorResponses
customErrorResponses,
        Name
"DefaultRootObject" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
defaultRootObject,
        Name
"HttpVersion" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe HttpVersion
httpVersion,
        Name
"IsIPV6Enabled" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Bool
isIPV6Enabled,
        Name
"Logging" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe LoggingConfig
logging,
        Name
"OriginGroups" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe OriginGroups
originGroups,
        Name
"PriceClass" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe PriceClass
priceClass,
        Name
"Restrictions" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Restrictions
restrictions,
        Name
"Staging" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Bool
staging,
        Name
"ViewerCertificate" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe ViewerCertificate
viewerCertificate,
        Name
"WebACLId" forall a. ToXML a => Name -> a -> XML
Data.@= Maybe Text
webACLId,
        Name
"CallerReference" forall a. ToXML a => Name -> a -> XML
Data.@= Text
callerReference,
        Name
"Origins" forall a. ToXML a => Name -> a -> XML
Data.@= Origins
origins,
        Name
"DefaultCacheBehavior" forall a. ToXML a => Name -> a -> XML
Data.@= DefaultCacheBehavior
defaultCacheBehavior,
        Name
"Comment" forall a. ToXML a => Name -> a -> XML
Data.@= Sensitive Text
comment,
        Name
"Enabled" forall a. ToXML a => Name -> a -> XML
Data.@= Bool
enabled
      ]