Skip to content

Commit

Permalink
Update examples
Browse files Browse the repository at this point in the history
  • Loading branch information
herman-wong-cf committed Mar 26, 2024
1 parent b6e9070 commit 02c5dca
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 30 deletions.
34 changes: 18 additions & 16 deletions examples/network-associations/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,26 +62,28 @@ module "example_sg" {

vpc_id = aws_vpc.main.id

ingress_rules = [{
protocol = "tcp"
from_port = "443"
to_port = "443"
cidr_blocks = [aws_vpc.main.cidr_block]
},
{
# ssh
ingress_rules = {
"allow_https" = {
ip_protocol = "tcp"
from_port = "443"
to_port = "443"
cidr_ipv4 = aws_vpc.main.cidr_block
}
"allow_ssh" = {
protocol = "tcp"
from_port = "22"
to_port = "22"
cidr_blocks = [aws_vpc.main.cidr_block]
}]

egress_rules = [{
protocol = "-1"
from_port = "0"
to_port = "0"
cidr_blocks = ["0.0.0.0/0"]
}]
}
}

egress_rules = {
"allow_all_egress" = {
ip_protocol = "-1"
cidr_ipv4 = "0.0.0.0/0"
description = "Allow all egress"
}
}

network_interface_resource_associations = [
aws_instance.instance1.primary_network_interface_id,
Expand Down
27 changes: 13 additions & 14 deletions examples/simple/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -38,27 +38,26 @@ module "example_sg" {

vpc_id = aws_vpc.main.id

ingress_rules = [
{
protocol = "tcp"
ingress_rules = {
"allow_https" = {
ip_protocol = "tcp"
from_port = "443"
to_port = "443"
cidr_blocks = [aws_vpc.main.cidr_block]
},
{
cidr_ipv4 = aws_vpc.main.cidr_block
}
"allow_ssh" = {
protocol = "tcp"
from_port = "22"
to_port = "22"
cidr_blocks = [aws_vpc.main.cidr_block]
}
]
}

egress_rules = [
{
protocol = "-1"
from_port = "0"
to_port = "0"
cidr_blocks = ["0.0.0.0/0"]
egress_rules = {
"allow_all_egress" = {
ip_protocol = "-1"
cidr_ipv4 = "0.0.0.0/0"
description = "Allow all egress"
}
]
}
}

0 comments on commit 02c5dca

Please sign in to comment.