forked from chelto/ApiGateway-Fargate-Terraform-templates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsecurity.tf
41 lines (39 loc) · 1.03 KB
/
security.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
resource "aws_security_group" "sidecar_security_group" {
name = "${var.name_prefix}-sg"
description = "${var.name_prefix} security group"
vpc_id = var.vpc_id
tags = var.default_tags
# might need to refine down/////
ingress {
from_port = var.controller_port
to_port = var.controller_port
protocol = "tcp"
cidr_blocks = ["0.0.0.0/0"]
ipv6_cidr_blocks = ["::/0"]
}
egress {
protocol = "-1"
from_port = 0
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_security_group" "VPC_endpoint_sg" {
name = "${var.name_prefix}-VPC_endpoin-sg"
description = "${var.name_prefix} security group"
vpc_id = var.vpc_id
tags = var.default_tags
# might need to refine down/////
ingress {
from_port = 443
to_port = 443
protocol = "tcp"
cidr_blocks = [data.aws_vpc.selected.cidr_block]
}
egress {
protocol = "-1"
from_port = 0
to_port = 0
cidr_blocks = ["0.0.0.0/0"]
}
}