"terraform plan" issues an error when I create a new security group:
resource "aws_security_group" "bastion-ssh-pub" {
name = "bastion-ssh-pub"
description = "Bastion SSH public"
ingress {
from_port = 22
to_port = 22
protocol = "tcp"
}
egress {
from_port = 22
to_port = 22
protocol = "tcp"
cidr_blocks = ["${aws_vpc.main.cidr_blocks}"]
}
tags {
Name = "bastion-ssh-pub"
}
}
ERROR:
* aws_security_group.bastion-ssh-pub: ingress.0: invalid or unknown key: cidr_block
From documentation I have checked structure and syntax is correct.
Regards.
Francisco