amazonka-s3-2.0: Amazon Simple Storage Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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.

If the target bucket for log delivery uses the bucket owner enforced setting for S3 Object Ownership, you can't use the Grantee request element to grant access to others. Permissions can only be granted using policies. For more information, see Permissions for server access log delivery in the Amazon S3 User Guide.

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 in the Amazon S3 User Guide.

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

  • checksumAlgorithm :: Maybe ChecksumAlgorithm

    Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

    If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

  • 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 fails with the HTTP status code 403 Forbidden (access denied).

  • bucket :: BucketName

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

  • bucketLoggingStatus :: BucketLoggingStatus

    Container for logging status information.

Instances

Instances details
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

AWSRequest PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type AWSResponse PutBucketLogging #

Generic PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type Rep PutBucketLogging :: Type -> Type #

Read PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Show PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

NFData PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Methods

rnf :: PutBucketLogging -> () #

Eq PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Hashable PutBucketLogging Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

type AWSResponse 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" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "PutBucketLogging'" 'PrefixI 'True) ((S1 ('MetaSel ('Just "checksumAlgorithm") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe ChecksumAlgorithm)) :*: 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)))))

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:

PutBucketLogging, putBucketLogging_checksumAlgorithm - Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

$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 fails with the HTTP status code 403 Forbidden (access denied).

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_checksumAlgorithm :: Lens' PutBucketLogging (Maybe ChecksumAlgorithm) Source #

Indicates the algorithm used to create the checksum for the object when using the SDK. This header will not provide any additional functionality if not using the SDK. When sending this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

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 fails with the HTTP status code 403 Forbidden (access denied).

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
Generic PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Associated Types

type Rep PutBucketLoggingResponse :: Type -> Type #

Read PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Show PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

NFData PutBucketLoggingResponse Source # 
Instance details

Defined in Amazonka.S3.PutBucketLogging

Eq 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" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" '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.