Route53 Record Undefined

  • Query id: 25db74bf-fa3b-44da-934e-8c3e005c0453
  • Query name: Route53 Record Undefined
  • Platform: Terraform
  • Severity: High
  • Category: Networking and Firewall
  • CWE: 778
  • URL: Github

Description

Check if Record is set
Documentation

Code samples

Code samples with security vulnerabilities

Positive test num. 1 - tf file
resource "aws_route53_record" "example" {
  allow_overwrite = true
  name            = "test.example.com"
  ttl             = 30
  type            = "NS"
  zone_id         = aws_route53_zone.example.zone_id

  records = [

  ]
}

Code samples without security vulnerabilities

Negative test num. 1 - tf file
resource "aws_route53_record" "example" {
  allow_overwrite = true
  name            = "test.example.com"
  ttl             = 30
  type            = "NS"
  zone_id         = aws_route53_zone.example.zone_id

  records = [
    aws_route53_zone.example.name_servers[0],
    aws_route53_zone.example.name_servers[1],
    aws_route53_zone.example.name_servers[2],
    aws_route53_zone.example.name_servers[3],
  ]
}