Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource group has to exist before you can use this module #602

Open
1 task done
DeviaVir opened this issue Nov 8, 2024 · 0 comments
Open
1 task done

Resource group has to exist before you can use this module #602

DeviaVir opened this issue Nov 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@DeviaVir
Copy link

DeviaVir commented Nov 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Greenfield/Brownfield provisioning

greenfield

Terraform Version

1.9.8

Module Version

9.2.0

AzureRM Provider Version

4.9.0

Affected Resource(s)/Data Source(s)

data.azurerm_resource_group.main

Terraform Configuration Files

resource "azurerm_resource_group" "resource_group" {
  name     = "${var.environment}-${var.uuid}-rg"
  location = var.location
}

module "aks" {
  source  = "Azure/aks/azurerm"
  version = "9.2.0"

  resource_group_name = var.resource_group_name
  location = var.location

  # otherwise assuming all defaults are set
}

tfvars variables values

environment=dev
uuid=test
location=westeurope

Debug Output/Panic Output

│ Error: Error: Resource Group "dev-test-rg" was not found
│ 
│   with module.cluster.module.aks.data.azurerm_resource_group.main,
│   on .terraform/modules/cluster.aks/main.tf line 1, in data "azurerm_resource_group" "main":
│    1: data "azurerm_resource_group" "main" {
│ 
╵
╷
│ Error: Error: Resource Group "dev-test-rg" was not found
│ 
│   with module.cluster.module.aks.data.azurerm_resource_group.aks_rg[0],
│   on .terraform/modules/cluster.aks/role_assignments.tf line 114, in data "azurerm_resource_group" "aks_rg":
│  114: data "azurerm_resource_group" "aks_rg" {
│ 
╵

Expected Behaviour

I expected the module to not try to read the resource group and expecting it to exist already on my first run.

Actual Behaviour

The data source fails.

Steps to Reproduce

  1. terraform apply

Important Factoids

No response

References

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant