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

Adding a "replica" block to "azurerm_app_configuration" throws "expanding replica: location ("X") of replica "Y" is duplicated with replica """ #24065

Closed
1 task done
owattley-rotageek opened this issue Nov 29, 2023 · 2 comments · Fixed by #24074

Comments

@owattley-rotageek
Copy link

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 "+1" or "me too" comments, 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.6.4

AzureRM Provider Version

3.82.0

Affected Resource(s)/Data Source(s)

azurerm_app_configuration

Terraform Configuration Files

resource "azurerm_app_configuration" "app_config" {
  name                     = "my-app-config"
  resource_group_name      = "my-resource-group"
  location                 = "North Europe"
  sku                      = "standard"
  public_network_access    = "Disabled"
  purge_protection_enabled = true

  # geo replicas

  replica {
      name = "secondary"
      location = "UK South"
  }
  
}

Debug Output/Panic Output

{
      "mode": "managed",
      "type": "azurerm_app_configuration",
      "name": "app_config",
      "provider": "provider[\"registry.terraform.io/hashicorp/azurerm\"]",
      "instances": [
        {
          "status": "tainted",
          "schema_version": 0,
          "attributes": {
            "encryption": [],
            "endpoint": null,
            "id": "/subscriptions/***/resourceGroups/***/providers/Microsoft.AppConfiguration/configurationStores/***",
            "identity": [],
            "local_auth_enabled": true,
            "location": "northeurope",
            "name": "***",
            "primary_read_key": null,
            "primary_write_key": null,
            "public_network_access": "Disabled",
            "purge_protection_enabled": true,
            "replica": [
              {
                "endpoint": "",
                "id": "",
                "location": "UK South",
                "name": ""
              },
              {
                "endpoint": "",
                "id": "",
                "location": "uksouth",
                "name": "secondary"
              }
            ],
            "resource_group_name": "***",
            "secondary_read_key": null,
            "secondary_write_key": null,
            "sku": "standard",
            "soft_delete_retention_days": 7,
            "tags": {
              "customer": "shared",
              "terraform": "true"
            },
            "timeouts": null
          },
          "sensitive_attributes": [],
          "private": "***"
        }
      ]

Expected Behaviour

The app config resource should be created in northeurope with a replica in uksouth

Actual Behaviour

azurerm provider complains that the replica is a duplicate of an empty string

 Error: expanding `replica`: location ("secondary") of replica "uksouth" is duplicated with replica ""
│
│   with azurerm_app_configuration.app_config,
│   on app_config.tf line 20, in resource "azurerm_app_configuration" "app_config":
│   20: resource "azurerm_app_configuration" "app_config" {
│
╵

Steps to Reproduce

  1. run terraform apply on any valid azurerm_app_configuration with a single valid replica block defined

Important Factoids

no

References

No response

@owattley-rotageek
Copy link
Author

After posting the state file definition into this issue I realised the duplicate replicas with "UK South" and "uksouth" is the source of the problem. I tried changing the definition of the replica block as follows and it works:

replica {
      name = "secondary"
      location = "uksouth" #<<<<<<<
  }

Looks like there's a bug in converting the location string from frtiendly format to a value that the api accepts.

The docs give an example using the friendly name:

  replica {
    name     = "replica1"
    location = "West US" #<<<<<<<<<<<<
  }

https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/app_configuration

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 Apr 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants