Skip to content

Commit 4cc36f7

Browse files
committed
fix(service): remove vpc_id check from subnet data count
The conditional for the aws_subnet data resource count no longer checks if var.vpc_id is null. This simplifies the logic and ensures the subnet data resource is created whenever a security group is needed and subnet_ids are provided.
1 parent 239a60c commit 4cc36f7

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

modules/service/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,8 +1876,7 @@ data "aws_subnet" "this" {
18761876
}
18771877

18781878
resource "aws_security_group" "this" {
1879-
count = local.create_security_group && (var.vpc_id != null ||
1880-
length(var.subnet_ids) > 0) ? 1 : 0
1879+
count = local.create_security_group && length(var.subnet_ids) > 0 ? 1 : 0
18811880

18821881
region = var.region
18831882

0 commit comments

Comments
 (0)