Azure / terraform-azurerm-avm-ptn-vnetgateway

AVM Terraform Pattern Module for Virtual Network Gateway
https://registry.terraform.io/modules/Azure/avm-ptn-vnetgateway/azurerm/latest
MIT License
7 stars 6 forks source link

[AVM Module Issue]: error local.express_route_circuit_virtual_network_gateway_connections is object with no attributes #54

Closed shri0024 closed 4 months ago

shri0024 commented 4 months ago

Check for previous/existing GitHub issues

Issue Type?

Bug

(Optional) Module Version

(https://github.com/Azure/terraform-azurerm-avm-ptn-vnetgateway)

(Optional) Correlation Id

No response

Description

getting below error while deploy example folder terraform code

│ Error: Invalid function argument │ │ on ....\locals.tf line 2, in locals: │ 2: azurerm_express_route_circuit_peering = nonsensitive(local.express_route_circuit_peerings) │ ├──────────────── │ │ while calling nonsensitive(value) │ │ local.express_route_circuit_peerings is object with no attributes │ │ Invalid value for "value" parameter: the given value is not sensitive, so │ this call is redundant. ╵

╷ │ Error: Invalid function argument │ │ on ....\locals.tf line 49, in locals: │ 49: azurerm_virtual_network_gateway_connection = nonsensitive(merge( │ 50: local.local_network_gateway_virtual_network_gateway_connections, │ 51: local.express_route_circuit_virtual_network_gateway_connections │ 52: )) │ ├──────────────── │ │ while calling nonsensitive(value) │ │ local.express_route_circuit_virtual_network_gateway_connections is object with no attributes │ │ local.local_network_gateway_virtual_network_gateway_connections is object with no attributes │ │ Invalid value for "value" parameter: the given value is not sensitive, so │ this call is redundant.

luke-taylor commented 4 months ago

Hey, what version of terraform are you currently using?

shri0024 commented 4 months ago

Terraform version is latest (1.8.2) & AzureRM provider v3.101.0.

luke-taylor commented 4 months ago

Can you share with me your tfvars file so I can try reproduce this error?

shri0024 commented 4 months ago

I am not using any tfvars file yet for this & validating deploy with default values only with 'terraform plan' (without passing var-file). I can see plan show deploying 8 resources. but it only throws error for locals.tf file in module.

Steps to reproduce:

  1. clone module to local
  2. switch to example/default/ directory
  3. terraform init (success)
  4. terraform plan (show below output)

Plan: 8 to add, 0 to change, 0 to destroy.

Changes to Outputs:

luke-taylor commented 4 months ago

@shri0024 I can't reproduce this with the versions you have stated. Was this an error on terraform plan or apply?

If you check the test environment for the change this ran through end-to-end.

In any case, I'll put in a PR to explicitly make this sensitive before making it nonsensitive

shri0024 commented 4 months ago

@luke-taylor It seems error which I was getting are remediated by fix you applied https://github.com/Azure/terraform-azurerm-avm-ptn-vnetgateway/pull/55 fyi, error was for plan Thanks!!