File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1638,7 +1638,7 @@ locals {
16381638}
16391639
16401640data "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 ,
You can’t perform that action at this time.
0 commit comments