mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-08 23:23:59 -06:00
0e3256b6f4
This example demonstrates both creating a network architecture *and* the use of data resources to minimize the number of variables needed for a child module by discovering additional data automatically.
26 lines
585 B
HCL
26 lines
585 B
HCL
resource "aws_security_group" "region" {
|
|
name = "region"
|
|
description = "Open access within this region"
|
|
vpc_id = "${aws_vpc.main.id}"
|
|
|
|
ingress {
|
|
from_port = 0
|
|
to_port = 0
|
|
protocol = -1
|
|
cidr_blocks = ["${aws_vpc.main.cidr_block}"]
|
|
}
|
|
}
|
|
|
|
resource "aws_security_group" "internal-all" {
|
|
name = "internal-all"
|
|
description = "Open access within the full internal network"
|
|
vpc_id = "${aws_vpc.main.id}"
|
|
|
|
ingress {
|
|
from_port = 0
|
|
to_port = 0
|
|
protocol = -1
|
|
cidr_blocks = ["${var.base_cidr_block}"]
|
|
}
|
|
}
|