• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide
  4. OBS Console Operation Guide
  5. Bucket Permissions
  6. Bucket Policy Resource

Bucket Policy Resource

This parameter specifies the resources on which a bucket policy takes effect. Resources can be specified in either of the following ways:

  • Include: Specifies the OBS resources on which the bucket policy takes effect.
  • Exclude: Specifies the OBS resources on which the bucket policy does not take effect.

The resource to be specified can either be a bucket or an object.

Specifying Bucket Resources

If the specified resource is a bucket, the bucket can only be the current one and you do not need to enter any content in the resource text box.

Specifying Object Resources

If the specified resources are objects, the bucket policy takes effect on certain objects. The configuration format is described as follows:

  • For an object, enter the object name (including the folder name). 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
NOTE:

Use commas (,) to separate multiple objects or object sets.

Relationship Between Resource Types and Actions

The type of resource specified is related to actions:

  • When the specified resource is a bucket, only the actions related to buckets (See Table 1) can be configured.
  • When the specified resource is an object or an object set, only the actions related to the objects (See Table 2) can be configured.