Ensure all NACL are attached to subnets

Error: Not all NACL are attached to subnets

Bridgecrew Policy ID: BC_AWS_NETWORKING_50
Checkov Check ID: CKV2_AWS_1
Severity: LOW

Not all NACL are attached to subnets

Description

TBA

Fix - Buildtime

Terraform

  • Resource: aws_vpc, aws_network_acl, aws_subne
  • Argument: subnet_ids of aws_network_acl
resource "aws_vpc" "ok_vpc" {
  cidr_block = "10.0.0.0/16"
}

resource "aws_subnet" "main" {
  vpc_id     = aws_vpc.ok_vpc.id
  cidr_block = "10.0.1.0/24"
}

resource "aws_subnet" "main" {
  cidr_block = "10.0.1.0/24"
}

resource "aws_network_acl" "acl_ok" {
  vpc_id = aws_vpc.ok_vpc.id
  subnet_ids = [aws_subnet.main.id]
}

Did this page help you?