Skip to content

Commit 8335a48

Browse files
committed
fix: Knew I should have not accepted this change request
1 parent cca123e commit 8335a48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/service/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,7 +1638,7 @@ locals {
16381638
}
16391639

16401640
data "aws_subnet" "this" {
1641-
count = local.create_security_group && var.vpc_id == null ? 1 : 0
1641+
count = local.create_security_group ? 1 : 0
16421642

16431643
region = var.region
16441644

@@ -1653,7 +1653,7 @@ resource "aws_security_group" "this" {
16531653
name = var.security_group_use_name_prefix ? null : local.security_group_name
16541654
name_prefix = var.security_group_use_name_prefix ? "${local.security_group_name}-" : null
16551655
description = var.security_group_description
1656-
vpc_id = try(data.aws_subnet.this[0].vpc_id, var.vpc_id)
1656+
vpc_id = coalesce(var.vpc_id, try(data.aws_subnet.this[0].vpc_id, null))
16571657

16581658
tags = merge(
16591659
var.tags,

0 commit comments

Comments
 (0)