All generic Git module sources should include a revision reference.
Module sources that begin with git:: must include a ?ref= parameter to pin the source to a specific commit, tag, or branch. This ensures reproducible and predictable builds.
This rule flags modules where module.source starts with git:: and does not contain ?ref=.
Compliant Code Examples
variable"cluster_name"{default="example"description="cluster name"type=string}module"acm"{source="terraform-aws-modules/acm/aws"version="~> v2.0"domain_name=var.site_domainzone_id=data.aws_route53_zone.this.zone_idtags=var.tagsproviders={aws=aws.us_east_1 # cloudfront needs acm certificate to be from "us-east-1" region
}}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="cluster name"type=string}module"acm"{source="git::https://example.com/vpc.git"version="~> v2.0"domain_name=var.site_domainzone_id=data.aws_route53_zone.this.zone_idtags=var.tagsproviders={aws=aws.us_east_1 # cloudfront needs acm certificate to be from "us-east-1" region
}}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}
1
2
rulesets:- Terraform # Rules to enforce .
맞춤형 데모 요청
Datadog 시작하기
Ask AI
AI-generated responses may be inaccurate. Verify important info.