Ensure Alibaba Cloud OSS bucket has versioning enabled

Error: Alibaba Cloud OSS bucket has versioning disabled

Bridgecrew Policy ID: BC_ALI_GENERAL_3
Checkov Check ID: CKV_ALI_10
Severity: LOW

Alibaba Cloud OSS bucket has versioning disabled

Description

Enabling versioning for an Alibaba Cloud OSS bucket can help to protect your data and provide a way to recover from accidental deletions or overwrites. When versioning is enabled, OSS automatically archives all versions of an object (including all writes and deletes) in the bucket. This allows you to recover previous versions of an object or restore an accidentally deleted object.

Fix - Buildtime

Terraform

resource "alicloud_oss_bucket" "pass" {
  bucket = "bucket-123-versioning"
  acl    = "private"

  versioning {
    status = "Enabled"
  }
}