-
Notifications
You must be signed in to change notification settings - Fork 31
/
sg.tf
47 lines (41 loc) · 969 Bytes
/
sg.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
42
43
44
45
46
47
/**
* Copyright (C) 2018-2020 Expedia, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
*/
resource "aws_security_group" "hms_ro" {
count = var.hms_instance_type == "ecs" ? 1 : 0
name = "${local.instance_alias}-hms-ro"
vpc_id = var.vpc_id
tags = var.apiary_tags
ingress {
from_port = 9083
to_port = 9083
protocol = "tcp"
cidr_blocks = local.ro_ingress_cidr
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}
resource "aws_security_group" "hms_rw" {
count = var.hms_instance_type == "ecs" ? 1 : 0
name = "${local.instance_alias}-hms-rw"
vpc_id = var.vpc_id
tags = var.apiary_tags
ingress {
from_port = 9083
to_port = 9083
protocol = "tcp"
cidr_blocks = local.rw_ingress_cidr
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["0.0.0.0/0"]
}
}