Skip to content

Commit bcac86f

Browse files
committed
using prefix list in complete example
1 parent 7cc8ea3 commit bcac86f

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

examples/complete/main.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,3 +399,30 @@ module "only_rules" {
399399
},
400400
]
401401
}
402+
403+
#################################
404+
# Security group using prefix list
405+
#################################
406+
resource "aws_ec2_managed_prefix_list" "prefix_list_sg_example" {
407+
address_family = "IPv4"
408+
max_entries = 1
409+
name = "prefix-list-sg-example"
410+
411+
entry {
412+
cidr = module.vpc.vpc_cidr_block
413+
description = "VPC CIDR"
414+
}
415+
}
416+
417+
module "prefix_list_sg" {
418+
source = "../../"
419+
420+
name = "prefix-list-sg"
421+
description = "Security group using prefix list"
422+
vpc_id = data.aws_vpc.default.id
423+
424+
use_name_prefix = false
425+
426+
ingress_prefix_list_ids = [aws_ec2_managed_prefix_list.prefix_list_sg_example.id]
427+
ingress_rules = ["https-443-tcp"]
428+
}

0 commit comments

Comments
 (0)