{-# 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.S3OriginConfig -- 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.S3OriginConfig where 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 complex type that contains information about the Amazon S3 origin. If -- the origin is a custom origin or an S3 bucket that is configured as a -- website endpoint, use the @CustomOriginConfig@ element instead. -- -- /See:/ 'newS3OriginConfig' smart constructor. data S3OriginConfig = S3OriginConfig' { -- | The CloudFront origin access identity to associate with the origin. Use -- an origin access identity to configure the origin so that viewers can -- /only/ access objects in an Amazon S3 bucket through CloudFront. The -- format of the value is: -- -- origin-access-identity\/cloudfront\//ID-of-origin-access-identity/ -- -- where @ @/@ID-of-origin-access-identity@/@ @ is the value that -- CloudFront returned in the @ID@ element when you created the origin -- access identity. -- -- If you want viewers to be able to access objects using either the -- CloudFront URL or the Amazon S3 URL, specify an empty -- @OriginAccessIdentity@ element. -- -- To delete the origin access identity from an existing distribution, -- update the distribution configuration and include an empty -- @OriginAccessIdentity@ element. -- -- To replace the origin access identity, update the distribution -- configuration and specify the new origin access identity. -- -- For more information about the origin access identity, see -- -- in the /Amazon CloudFront Developer Guide/. originAccessIdentity :: Prelude.Text } deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic) -- | -- Create a value of 'S3OriginConfig' with all optional fields omitted. -- -- Use or to modify other optional fields. -- -- The following record fields are available, with the corresponding lenses provided -- for backwards compatibility: -- -- 'originAccessIdentity', 's3OriginConfig_originAccessIdentity' - The CloudFront origin access identity to associate with the origin. Use -- an origin access identity to configure the origin so that viewers can -- /only/ access objects in an Amazon S3 bucket through CloudFront. The -- format of the value is: -- -- origin-access-identity\/cloudfront\//ID-of-origin-access-identity/ -- -- where @ @/@ID-of-origin-access-identity@/@ @ is the value that -- CloudFront returned in the @ID@ element when you created the origin -- access identity. -- -- If you want viewers to be able to access objects using either the -- CloudFront URL or the Amazon S3 URL, specify an empty -- @OriginAccessIdentity@ element. -- -- To delete the origin access identity from an existing distribution, -- update the distribution configuration and include an empty -- @OriginAccessIdentity@ element. -- -- To replace the origin access identity, update the distribution -- configuration and specify the new origin access identity. -- -- For more information about the origin access identity, see -- -- in the /Amazon CloudFront Developer Guide/. newS3OriginConfig :: -- | 'originAccessIdentity' Prelude.Text -> S3OriginConfig newS3OriginConfig pOriginAccessIdentity_ = S3OriginConfig' { originAccessIdentity = pOriginAccessIdentity_ } -- | The CloudFront origin access identity to associate with the origin. Use -- an origin access identity to configure the origin so that viewers can -- /only/ access objects in an Amazon S3 bucket through CloudFront. The -- format of the value is: -- -- origin-access-identity\/cloudfront\//ID-of-origin-access-identity/ -- -- where @ @/@ID-of-origin-access-identity@/@ @ is the value that -- CloudFront returned in the @ID@ element when you created the origin -- access identity. -- -- If you want viewers to be able to access objects using either the -- CloudFront URL or the Amazon S3 URL, specify an empty -- @OriginAccessIdentity@ element. -- -- To delete the origin access identity from an existing distribution, -- update the distribution configuration and include an empty -- @OriginAccessIdentity@ element. -- -- To replace the origin access identity, update the distribution -- configuration and specify the new origin access identity. -- -- For more information about the origin access identity, see -- -- in the /Amazon CloudFront Developer Guide/. s3OriginConfig_originAccessIdentity :: Lens.Lens' S3OriginConfig Prelude.Text s3OriginConfig_originAccessIdentity = Lens.lens (\S3OriginConfig' {originAccessIdentity} -> originAccessIdentity) (\s@S3OriginConfig' {} a -> s {originAccessIdentity = a} :: S3OriginConfig) instance Data.FromXML S3OriginConfig where parseXML x = S3OriginConfig' Prelude.<$> (x Data..@ "OriginAccessIdentity") instance Prelude.Hashable S3OriginConfig where hashWithSalt _salt S3OriginConfig' {..} = _salt `Prelude.hashWithSalt` originAccessIdentity instance Prelude.NFData S3OriginConfig where rnf S3OriginConfig' {..} = Prelude.rnf originAccessIdentity instance Data.ToXML S3OriginConfig where toXML S3OriginConfig' {..} = Prelude.mconcat ["OriginAccessIdentity" Data.@= originAccessIdentity]