| 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 |
Amazonka.S3.PutPublicAccessBlock
Description
Creates or modifies the PublicAccessBlock configuration for an Amazon
S3 bucket. To use this operation, you must have the
s3:PutBucketPublicAccessBlock permission. For more information about
Amazon S3 permissions, see
Specifying Permissions in a Policy.
When Amazon S3 evaluates the PublicAccessBlock configuration for a
bucket or an object, it checks the PublicAccessBlock configuration for
both the bucket (or the bucket that contains the object) and the bucket
owner's account. If the PublicAccessBlock configurations are
different between the bucket and the account, Amazon S3 uses the most
restrictive combination of the bucket-level and account-level settings.
For more information about when Amazon S3 considers a bucket or an object public, see The Meaning of "Public".
Related Resources
Synopsis
- data PutPublicAccessBlock = PutPublicAccessBlock' {}
- newPutPublicAccessBlock :: BucketName -> PublicAccessBlockConfiguration -> PutPublicAccessBlock
- putPublicAccessBlock_checksumAlgorithm :: Lens' PutPublicAccessBlock (Maybe ChecksumAlgorithm)
- putPublicAccessBlock_contentMD5 :: Lens' PutPublicAccessBlock (Maybe Text)
- putPublicAccessBlock_expectedBucketOwner :: Lens' PutPublicAccessBlock (Maybe Text)
- putPublicAccessBlock_bucket :: Lens' PutPublicAccessBlock BucketName
- putPublicAccessBlock_publicAccessBlockConfiguration :: Lens' PutPublicAccessBlock PublicAccessBlockConfiguration
- data PutPublicAccessBlockResponse = PutPublicAccessBlockResponse' {
- newPutPublicAccessBlockResponse :: PutPublicAccessBlockResponse
Creating a Request
data PutPublicAccessBlock Source #
See: newPutPublicAccessBlock smart constructor.
Constructors
| PutPublicAccessBlock' | |
Fields
| |
Instances
newPutPublicAccessBlock Source #
Arguments
| :: BucketName | |
| -> PublicAccessBlockConfiguration | |
| -> PutPublicAccessBlock |
Create a value of PutPublicAccessBlock 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:
PutPublicAccessBlock, putPublicAccessBlock_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:PutPublicAccessBlock', putPublicAccessBlock_contentMD5 - The MD5 hash of the PutPublicAccessBlock 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:PutPublicAccessBlock', putPublicAccessBlock_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).
PutPublicAccessBlock, putPublicAccessBlock_bucket - The name of the Amazon S3 bucket whose PublicAccessBlock configuration
you want to set.
$sel:publicAccessBlockConfiguration:PutPublicAccessBlock', putPublicAccessBlock_publicAccessBlockConfiguration - The PublicAccessBlock configuration that you want to apply to this
Amazon S3 bucket. You can enable the configuration options in any
combination. For more information about when Amazon S3 considers a
bucket or object public, see
The Meaning of "Public"
in the Amazon S3 User Guide.
Request Lenses
putPublicAccessBlock_checksumAlgorithm :: Lens' PutPublicAccessBlock (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.
putPublicAccessBlock_contentMD5 :: Lens' PutPublicAccessBlock (Maybe Text) Source #
The MD5 hash of the PutPublicAccessBlock request body.
For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.
putPublicAccessBlock_expectedBucketOwner :: Lens' PutPublicAccessBlock (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).
putPublicAccessBlock_bucket :: Lens' PutPublicAccessBlock BucketName Source #
The name of the Amazon S3 bucket whose PublicAccessBlock configuration
you want to set.
putPublicAccessBlock_publicAccessBlockConfiguration :: Lens' PutPublicAccessBlock PublicAccessBlockConfiguration Source #
The PublicAccessBlock configuration that you want to apply to this
Amazon S3 bucket. You can enable the configuration options in any
combination. For more information about when Amazon S3 considers a
bucket or object public, see
The Meaning of "Public"
in the Amazon S3 User Guide.
Destructuring the Response
data PutPublicAccessBlockResponse Source #
See: newPutPublicAccessBlockResponse smart constructor.
Constructors
| PutPublicAccessBlockResponse' | |
Instances
| Generic PutPublicAccessBlockResponse Source # | |
Defined in Amazonka.S3.PutPublicAccessBlock Associated Types type Rep PutPublicAccessBlockResponse :: Type -> Type # | |
| Read PutPublicAccessBlockResponse Source # | |
| Show PutPublicAccessBlockResponse Source # | |
Defined in Amazonka.S3.PutPublicAccessBlock Methods showsPrec :: Int -> PutPublicAccessBlockResponse -> ShowS # show :: PutPublicAccessBlockResponse -> String # showList :: [PutPublicAccessBlockResponse] -> ShowS # | |
| NFData PutPublicAccessBlockResponse Source # | |
Defined in Amazonka.S3.PutPublicAccessBlock Methods rnf :: PutPublicAccessBlockResponse -> () # | |
| Eq PutPublicAccessBlockResponse Source # | |
Defined in Amazonka.S3.PutPublicAccessBlock Methods (==) :: PutPublicAccessBlockResponse -> PutPublicAccessBlockResponse -> Bool # (/=) :: PutPublicAccessBlockResponse -> PutPublicAccessBlockResponse -> Bool # | |
| type Rep PutPublicAccessBlockResponse Source # | |
newPutPublicAccessBlockResponse :: PutPublicAccessBlockResponse Source #
Create a value of PutPublicAccessBlockResponse with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.