I was looking at a GitHub project ibm-cloud-architecture/terraform-openshift4-azure to install OpenShift using Terraform.
Using Terraform 1.3.7 this project fails on the following code
resource "azurerm_lb_backend_address_pool" "internal_lb_controlplane_pool_v4" {
count = var.use_ipv4 ? 1 : 0
resource_group_name = var.resource_group_name
loadbalancer_id = azurerm_lb.internal.id
name = var.cluster_id
}
with the message
Error: Unsupported argument
on vnet/internal-lb.tf line 40, in resource "azurerm_lb_backend_address_pool" internal_lb_controlplane_pool_v4":
40: resource_group_name = var.resource_group_nameAn argument named "resource_group_name" is not expected here.
Why is this code failing? How can we specify the name of a resource group with the current version of Terraform and Azure?
2
Answers
If you check docs for azurerm_lb_backend_address_pool you will see that it does not take
resource_group_name
argument. So it should be:Issue was caused because of syntax error. There
resource_group_name
is not required.here is the code reference and replicated the same
main tf as follow:
upon plan and apply
From Portal