@@ -40,23 +40,52 @@ data "aws_ami" "ubuntu" {
4040}
4141
4242module "ec2_instance_group" {
43- source = " ../../"
44- region = var. region
45- ami = data. aws_ami . ubuntu . id
46- ami_owner = var. ami_owner
47- vpc_id = module. vpc . vpc_id
48- subnet = module. subnets . private_subnet_ids [0 ]
49- security_groups = [module . vpc . vpc_default_security_group_id ]
50- assign_eip_address = var. assign_eip_address
51- associate_public_ip_address = var. associate_public_ip_address
52- instance_type = var. instance_type
53- instance_count = var. instance_count
54- allowed_ports = var. allowed_ports
55- create_default_security_group = var. create_default_security_group
56- generate_ssh_key_pair = var. generate_ssh_key_pair
57- root_volume_type = var. root_volume_type
58- root_volume_size = var. root_volume_size
59- delete_on_termination = var. delete_on_termination
43+ source = " ../../"
44+ region = var. region
45+ ami = data. aws_ami . ubuntu . id
46+ ami_owner = var. ami_owner
47+ vpc_id = module. vpc . vpc_id
48+ subnet = module. subnets . private_subnet_ids [0 ]
49+ security_groups = [module . vpc . vpc_default_security_group_id ]
50+ assign_eip_address = var. assign_eip_address
51+ associate_public_ip_address = var. associate_public_ip_address
52+ instance_type = var. instance_type
53+ instance_count = var. instance_count
54+ generate_ssh_key_pair = var. generate_ssh_key_pair
55+ root_volume_type = var. root_volume_type
56+ root_volume_size = var. root_volume_size
57+ delete_on_termination = var. delete_on_termination
58+
59+ security_group_rules = [
60+ {
61+ type = " egress"
62+ from_port = 0
63+ to_port = 65535
64+ protocol = " -1"
65+ cidr_blocks = [" 0.0.0.0/0" ]
66+ },
67+ {
68+ type = " ingress"
69+ from_port = 22
70+ to_port = 22
71+ protocol = " tcp"
72+ cidr_blocks = [" 0.0.0.0/0" ]
73+ },
74+ {
75+ type = " ingress"
76+ from_port = 80
77+ to_port = 80
78+ protocol = " tcp"
79+ cidr_blocks = [" 0.0.0.0/0" ]
80+ },
81+ {
82+ type = " ingress"
83+ from_port = 443
84+ to_port = 443
85+ protocol = " tcp"
86+ cidr_blocks = [" 0.0.0.0/0" ]
87+ }
88+ ]
6089
6190 context = module. this . context
6291}
0 commit comments