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 data resource #2623

Closed
inkel opened this issue Jan 8, 2019 · 4 comments
Closed

azurerm_application_insights data resource #2623

inkel opened this issue Jan 8, 2019 · 4 comments

Comments

@inkel
Copy link
Contributor

inkel commented Jan 8, 2019

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

Description

Hi maintainers, happy new year, and thanks for all your efforts in maintaining this provider.

In the past I've sent a PR (#2463) to add the new azurerm_virtual_machine data resource. For the same project I'm working on, I'm kind of in need of having an azurerm_application_insights data resource too, are you considering adding it yourselves to the next release or should I send a PR?

As in #2463 the needs arise from wanting to use an Application Insights instrumentation key in another resource (azurerm_app_service environment settings). The infra in this project is managed by different teams, and the App Insights bucket I'm trying to read its instrumentation key from it's already created. Now, one possible solution could be to use a azurerm_application_insights on my App Service Terraform definition and then terraform import the existing resource; sadly this won't scale as the App Insights bucket is being currently managed by hand by another team.

My proposal would be to add a new azurerm_application_insights data resource that let me access the instrumentation key by searching for the App Insights bucket name, resource group and location (this last property I'm not sure if it's required).

Thanks.

New or Affected Resource(s)

  • azurerm_application_insights data resource.

Potential Terraform Configuration

// This is the proposed new data resource configuration
data "azurerm_application_insights" "myappinsights" {
    name = "my_app_insights_bucket"
    resource_group_name = "${var.resource_group_name}"
}

// And here we use it to inject the AppInsights' instrumentation key in another resource
resource "azurerm_app_service" "myappsvc" {
    # …all required properties…

    app_settings {
        "APPINSIGHTS_INSTRUMENTATIONKEY" = "${data.azurerm_application_insights.myappinsights.instrumentation_key}"
    }
}

References

@tombuildsstuff
Copy link
Contributor

hey @inkel

Thanks for opening this issue :)

In the past I've sent a PR (#2463) to add the new azurerm_virtual_machine data resource. For the same project I'm working on, I'm kind of in need of having an azurerm_application_insights data resource too, are you considering adding it yourselves to the next release or should I send a PR?

We've not got (scheduled) plans to work on this but I'd be 👍 for this if you'd like to send a PR? :)

My proposal would be to add a new azurerm_application_insights data resource that let me access the instrumentation key by searching for the App Insights bucket name, resource group and location (this last property I'm not sure if it's required).

Based on the API call I believe we should be able to just require the Application Insights name and the Resource Group Name (and not the location) - but that sounds good to me 👍

Thanks!

@inkel
Copy link
Contributor Author

inkel commented Jan 8, 2019

Hey @tombuildsstuff, I'll gladly work on this! I'll fire up my editor and start coding 😉

Yup, it would seem like location isn't really needed, so I'll start with the bare minimum amount of code that's necessary. I'll link to this issue once I open a PR.

@inkel
Copy link
Contributor Author

inkel commented Jan 10, 2019

This has been implemented in #2625, so I guess it's safe to close this one.

@inkel inkel closed this as completed Jan 10, 2019
@tombuildsstuff tombuildsstuff added this to the 1.21.0 milestone Jan 10, 2019
@ghost
Copy link

ghost commented Mar 5, 2019

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 5, 2019
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

2 participants