libZSservicesZSamazonka-s3ZSamazonka-s3
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.S3.PutBucketLogging

Description

Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters. All logs are saved to buckets in the same Amazon Web Services Region as the source bucket. To set the logging status of a bucket, you must be the bucket owner.

The bucket owner is automatically granted FULL_CONTROL to all logs. You use the Grantee request element to grant access to other people. The Permissions request element specifies the kind of access the grantee has to the logs.

Grantee Values

You can specify the person (grantee) to whom you're assigning access rights (using request elements) in the following ways:

  • By the person's ID:

    <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID><>ID<></ID><DisplayName><>GranteesEmail<></DisplayName> </Grantee>

    DisplayName is optional and ignored in the request.

  • By Email address:

     <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"><EmailAddress><>Grantees@email.com<></EmailAddress></Grantee>

    The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl request, appears as the CanonicalUser.

  • By URI:

    <Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<></URI></Grantee>

To enable logging, you use LoggingEnabled and its children request elements. To disable logging, you use an empty BucketLoggingStatus request element:

<BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />

For more information about server access logging, see Server Access Logging.

For more information about creating a bucket, see CreateBucket. For more information about returning the logging status of a bucket, see GetBucketLogging.

The following operations are related to PutBucketLogging:

Synopsis

Creating a Request

data PutBucketLogging Source #

See: newPutBucketLogging smart constructor.

Constructors

PutBucketLogging' 

Fields

  • contentMD5 :: Maybe Text

    The MD5 hash of the PutBucketLogging request body.

    For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

  • expectedBucketOwner :: Maybe Text

    The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

  • bucket :: BucketName

    The name of the bucket for which to set the logging parameters.

  • bucketLoggingStatus :: BucketLoggingStatus

    Container for logging status information.

Instances

Instances details
Eq PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Read PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Show PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Generic PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type Rep PutBucketLogging :: Type -> Type #

NFData PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Methods

rnf :: PutBucketLogging -> () #

Hashable PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

AWSRequest PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type AWSResponse PutBucketLogging #

ToHeaders PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

ToPath PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

ToQuery PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

ToElement PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

type Rep PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

type Rep PutBucketLogging = D1 ('MetaData "PutBucketLogging" "Amazonka.S3.PutBucketLogging" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "PutBucketLogging'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "contentMD5") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "expectedBucketOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "bucket") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BucketName) :*: S1 ('MetaSel ('Just "bucketLoggingStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BucketLoggingStatus))))
type AWSResponse PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

newPutBucketLogging Source #

Create a value of PutBucketLogging with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:contentMD5:PutBucketLogging', putBucketLogging_contentMD5 - The MD5 hash of the PutBucketLogging request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

$sel:expectedBucketOwner:PutBucketLogging', putBucketLogging_expectedBucketOwner - The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

$sel:bucket:PutBucketLogging', putBucketLogging_bucket - The name of the bucket for which to set the logging parameters.

$sel:bucketLoggingStatus:PutBucketLogging', putBucketLogging_bucketLoggingStatus - Container for logging status information.

Request Lenses

putBucketLogging_contentMD5 :: Lens' PutBucketLogging (Maybe Text) Source #

The MD5 hash of the PutBucketLogging request body.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

putBucketLogging_expectedBucketOwner :: Lens' PutBucketLogging (Maybe Text) Source #

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

putBucketLogging_bucket :: Lens' PutBucketLogging BucketName Source #

The name of the bucket for which to set the logging parameters.

Destructuring the Response

data PutBucketLoggingResponse Source #

See: newPutBucketLoggingResponse smart constructor.

Instances

Instances details
Eq PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Read PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Show PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Generic PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type Rep PutBucketLoggingResponse :: Type -> Type #

NFData PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

type Rep PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

type Rep PutBucketLoggingResponse = D1 ('MetaData "PutBucketLoggingResponse" "Amazonka.S3.PutBucketLogging" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "PutBucketLoggingResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newPutBucketLoggingResponse :: PutBucketLoggingResponse Source #

Create a value of PutBucketLoggingResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.