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

Description

This action is useful to determine if a bucket exists and you have permission to access it. The action returns a 200 OK if the bucket exists and you have permission to access it.

If the bucket does not exist or you do not have permission to access it, the HEAD request returns a generic 404 Not Found or 403 Forbidden code. A message body is not included, so you cannot determine the exception beyond these error codes.

To use this operation, you must have permissions to perform the s3:ListBucket action. The bucket owner has this permission by default and can grant this permission to others. For more information about permissions, see Permissions Related to Bucket Subresource Operations and Managing Access Permissions to Your Amazon S3 Resources.

To use this API against an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using the Amazon Web Services SDKs, you provide the ARN in place of the bucket name. For more information see, Using access points.

Synopsis

Creating a Request

data HeadBucket Source #

See: newHeadBucket smart constructor.

Constructors

HeadBucket' 

Fields

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

    When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

    When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.

Instances

Instances details
Eq HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Read HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Show HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Generic HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Associated Types

type Rep HeadBucket :: Type -> Type #

NFData HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Methods

rnf :: HeadBucket -> () #

Hashable HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

AWSRequest HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Associated Types

type AWSResponse HeadBucket #

ToHeaders HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Methods

toHeaders :: HeadBucket -> [Header] #

ToPath HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

ToQuery HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

type Rep HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

type Rep HeadBucket = D1 ('MetaData "HeadBucket" "Amazonka.S3.HeadBucket" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "HeadBucket'" 'PrefixI 'True) (S1 ('MetaSel ('Just "expectedBucketOwner") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "bucket") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 BucketName)))
type AWSResponse HeadBucket Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

newHeadBucket Source #

Create a value of HeadBucket 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:HeadBucket', headBucket_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:HeadBucket', headBucket_bucket - The bucket name.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.

Request Lenses

headBucket_expectedBucketOwner :: Lens' HeadBucket (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.

headBucket_bucket :: Lens' HeadBucket BucketName Source #

The bucket name.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see Using access points in the Amazon S3 User Guide.

When using this action with Amazon S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action using S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using S3 on Outposts in the Amazon S3 User Guide.

Destructuring the Response

data HeadBucketResponse Source #

See: newHeadBucketResponse smart constructor.

Constructors

HeadBucketResponse' 

Instances

Instances details
Eq HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Read HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Show HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Generic HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Associated Types

type Rep HeadBucketResponse :: Type -> Type #

NFData HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

Methods

rnf :: HeadBucketResponse -> () #

type Rep HeadBucketResponse Source # 
Instance details

Defined in Amazonka.S3.HeadBucket

type Rep HeadBucketResponse = D1 ('MetaData "HeadBucketResponse" "Amazonka.S3.HeadBucket" "libZSservicesZSamazonka-s3ZSamazonka-s3" 'False) (C1 ('MetaCons "HeadBucketResponse'" 'PrefixI 'False) (U1 :: Type -> Type))

newHeadBucketResponse :: HeadBucketResponse Source #

Create a value of HeadBucketResponse with all optional fields omitted.

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