Open mhrreddy2312 opened 6 months ago
Thanks @mhrreddy2312 for raising this issue, let me check the feature and update once I have any more information.
Thanks @mhrreddy2312 for raising this issue, let me check the feature and update once I have any more information.
Thanks for your response @xiaxyi , let me know if you need any other details on the issue
@mhrreddy2312 I'm doing a similar setup for Geo-Red however since there are some shared resources that can be shared!
variables.tf
variable "geoZones" {
type = map(any)
default = {
east= "East US"
west="West US"
}
}
locals {
tags = {
Tag1 = "value1"
Tag2 = "value2"
Tag3 = "value3"
Tag4 = "value4"
Tag5 = "value5"
}
}
resource "azurerm_resource_group" "main" {
name = "sharedRG"
location = "eastus"
tags = local.tags
}
resource "azurerm_resource_group" "geo_redundancy" {
for_each = var.geoZones
name = join("-", ["shareRG", each.key])
location = each.value
tags = local.tags
}
resource "azurerm_eventhub_namespace" "main" {
for_each = azurerm_resource_group.geo_redundancy
name = join("-", ["eventHubGeo", each.key])
resource_group_name = each.value.name
location = each.value.location
sku = "Standard"
capacity = 1
tags = local.tags
lifecycle {
ignore_changes = all
}
}
@AhalimZaki - Thanks for your response. I'm looking to update different tags/values on Primary and Secondary Eventhub name space. I can't achieve this requirement via Terraform but can be done using the Azure Portal
@mhrreddy2312 you can follow the same concept and the tags value should be replaced based on key and value of the for loop aswell. I think if you would do it if it's east then you will take these tags, and vice versa. If I have time tomorrow I will try to assemble something.
@mhrreddy2312 you can follow the same concept and the tags value should be replaced based on key and value of the for loop aswell. I think if you would do it if it's east then you will take these tags, and vice versa. If I have time tomorrow I will try to assemble something.
@AhalimZaki - I can achieve this only if I use the ignore_changes block but my requirement doesn't allow me to use the ignore_changes block. Please let me know if my understanding is incorrect
Thanks @mhrreddy2312 for raising this issue, let me check the feature and update once I have any more information.
@xiaxyi - Please let me know if you have further updates on this issue
@xiaxyi - Could you please advise if you have further updates on this case
Is there an existing issue for this?
Community Note
Terraform Version
1.3.9
AzureRM Provider Version
3.92.0
Affected Resource(s)/Data Source(s)
azurerm_eventhub_namespace
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Terraform should allow updating tags/values on the
secondary event hub namespace
even after enablingGeo Disaster Recovery
, similar to the functionality available through the Azure portal.Actual Behaviour
Currently, when attempting to modify tags/values on the
secondary event hub namespace
usingTerraform
, the changes do not reflect as expected and the pipeline fails with error message -unexpected status 400 with error: MetadataDRSecondaryNamespaceInvalidUpdateBadRequest: Cannot update a namespace which is secondary. For more information visit [https://aka.ms/eventhubsarmexceptions](https://aka.ms/eventhubsarmexceptions.)
.However, these changes are successfully applied when performed through the
Azure portal
Steps to Reproduce
Geo Disaster Recovery
for the event hub namespace.secondary namespace
usingTerraform
.Important Factoids
No response
References
No response