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

Description

This implementation of the DELETE action uses the policy subresource to delete the policy of a specified bucket. If you are using an identity other than the root user of the Amazon Web Services account that owns the bucket, the calling identity must have the DeleteBucketPolicy permissions on the specified bucket and belong to the bucket owner's account to use this operation.

If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 Access Denied error. If you have the correct permissions, but you're not using an identity that belongs to the bucket owner's account, Amazon S3 returns a 405 Method Not Allowed error.

As a security precaution, the root user of the Amazon Web Services account that owns a bucket can always use this operation, even if the policy explicitly denies the root user the ability to perform this action.

For more information about bucket policies, see Using Bucket Policies and UserPolicies.

The following operations are related to DeleteBucketPolicy

Synopsis

Creating a Request

data DeleteBucketPolicy Source #

See: newDeleteBucketPolicy smart constructor.

Constructors

DeleteBucketPolicy' 

Fields

  • 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 bucket name.

Instances

Instances details
ToHeaders DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

ToPath DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

ToQuery DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

AWSRequest DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Associated Types

type AWSResponse DeleteBucketPolicy #

Generic DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Associated Types

type Rep DeleteBucketPolicy :: Type -> Type #

Read DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Show DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

NFData DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Methods

rnf :: DeleteBucketPolicy -> () #

Eq DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Hashable DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

type AWSResponse DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

type Rep DeleteBucketPolicy Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

type Rep DeleteBucketPolicy = D1 ('MetaData "DeleteBucketPolicy" "Amazonka.S3.DeleteBucketPolicy" "amazonka-s3-2.0-CNZtv1UmVzj28JXsFvwNoj" 'False) (C1 ('MetaCons "DeleteBucketPolicy'" 'PrefixI 'True) (S1 ('MetaSel ('Just "expectedBucketOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bucket") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BucketName)))

newDeleteBucketPolicy Source #

Create a value of DeleteBucketPolicy 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:expectedBucketOwner:DeleteBucketPolicy', deleteBucketPolicy_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).

DeleteBucketPolicy, deleteBucketPolicy_bucket - The bucket name.

Request Lenses

deleteBucketPolicy_expectedBucketOwner :: Lens' DeleteBucketPolicy (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).

Destructuring the Response

data DeleteBucketPolicyResponse Source #

See: newDeleteBucketPolicyResponse smart constructor.

Instances

Instances details
Generic DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Associated Types

type Rep DeleteBucketPolicyResponse :: Type -> Type #

Read DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Show DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

NFData DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

Eq DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

type Rep DeleteBucketPolicyResponse Source # 
Instance details

Defined in Amazonka.S3.DeleteBucketPolicy

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

newDeleteBucketPolicyResponse :: DeleteBucketPolicyResponse Source #

Create a value of DeleteBucketPolicyResponse with all optional fields omitted.

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