From 8080192c3929afb490176b2fb9b0a411b1e803d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wiktor=20Niesiob=C4=99dzki?= Date: Tue, 21 Oct 2025 12:08:59 +0000 Subject: [PATCH] Dont use provider functions, because OpenTofu doesnt like them --- modules/cloud-function-v1/vpcconnector.tf | 4 ++-- modules/cloud-function-v2/vpcconnector.tf | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/cloud-function-v1/vpcconnector.tf b/modules/cloud-function-v1/vpcconnector.tf index 4d01eada0..2c449132a 100644 --- a/modules/cloud-function-v1/vpcconnector.tf +++ b/modules/cloud-function-v1/vpcconnector.tf @@ -22,7 +22,7 @@ locals { # if you pass the subnet, you must pass only the name, not the whole id _connector_subnet_name = ( local._connector_subnet_name_ctx - ? provider::google::name_from_id(local.ctx.subnets[var.vpc_connector_create.subnet.name]) + ? reverse(split("/", local.ctx.subnets[var.vpc_connector_create.subnet.name]))[0] : try(var.vpc_connector_create.subnet.name, null) ) # if project is not provided, but subnet is coming from context, use project from subnet id in context @@ -32,7 +32,7 @@ locals { local._connector_subnet_project_input == null ? ( local._connector_subnet_name_ctx - ? provider::google::project_from_id(local.ctx.subnets[var.vpc_connector_create.subnet.name]) + ? split("/", local.ctx.subnets[var.vpc_connector_create.subnet.name])[1] : null ) : lookup( diff --git a/modules/cloud-function-v2/vpcconnector.tf b/modules/cloud-function-v2/vpcconnector.tf index 4d01eada0..2c449132a 100644 --- a/modules/cloud-function-v2/vpcconnector.tf +++ b/modules/cloud-function-v2/vpcconnector.tf @@ -22,7 +22,7 @@ locals { # if you pass the subnet, you must pass only the name, not the whole id _connector_subnet_name = ( local._connector_subnet_name_ctx - ? provider::google::name_from_id(local.ctx.subnets[var.vpc_connector_create.subnet.name]) + ? reverse(split("/", local.ctx.subnets[var.vpc_connector_create.subnet.name]))[0] : try(var.vpc_connector_create.subnet.name, null) ) # if project is not provided, but subnet is coming from context, use project from subnet id in context @@ -32,7 +32,7 @@ locals { local._connector_subnet_project_input == null ? ( local._connector_subnet_name_ctx - ? provider::google::project_from_id(local.ctx.subnets[var.vpc_connector_create.subnet.name]) + ? split("/", local.ctx.subnets[var.vpc_connector_create.subnet.name])[1] : null ) : lookup(