A TKE cluster should have tencentcloud_kubernetes_encryption_protection enabled.
This rule verifies that each tencentcloud_kubernetes_cluster has a corresponding tencentcloud_kubernetes_encryption_protection resource whose cluster_id references the cluster.
If no matching tencentcloud_kubernetes_encryption_protection is found, the rule reports a MissingAttribute issue.
Compliant Code Examples
data"tencentcloud_vpc_subnets""vpc"{is_default=trueavailability_zone="ap-guangzhou-3"}resource"tencentcloud_kubernetes_cluster""has_encryption_protection"{vpc_id=data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_idcluster_cidr="10.32.0.0/16"cluster_max_pod_num=32cluster_name="tf_example_cluster"cluster_desc="a tf example cluster for the kms test"cluster_max_service_num=32cluster_deploy_type="MANAGED_CLUSTER"}resource"tencentcloud_kms_key""example"{alias="tf-example-kms-key"description="example of kms key instance"key_usage="ENCRYPT_DECRYPT"is_enabled=true}resource"tencentcloud_kubernetes_encryption_protection""example"{cluster_id=tencentcloud_kubernetes_cluster.has_encryption_protection.idkms_configuration{key_id=tencentcloud_kms_key.example.idkms_region="ap-guangzhou"}}
Non-Compliant Code Examples
data"tencentcloud_vpc_subnets""vpc"{is_default=trueavailability_zone="ap-guangzhou-3"}resource"tencentcloud_kubernetes_cluster""none_encryption_protection"{vpc_id=data.tencentcloud_vpc_subnets.vpc.instance_list.0.vpc_idcluster_cidr="10.32.0.0/16"cluster_max_pod_num=32cluster_name="tf_example_cluster"cluster_desc="a tf example cluster for the kms test"cluster_max_service_num=32cluster_deploy_type="MANAGED_CLUSTER"}
1
2
rulesets:- Terraform / TencentCloud # Rules to enforce / TencentCloud.
個別デモのリクエスト
Datadogを開始
Ask AI
AI-generated responses may be inaccurate. Verify important info.