We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7760fc commit deb153fCopy full SHA for deb153f
modules/app_stack/security_groups.tf
@@ -1,3 +1,15 @@
1
+data "aws_instance" "monitoring_ec2" {
2
+ filter {
3
+ name = "tag:Name"
4
+ values = ["solid-connection-monitoring"]
5
+ }
6
+
7
8
+ name = "instance-state-name"
9
+ values = ["running"]
10
11
+}
12
13
# 1. API Server용 보안 그룹 (SSH 연결 허용)
14
resource "aws_security_group" "api_sg" {
15
name = "sc-${var.env_name}-api-sg"
@@ -45,6 +57,15 @@ resource "aws_security_group" "db_sg" {
45
57
}
46
58
47
59
60
+ ingress {
61
+ description = "Allow 8081 from EC2: (${data.aws_instance.monitoring_ec2.tags.Name})"
62
+ from_port = 8081
63
+ to_port = 8081
64
+ protocol = "tcp"
65
66
+ cidr_blocks = ["${data.aws_instance.monitoring_ec2.private_ip}/32"]
67
68
48
69
tags = {
49
70
Name = "solid-connection-${var.env_name}-db-sg"
50
71
0 commit comments