Terraform
AWS Terraform
Terraform. . Terraform, . Terraform Amazon. Terraform.
terraform 0.12
. , . lesson-5
. - Atom.
DynamicSecurityGroup.tf
webserver.tf
. , , -.

. Terraform, .

2 . 80 22, , 443 , .
, 20 . copy-paste, .. . terraform 0.12 DynamicBlocks
, Terraform.
:
dynamic "ingress" { for_each = ["80", "443", "8080", "1541", "9092"] content { from_port = ingress.value to_port = ingress.value protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] } }
. Dynamic, , - , Ingress
. for_each = ["1", "2"]
. , for_each
content
. content
, , .
content
cider_blocks
IP IP . 0.0.0.0/0
, IP . IP , , .
, , 5 , .. , . .
dynamic
, ingress
. . name
resource
, AWS.

, , . , , . , . terraform init
. , Terraform . terraform apply
. . :

, . .