Configures an access point for a bucket.
Prerequisites
Before you begin, ensure that you have:
Alibaba Cloud account: No additional permissions required. The account is authorized to create access points by default.
RAM user or Security Token Service (STS): The
oss:CreateAccessPointpermission. For setup instructions, see Grant custom policy to a RAM user.
Limits
An Alibaba Cloud account can have up to 1,000 access points across all buckets.
A single bucket can have up to 100 access points.
Syntax
ossutil api create-access-point --bucket <value> --create-access-point-configuration <value> [flags]| Parameter | Type | Description |
|---|---|---|
--bucket | string | The name of the bucket. |
--create-access-point-configuration | string | The access point configuration, in XML or JSON format. |
This command maps to the CreateAccessPoint API operation. For supported global flags, see Command-line options.
--create-access-point-configuration
The --create-access-point-configuration parameter accepts XML or JSON. Prefix the value with file:// to load the configuration from a file.
XML format:
<CreateAccessPointConfiguration>
<AccessPointName>string</AccessPointName>
<NetworkOrigin>string</NetworkOrigin>
<VpcConfiguration>
<VpcId>string</VpcId>
</VpcConfiguration>
</CreateAccessPointConfiguration>JSON format:
{
"AccessPointName": "string",
"NetworkOrigin": "string",
"VpcConfiguration": {
"VpcId": "string"
}
}Examples
The following examples create an access point named ap-01 for examplebucket with NetworkOrigin set to internet. Before running any example, replace examplebucket, ap-01, and internet with values for your use case.
Use an XML configuration file
Create
create-access-point-configuration.xml:<?xml version="1.0" encoding="UTF-8"?> <CreateAccessPointConfiguration> <AccessPointName>ap-01</AccessPointName> <NetworkOrigin>internet</NetworkOrigin> </CreateAccessPointConfiguration>Run the command:
ossutil api create-access-point --bucket examplebucket --create-access-point-configuration file://create-access-point-configuration.xml
Use a JSON configuration file
Create
create-access-point-configuration.json:{ "AccessPointName": "ap-01", "NetworkOrigin": "internet" }Run the command:
ossutil api create-access-point --bucket examplebucket --create-access-point-configuration file://create-access-point-configuration.json
Pass inline JSON
Pass the configuration directly in the command without a file:
ossutil api create-access-point --bucket examplebucket --create-access-point-configuration "{\"AccessPointName\":\"ap-01\",\"NetworkOrigin\":\"internet\"}"