Thank you! I see there is minor error.
Add the following EIP resource to your main.tf file, preferably before the NAT Gateway resource:
resource "aws_eip" "nat" { count = local.create_nat_gateway ? local.az_count : 0 domain = "vpc"
tags = { Name = "${var.project_name}-${var.environment}-nat-eip-${count.index + 1}" } }