-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity_groups.tf
42 lines (32 loc) · 1.13 KB
/
security_groups.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
##################################################################
# Security Group database.
##################################################################
module "database_security_group" {
source = "terraform-aws-modules/security-group/aws"
version = "~> 3.0"
providers = {
aws = aws.us-east-2
}
name = "example"
description = "Security group for example usage with EC2 instance"
vpc_id = data.aws_vpc.database.id
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["postgresql-tcp"]
egress_rules = ["all-all"]
}
##################################################################
# Security Group web server.
##################################################################
module "security_group" {
source = "terraform-aws-modules/security-group/aws"
version = "~> 3.0"
providers = {
aws = aws.us-east-1
}
name = "security_group_webserver"
description = "Security group for example usage with EC2 instance"
vpc_id = data.aws_vpc.default.id
ingress_cidr_blocks = ["0.0.0.0/0"]
ingress_rules = ["all-all"]
egress_rules = ["all-all"]
}