File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ Note that this example may create resources which cost money. Run `terraform des
4040| <a name =" module_main_sg " ></a > [ main\_ sg] ( #module\_ main\_ sg ) | ../../ | n/a |
4141| <a name =" module_only_rules " ></a > [ only\_ rules] ( #module\_ only\_ rules ) | ../../ | n/a |
4242| <a name =" module_prefix_list " ></a > [ prefix\_ list] ( #module\_ prefix\_ list ) | ../../ | n/a |
43+ | <a name =" module_prefix_list_sg " ></a > [ prefix\_ list\_ sg] ( #module\_ prefix\_ list\_ sg ) | ../../ | n/a |
4344| <a name =" module_vpc " ></a > [ vpc] ( #module\_ vpc ) | terraform-aws-modules/vpc/aws | n/a |
4445
4546## Resources
@@ -48,6 +49,7 @@ Note that this example may create resources which cost money. Run `terraform des
4849| ------| ------|
4950| [ aws_prefix_list.dynamodb] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/prefix_list ) | data source |
5051| [ aws_prefix_list.s3] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/prefix_list ) | data source |
52+ | [ aws_ec2_managed_prefix_list.prefix_list_sg_example] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ec2_managed_prefix_list ) | resource |
5153| [ aws_security_group.default] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/security_group ) | data source |
5254| [ aws_vpc.default] ( https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/vpc ) | data source |
5355
Original file line number Diff line number Diff line change @@ -437,3 +437,30 @@ module "prefix_list" {
437437 },
438438 ]
439439}
440+
441+ # ################################
442+ # Security group using prefix list
443+ # ################################
444+ resource "aws_ec2_managed_prefix_list" "prefix_list_sg_example" {
445+ address_family = " IPv4"
446+ max_entries = 1
447+ name = " prefix-list-sg-example"
448+
449+ entry {
450+ cidr = module. vpc . vpc_cidr_block
451+ description = " VPC CIDR"
452+ }
453+ }
454+
455+ module "prefix_list_sg" {
456+ source = " ../../"
457+
458+ name = " prefix-list-sg"
459+ description = " Security group using prefix list"
460+ vpc_id = data. aws_vpc . default . id
461+
462+ use_name_prefix = false
463+
464+ ingress_prefix_list_ids = [aws_ec2_managed_prefix_list . prefix_list_sg_example . id ]
465+ ingress_rules = [" https-443-tcp" ]
466+ }
You can’t perform that action at this time.
0 commit comments