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

azurerm_ip_group_cidr cannot be added to an ip_group hosted in a different subscription #27589

Closed
1 task done
LaurentLesle opened this issue Oct 8, 2024 · 1 comment · Fixed by #27591
Closed
1 task done

Comments

@LaurentLesle
Copy link
Contributor

LaurentLesle commented Oct 8, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.9.7

AzureRM Provider Version

4.0.1

Affected Resource(s)/Data Source(s)

azurerm_ip_group_cidr

Terraform Configuration Files

# root code:

# 2 providers
# azurerm target the application landingzone with the CIDR to register in the ip group
# azurerm.connectivity target the connectivity subscription where the IP Group is hosted

provider "azurerm" {
  features {}
  subscription_id                 = var.subscription_id
  resource_provider_registrations = "none"
}

provider "azurerm" {
  alias = "connectivity"
  features {}
  subscription_id                 = var.connectivity_subscription_id
  tenant_id                       = var.tenant_id
  resource_provider_registrations = "none"
}

# module to call the ip group
module "azurerm_ip_group_cidrs" {
  source   = "./modules/azurerm/terraform-azurerm-ip-group-cidr"
  for_each = var.azurerm_ip_group_cidrs

  providers = {
    azurerm.connectivity = azurerm.connectivity
  }

  ip_group_id          = var.ip_group_id
  cidrs                = each.value.cidrs
}

##### submodule
terraform {
  required_providers {
    azurerm = {
      configuration_aliases = [
        azurerm.connectivity
      ]
    }
  }
}
resource "azurerm_ip_group_cidr" "this" {
  for_each = var.cidrs

  provider = azurerm.connectivity

  ip_group_id = var.ip_group_id
  cidr        = each.value
}

variable "ip_group_id" {
  type = string
}

variable "cidrs" {
  type = set(string)
}

Debug Output/Panic Output

See picture in reference

Expected Behaviour

CIDR should be added to the IP Group even if the IP Group has been created into a different subscription.

Actual Behaviour

Failing to add the CIDR to an existing

Steps to Reproduce

Create a sub module and run the code above

Important Factoids

No response

References

image
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
2 participants