ALIYUN::OSS::BucketOverwriteConfig

更新时间:
复制为 MD 格式

ALIYUN::OSS::BucketOverwriteConfig类型用于设置存储空间(Bucket)的禁止覆盖写规则。

语法

{
  "Type": "ALIYUN::OSS::BucketOverwriteConfig",
  "Properties": {
    "Bucket": String,
    "Rule": List
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Bucket

String

存储桶的名称。

Rule

List

禁止覆盖规则。

最小长度:0,最大长度:100。更多信息,请参考Rule属性

Rule语法

"Rule": [
  {
    "Action": String,
    "Suffix": String,
    "Principals": Map,
    "Prefix": String,
    "Id": String
  }
]

Rule属性

属性名称

类型

必须

允许更新

描述

约束

Action

String

操作类型。

取值:

  • forbid

Id

String

规则ID。

Prefix

String

对象名称的前缀。

用于筛选待处理的对象。

Principals

Map

授权主体集合。

用法类似于Bucket PolicyPrincipal。您可以输入主账号、子账号或角色。如果此参数为空或未配置,则不允许覆盖符合前缀和后缀条件的对象。更多信息,请参考Principals属性

Suffix

String

对象名称的后缀。

用于筛选待处理的对象。

Principals语法

"Principals": {
  "Principal": List
}

Principals属性

属性名称

类型

必须

允许更新

描述

约束

Principal

List

授权主体。

最小长度:0,最大长度:100。支持输入主账号、子账号或角色,值为空时设置无效。

返回值

Fn::GetAtt

Rule:禁止覆盖规则。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  Bucket:
    Type: String
    Description:
      en: The name of the bucket.
    Required: true
  Rule:
    Description:
      en: Forbid overwrite rule.
    Required: false
    Default: Null
    Type: Json
    MinLength: 0
    MaxLength: 100
    AssociationProperty: List[Parameter]
    AssociationPropertyMetadata:
      Parameter:
        Description:
          en: Forbid overwrite rule.
        Required: false
        Default: Null
        Type: Json
        AssociationPropertyMetadata:
          Parameters:
            Action:
              Type: String
              Description:
                en: The operation type. Currently, only "forbid" is supported.
              AllowedValues:
                - forbid
              Default: Null
              Required: false
            Prefix:
              Type: String
              Description:
                en: The prefix of the Object name, which is used to filter objects to be processed.
              Default: Null
              Required: false
            Principals:
              Description:
                en: A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions.
              Required: false
              Default: Null
              Type: Json
              AssociationPropertyMetadata:
                Parameters:
                  Principal:
                    Description:
                      en: Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty.
                    Required: false
                    Default: Null
                    Type: Json
                    MinLength: 0
                    MaxLength: 100
                    AssociationProperty: List[Parameter]
                    AssociationPropertyMetadata:
                      Parameter:
                        Type: String
                        Description:
                          en: Authorized Subject.
                        Default: Null
                        Required: false
            Suffix:
              Type: String
              Description:
                en: The suffix of the Object name, which is used to filter objects to be processed.
              Default: Null
              Required: false
            Id:
              Type: String
              Description:
                en: Rule ID.
              Default: Null
              Required: false
Resources:
  ExtensionResource:
    Type: ALIYUN::OSS::BucketOverwriteConfig
    Properties:
      Bucket:
        Ref: Bucket
      Rule:
        Ref: Rule
Outputs:
  Rule:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - Rule
    Description: Forbid overwrite rule.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "Bucket": {
      "Type": "String",
      "Description": {
        "en": "The name of the bucket."
      },
      "Required": true
    },
    "Rule": {
      "Description": {
        "en": "Forbid overwrite rule."
      },
      "Required": false,
      "Default": null,
      "Type": "Json",
      "MinLength": 0,
      "MaxLength": 100,
      "AssociationProperty": "List[Parameter]",
      "AssociationPropertyMetadata": {
        "Parameter": {
          "Description": {
            "en": "Forbid overwrite rule."
          },
          "Required": false,
          "Default": null,
          "Type": "Json",
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Action": {
                "Type": "String",
                "Description": {
                  "en": "The operation type. Currently, only \"forbid\" is supported."
                },
                "AllowedValues": [
                  "forbid"
                ],
                "Default": null,
                "Required": false
              },
              "Prefix": {
                "Type": "String",
                "Description": {
                  "en": "The prefix of the Object name, which is used to filter objects to be processed."
                },
                "Default": null,
                "Required": false
              },
              "Principals": {
                "Description": {
                  "en": "A collection of authorized principals. The usage is similar to that of the Principal of the Bucket Policy. You can enter the primary account, sub-account, or role. If this parameter is empty or not configured, overwriting is not allowed for objects that meet the preceding and suffix conditions."
                },
                "Required": false,
                "Default": null,
                "Type": "Json",
                "AssociationPropertyMetadata": {
                  "Parameters": {
                    "Principal": {
                      "Description": {
                        "en": "Authorized subject. Supports the input of primary accounts, sub-accounts, or roles. Invalid setting if the value is empty."
                      },
                      "Required": false,
                      "Default": null,
                      "Type": "Json",
                      "MinLength": 0,
                      "MaxLength": 100,
                      "AssociationProperty": "List[Parameter]",
                      "AssociationPropertyMetadata": {
                        "Parameter": {
                          "Type": "String",
                          "Description": {
                            "en": "Authorized Subject."
                          },
                          "Default": null,
                          "Required": false
                        }
                      }
                    }
                  }
                }
              },
              "Suffix": {
                "Type": "String",
                "Description": {
                  "en": "The suffix of the Object name, which is used to filter objects to be processed."
                },
                "Default": null,
                "Required": false
              },
              "Id": {
                "Type": "String",
                "Description": {
                  "en": "Rule ID."
                },
                "Default": null,
                "Required": false
              }
            }
          }
        }
      }
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::OSS::BucketOverwriteConfig",
      "Properties": {
        "Bucket": {
          "Ref": "Bucket"
        },
        "Rule": {
          "Ref": "Rule"
        }
      }
    }
  },
  "Outputs": {
    "Rule": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "Rule"
        ]
      },
      "Description": "Forbid overwrite rule."
    }
  }
}