For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/terraform-aws-vpc-subnet-assigns-public-ip.md.
A documentation index is available at /llms.txt.
This check ensures that AWS VPC subnets do not automatically assign public IP addresses by verifying the value of the map_public_ip_on_launch attribute. If this attribute is set to true, as shown in map_public_ip_on_launch = true, instances launched in the subnet will receive public IPs by default, potentially exposing them to the public internet. Leaving this misconfiguration unaddressed increases the risk of unauthorized access, data breaches, and external attacks.