Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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
- data PutBucketLogging = PutBucketLogging' {}
- newPutBucketLogging :: BucketName -> BucketLoggingStatus -> PutBucketLogging
- putBucketLogging_checksumAlgorithm :: Lens' PutBucketLogging (Maybe ChecksumAlgorithm)
- putBucketLogging_contentMD5 :: Lens' PutBucketLogging (Maybe Text)
- putBucketLogging_expectedBucketOwner :: Lens' PutBucketLogging (Maybe Text)
- putBucketLogging_bucket :: Lens' PutBucketLogging BucketName
- putBucketLogging_bucketLoggingStatus :: Lens' PutBucketLogging BucketLoggingStatus
- data PutBucketLoggingResponse = PutBucketLoggingResponse' {
- newPutBucketLoggingResponse :: PutBucketLoggingResponse
Creating a Request
data PutBucketLogging Source #
See: newPutBucketLogging
smart constructor.
PutBucketLogging' | |
|
Instances
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.
putBucketLogging_bucketLoggingStatus :: Lens' PutBucketLogging BucketLoggingStatus Source #
Container for logging status information.
Destructuring the Response
data PutBucketLoggingResponse Source #
See: newPutBucketLoggingResponse
smart constructor.
Instances
Generic PutBucketLoggingResponse Source # | |
Defined in Amazonka.S3.PutBucketLogging type Rep PutBucketLoggingResponse :: Type -> Type # | |
Read PutBucketLoggingResponse Source # | |
Show PutBucketLoggingResponse Source # | |
Defined in Amazonka.S3.PutBucketLogging showsPrec :: Int -> PutBucketLoggingResponse -> ShowS # show :: PutBucketLoggingResponse -> String # showList :: [PutBucketLoggingResponse] -> ShowS # | |
NFData PutBucketLoggingResponse Source # | |
Defined in Amazonka.S3.PutBucketLogging rnf :: PutBucketLoggingResponse -> () # | |
Eq PutBucketLoggingResponse Source # | |
Defined in Amazonka.S3.PutBucketLogging | |
type Rep PutBucketLoggingResponse Source # | |
newPutBucketLoggingResponse :: PutBucketLoggingResponse Source #
Create a value of PutBucketLoggingResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.