To process object data at read time — such as image transcoding, data masking, or format conversion — without modifying client code, use an Object FC Access Point. When a GetObject request arrives at the access point alias, OSS automatically triggers your Function Compute function, which processes the object and returns the transformed result to the caller.
This topic describes how to create an Object FC Access Point using the console or the REST API.
Prerequisites
Before you begin, ensure that you have:
A bucket in a supported region: China (Hangzhou), China (Shanghai), China (Qingdao), China (Beijing), China (Zhangjiakou), China (Hohhot), China (Shenzhen), China (Chengdu), China (Hong Kong), US (Silicon Valley), US (Virginia), Japan (Tokyo), South Korea (Seoul), Singapore, Malaysia (Kuala Lumpur), Indonesia (Jakarta), Germany (Frankfurt), or UK (London)
An OSS access point created in the same region as the bucket — this becomes the Supporting Access Point. See Create an access point
Function Compute activated in the same region as the bucket. See Create a service
The
oss:WriteGetObjectResponsepermission granted to theAliyunFCDefaultRoleservice-linked role. Add the following policy to the role. See Grant permissions to a RAM role:{ "Statement": [ { "Action": "oss:WriteGetObjectResponse", "Effect": "Allow", "Resource": "*" } ], "Version": "1" }A function created in Function Compute. Function Compute can be triggered when you call GetObject using OSS SDK for Java, Python, or Go. Match the function runtime to the SDK you plan to use: Keep all other function parameters at their defaults. See Create a function
SDK Required runtime OSS SDK for Java Java 11 OSS SDK for Python Python 3.10 OSS SDK for Go Go 1 A RAM user with the following permissions:
oss:CreateAccessPointForObjectProcess,oss:GetAccessPointForObjectProcess,oss:DeleteAccessPointForObjectProcess,oss:ListAccessPointsForObjectProcess,oss:PutAccessPointConfigForObjectProcess,oss:GetAccessPointConfigForObjectProcess,oss:PutAccessPointPolicyForObjectProcess,oss:GetAccessPointPolicyForObjectProcess, andoss:DeleteAccessPointPolicyForObjectProcess. See Common examples of RAM policies
Limits
| Constraint | Details |
|---|---|
| Creation method | OSS console or API only. OSS SDKs and ossutil are not supported. |
| Quota per Alibaba Cloud account | 1,000 |
| Quota per bucket | 100 |
| Modifications after creation | Policy only. The name and alias cannot be changed. |
| Anonymous access | Not supported |
Create an Object FC Access Point in the console
Log on to the OSS console.
In the left navigation pane, click Object FC Access Points.
Click Create Object FC Access Point.
Configure the following parameters and click OK.
Parameter Description Region The region where the access point is located. Object FC Access Point Name A name for the access point. The name can be up to 63 characters, contain only lowercase letters, digits, and hyphens ( -), not start or end with a hyphen, and be unique within the region.Supporting Access Point The existing OSS access point to associate with this Object FC Access Point. Bucket Name Displayed automatically based on the selected access point. OSS API Select GetObject. Function to Invoke Select the function you created and then select Support Range GetObject Requests. Function Version (Optional) Select a specific version of the function. Defaults to LATEST. Complete role authorization. The first time you create an Object FC Access Point, click RAM Quick Authorization and follow the on-screen instructions to authorize the
AliyunOSSObjectFcForOSSDefaultRolerole to access your OSS and Function Compute resources. Do not disable, modify, or delete this role or its attached policies.Click OK.
The access point is created within approximately 10 minutes. After creation, its alias appears on the Object FC Access Points page. The alias cannot be modified, deleted, or disabled.
Function Compute is triggered only when you call GetObject using the alias of an Object FC Access Point. Non-GetObject operations using the alias are automatically routed to the associated OSS access point, which applies its own policy.
Use the REST API
To create an Object FC Access Point programmatically, call the CreateAccessPointForObjectProcess API operation. You must include the signature calculation in your code.