CreateAccessPoint - Amazon Simple Storage Service (original) (raw)
Creates an access point and associates it to a specified bucket. For more information, seeManaging access to shared datasets in general purpose buckets with access points or Managing access to shared datasets in directory buckets with access points in the_Amazon S3 User Guide_.
All Amazon S3 on Outposts REST API requests for this action require an additional parameter of x-amz-outpost-id
to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of s3-control
. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the x-amz-outpost-id
derived by using the access point ARN, see the Examples section.
The following actions are related to CreateAccessPoint
:
Request Syntax
PUT /v20180820/accesspoint/name HTTP/1.1
Host: s3-control.amazonaws.com
x-amz-account-id: AccountId
<?xml version="1.0" encoding="UTF-8"?>
<CreateAccessPointRequest xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/">
<Bucket>string</Bucket>
<VpcConfiguration>
<VpcId>string</VpcId>
</VpcConfiguration>
<PublicAccessBlockConfiguration>
<BlockPublicAcls>boolean</BlockPublicAcls>
<BlockPublicPolicy>boolean</BlockPublicPolicy>
<IgnorePublicAcls>boolean</IgnorePublicAcls>
<RestrictPublicBuckets>boolean</RestrictPublicBuckets>
</PublicAccessBlockConfiguration>
<BucketAccountId>string</BucketAccountId>
<Scope>
<Permissions>
<Permission>string</Permission>
</Permissions>
<Prefixes>
<Prefix>string</Prefix>
</Prefixes>
</Scope>
</CreateAccessPointRequest>
URI Request Parameters
The request uses the following URI parameters.
The name you want to assign to this access point.
For directory buckets, the access point name must consist of a base name that you provide and suffix that includes the ZoneID
(AWS Availability Zone or Local Zone) of your bucket location, followed by --xa-s3
. For more information, see Managing access to shared datasets in directory buckets with access points in the Amazon S3 User Guide.
Length Constraints: Minimum length of 3. Maximum length of 255.
Required: Yes
The AWS account ID for the account that owns the specified access point.
Length Constraints: Maximum length of 64.
Pattern: ^\d{12}$
Required: Yes
Request Body
The request accepts the following data in XML format.
Root level tag for the CreateAccessPointRequest parameters.
Required: Yes
The name of the bucket that you want to associate this access point with.
For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.
For using this parameter with S3 on Outposts with the AWS SDK and CLI, you must specify the ARN of the bucket accessed in the format arn:aws:s3-outposts:<Region>:<account-id>:outpost/<outpost-id>/bucket/<my-bucket-name>
. For example, to access the bucket reports
through Outpost my-outpost
owned by account 123456789012
in Region us-west-2
, use the URL encoding of arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports
. The value must be URL encoded.
Type: String
Length Constraints: Minimum length of 3. Maximum length of 255.
Required: Yes
The AWS account ID associated with the S3 bucket associated with this access point.
For same account access point when your bucket and access point belong to the same account owner, the BucketAccountId
is not required. For cross-account access point when your bucket and access point are not in the same account, the BucketAccountId
is required.
Type: String
Length Constraints: Maximum length of 64.
Pattern: ^\d{12}$
Required: No
PublicAccessBlockConfiguration
The PublicAccessBlock
configuration that you want to apply to the access point.
Type: PublicAccessBlockConfiguration data type
Required: No
For directory buckets, you can filter access control to specific prefixes, API operations, or a combination of both. For more information, see Managing access to shared datasets in directory buckets with access points in the Amazon S3 User Guide.
Note
Scope is not supported for access points for general purpose buckets.
Type: Scope data type
Required: No
If you include this field, Amazon S3 restricts access to this access point to requests from the specified virtual private cloud (VPC).
Note
This is required for creating an access point for Amazon S3 on Outposts buckets.
Type: VpcConfiguration data type
Required: No
Response Syntax
HTTP/1.1 200
<?xml version="1.0" encoding="UTF-8"?>
<CreateAccessPointResult>
<AccessPointArn>string</AccessPointArn>
<Alias>string</Alias>
</CreateAccessPointResult>
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in XML format by the service.
Root level tag for the CreateAccessPointResult parameters.
Required: Yes
The ARN of the access point.
Note
This is only supported by Amazon S3 on Outposts.
Type: String
Length Constraints: Minimum length of 4. Maximum length of 128.
The name or alias of the access point.
Type: String
Length Constraints: Maximum length of 63.
Pattern: ^[0-9a-z\\-]{63}
Examples
Sample request for creating an access point for an Amazon S3 on Outposts bucket
This request creates an access point for S3 on Outposts bucket.
PUT /v20180820/accesspoint/example-access-point HTTP/1.1
Host:s3-outposts.<Region>.amazonaws.com
x-amz-account-id: example-account-id
x-amz-outpost-id: op-01ac5d28a6a232904
<?xml version="1.0" encoding="UTF-8"?>
<CreateAccessPointRequest xmlns="http://awss3control.amazonaws.com/doc/2018-08-20/">
<Bucket>example-outpost-bucket </Bucket>
</CreateAccessPointRequest>
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: