Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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.
HeadBucket' | |
|
Instances
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.
Instances
Eq HeadBucketResponse Source # | |
Defined in Amazonka.S3.HeadBucket (==) :: HeadBucketResponse -> HeadBucketResponse -> Bool # (/=) :: HeadBucketResponse -> HeadBucketResponse -> Bool # | |
Read HeadBucketResponse Source # | |
Defined in Amazonka.S3.HeadBucket | |
Show HeadBucketResponse Source # | |
Defined in Amazonka.S3.HeadBucket showsPrec :: Int -> HeadBucketResponse -> ShowS # show :: HeadBucketResponse -> String # showList :: [HeadBucketResponse] -> ShowS # | |
Generic HeadBucketResponse Source # | |
Defined in Amazonka.S3.HeadBucket type Rep HeadBucketResponse :: Type -> Type # from :: HeadBucketResponse -> Rep HeadBucketResponse x # to :: Rep HeadBucketResponse x -> HeadBucketResponse # | |
NFData HeadBucketResponse Source # | |
Defined in Amazonka.S3.HeadBucket rnf :: HeadBucketResponse -> () # | |
type Rep HeadBucketResponse Source # | |
newHeadBucketResponse :: HeadBucketResponse Source #
Create a value of HeadBucketResponse
with all optional fields omitted.
Use generic-lens or optics to modify other optional fields.