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_application_insights_api_key recreated on every apply #6040

Closed
odee30 opened this issue Mar 9, 2020 · 3 comments
Closed

azurerm_application_insights_api_key recreated on every apply #6040

odee30 opened this issue Mar 9, 2020 · 3 comments

Comments

@odee30
Copy link

odee30 commented Mar 9, 2020

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

Terraform (and AzureRM Provider) Version

Terraform v0.12.23

  • provider.azurerm v1.44.0

Affected Resource(s)

  • azurerm_application_insights_api_key

Terraform Configuration Files

resource "azurerm_resource_group" "test" {
  name     = "example-rg"
  location = "uksouth"
}

resource "azurerm_application_insights" "test" {
  resource_group_name = azurerm_resource_group.test.name
  location            = azurerm_resource_group.test.location

  name             = "example-appins"
  application_type = "web"
}

resource "azurerm_application_insights_api_key" "test" {
  application_insights_id = azurerm_application_insights.test.id

  name              = "search-api-key"
  read_permissions  = ["search"]
  write_permissions = []
}

Debug Output

Panic Output

Expected Behavior

Documentation for resource suggests that read_permissions can be a list containing any of the values agentconfig, aggregate, api, draft, extendqueries, search.

When specifying the read permissions value as ["search"] (as in the example above) I would expect the resource read_permissions would match.

If the read_permissions are left unchanged then the resource should not redeploy on subsequent terraform apply runs.

Note: : The behaviour I describe above IS seen if the read_permissions is set to ["agentconfig"].

Actual Behaviour

When the value provided for read_permissions in one, or any combination of, aggregate, api, draft, extendqueries, search then all are assigned. When the next terraform apply is run, the resource permissions do not match the state and this forces the resource to be recreated.

The only exception to the above is specifying the read_permissions as just ["agentconfig"]. In this instance, the resource does not recreate on subsequent terraform apply runs.

Steps to Reproduce

  1. terraform apply
  2. terraform apply

Important Factoids

References

  • #0000
@orsharab-yy
Copy link

Any updates on this?

@favoretti
Copy link
Contributor

Since this issue has been reported a long time ago and relates to the version of provider we no longer support - I'm going to close it. Please open a new updated bug report on current versions of terraform and provider if this is still relevant. Thank you.

@github-actions
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 Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants