Skip to content

Commit 4e5dba9

Browse files
authored
Fix SG naming
1 parent 13addf5 commit 4e5dba9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

operations/deployment/terraform/postgres.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
resource "aws_security_group" "pg_security_group" {
22
count = var.aws_enable_postgres == "true" ? 1 : 0
3-
name = var.aws_security_group_name_pg
3+
name = var.aws_security_group_name_pg != "" ? var.aws_security_group_name_pg : "SG for ${var.aws_resource_identifier} - PG"
44
description = "SG for ${var.aws_resource_identifier} - PG"
55
egress {
66
from_port = 0

operations/deployment/terraform/security-group.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
resource "aws_security_group" "ec2_security_group" {
2-
name = var.security_group_name
2+
name = var.security_group_name != "" ? var.security_group_name : "SG for ${var.aws_resource_identifier} - EC2"
33
description = "SG for ${var.aws_resource_identifier}"
44
vpc_id = data.aws_vpc.default.id
55
egress {

operations/deployment/terraform/variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ variable "ec2_volume_size" {
6161

6262
variable "security_group_name" {
6363
type = string
64-
default = "SG for deployment"
64+
default = ""
6565
description = "Name of the security group to use"
6666
}
6767
variable "aws_security_group_name_pg" {
6868
type = string
69-
default = "SG for postgres deployment"
69+
default = ""
7070
description = "Name of the security group to use for postgres"
7171
}
7272
variable "ec2_iam_instance_profile" {

0 commit comments

Comments
 (0)