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

  • 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 will fail with an HTTP 403 (Access Denied) error.

  • 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
Eq PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Read PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Show PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Generic PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type Rep PutPublicAccessBlock :: Type -> Type #

NFData PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Methods

rnf :: PutPublicAccessBlock -> () #

Hashable PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

AWSRequest PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type AWSResponse PutPublicAccessBlock #

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

type Rep PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

type Rep PutPublicAccessBlock = D1 ('MetaData "PutPublicAccessBlock" "Amazonka.S3.PutPublicAccessBlock" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "PutPublicAccessBlock'" '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 "publicAccessBlockConfiguration") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 PublicAccessBlockConfiguration))))
type AWSResponse PutPublicAccessBlock Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

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:

$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 will fail with an HTTP 403 (Access Denied) error.

$sel:bucket: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_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 will fail with an HTTP 403 (Access Denied) error.

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
Eq PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Read PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Show PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Generic PutPublicAccessBlockResponse Source # 
Instance details

Defined in Amazonka.S3.PutPublicAccessBlock

Associated Types

type Rep PutPublicAccessBlockResponse :: Type -> Type #

NFData 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" "libZSservicesZSamazonka-s3ZSamazonka-s3" '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.