All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::OSS::BucketWorm

更新時間:Jul 05, 2026

The ALIYUN::OSS::BucketWorm resource creates a compliance retention policy.

Syntax

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

Properties

Parameter

Type

Required

Editable

Description

Constraints

Bucket

String

Yes

No

The name of the bucket.

None

RetentionPeriodInDays

Integer

Yes

No

The number of days to retain objects.

Minimum: 1. Maximum: 25567.

Return values

Fn::GetAtt

  • ExpirationDate: The time when the retention policy expires.

  • RetentionPeriodInDays: The number of days to retain objects.

  • CreateTime: The creation time of the resource.

  • WormId: The ID of the retention policy.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  RetentionPeriodInDays:
    Type: Number
    Description:
      en: The number of days to retain objects.
    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 number of days to retain objects.
  CreateTime:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - CreateTime
    Description: The creation time of the resource.
  ExpirationDate:
    Value:
      Fn::GetAtt:
        - ExtensionResource
        - ExpirationDate
    Description: The time when the retention policy expires.
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "RetentionPeriodInDays": {
      "Type": "Number",
      "Description": {
        "en": "The number of days to retain objects."
      },
      "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 number of days to retain objects."
    },
    "CreateTime": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "CreateTime"
        ]
      },
      "Description": "The creation time of the resource."
    },
    "ExpirationDate": {
      "Value": {
        "Fn::GetAtt": [
          "ExtensionResource",
          "ExpirationDate"
        ]
      },
      "Description": "The time when the retention policy expires."
    }
  }
}