ALIYUN::OSS::BucketWorm

更新时间:
复制为 MD 格式

ALIYUN::OSS::BucketWorm类型用于新建一条合规保留策略。

语法

{
  "Type": "ALIYUN::OSS::BucketWorm",
  "Properties": {
    "Bucket": String,
    "RetentionPeriodInDays": Integer
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

Bucket

String

存储桶的名称。

RetentionPeriodInDays

Integer

指定保留对象的天数。

最小值:1,最大值:25567

返回值

Fn::GetAtt

  • ExpirationDate:保留策略过期时间。

  • RetentionPeriodInDays:指定保留对象的天数。

  • CreateTime:资源的创建时间。

  • WormId:保留策略的ID。

示例

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RetentionPeriodInDays:
    Type: Number
    Description:
      en: The specified number of days to retain the Object.
    MinValue: 1
    MaxValue: 25567
    Required: true
  Bucket:
    Type: String
    Description:
      en: The name of the bucket.
    Required: true
Resources:
  ExtensionResource:
    Type: ALIYUN::OSS::BucketWorm
    Properties:
      RetentionPeriodInDays:
        Ref: RetentionPeriodInDays
      Bucket:
        Ref: Bucket
Outputs:
  WormId:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - WormId
    Description: The ID of the retention policy.
  RetentionPeriodInDays:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - RetentionPeriodInDays
    Description: The specified number of days to retain the Object.
  CreateTime:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
    Description: The creation time of the resource.
  ExpirationDate:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ExpirationDate
    Description: Retention Policy Expiration Time.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RetentionPeriodInDays": {
      "Type": "Number",
      "Description": {
        "en": "The specified number of days to retain the Object."
      },
      "MinValue": 1,
      "MaxValue": 25567,
      "Required": true
    },
    "Bucket": {
      "Type": "String",
      "Description": {
        "en": "The name of the bucket."
      },
      "Required": true
    }
  },
  "Resources": {
    "ExtensionResource": {
      "Type": "ALIYUN::OSS::BucketWorm",
      "Properties": {
        "RetentionPeriodInDays": {
          "Ref": "RetentionPeriodInDays"
        },
        "Bucket": {
          "Ref": "Bucket"
        }
      }
    }
  },
  "Outputs": {
    "WormId": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "WormId"
        ]
      },
      "Description": "The ID of the retention policy."
    },
    "RetentionPeriodInDays": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "RetentionPeriodInDays"
        ]
      },
      "Description": "The specified number of days to retain the Object."
    },
    "CreateTime": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      },
      "Description": "The creation time of the resource."
    },
    "ExpirationDate": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExpirationDate"
        ]
      },
      "Description": "Retention Policy Expiration Time."
    }
  }
}