이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우
언제든지 연락주시기 바랍니다.Id: terraform-variable-without-type
Platform: Terraform
Severity: Low
Category: Best Practices
Learn More
Description
All variables must include a valid type attribute.
The type must be defined, not null, and not an empty string after trimming whitespace.
Compliant Code Examples
variable "cluster_name" {
default = "example"
description = "cluster name"
type = string
}
resource "aws_eks_cluster" "negative1" {
depends_on = [aws_cloudwatch_log_group.example]
enabled_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
name = var.cluster_name
}
Non-Compliant Code Examples
variable "cluster_name" {
default = "example"
description = "test"
}
resource "aws_eks_cluster" "positive1" {
depends_on = [aws_cloudwatch_log_group.example]
name = var.cluster_name
}
variable "cluster_name" {
default = "example"
type = " "
description = "test"
}
resource "aws_eks_cluster" "positive1" {
depends_on = [aws_cloudwatch_log_group.example]
name = var.cluster_name
}
variable "cluster_name" {
default = "example"
type = ""
description = "test"
}
resource "aws_eks_cluster" "positive1" {
depends_on = [aws_cloudwatch_log_group.example]
name = var.cluster_name
}