이 제품은 선택한 Datadog 사이트에서 지원되지 않습니다. ().
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우 언제든지 연락주시기 바랍니다.

Metadata

Id: terraform-alicloud-oss-bucket-lifecycle-disabled

Provider: Alicloud

Platform: Terraform

Severity: Low

Category: Backup

Learn More

Description

alicloud_oss_bucket resources should include a lifecycle_rule block with enabled set to true. If the lifecycle_rule block is missing, the policy flags the bucket. If the block exists but enabled is false, the policy flags it and recommends changing enabled from false to true.

Compliant Code Examples

resource "alicloud_oss_bucket" "oss_bucket_lifecycle_enabled1" {
  bucket = "bucket-170309-lifecycle"
  acl    = "public-read"

  lifecycle_rule {
    id      = "rule-days"
    prefix  = "path1/"
    enabled = true

    expiration {
      days = 365
    }
  }
  lifecycle_rule {
    id      = "rule-date"
    prefix  = "path2/"
    enabled = true

    expiration {
      date = "2018-01-12"
    }
  }
}

Non-Compliant Code Examples

resource "alicloud_oss_bucket" "oss_bucket_lifecycle_enabled2" {
  bucket = "bucket-170309-lifecycle"
  acl    = "public-read"

  lifecycle_rule {
    id      = "rule-days"
    prefix  = "path1/"
    enabled = false

    expiration {
      days = 365
    }
  }
  lifecycle_rule {
    id      = "rule-date"
    prefix  = "path2/"
    enabled = true

    expiration {
      date = "2018-01-12"
    }
  }
}
resource "alicloud_oss_bucket" "oss_bucket_lifecycle_enabled3" {
  bucket = "bucket-170309-versioning"
  acl    = "private"

  versioning {
    status = "Enabled"
  }
}