---
title: CMK is unusable
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > Code Security > Infrastructure as Code (IaC)
  Security > IaC Security Rules > CMK is unusable
---

# CMK is unusable

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}

## Metadata{% #metadata %}

**Id:** `ed6e3ba0-278f-47b6-a1f5-173576b40b7e`

**Cloud Provider:** Alicloud

**Platform:** Terraform

**Severity:** Medium

**Category:** Availability

#### Learn More{% #learn-more %}

- [Provider Reference](https://registry.terraform.io/providers/aliyun/alicloud/latest/docs/resources/kms_key#is_enabled)

### Description{% #description %}

Alicloud KMS must only include enabled Customer Master Keys (CMKs). This rule flags `alicloud_kms_key` resources when:

- `is_enabled` is explicitly set to false (`IncorrectValue`), or
- `is_enabled` is missing (`MissingAttribute`)

To remediate, set or update `is_enabled = true`.

## Compliant Code Examples{% #compliant-code-examples %}

```terraform
resource "alicloud_kms_key" "key" {
  description             = "Hello KMS"
  pending_window_in_days  = "7"
  status                  = "Enabled"
  is_enabled              = true
}
```

## Non-Compliant Code Examples{% #non-compliant-code-examples %}

```terraform
resource "alicloud_kms_key" "key" {
  description             = "Hello KMS"
  pending_window_in_days  = "7"
  status                  = "Enabled"
  is_enabled              = false
}
```

```terraform
resource "alicloud_kms_key" "key" {
  description             = "Hello KMS"
  pending_window_in_days  = "7"
  status                  = "Enabled"
}
```
