Terraform

AWS Terraform

4

Terraform. . Terraform, . Terraform Amazon. Terraform.

terraform 0.12 . , . lesson-5. - Atom.

DynamicSecurityGroup.tf webserver.tf . , , -.

C,   -

. Terraform, .

   80  22

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.

name

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

, . .


50% Merion Academy