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.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

Creating a Request

data PutPublicAccessBlock Source #

See: newPutPublicAccessBlock smart constructor.

Constructors

PutPublicAccessBlock' 

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 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.

  • 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 Amazon S3 bucket whose PublicAccessBlock configuration you want to set.

  • publicAccessBlockConfiguration :: 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.

Instances

Instances details
ToHeaders PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

ToPath PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

ToQuery PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

ToElement PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

AWSRequest PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type AWSResponse PutPublicAccessBlock #

Generic PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type Rep PutPublicAccessBlock :: Type -> Type #

Read PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Show PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

NFData PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Methods

rnf :: PutPublicAccessBlock -> () #

Eq PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Hashable PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type AWSResponse PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type Rep PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type Rep PutPublicAccessBlock = D1 ('MetaData "PutPublicAccessBlock" "Amazonka.S3.PutPublicAccessBlock" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "PutPublicAccessBlock'" '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 "publicAccessBlockConfiguration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PublicAccessBlockConfiguration)))))

newPutPublicAccessBlock Source #

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.

Instances

Instances details
Generic PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type Rep PutPublicAccessBlockResponse :: Type -> Type #

Read PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Show PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

NFData PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Eq PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type Rep PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type Rep PutPublicAccessBlockResponse = D1 ('MetaData "PutPublicAccessBlockResponse" "Amazonka.S3.PutPublicAccessBlock" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "PutPublicAccessBlockResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newPutPublicAccessBlockResponse :: PutPublicAccessBlockResponse Source #

Create a value of PutPublicAccessBlockResponse with all optional fields omitted.

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