Resources
You can apply a bucket policy to the following resources: the current bucket, and all objects in a bucket.
Resources can be specified in either of the following ways:
- Include: The policy takes effect on the specified OBS resources.
- Exclude: The policy takes effect on all OBS resources except the specified ones.
Applying a Bucket Policy to a Bucket
To specify the current bucket as the resource, select Current bucket. When configuring actions for the policy, select bucket related actions.
Applying a Bucket Policy to Specified Objects
To apply the bucket policy to specified objects in a bucket, object-related actions must be configured in the policy. The configuration format is as follows:
- For an object, enter the object name (including its folder name if any). For example, if the specified resource is the example.jpg file in the imgs-folder folder in the bucket, enter the following content in the resource text box:
imgs-folder/example.jpg
- For an object set, the wildcard asterisk (*) should be used. The asterisk * indicates an empty string or any combination of multiple characters. The format rules are as follows:
- Use only one asterisk (*) to indicate all objects in a bucket.
- Use Object name prefix* to indicate objects starting with this prefix in a bucket. For example,
imgs*
- Use *Object name suffix to indicate objects ending with this suffix in a bucket. For example,
*.jpg