All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::OSS::ObjectAcl

更新時間:Aug 12, 2024

ALIYUN::OSS::ObjectAcl is used to modify the access control list (ACL) of an Object Storage Service (OSS) object.

Syntax

{
  "Type": "ALIYUN::OSS::ObjectAcl",
  "Properties": {
    "Bucket": String,
    "ObjectAcl": String,
    "ObjectKey": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

Bucket

String

Yes

No

The bucket name.

None.

ObjectAcl

String

Yes

Yes

The ACL of the object.

Valid values:

  • default (default): The ACL of the object is the same as the ACL of the bucket in which the object is stored.

  • private: The ACL of the object is private. Only the owner of the object and authorized users have the read and write permissions on the object.

  • public-read: The ACL of the object is public-read. Only the owner of the object and authorized users have the read and write permissions on the object. Other users have only the read permissions on the object. Exercise caution when you set the ACL of the object to this value.

  • public-read-write: The ACL of the object is public-read-write. All users have the read and write permissions on the object. Exercise caution when you set the ACL of the object to this value.

ObjectKey

String

Yes

No

The object key.

The object key specifies the full path that includes the object extension. Example: abc/efg/123.jpg.

Return values

Fn::GetAtt

None.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters: {}
Resources:
  OSSObjectAcl:
    Type: ALIYUN::OSS::ObjectAcl
    Properties:
      ObjectAcl: private
      Bucket: demo
      ObjectKey: demo/efg/123.jpg

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
  },
  "Resources": {
    "OSSObjectAcl": {
      "Type": "ALIYUN::OSS::ObjectAcl",
      "Properties": {
        "ObjectAcl": "private",
        "Bucket": "demo",
        "ObjectKey": "demo/efg/123.jpg"
      }
    }
  }
}